From cc4906042c7f17f27d3f45090c95edd29645c88e Mon Sep 17 00:00:00 2001 From: Kong Wai Weng Date: Mon, 6 Dec 2021 17:13:15 +0800 Subject: [PATCH 001/246] Added Maker Nano RP2040. --- .../boards/cytron_maker_nano_rp2040/board.c | 40 ++++++++++++++ .../cytron_maker_nano_rp2040/mpconfigboard.h | 12 ++++ .../cytron_maker_nano_rp2040/mpconfigboard.mk | 15 +++++ .../pico-sdk-configboard.h | 4 ++ .../boards/cytron_maker_nano_rp2040/pins.c | 55 +++++++++++++++++++ 5 files changed, 126 insertions(+) create mode 100644 ports/raspberrypi/boards/cytron_maker_nano_rp2040/board.c create mode 100644 ports/raspberrypi/boards/cytron_maker_nano_rp2040/mpconfigboard.h create mode 100644 ports/raspberrypi/boards/cytron_maker_nano_rp2040/mpconfigboard.mk create mode 100644 ports/raspberrypi/boards/cytron_maker_nano_rp2040/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/cytron_maker_nano_rp2040/pins.c diff --git a/ports/raspberrypi/boards/cytron_maker_nano_rp2040/board.c b/ports/raspberrypi/boards/cytron_maker_nano_rp2040/board.c new file mode 100644 index 0000000000..b583e7bf11 --- /dev/null +++ b/ports/raspberrypi/boards/cytron_maker_nano_rp2040/board.c @@ -0,0 +1,40 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Wai Weng for Cytron Technologies + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} + +void board_deinit(void) { +} diff --git a/ports/raspberrypi/boards/cytron_maker_nano_rp2040/mpconfigboard.h b/ports/raspberrypi/boards/cytron_maker_nano_rp2040/mpconfigboard.h new file mode 100644 index 0000000000..2d182e78c9 --- /dev/null +++ b/ports/raspberrypi/boards/cytron_maker_nano_rp2040/mpconfigboard.h @@ -0,0 +1,12 @@ +#define MICROPY_HW_BOARD_NAME "Cytron Maker Nano RP2040" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO1) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO0) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO18) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO19) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO16) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO1) +#define DEFAULT_UART_BUS_TX (&pin_GPIO0) diff --git a/ports/raspberrypi/boards/cytron_maker_nano_rp2040/mpconfigboard.mk b/ports/raspberrypi/boards/cytron_maker_nano_rp2040/mpconfigboard.mk new file mode 100644 index 0000000000..fc5f8ead36 --- /dev/null +++ b/ports/raspberrypi/boards/cytron_maker_nano_rp2040/mpconfigboard.mk @@ -0,0 +1,15 @@ +USB_VID = 0x2E8A +USB_PID = 0x100f +USB_PRODUCT = "Maker Nano RP2040" +USB_MANUFACTURER = "Cytron" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ" + +CIRCUITPY__EVE = 1 + +# Include these Python libraries in firmware. +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SimpleIO diff --git a/ports/raspberrypi/boards/cytron_maker_nano_rp2040/pico-sdk-configboard.h b/ports/raspberrypi/boards/cytron_maker_nano_rp2040/pico-sdk-configboard.h new file mode 100644 index 0000000000..a41131dd22 --- /dev/null +++ b/ports/raspberrypi/boards/cytron_maker_nano_rp2040/pico-sdk-configboard.h @@ -0,0 +1,4 @@ +// Put board-specific pico-sdk definitions here. This file must exist. + +// Allow extra time for xosc to start. +#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64 diff --git a/ports/raspberrypi/boards/cytron_maker_nano_rp2040/pins.c b/ports/raspberrypi/boards/cytron_maker_nano_rp2040/pins.c new file mode 100644 index 0000000000..30fe8d64a9 --- /dev/null +++ b/ports/raspberrypi/boards/cytron_maker_nano_rp2040/pins.c @@ -0,0 +1,55 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_GP0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_GP1), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_GP2), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_ROM_QSTR(MP_QSTR_GP3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_GP4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_GP5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_GP6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_GP7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_GP8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_GP9), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_RGB), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_GP11), MP_ROM_PTR(&pin_GPIO11) }, + + { MP_ROM_QSTR(MP_QSTR_GP12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_GP13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_GP14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_GP15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_GP16), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_GP17), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_GP18), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_GP19), MP_ROM_PTR(&pin_GPIO19) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_GP20), MP_ROM_PTR(&pin_GPIO20) }, + + { MP_ROM_QSTR(MP_QSTR_BUZZER), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_GP22), MP_ROM_PTR(&pin_GPIO22) }, + + { MP_ROM_QSTR(MP_QSTR_GP26_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_GP26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_GP27_A1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_GP27), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, + + { MP_ROM_QSTR(MP_QSTR_GP28_A2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_GP28), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) }, + + { MP_ROM_QSTR(MP_QSTR_GP29_A3), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_GP29), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From 78cf13d201f3f8e915412a7b657e6c2af7852cbd Mon Sep 17 00:00:00 2001 From: Kong Wai Weng Date: Mon, 6 Dec 2021 17:21:25 +0800 Subject: [PATCH 002/246] Revert "Added Maker Nano RP2040." This reverts commit cc4906042c7f17f27d3f45090c95edd29645c88e. --- .../boards/cytron_maker_nano_rp2040/board.c | 40 -------------- .../cytron_maker_nano_rp2040/mpconfigboard.h | 12 ---- .../cytron_maker_nano_rp2040/mpconfigboard.mk | 15 ----- .../pico-sdk-configboard.h | 4 -- .../boards/cytron_maker_nano_rp2040/pins.c | 55 ------------------- 5 files changed, 126 deletions(-) delete mode 100644 ports/raspberrypi/boards/cytron_maker_nano_rp2040/board.c delete mode 100644 ports/raspberrypi/boards/cytron_maker_nano_rp2040/mpconfigboard.h delete mode 100644 ports/raspberrypi/boards/cytron_maker_nano_rp2040/mpconfigboard.mk delete mode 100644 ports/raspberrypi/boards/cytron_maker_nano_rp2040/pico-sdk-configboard.h delete mode 100644 ports/raspberrypi/boards/cytron_maker_nano_rp2040/pins.c diff --git a/ports/raspberrypi/boards/cytron_maker_nano_rp2040/board.c b/ports/raspberrypi/boards/cytron_maker_nano_rp2040/board.c deleted file mode 100644 index b583e7bf11..0000000000 --- a/ports/raspberrypi/boards/cytron_maker_nano_rp2040/board.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2021 Wai Weng for Cytron Technologies - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "supervisor/board.h" - -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} diff --git a/ports/raspberrypi/boards/cytron_maker_nano_rp2040/mpconfigboard.h b/ports/raspberrypi/boards/cytron_maker_nano_rp2040/mpconfigboard.h deleted file mode 100644 index 2d182e78c9..0000000000 --- a/ports/raspberrypi/boards/cytron_maker_nano_rp2040/mpconfigboard.h +++ /dev/null @@ -1,12 +0,0 @@ -#define MICROPY_HW_BOARD_NAME "Cytron Maker Nano RP2040" -#define MICROPY_HW_MCU_NAME "rp2040" - -#define DEFAULT_I2C_BUS_SCL (&pin_GPIO1) -#define DEFAULT_I2C_BUS_SDA (&pin_GPIO0) - -#define DEFAULT_SPI_BUS_SCK (&pin_GPIO18) -#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO19) -#define DEFAULT_SPI_BUS_MISO (&pin_GPIO16) - -#define DEFAULT_UART_BUS_RX (&pin_GPIO1) -#define DEFAULT_UART_BUS_TX (&pin_GPIO0) diff --git a/ports/raspberrypi/boards/cytron_maker_nano_rp2040/mpconfigboard.mk b/ports/raspberrypi/boards/cytron_maker_nano_rp2040/mpconfigboard.mk deleted file mode 100644 index fc5f8ead36..0000000000 --- a/ports/raspberrypi/boards/cytron_maker_nano_rp2040/mpconfigboard.mk +++ /dev/null @@ -1,15 +0,0 @@ -USB_VID = 0x2E8A -USB_PID = 0x100f -USB_PRODUCT = "Maker Nano RP2040" -USB_MANUFACTURER = "Cytron" - -CHIP_VARIANT = RP2040 -CHIP_FAMILY = rp2 - -EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ" - -CIRCUITPY__EVE = 1 - -# Include these Python libraries in firmware. -FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel -FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SimpleIO diff --git a/ports/raspberrypi/boards/cytron_maker_nano_rp2040/pico-sdk-configboard.h b/ports/raspberrypi/boards/cytron_maker_nano_rp2040/pico-sdk-configboard.h deleted file mode 100644 index a41131dd22..0000000000 --- a/ports/raspberrypi/boards/cytron_maker_nano_rp2040/pico-sdk-configboard.h +++ /dev/null @@ -1,4 +0,0 @@ -// Put board-specific pico-sdk definitions here. This file must exist. - -// Allow extra time for xosc to start. -#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64 diff --git a/ports/raspberrypi/boards/cytron_maker_nano_rp2040/pins.c b/ports/raspberrypi/boards/cytron_maker_nano_rp2040/pins.c deleted file mode 100644 index 30fe8d64a9..0000000000 --- a/ports/raspberrypi/boards/cytron_maker_nano_rp2040/pins.c +++ /dev/null @@ -1,55 +0,0 @@ -#include "shared-bindings/board/__init__.h" - -STATIC const mp_rom_map_elem_t board_module_globals_table[] = { - CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS - - { MP_ROM_QSTR(MP_QSTR_GP0), MP_ROM_PTR(&pin_GPIO0) }, - { MP_ROM_QSTR(MP_QSTR_GP1), MP_ROM_PTR(&pin_GPIO1) }, - - { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO2) }, - { MP_ROM_QSTR(MP_QSTR_GP2), MP_ROM_PTR(&pin_GPIO2) }, - - { MP_ROM_QSTR(MP_QSTR_GP3), MP_ROM_PTR(&pin_GPIO3) }, - { MP_ROM_QSTR(MP_QSTR_GP4), MP_ROM_PTR(&pin_GPIO4) }, - { MP_ROM_QSTR(MP_QSTR_GP5), MP_ROM_PTR(&pin_GPIO5) }, - { MP_ROM_QSTR(MP_QSTR_GP6), MP_ROM_PTR(&pin_GPIO6) }, - { MP_ROM_QSTR(MP_QSTR_GP7), MP_ROM_PTR(&pin_GPIO7) }, - { MP_ROM_QSTR(MP_QSTR_GP8), MP_ROM_PTR(&pin_GPIO8) }, - { MP_ROM_QSTR(MP_QSTR_GP9), MP_ROM_PTR(&pin_GPIO9) }, - - { MP_ROM_QSTR(MP_QSTR_RGB), MP_ROM_PTR(&pin_GPIO11) }, - { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO11) }, - { MP_ROM_QSTR(MP_QSTR_GP11), MP_ROM_PTR(&pin_GPIO11) }, - - { MP_ROM_QSTR(MP_QSTR_GP12), MP_ROM_PTR(&pin_GPIO12) }, - { MP_ROM_QSTR(MP_QSTR_GP13), MP_ROM_PTR(&pin_GPIO13) }, - { MP_ROM_QSTR(MP_QSTR_GP14), MP_ROM_PTR(&pin_GPIO14) }, - { MP_ROM_QSTR(MP_QSTR_GP15), MP_ROM_PTR(&pin_GPIO15) }, - { MP_ROM_QSTR(MP_QSTR_GP16), MP_ROM_PTR(&pin_GPIO16) }, - { MP_ROM_QSTR(MP_QSTR_GP17), MP_ROM_PTR(&pin_GPIO17) }, - { MP_ROM_QSTR(MP_QSTR_GP18), MP_ROM_PTR(&pin_GPIO18) }, - { MP_ROM_QSTR(MP_QSTR_GP19), MP_ROM_PTR(&pin_GPIO19) }, - - { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO20) }, - { MP_ROM_QSTR(MP_QSTR_GP20), MP_ROM_PTR(&pin_GPIO20) }, - - { MP_ROM_QSTR(MP_QSTR_BUZZER), MP_ROM_PTR(&pin_GPIO22) }, - { MP_ROM_QSTR(MP_QSTR_GP22), MP_ROM_PTR(&pin_GPIO22) }, - - { MP_ROM_QSTR(MP_QSTR_GP26_A0), MP_ROM_PTR(&pin_GPIO26) }, - { MP_ROM_QSTR(MP_QSTR_GP26), MP_ROM_PTR(&pin_GPIO26) }, - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, - - { MP_ROM_QSTR(MP_QSTR_GP27_A1), MP_ROM_PTR(&pin_GPIO27) }, - { MP_ROM_QSTR(MP_QSTR_GP27), MP_ROM_PTR(&pin_GPIO27) }, - { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, - - { MP_ROM_QSTR(MP_QSTR_GP28_A2), MP_ROM_PTR(&pin_GPIO28) }, - { MP_ROM_QSTR(MP_QSTR_GP28), MP_ROM_PTR(&pin_GPIO28) }, - { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) }, - - { MP_ROM_QSTR(MP_QSTR_GP29_A3), MP_ROM_PTR(&pin_GPIO29) }, - { MP_ROM_QSTR(MP_QSTR_GP29), MP_ROM_PTR(&pin_GPIO29) }, - { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, -}; -MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From c919e9c2cc9767f0936e571e97fe9751c55cf692 Mon Sep 17 00:00:00 2001 From: BigTuna94 Date: Mon, 14 Mar 2022 21:02:14 -0400 Subject: [PATCH 003/246] fix duplicate reference names for DSN export --- .../boards/zrichard_rp2.65-f/board.c | 45 +++++++++++++++++++ .../boards/zrichard_rp2.65-f/mpconfigboard.h | 4 ++ .../boards/zrichard_rp2.65-f/mpconfigboard.mk | 13 ++++++ .../zrichard_rp2.65-f/pico-sdk-configboard.h | 4 ++ .../boards/zrichard_rp2.65-f/pins.c | 32 +++++++++++++ 5 files changed, 98 insertions(+) create mode 100644 ports/raspberrypi/boards/zrichard_rp2.65-f/board.c create mode 100644 ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.h create mode 100644 ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.mk create mode 100644 ports/raspberrypi/boards/zrichard_rp2.65-f/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/zrichard_rp2.65-f/pins.c diff --git a/ports/raspberrypi/boards/zrichard_rp2.65-f/board.c b/ports/raspberrypi/boards/zrichard_rp2.65-f/board.c new file mode 100644 index 0000000000..635e767a8f --- /dev/null +++ b/ports/raspberrypi/boards/zrichard_rp2.65-f/board.c @@ -0,0 +1,45 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "src/rp2_common/hardware_gpio/include/hardware/gpio.h" +#include "supervisor/shared/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + // turn off any left over LED + board_reset_user_neopixels(&pin_GPIO25, 62); +} + +void board_deinit(void) { +} diff --git a/ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.h b/ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.h new file mode 100644 index 0000000000..5acfceba9d --- /dev/null +++ b/ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.h @@ -0,0 +1,4 @@ +#define MICROPY_HW_BOARD_NAME "RP2.65-F" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO25) diff --git a/ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.mk b/ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.mk new file mode 100644 index 0000000000..79970a1a1b --- /dev/null +++ b/ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.mk @@ -0,0 +1,13 @@ +# ZR 6F +USB_VID = 0x5a52 +USB_PID = 0x3646 + +USB_PRODUCT = "RP2.65-F" +USB_MANUFACTURER = "ZRichard" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "W25Q64JVxQ,W25Q128JVxQ" + +CIRCUITPY__EVE = 1 diff --git a/ports/raspberrypi/boards/zrichard_rp2.65-f/pico-sdk-configboard.h b/ports/raspberrypi/boards/zrichard_rp2.65-f/pico-sdk-configboard.h new file mode 100644 index 0000000000..a41131dd22 --- /dev/null +++ b/ports/raspberrypi/boards/zrichard_rp2.65-f/pico-sdk-configboard.h @@ -0,0 +1,4 @@ +// Put board-specific pico-sdk definitions here. This file must exist. + +// Allow extra time for xosc to start. +#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64 diff --git a/ports/raspberrypi/boards/zrichard_rp2.65-f/pins.c b/ports/raspberrypi/boards/zrichard_rp2.65-f/pins.c new file mode 100644 index 0000000000..02c69c014f --- /dev/null +++ b/ports/raspberrypi/boards/zrichard_rp2.65-f/pins.c @@ -0,0 +1,32 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_ROW0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_COL0), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_ROW1), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_COL1), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_ROW2), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_COL2), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_ROW3), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_COL3), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_ROW4), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_COL4), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_ROW5), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_COL5), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_ROW6), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_COL6), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_ROW7), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_COL7), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_ROW8), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_ROW9), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_RV1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_RV2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_RV3), MP_ROM_PTR(&pin_GPIO29) }, + +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From dd933c7d0638d9d42cdeea886e4a7274fbe1f943 Mon Sep 17 00:00:00 2001 From: BigTuna94 Date: Wed, 30 Mar 2022 09:17:26 -0400 Subject: [PATCH 004/246] add NeoPixel lib to firmware --- ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.mk b/ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.mk index 79970a1a1b..65fc82f7ff 100644 --- a/ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.mk +++ b/ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.mk @@ -11,3 +11,6 @@ CHIP_FAMILY = rp2 EXTERNAL_FLASH_DEVICES = "W25Q64JVxQ,W25Q128JVxQ" CIRCUITPY__EVE = 1 + + +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel From 666a5ff04cf5c0ee1bedf768830beb9f45dcdfaf Mon Sep 17 00:00:00 2001 From: foamyguy Date: Sat, 9 Apr 2022 10:09:46 -0500 Subject: [PATCH 005/246] trying to make vectorio shape hidable --- shared-module/displayio/Group.c | 58 +++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/shared-module/displayio/Group.c b/shared-module/displayio/Group.c index b9179f0a00..28d3d89735 100644 --- a/shared-module/displayio/Group.c +++ b/shared-module/displayio/Group.c @@ -358,35 +358,45 @@ void displayio_group_construct(displayio_group_t *self, mp_obj_list_t *members, bool displayio_group_fill_area(displayio_group_t *self, const _displayio_colorspace_t *colorspace, const displayio_area_t *area, uint32_t *mask, uint32_t *buffer) { // Track if any of the layers finishes filling in the given area. We can ignore any remaining // layers at that point. - for (int32_t i = self->members->len - 1; i >= 0; i--) { - mp_obj_t layer; - #if CIRCUITPY_VECTORIO - const vectorio_draw_protocol_t *draw_protocol = mp_proto_get(MP_QSTR_protocol_draw, self->members->items[i]); - if (draw_protocol != NULL) { - layer = draw_protocol->draw_get_protocol_self(self->members->items[i]); - if (draw_protocol->draw_protocol_impl->draw_fill_area(layer, colorspace, area, mask, buffer)) { - return true; + //mp_printf(&mp_plat_print, "inside fill area \n"); + //mp_printf(&mp_plat_print, "%d \n", self->hidden); + //mp_printf(&mp_plat_print, "\n"); + + //mp_printf(&mp_plat_print, "inside fill area \n"); + if (self->hidden == false){ + //mp_printf(&mp_plat_print, "not hidden\n"); + for (int32_t i = self->members->len - 1; i >= 0; i--) { + mp_obj_t layer; + #if CIRCUITPY_VECTORIO + const vectorio_draw_protocol_t *draw_protocol = mp_proto_get(MP_QSTR_protocol_draw, self->members->items[i]); + if (draw_protocol != NULL) { + layer = draw_protocol->draw_get_protocol_self(self->members->items[i]); + if (draw_protocol->draw_protocol_impl->draw_fill_area(layer, colorspace, area, mask, buffer)) { + return true; + } + continue; } - continue; - } - #endif - layer = mp_obj_cast_to_native_base( - self->members->items[i], &displayio_tilegrid_type); - if (layer != MP_OBJ_NULL) { - if (displayio_tilegrid_fill_area(layer, colorspace, area, mask, buffer)) { - return true; + #endif + layer = mp_obj_cast_to_native_base( + self->members->items[i], &displayio_tilegrid_type); + if (layer != MP_OBJ_NULL) { + if (displayio_tilegrid_fill_area(layer, colorspace, area, mask, buffer)) { + return true; + } + continue; } - continue; - } - layer = mp_obj_cast_to_native_base( - self->members->items[i], &displayio_group_type); - if (layer != MP_OBJ_NULL) { - if (displayio_group_fill_area(layer, colorspace, area, mask, buffer)) { - return true; + layer = mp_obj_cast_to_native_base( + self->members->items[i], &displayio_group_type); + if (layer != MP_OBJ_NULL) { + if (displayio_group_fill_area(layer, colorspace, area, mask, buffer)) { + return true; + } + continue; } - continue; } } + + return false; } From 01cff3c4f8e7f43b84eba74213549a1f3be17f4a Mon Sep 17 00:00:00 2001 From: BigTuna94 Date: Sun, 10 Apr 2022 14:10:07 -0400 Subject: [PATCH 006/246] add MIDI to frozen libs --- ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.mk b/ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.mk index 65fc82f7ff..6614b75fe3 100644 --- a/ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.mk +++ b/ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.mk @@ -14,3 +14,4 @@ CIRCUITPY__EVE = 1 FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_MIDI From a23ede8bc450632d6160707b3def344b03e25993 Mon Sep 17 00:00:00 2001 From: Zach Richard Date: Mon, 2 May 2022 19:49:30 -0400 Subject: [PATCH 007/246] update USB VID/PID codes to match pidcodes request --- ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.mk b/ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.mk index 6614b75fe3..4cba650ec4 100644 --- a/ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.mk +++ b/ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.mk @@ -1,6 +1,6 @@ -# ZR 6F -USB_VID = 0x5a52 -USB_PID = 0x3646 +# pid.codes ZR +USB_VID = 0x1209 +USB_PID = 0x5a52 USB_PRODUCT = "RP2.65-F" USB_MANUFACTURER = "ZRichard" From 030d5fefa02bfc0a5b243facb7d77a6fea193d9f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 3 May 2022 09:23:36 -0500 Subject: [PATCH 008/246] Ignore SH1107 quirk if not 1bpp --- shared-module/displayio/Display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index 579dca49fc..255cd49e06 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -74,7 +74,7 @@ void common_hal_displayio_display_construct(displayio_display_obj_t *self, self->first_manual_refresh = !auto_refresh; self->data_as_commands = data_as_commands; self->backlight_on_high = backlight_on_high; - self->SH1107_addressing = SH1107_addressing; + self->SH1107_addressing = SH1107_addressing && color_depth == 1; self->native_frames_per_second = native_frames_per_second; self->native_ms_per_frame = 1000 / native_frames_per_second; From b292a925d5f776ecd2e865345c46d3b3287dda7c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 3 May 2022 09:23:47 -0500 Subject: [PATCH 009/246] remove stray semicolon --- 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 f7b3305439..b187d1329f 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -172,7 +172,7 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a primary_display_t *disp = allocate_display_or_raise(); displayio_display_obj_t *self = &disp->display; - ; + self->base.type = &displayio_display_type; common_hal_displayio_display_construct( self, From 49918299f23043e1cb6f929b0ef98b71dceed47e Mon Sep 17 00:00:00 2001 From: Alec Delaney <89490472+tekktrik@users.noreply.github.com> Date: Tue, 3 May 2022 13:42:42 -0400 Subject: [PATCH 010/246] Update docs with links to tutorials for I2C, SPI, and UART --- shared-bindings/busio/__init__.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/shared-bindings/busio/__init__.c b/shared-bindings/busio/__init__.c index 13115eb793..7ac9b58dd2 100644 --- a/shared-bindings/busio/__init__.c +++ b/shared-bindings/busio/__init__.c @@ -70,6 +70,17 @@ //| hardware. The last step is optional because CircuitPython automatically //| resets hardware after a program finishes.""" //| +//| Note that drivers will typically handle communication if provided the bus +//| instance (such as `busio.I2C(board.SCL, board.SDA)`), and that many of +//| the methods listed here are lower level functionalities that are needed +//| for working with custom drivers. +//| +//| Tutorial for I2C and SPI: +//| https://learn.adafruit.com/circuitpython-basics-i2c-and-spi +//| +//| Tutorial for UART: +//| https://learn.adafruit.com/circuitpython-essentials/circuitpython-uart-serial +//| STATIC const mp_rom_map_elem_t busio_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_busio) }, From 802931987aca249a9fcebe4fcd0059e27525282c Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Wed, 4 May 2022 13:49:47 -0400 Subject: [PATCH 011/246] Fix board module additions --- shared-bindings/busio/__init__.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shared-bindings/busio/__init__.c b/shared-bindings/busio/__init__.c index 7ac9b58dd2..38bbfaf6ef 100644 --- a/shared-bindings/busio/__init__.c +++ b/shared-bindings/busio/__init__.c @@ -68,10 +68,10 @@ //| This example will initialize the the device, run //| :py:meth:`~busio.I2C.scan` and then :py:meth:`~busio.I2C.deinit` the //| hardware. The last step is optional because CircuitPython automatically -//| resets hardware after a program finishes.""" +//| resets hardware after a program finishes. //| //| Note that drivers will typically handle communication if provided the bus -//| instance (such as `busio.I2C(board.SCL, board.SDA)`), and that many of +//| instance (such as ``busio.I2C(board.SCL, board.SDA)``), and that many of //| the methods listed here are lower level functionalities that are needed //| for working with custom drivers. //| @@ -80,6 +80,7 @@ //| //| Tutorial for UART: //| https://learn.adafruit.com/circuitpython-essentials/circuitpython-uart-serial +//| """ //| STATIC const mp_rom_map_elem_t busio_module_globals_table[] = { From 8651156ee0236f6855ad3bf81c67524748c3390c Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Wed, 4 May 2022 13:50:08 -0400 Subject: [PATCH 012/246] Add link to busio from board module --- shared-bindings/board/__init__.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shared-bindings/board/__init__.c b/shared-bindings/board/__init__.c index 8b2738a248..a400c19224 100644 --- a/shared-bindings/board/__init__.c +++ b/shared-bindings/board/__init__.c @@ -43,6 +43,10 @@ //| Common container for board base pin names. These will vary from board to //| board so don't expect portability when using this module. //| +//| The most common use of this module is to use serial communciation buses with +//| the default pins and settings. For more information about serial communcication +//| in CircuitPython, see the :mod:`busio`. +//| //| .. warning:: The board module varies by board. The APIs documented here may or may not be //| available on a specific board.""" From 3b665dda3c6add19b241c3c69927709139b35231 Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Wed, 4 May 2022 13:54:20 -0400 Subject: [PATCH 013/246] Add Learn guide for digitalio --- shared-bindings/digitalio/__init__.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shared-bindings/digitalio/__init__.c b/shared-bindings/digitalio/__init__.c index e3f4e9992d..dd17d372a1 100644 --- a/shared-bindings/digitalio/__init__.c +++ b/shared-bindings/digitalio/__init__.c @@ -71,7 +71,11 @@ //| led.value = True //| time.sleep(0.1) //| led.value = False -//| time.sleep(0.1)""" +//| time.sleep(0.1) +//| +//| For more information on using `digitalio`, see this Learn guide: +//| https://learn.adafruit.com/circuitpython-digital-inputs-and-outputs +//| """ //| STATIC const mp_rom_map_elem_t digitalio_module_globals_table[] = { From 9d6c4059e062fa26e3f83a3bc7b3bfc2231df1b9 Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Wed, 4 May 2022 13:57:37 -0400 Subject: [PATCH 014/246] Add CPY essential learn guide link to digitalio --- shared-bindings/digitalio/__init__.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/shared-bindings/digitalio/__init__.c b/shared-bindings/digitalio/__init__.c index dd17d372a1..8bc872be99 100644 --- a/shared-bindings/digitalio/__init__.c +++ b/shared-bindings/digitalio/__init__.c @@ -73,10 +73,13 @@ //| led.value = False //| time.sleep(0.1) //| -//| For more information on using `digitalio`, see this Learn guide: +//| For the essentials of `digitalio`, see the CircuitPython Essentials +//| Learn guide: +//| https://learn.adafruit.com/circuitpython-essentials/circuitpython-digital-in-out +//| +//| For more information on using `digitalio`, see this additional Learn guide: //| https://learn.adafruit.com/circuitpython-digital-inputs-and-outputs //| """ -//| STATIC const mp_rom_map_elem_t digitalio_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_digitalio) }, From 7a0b0010e83a38fe9238347d394416d2ea8c9c5f Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Wed, 4 May 2022 13:59:04 -0400 Subject: [PATCH 015/246] Add CircuitPython Essentials Learn guide link to pwmio --- shared-bindings/pwmio/__init__.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/shared-bindings/pwmio/__init__.c b/shared-bindings/pwmio/__init__.c index c9f7a50155..dbe487d580 100644 --- a/shared-bindings/pwmio/__init__.c +++ b/shared-bindings/pwmio/__init__.c @@ -57,7 +57,12 @@ //| :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.""" +//| to do it yourself. +//| +//| For the essentials of `pwmio`, see the CircuitPython Essentials +//| Learn guide: +//| https://learn.adafruit.com/circuitpython-essentials/circuitpython-pwm +//| """ //| STATIC const mp_rom_map_elem_t pwmio_module_globals_table[] = { From 042eb84d84c0b4700f5fe97be0b685b93fde2628 Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Wed, 4 May 2022 14:01:03 -0400 Subject: [PATCH 016/246] Add Learn guide link to displayio --- shared-bindings/displayio/__init__.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/shared-bindings/displayio/__init__.c b/shared-bindings/displayio/__init__.c index 5588dc83e9..931ec3f77a 100644 --- a/shared-bindings/displayio/__init__.c +++ b/shared-bindings/displayio/__init__.c @@ -49,7 +49,12 @@ //| """Native helpers for driving displays //| //| The `displayio` module contains classes to manage display output -//| including synchronizing with refresh rates and partial updating.""" +//| including synchronizing with refresh rates and partial updating. +//| +//| For more a more thorugh explanation and guide for using `displayio`, please +//| refer to this Learn guide: +//| https://learn.adafruit.com/circuitpython-display-support-using-displayio +//| """ //| //| import paralleldisplay From ba4a253e7792fa772d188bcd2c338bb17dca57e9 Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Wed, 4 May 2022 14:04:07 -0400 Subject: [PATCH 017/246] Add link to CPY Essentials Learn guide for storage module --- shared-bindings/storage/__init__.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/shared-bindings/storage/__init__.c b/shared-bindings/storage/__init__.c index 3c957468da..4a3a8384b1 100644 --- a/shared-bindings/storage/__init__.c +++ b/shared-bindings/storage/__init__.c @@ -40,7 +40,12 @@ //| The `storage` provides storage management functionality such as mounting and //| unmounting which is typically handled by the operating system hosting Python. //| CircuitPython does not have an OS, so this module provides this functionality -//| directly.""" +//| directly. + +//| For more information regarding using the `storage` module, refer to the CircuitPython +//| Essentials Learn guide: +//| https://learn.adafruit.com/circuitpython-essentials/circuitpython-storage +//| """ //| //| def mount(filesystem: VfsFat, mount_path: str, *, readonly: bool = False) -> None: From f4bd20b5e8846c079d6d1804de7069646466d0d1 Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Wed, 4 May 2022 14:20:48 -0400 Subject: [PATCH 018/246] Add inofrmation about NeoPixels in neopixel_write module --- shared-bindings/neopixel_write/__init__.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/shared-bindings/neopixel_write/__init__.c b/shared-bindings/neopixel_write/__init__.c index bcdedf62a7..9375beab06 100644 --- a/shared-bindings/neopixel_write/__init__.c +++ b/shared-bindings/neopixel_write/__init__.c @@ -91,7 +91,19 @@ STATIC void check_for_deinit(digitalio_digitalinout_obj_t *self) { //| pin = digitalio.DigitalInOut(board.NEOPIXEL) //| pin.direction = digitalio.Direction.OUTPUT //| pixel_off = bytearray([0, 0, 0]) -//| neopixel_write.neopixel_write(pin, pixel_off)""" +//| neopixel_write.neopixel_write(pin, pixel_off) +//| +//| .. note:: +//| +//| This library is typically not used by user level code. +//| +//| For more information on actually using NeoPixels, refer to the CircuitPython +//| Essentials Learn guide: https://learn.adafruit.com/circuitpython-essentials/circuitpython-neopixel +//| +//| For a much more thorough guide about using NeoPixels, refer to the Adadfruit NeoPixel Überguide: +//| https://learn.adafruit.com/adafruit-neopixel-uberguide +//| +//| """ //| //| def neopixel_write(digitalinout: digitalio.DigitalInOut, buf: ReadableBuffer) -> None: //| """Write buf out on the given DigitalInOut. From aaaa0acde47121c79f54797f396b70cc9ce3aec2 Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Wed, 4 May 2022 14:26:52 -0400 Subject: [PATCH 019/246] Add link to CPY Essentials Learn guide for board module --- shared-bindings/board/__init__.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shared-bindings/board/__init__.c b/shared-bindings/board/__init__.c index a400c19224..895edc6b6b 100644 --- a/shared-bindings/board/__init__.c +++ b/shared-bindings/board/__init__.c @@ -43,10 +43,14 @@ //| Common container for board base pin names. These will vary from board to //| board so don't expect portability when using this module. //| -//| The most common use of this module is to use serial communciation buses with +//| Another common use of this module is to use serial communciation buses with //| the default pins and settings. For more information about serial communcication //| in CircuitPython, see the :mod:`busio`. //| +//| For more information regarding the typical usage of `board`, refer to the CircuitPython +//| Essentials Learn guide: +//| https://learn.adafruit.com/circuitpython-essentials/circuitpython-pins-and-modules +//| //| .. warning:: The board module varies by board. The APIs documented here may or may not be //| available on a specific board.""" From 9d83b319b3cb0d30be5f4eb58377c6fa021b7060 Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Wed, 4 May 2022 14:27:10 -0400 Subject: [PATCH 020/246] Add Learn guide link to CPY Essentials for analogio --- shared-bindings/analogio/__init__.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/shared-bindings/analogio/__init__.c b/shared-bindings/analogio/__init__.c index 51f8a21537..89096ae9aa 100644 --- a/shared-bindings/analogio/__init__.c +++ b/shared-bindings/analogio/__init__.c @@ -57,7 +57,15 @@ //| This example will initialize the the device, read //| :py:data:`~analogio.AnalogIn.value` and then //| :py:meth:`~analogio.AnalogIn.deinit` the hardware. The last step is optional -//| because CircuitPython will do it automatically after the program finishes.""" +//| because CircuitPython will do it automatically after the program finishes. +//| +//| For the essentials of `analogio`, see the CircuitPython Essentials +//| Learn guide: +//| https://learn.adafruit.com/circuitpython-essentials/circuitpython-analog-in +//| +//| For more information on using `analogio`, see this additional Learn guide: +//| https://learn.adafruit.com/circuitpython-basics-analog-inputs-and-outputs +//| """ //| STATIC const mp_rom_map_elem_t analogio_module_globals_table[] = { From d1d6d99318b3da73beb5f1e1de05c0bb93e6548a Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Wed, 4 May 2022 21:59:08 -0400 Subject: [PATCH 021/246] Specify target for `board` --- shared-bindings/board/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/board/__init__.c b/shared-bindings/board/__init__.c index 895edc6b6b..a496ff0b9c 100644 --- a/shared-bindings/board/__init__.c +++ b/shared-bindings/board/__init__.c @@ -47,7 +47,7 @@ //| the default pins and settings. For more information about serial communcication //| in CircuitPython, see the :mod:`busio`. //| -//| For more information regarding the typical usage of `board`, refer to the CircuitPython +//| For more information regarding the typical usage of :py:mod:`board`, refer to the CircuitPython //| Essentials Learn guide: //| https://learn.adafruit.com/circuitpython-essentials/circuitpython-pins-and-modules //| From a9d929627a0550f83cacc02aa97dbdcdb0e9737e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 5 May 2022 14:40:49 -0500 Subject: [PATCH 022/246] minor comment update --- ports/raspberrypi/common-hal/neopixel_write/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/raspberrypi/common-hal/neopixel_write/__init__.c b/ports/raspberrypi/common-hal/neopixel_write/__init__.c index 034c5de002..5c66d33feb 100644 --- a/ports/raspberrypi/common-hal/neopixel_write/__init__.c +++ b/ports/raspberrypi/common-hal/neopixel_write/__init__.c @@ -63,7 +63,7 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t *digitalinout, uint32_t pins_we_use = 1 << digitalinout->pin->number; bool ok = rp2pio_statemachine_construct(&state_machine, neopixel_program, sizeof(neopixel_program) / sizeof(neopixel_program[0]), - 12800000, // MHz, to get about appropriate sub-bit times in PIO program. + 12800000, // 12.8MHz, to get appropriate sub-bit times in PIO program. NULL, 0, // init program NULL, 1, // out NULL, 1, // in From 1a9034ff7c3aa2b17822a61e35ea277ec401d2ac Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 6 May 2022 14:21:09 -0500 Subject: [PATCH 023/246] rp2pio: Allow background_write(None) to terminate after complete loop --- ports/raspberrypi/common-hal/rp2pio/StateMachine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c index c38e1ec010..b830a82be8 100644 --- a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c +++ b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c @@ -917,7 +917,7 @@ bool common_hal_rp2pio_statemachine_background_write(rp2pio_statemachine_obj_t * self->loop = *loop; self->pending_buffers = pending_buffers; - if (self->dma_completed) { + if (self->dma_completed && self->once.info.len) { rp2pio_statemachine_dma_complete(self, SM_DMA_GET_CHANNEL(pio_index, sm)); self->dma_completed = false; } From f776749ca3f5cc69beeff2f7b1005c3527dec27d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 6 May 2022 14:22:07 -0500 Subject: [PATCH 024/246] Key off len, not buf, to decide if anything to DMA --- ports/raspberrypi/common-hal/rp2pio/StateMachine.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c index b830a82be8..00e715be6b 100644 --- a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c +++ b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c @@ -894,8 +894,8 @@ bool common_hal_rp2pio_statemachine_background_write(rp2pio_statemachine_obj_t * uint8_t pio_index = pio_get_index(self->pio); uint8_t sm = self->state_machine; - int pending_buffers = (once->info.buf != NULL) + (loop->info.buf != NULL); - if (!once->info.buf) { + int pending_buffers = (once->info.len != 0) + (loop->info.len != 0); + if (!once->info.len) { once = loop; } From 23c0fc83549536905b1562a3fd4b5ed0a6fde871 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 6 May 2022 14:42:24 -0500 Subject: [PATCH 025/246] add ability to get, clear txstall flag This can be used to make sure a PIO has actually finished all data it was schedule to receive via a 'once' background_write --- .../bindings/rp2pio/StateMachine.c | 34 +++++++++++++++++++ .../bindings/rp2pio/StateMachine.h | 2 ++ .../common-hal/rp2pio/StateMachine.c | 12 +++++++ 3 files changed, 48 insertions(+) diff --git a/ports/raspberrypi/bindings/rp2pio/StateMachine.c b/ports/raspberrypi/bindings/rp2pio/StateMachine.c index 28668355b1..d234a50a9a 100644 --- a/ports/raspberrypi/bindings/rp2pio/StateMachine.c +++ b/ports/raspberrypi/bindings/rp2pio/StateMachine.c @@ -708,6 +708,18 @@ STATIC mp_obj_t rp2pio_statemachine_obj_clear_rxfifo(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_clear_rxfifo_obj, rp2pio_statemachine_obj_clear_rxfifo); +//| def clear_txstall(self) -> None: +//| """Clears the txstall flag.""" +//| ... +//| +STATIC mp_obj_t rp2pio_statemachine_obj_clear_txstall(mp_obj_t self_in) { + rp2pio_statemachine_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_rp2pio_statemachine_clear_txstall(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_clear_txstall_obj, rp2pio_statemachine_obj_clear_txstall); + + //| frequency: int //| """The actual state machine frequency. This may not match the frequency requested //| due to internal limitations.""" @@ -736,6 +748,26 @@ const mp_obj_property_t rp2pio_statemachine_frequency_obj = { MP_ROM_NONE}, }; +//| txstall: bool +//| """True when the state machine has stalled due to a full TX FIFO since the last +//| `clear_txstall` call.""" +//| + +STATIC mp_obj_t rp2pio_statemachine_obj_get_txstall(mp_obj_t self_in) { + rp2pio_statemachine_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_rp2pio_statemachine_get_txstall(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_get_txstall_obj, rp2pio_statemachine_obj_get_txstall); + +const mp_obj_property_t rp2pio_statemachine_txstall_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&rp2pio_statemachine_get_txstall_obj, + MP_ROM_NONE, + MP_ROM_NONE}, +}; + + //| rxstall: bool //| """True when the state machine has stalled due to a full RX FIFO since the last //| `clear_rxfifo` call.""" @@ -782,6 +814,7 @@ STATIC const mp_rom_map_elem_t rp2pio_statemachine_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_restart), MP_ROM_PTR(&rp2pio_statemachine_restart_obj) }, { MP_ROM_QSTR(MP_QSTR_run), MP_ROM_PTR(&rp2pio_statemachine_run_obj) }, { MP_ROM_QSTR(MP_QSTR_clear_rxfifo), MP_ROM_PTR(&rp2pio_statemachine_clear_rxfifo_obj) }, + { MP_ROM_QSTR(MP_QSTR_clear_txstall), MP_ROM_PTR(&rp2pio_statemachine_clear_txstall_obj) }, { MP_ROM_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&rp2pio_statemachine_readinto_obj) }, { MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&rp2pio_statemachine_write_obj) }, @@ -793,6 +826,7 @@ STATIC const mp_rom_map_elem_t rp2pio_statemachine_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_frequency), MP_ROM_PTR(&rp2pio_statemachine_frequency_obj) }, { MP_ROM_QSTR(MP_QSTR_rxstall), MP_ROM_PTR(&rp2pio_statemachine_rxstall_obj) }, + { MP_ROM_QSTR(MP_QSTR_txstall), MP_ROM_PTR(&rp2pio_statemachine_txstall_obj) }, { MP_ROM_QSTR(MP_QSTR_in_waiting), MP_ROM_PTR(&rp2pio_statemachine_in_waiting_obj) }, }; STATIC MP_DEFINE_CONST_DICT(rp2pio_statemachine_locals_dict, rp2pio_statemachine_locals_dict_table); diff --git a/ports/raspberrypi/bindings/rp2pio/StateMachine.h b/ports/raspberrypi/bindings/rp2pio/StateMachine.h index 087283ced2..36e406032d 100644 --- a/ports/raspberrypi/bindings/rp2pio/StateMachine.h +++ b/ports/raspberrypi/bindings/rp2pio/StateMachine.h @@ -81,6 +81,8 @@ void common_hal_rp2pio_statemachine_set_frequency(rp2pio_statemachine_obj_t *sel bool common_hal_rp2pio_statemachine_get_rxstall(rp2pio_statemachine_obj_t *self); void common_hal_rp2pio_statemachine_clear_rxfifo(rp2pio_statemachine_obj_t *self); +bool common_hal_rp2pio_statemachine_get_txstall(rp2pio_statemachine_obj_t *self); +void common_hal_rp2pio_statemachine_clear_txstall(rp2pio_statemachine_obj_t *self); size_t common_hal_rp2pio_statemachine_get_in_waiting(rp2pio_statemachine_obj_t *self); void common_hal_rp2pio_statemachine_set_interrupt_handler(rp2pio_statemachine_obj_t *self, void (*handler)(void *), void *arg, int mask); diff --git a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c index 00e715be6b..8017722e62 100644 --- a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c +++ b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c @@ -848,6 +848,18 @@ void common_hal_rp2pio_statemachine_clear_rxfifo(rp2pio_statemachine_obj_t *self self->pio->fdebug = stall_mask; } +bool common_hal_rp2pio_statemachine_get_txstall(rp2pio_statemachine_obj_t *self) { + uint32_t stall_mask = 1 << (PIO_FDEBUG_TXSTALL_LSB + self->state_machine); + return (self->pio->fdebug & stall_mask) != 0; +} + +void common_hal_rp2pio_statemachine_clear_txstall(rp2pio_statemachine_obj_t *self) { + uint8_t level = pio_sm_get_rx_fifo_level(self->pio, self->state_machine); + uint32_t stall_mask = 1 << (PIO_FDEBUG_TXSTALL_LSB + self->state_machine); + self->pio->fdebug = stall_mask; +} + + size_t common_hal_rp2pio_statemachine_get_in_waiting(rp2pio_statemachine_obj_t *self) { uint8_t level = pio_sm_get_rx_fifo_level(self->pio, self->state_machine); return level; From b482a732c6ab2293d3a9efdcd39dda92848238d5 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 6 May 2022 15:18:59 -0500 Subject: [PATCH 026/246] StateMachine: add swap flag Always use DMA if swap flag is enabled. Improve docs a bit --- locale/circuitpython.pot | 6 ++- .../bindings/rp2pio/StateMachine.c | 42 +++++++++++++------ .../bindings/rp2pio/StateMachine.h | 8 ++-- .../raspberrypi/common-hal/audiobusio/PDMIn.c | 4 +- .../imagecapture/ParallelImageCapture.c | 2 +- .../common-hal/neopixel_write/__init__.c | 2 +- .../common-hal/paralleldisplay/ParallelBus.c | 2 +- .../common-hal/rotaryio/IncrementalEncoder.c | 2 +- .../common-hal/rp2pio/StateMachine.c | 40 +++++++++++++----- .../common-hal/rp2pio/StateMachine.h | 2 +- 10 files changed, 74 insertions(+), 36 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index db06147fe0..3f8322c8dd 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -1540,6 +1540,10 @@ msgstr "" msgid "Mismatched data size" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" @@ -2033,7 +2037,7 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "" diff --git a/ports/raspberrypi/bindings/rp2pio/StateMachine.c b/ports/raspberrypi/bindings/rp2pio/StateMachine.c index d234a50a9a..c690a0da5d 100644 --- a/ports/raspberrypi/bindings/rp2pio/StateMachine.c +++ b/ports/raspberrypi/bindings/rp2pio/StateMachine.c @@ -378,7 +378,7 @@ STATIC mp_obj_t rp2pio_statemachine_stop(mp_obj_t self_obj) { } MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_stop_obj, rp2pio_statemachine_stop); -//| def write(self, buffer: ReadableBuffer, *, start: int = 0, end: Optional[int] = None) -> None: +//| def write(self, buffer: ReadableBuffer, *, start: int = 0, end: Optional[int] = None, swap bool = False) -> None: //| """Write the data contained in ``buffer`` to the state machine. If the buffer is empty, nothing happens. //| //| Writes to the FIFO will match the input buffer's element size. For example, bytearray elements @@ -391,14 +391,16 @@ MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_stop_obj, rp2pio_statemachine_stop //| :param ~circuitpython_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)``""" +//| :param bool swap: For 2- and 4-byte elements, swap the byte order""" //| ... //| STATIC mp_obj_t rp2pio_statemachine_write(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_buffer, ARG_start, ARG_end }; + enum { ARG_buffer, ARG_start, ARG_end, ARG_swap }; static const mp_arg_t allowed_args[] = { { 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_swap, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} }, }; rp2pio_statemachine_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); check_for_deinit(self); @@ -420,7 +422,7 @@ STATIC mp_obj_t rp2pio_statemachine_write(size_t n_args, const mp_obj_t *pos_arg mp_raise_ValueError(translate("Buffer elements must be 4 bytes long or less")); } - bool ok = common_hal_rp2pio_statemachine_write(self, ((uint8_t *)bufinfo.buf) + start, length, stride_in_bytes); + bool ok = common_hal_rp2pio_statemachine_write(self, ((uint8_t *)bufinfo.buf) + start, length, stride_in_bytes, args[ARG_swap].u_bool); if (mp_hal_is_interrupted()) { return mp_const_none; } @@ -431,7 +433,7 @@ STATIC mp_obj_t rp2pio_statemachine_write(size_t n_args, const mp_obj_t *pos_arg } MP_DEFINE_CONST_FUN_OBJ_KW(rp2pio_statemachine_write_obj, 2, rp2pio_statemachine_write); -//| def background_write(self, once: Optional[ReadableBuffer]=None, *, loop: Optional[ReadableBuffer]=None) -> None: +//| def background_write(self, once: Optional[ReadableBuffer]=None, *, loop: Optional[ReadableBuffer]=None, swap: bool=False) -> None: //| """Write data to the TX fifo in the background, with optional looping. //| //| First, if any previous ``once`` or ``loop`` buffer has not been started, this function blocks until they have. @@ -459,8 +461,13 @@ MP_DEFINE_CONST_FUN_OBJ_KW(rp2pio_statemachine_write_obj, 2, rp2pio_statemachine //| where a change in duty cycle requires a special transitional buffer to be used exactly once. Most //| use cases will probably only use one of ``once`` or ``loop``. //| +//| Having neither ``once`` nor ``loop`` terminates an existing +//| background looping write after exactly a whole loop. This is in contrast to +//| `stop_background_write, which interrupts an ongoing DMA operation. +//| //| :param ~Optional[circuitpython_typing.ReadableBuffer] once: Data to be written once //| :param ~Optional[circuitpython_typing.ReadableBuffer] loop: Data to be written repeatedly +//| :param bool swap: For 2- and 4-byte elements, swap the byte order""" //| """ //| ... //| @@ -483,10 +490,11 @@ STATIC void fill_buf_info(sm_buf_info *info, mp_obj_t obj, size_t *stride_in_byt } STATIC mp_obj_t rp2pio_statemachine_background_write(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_once, ARG_loop }; + enum { ARG_once, ARG_loop, ARG_swap }; static const mp_arg_t allowed_args[] = { { MP_QSTR_once, MP_ARG_OBJ, {.u_obj = mp_const_none} }, { MP_QSTR_loop, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = mp_const_none} }, + { MP_QSTR_swap, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} }, }; rp2pio_statemachine_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); check_for_deinit(self); @@ -502,7 +510,7 @@ STATIC mp_obj_t rp2pio_statemachine_background_write(size_t n_args, const mp_obj return mp_const_none; } - bool ok = common_hal_rp2pio_statemachine_background_write(self, &once_info, &loop_info, stride_in_bytes); + bool ok = common_hal_rp2pio_statemachine_background_write(self, &once_info, &loop_info, stride_in_bytes, args[ARG_swap].u_bool); if (mp_hal_is_interrupted()) { return mp_const_none; @@ -515,7 +523,9 @@ STATIC mp_obj_t rp2pio_statemachine_background_write(size_t n_args, const mp_obj MP_DEFINE_CONST_FUN_OBJ_KW(rp2pio_statemachine_background_write_obj, 1, rp2pio_statemachine_background_write); //| def stop_background_write(self) -> None: -//| """Immediately stop a background write, if one is in progress. Items already in the TX FIFO are not affected.""" +//| """Immediately stop a background write, if one is in progress. Any +//| DMA in progress is halted, but items already in the TX FIFO are not +//| affected.""" //| STATIC mp_obj_t rp2pio_statemachine_obj_stop_background_write(mp_obj_t self_in) { rp2pio_statemachine_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -567,7 +577,7 @@ const mp_obj_property_t rp2pio_statemachine_pending_obj = { MP_ROM_NONE}, }; -//| def readinto(self, buffer: WriteableBuffer, *, start: int = 0, end: Optional[int] = None) -> None: +//| def readinto(self, buffer: WriteableBuffer, *, start: int = 0, end: Optional[int] = None, bool swap) -> None: //| """Read into ``buffer``. If the number of bytes to read is 0, nothing happens. The buffer //| includes any data added to the fifo even if it was added before this was called. //| @@ -581,16 +591,18 @@ const mp_obj_property_t rp2pio_statemachine_pending_obj = { //| //| :param ~circuitpython_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 end: End of the slice; this index is not included. Defaults to ``len(buffer)`` +//| :param bool swap: For 2- and 4-byte elements, swap the byte order""" //| ... //| STATIC mp_obj_t rp2pio_statemachine_readinto(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_buffer, ARG_start, ARG_end }; + enum { ARG_buffer, ARG_start, ARG_end, ARG_swap }; static const mp_arg_t allowed_args[] = { { 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_swap, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} }, }; rp2pio_statemachine_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); check_for_deinit(self); @@ -613,7 +625,7 @@ STATIC mp_obj_t rp2pio_statemachine_readinto(size_t n_args, const mp_obj_t *pos_ mp_raise_ValueError(translate("Buffer elements must be 4 bytes long or less")); } - bool ok = common_hal_rp2pio_statemachine_readinto(self, ((uint8_t *)bufinfo.buf) + start, length, stride_in_bytes); + bool ok = common_hal_rp2pio_statemachine_readinto(self, ((uint8_t *)bufinfo.buf) + start, length, stride_in_bytes, args[ARG_swap].u_bool); if (!ok) { mp_raise_OSError(MP_EIO); } @@ -639,11 +651,13 @@ MP_DEFINE_CONST_FUN_OBJ_KW(rp2pio_statemachine_readinto_obj, 2, rp2pio_statemach //| :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]`` //| :param int in_end: End of the slice; this index is not included. Defaults to ``len(buffer_in)``""" +//| :param bool swap_out: For 2- and 4-byte elements, swap the byte order for the buffer being transmitted (written)""" +//| :param bool swap_in: For 2- and 4-rx elements, swap the byte order for the buffer being received (read)""" //| ... //| STATIC mp_obj_t rp2pio_statemachine_write_readinto(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_buffer_out, ARG_buffer_in, ARG_out_start, ARG_out_end, ARG_in_start, ARG_in_end }; + enum { ARG_buffer_out, ARG_buffer_in, ARG_out_start, ARG_out_end, ARG_in_start, ARG_in_end, ARG_swap_out, ARG_swap_in }; static const mp_arg_t allowed_args[] = { { MP_QSTR_buffer_out, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, { MP_QSTR_buffer_in, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, @@ -651,6 +665,8 @@ STATIC mp_obj_t rp2pio_statemachine_write_readinto(size_t n_args, const mp_obj_t { MP_QSTR_out_end, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = INT_MAX} }, { MP_QSTR_in_start, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, { MP_QSTR_in_end, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = INT_MAX} }, + { MP_QSTR_swap_out, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} }, + { MP_QSTR_swap_in, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} }, }; rp2pio_statemachine_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); check_for_deinit(self); @@ -689,7 +705,7 @@ STATIC mp_obj_t rp2pio_statemachine_write_readinto(size_t n_args, const mp_obj_t out_stride_in_bytes, ((uint8_t *)buf_in_info.buf) + in_start, in_length, - in_stride_in_bytes); + in_stride_in_bytes, args[ARG_swap_out].u_bool, args[ARG_swap_in].u_bool); if (!ok) { mp_raise_OSError(MP_EIO); } diff --git a/ports/raspberrypi/bindings/rp2pio/StateMachine.h b/ports/raspberrypi/bindings/rp2pio/StateMachine.h index 36e406032d..3ec70a8703 100644 --- a/ports/raspberrypi/bindings/rp2pio/StateMachine.h +++ b/ports/raspberrypi/bindings/rp2pio/StateMachine.h @@ -65,15 +65,15 @@ void common_hal_rp2pio_statemachine_stop(rp2pio_statemachine_obj_t *self); void common_hal_rp2pio_statemachine_run(rp2pio_statemachine_obj_t *self, const uint16_t *instructions, size_t len); // Writes out the given data. -bool common_hal_rp2pio_statemachine_write(rp2pio_statemachine_obj_t *self, const uint8_t *data, size_t len, uint8_t stride_in_bytes); -bool common_hal_rp2pio_statemachine_background_write(rp2pio_statemachine_obj_t *self, const sm_buf_info *once_obj, const sm_buf_info *loop_obj, uint8_t stride_in_bytes); +bool common_hal_rp2pio_statemachine_write(rp2pio_statemachine_obj_t *self, const uint8_t *data, size_t len, uint8_t stride_in_bytes, bool swap); +bool common_hal_rp2pio_statemachine_background_write(rp2pio_statemachine_obj_t *self, const sm_buf_info *once_obj, const sm_buf_info *loop_obj, uint8_t stride_in_bytes, bool swap); bool common_hal_rp2pio_statemachine_stop_background_write(rp2pio_statemachine_obj_t *self); mp_int_t common_hal_rp2pio_statemachine_get_pending(rp2pio_statemachine_obj_t *self); bool common_hal_rp2pio_statemachine_get_writing(rp2pio_statemachine_obj_t *self); -bool common_hal_rp2pio_statemachine_readinto(rp2pio_statemachine_obj_t *self, uint8_t *data, size_t len, uint8_t stride_in_bytes); +bool common_hal_rp2pio_statemachine_readinto(rp2pio_statemachine_obj_t *self, uint8_t *data, size_t len, uint8_t stride_in_bytes, bool swap); bool common_hal_rp2pio_statemachine_write_readinto(rp2pio_statemachine_obj_t *self, const uint8_t *data_out, size_t out_len, uint8_t out_stride_in_bytes, - uint8_t *data_in, size_t in_len, uint8_t in_stride_in_bytes); + uint8_t *data_in, size_t in_len, uint8_t in_stride_in_bytes, bool swap_out, bool swap_in); // Return actual state machine frequency. uint32_t common_hal_rp2pio_statemachine_get_frequency(rp2pio_statemachine_obj_t *self); diff --git a/ports/raspberrypi/common-hal/audiobusio/PDMIn.c b/ports/raspberrypi/common-hal/audiobusio/PDMIn.c index 1a120a45f7..8301f9fde4 100644 --- a/ports/raspberrypi/common-hal/audiobusio/PDMIn.c +++ b/ports/raspberrypi/common-hal/audiobusio/PDMIn.c @@ -157,9 +157,9 @@ uint32_t common_hal_audiobusio_pdmin_record_to_buffer(audiobusio_pdmin_obj_t *se size_t output_count = 0; common_hal_rp2pio_statemachine_clear_rxfifo(&self->state_machine); // Do one read to get the mic going and throw it away. - common_hal_rp2pio_statemachine_readinto(&self->state_machine, (uint8_t *)samples, 2 * sizeof(uint32_t), sizeof(uint32_t)); + common_hal_rp2pio_statemachine_readinto(&self->state_machine, (uint8_t *)samples, 2 * sizeof(uint32_t), sizeof(uint32_t), false); while (output_count < output_buffer_length && !common_hal_rp2pio_statemachine_get_rxstall(&self->state_machine)) { - common_hal_rp2pio_statemachine_readinto(&self->state_machine, (uint8_t *)samples, 2 * sizeof(uint32_t), sizeof(uint32_t)); + common_hal_rp2pio_statemachine_readinto(&self->state_machine, (uint8_t *)samples, 2 * sizeof(uint32_t), sizeof(uint32_t), false); // Call filter_sample just one place so it can be inlined. uint16_t value = filter_sample(samples); if (self->bit_depth == 8) { diff --git a/ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c b/ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c index c578c3216f..3c5c57eea5 100644 --- a/ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c +++ b/ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c @@ -153,7 +153,7 @@ void common_hal_imagecapture_parallelimagecapture_singleshot_capture(imagecaptur pio_sm_exec(pio, sm, pio_encode_jmp(offset)); pio_sm_set_enabled(pio, sm, true); - common_hal_rp2pio_statemachine_readinto(&self->state_machine, bufinfo.buf, bufinfo.len, 4); + common_hal_rp2pio_statemachine_readinto(&self->state_machine, bufinfo.buf, bufinfo.len, 4, false); pio_sm_set_enabled(pio, sm, false); } diff --git a/ports/raspberrypi/common-hal/neopixel_write/__init__.c b/ports/raspberrypi/common-hal/neopixel_write/__init__.c index 5c66d33feb..d473285b02 100644 --- a/ports/raspberrypi/common-hal/neopixel_write/__init__.c +++ b/ports/raspberrypi/common-hal/neopixel_write/__init__.c @@ -90,7 +90,7 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t *digitalinout, while (port_get_raw_ticks(NULL) < next_start_raw_ticks) { } - common_hal_rp2pio_statemachine_write(&state_machine, pixels, num_bytes, 1 /* stride in bytes */); + common_hal_rp2pio_statemachine_write(&state_machine, pixels, num_bytes, 1 /* stride in bytes */, false); // Use a private deinit of the state machine that doesn't reset the pin. rp2pio_statemachine_deinit(&state_machine, true); diff --git a/ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c b/ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c index 4f30d121ad..96c89ade95 100644 --- a/ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c +++ b/ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c @@ -161,7 +161,7 @@ void common_hal_paralleldisplay_parallelbus_send(mp_obj_t obj, display_byte_type paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); common_hal_digitalio_digitalinout_set_value(&self->command, byte_type == DISPLAY_DATA); - common_hal_rp2pio_statemachine_write(&self->state_machine, data, data_length, 1); + common_hal_rp2pio_statemachine_write(&self->state_machine, data, data_length, 1, false); } void common_hal_paralleldisplay_parallelbus_end_transaction(mp_obj_t obj) { diff --git a/ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c b/ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c index bbeeb5a1b9..0da12e5923 100644 --- a/ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c +++ b/ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c @@ -98,7 +98,7 @@ void common_hal_rotaryio_incrementalencoder_construct(rotaryio_incrementalencode // We're guaranteed by the init code that some output will be available promptly uint8_t quiescent_state; - common_hal_rp2pio_statemachine_readinto(&self->state_machine, &quiescent_state, 1, 1); + common_hal_rp2pio_statemachine_readinto(&self->state_machine, &quiescent_state, 1, 1, false); shared_module_softencoder_state_init(self, quiescent_state & 3); common_hal_rp2pio_statemachine_set_interrupt_handler(&self->state_machine, incrementalencoder_interrupt_handler, self, PIO_IRQ0_INTF_SM0_RXNEMPTY_BITS); diff --git a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c index 8017722e62..bee77238b5 100644 --- a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c +++ b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c @@ -663,7 +663,7 @@ STATIC enum dma_channel_transfer_size _stride_to_dma_size(uint8_t stride) { static bool _transfer(rp2pio_statemachine_obj_t *self, const uint8_t *data_out, size_t out_len, uint8_t out_stride_in_bytes, - uint8_t *data_in, size_t in_len, uint8_t in_stride_in_bytes) { + uint8_t *data_in, size_t in_len, uint8_t in_stride_in_bytes, bool swap_out, bool swap_in) { // This implementation is based on SPI but varies because the tx and rx buffers // may be different lengths and occur at different times or speeds. @@ -674,13 +674,26 @@ static bool _transfer(rp2pio_statemachine_obj_t *self, size_t len = MAX(out_len, in_len); bool tx = data_out != NULL; bool rx = data_in != NULL; - if (len >= dma_min_size_threshold) { + bool use_dma = len >= dma_min_size_threshold || swap_out || swap_in; + if (use_dma) { // Use DMA channels to service the two FIFOs if (tx) { chan_tx = dma_claim_unused_channel(false); + // DMA allocation failed... + if (chan_tx < 0) { + return false; + } } if (rx) { chan_rx = dma_claim_unused_channel(false); + // DMA allocation failed... + if (chan_rx < 0) { + // may need to free tx channel + if (chan_tx >= 0) { + dma_channel_unclaim(chan_tx); + } + return false; + } } } volatile uint8_t *tx_destination = NULL; @@ -698,7 +711,6 @@ static bool _transfer(rp2pio_statemachine_obj_t *self, } } uint32_t stall_mask = 1 << (PIO_FDEBUG_TXSTALL_LSB + self->state_machine); - bool use_dma = (!rx || chan_rx >= 0) && (!tx || chan_tx >= 0); if (use_dma) { dma_channel_config c; uint32_t channel_mask = 0; @@ -708,6 +720,7 @@ static bool _transfer(rp2pio_statemachine_obj_t *self, channel_config_set_dreq(&c, self->tx_dreq); channel_config_set_read_increment(&c, true); channel_config_set_write_increment(&c, false); + channel_config_set_bswap(&c, swap_out); dma_channel_configure(chan_tx, &c, tx_destination, data_out, @@ -721,6 +734,7 @@ static bool _transfer(rp2pio_statemachine_obj_t *self, channel_config_set_dreq(&c, self->rx_dreq); channel_config_set_read_increment(&c, false); channel_config_set_write_increment(&c, true); + channel_config_set_bswap(&c, swap_in); dma_channel_configure(chan_rx, &c, data_in, rx_source, @@ -811,27 +825,27 @@ static bool _transfer(rp2pio_statemachine_obj_t *self, // TODO: Provide a way around these checks in case someone wants to use the FIFO // with manually run code. -bool common_hal_rp2pio_statemachine_write(rp2pio_statemachine_obj_t *self, const uint8_t *data, size_t len, uint8_t stride_in_bytes) { +bool common_hal_rp2pio_statemachine_write(rp2pio_statemachine_obj_t *self, const uint8_t *data, size_t len, uint8_t stride_in_bytes, bool swap) { if (!self->out) { mp_raise_RuntimeError(translate("No out in program")); } - return _transfer(self, data, len, stride_in_bytes, NULL, 0, 0); + return _transfer(self, data, len, stride_in_bytes, NULL, 0, 0, swap, false); } -bool common_hal_rp2pio_statemachine_readinto(rp2pio_statemachine_obj_t *self, uint8_t *data, size_t len, uint8_t stride_in_bytes) { +bool common_hal_rp2pio_statemachine_readinto(rp2pio_statemachine_obj_t *self, uint8_t *data, size_t len, uint8_t stride_in_bytes, bool swap) { if (!self->in) { mp_raise_RuntimeError(translate("No in in program")); } - return _transfer(self, NULL, 0, 0, data, len, stride_in_bytes); + return _transfer(self, NULL, 0, 0, data, len, stride_in_bytes, false, swap); } bool common_hal_rp2pio_statemachine_write_readinto(rp2pio_statemachine_obj_t *self, const uint8_t *data_out, size_t out_len, uint8_t out_stride_in_bytes, - uint8_t *data_in, size_t in_len, uint8_t in_stride_in_bytes) { + uint8_t *data_in, size_t in_len, uint8_t in_stride_in_bytes, bool swap_out, bool swap_in) { if (!self->in || !self->out) { mp_raise_RuntimeError(translate("No in or out in program")); } - return _transfer(self, data_out, out_len, out_stride_in_bytes, data_in, in_len, in_stride_in_bytes); + return _transfer(self, data_out, out_len, out_stride_in_bytes, data_in, in_len, in_stride_in_bytes, swap_out, swap_in); } bool common_hal_rp2pio_statemachine_get_rxstall(rp2pio_statemachine_obj_t *self) { @@ -902,7 +916,7 @@ uint8_t rp2pio_statemachine_program_offset(rp2pio_statemachine_obj_t *self) { return _current_program_offset[pio_index][sm]; } -bool common_hal_rp2pio_statemachine_background_write(rp2pio_statemachine_obj_t *self, const sm_buf_info *once, const sm_buf_info *loop, uint8_t stride_in_bytes) { +bool common_hal_rp2pio_statemachine_background_write(rp2pio_statemachine_obj_t *self, const sm_buf_info *once, const sm_buf_info *loop, uint8_t stride_in_bytes, bool swap) { uint8_t pio_index = pio_get_index(self->pio); uint8_t sm = self->state_machine; @@ -911,11 +925,13 @@ bool common_hal_rp2pio_statemachine_background_write(rp2pio_statemachine_obj_t * once = loop; } - if (SM_DMA_ALLOCATED(pio_index, sm)) { if (stride_in_bytes != self->background_stride_in_bytes) { mp_raise_ValueError(translate("Mismatched data size")); } + if (swap != self->byteswap) { + mp_raise_ValueError(translate("Mismatched swap flag")); + } while (self->pending_buffers) { RUN_BACKGROUND_TASKS; @@ -958,12 +974,14 @@ bool common_hal_rp2pio_statemachine_background_write(rp2pio_statemachine_obj_t * self->pending_buffers = pending_buffers; self->dma_completed = false; self->background_stride_in_bytes = stride_in_bytes; + self->byteswap = swap; c = dma_channel_get_default_config(channel); channel_config_set_transfer_data_size(&c, _stride_to_dma_size(stride_in_bytes)); channel_config_set_dreq(&c, self->tx_dreq); channel_config_set_read_increment(&c, true); channel_config_set_write_increment(&c, false); + channel_config_set_bswap(&c, swap); dma_channel_configure(channel, &c, tx_destination, once->info.buf, diff --git a/ports/raspberrypi/common-hal/rp2pio/StateMachine.h b/ports/raspberrypi/common-hal/rp2pio/StateMachine.h index 470f0ed8b1..03dadc53b3 100644 --- a/ports/raspberrypi/common-hal/rp2pio/StateMachine.h +++ b/ports/raspberrypi/common-hal/rp2pio/StateMachine.h @@ -64,7 +64,7 @@ typedef struct { volatile int pending_buffers; sm_buf_info current, once, loop; int background_stride_in_bytes; - bool dma_completed; + bool dma_completed, byteswap; } rp2pio_statemachine_obj_t; void reset_rp2pio_statemachine(void); From b7882edd013b68db824135148a4957cd5127bd49 Mon Sep 17 00:00:00 2001 From: Michael Wisslead Date: Sat, 7 May 2022 00:57:10 +0000 Subject: [PATCH 027/246] Fix buffer issue for rp2040 PulseIn --- ports/raspberrypi/common-hal/pulseio/PulseIn.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ports/raspberrypi/common-hal/pulseio/PulseIn.c b/ports/raspberrypi/common-hal/pulseio/PulseIn.c index 83edde25ad..45d31626ec 100644 --- a/ports/raspberrypi/common-hal/pulseio/PulseIn.c +++ b/ports/raspberrypi/common-hal/pulseio/PulseIn.c @@ -147,9 +147,12 @@ void common_hal_pulseio_pulsein_interrupt(void *self_in) { } // return pulses that are not too short if (result > MIN_PULSE) { - self->buffer[self->buf_index] = (uint16_t)result; + size_t buf_index = (self->start + self->len) % self->maxlen; + self->buffer[buf_index] = (uint16_t)result; if (self->len < self->maxlen) { self->len++; + } else { + self->start = (self->start + 1) % self->maxlen; } if (self->buf_index < self->maxlen) { self->buf_index++; @@ -169,7 +172,6 @@ void common_hal_pulseio_pulsein_interrupt(void *self_in) { pio_sm_restart(self->state_machine.pio,self->state_machine.state_machine); pio_sm_set_enabled(self->state_machine.pio, self->state_machine.state_machine, true); self->buf_index = 0; - self->start = 0; } } void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t *self, From 34427bd6ba02d0a3a3a6c8bfad85cd38dddaa1d8 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 6 May 2022 22:36:24 -0400 Subject: [PATCH 028/246] Update StateMachine.c --- ports/raspberrypi/bindings/rp2pio/StateMachine.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/raspberrypi/bindings/rp2pio/StateMachine.c b/ports/raspberrypi/bindings/rp2pio/StateMachine.c index c690a0da5d..eee6e6b018 100644 --- a/ports/raspberrypi/bindings/rp2pio/StateMachine.c +++ b/ports/raspberrypi/bindings/rp2pio/StateMachine.c @@ -391,7 +391,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_stop_obj, rp2pio_statemachine_stop //| :param ~circuitpython_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)``""" -//| :param bool swap: For 2- and 4-byte elements, swap the byte order""" +//| :param bool swap: For 2- and 4-byte elements, swap (reverse) the byte order""" //| ... //| STATIC mp_obj_t rp2pio_statemachine_write(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { @@ -467,7 +467,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(rp2pio_statemachine_write_obj, 2, rp2pio_statemachine //| //| :param ~Optional[circuitpython_typing.ReadableBuffer] once: Data to be written once //| :param ~Optional[circuitpython_typing.ReadableBuffer] loop: Data to be written repeatedly -//| :param bool swap: For 2- and 4-byte elements, swap the byte order""" +//| :param bool swap: For 2- and 4-byte elements, swap (reverse) the byte order //| """ //| ... //| @@ -592,7 +592,7 @@ const mp_obj_property_t rp2pio_statemachine_pending_obj = { //| :param ~circuitpython_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 bool swap: For 2- and 4-byte elements, swap the byte order""" +//| :param bool swap: For 2- and 4-byte elements, swap (reverse) the byte order""" //| ... //| @@ -651,8 +651,8 @@ MP_DEFINE_CONST_FUN_OBJ_KW(rp2pio_statemachine_readinto_obj, 2, rp2pio_statemach //| :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]`` //| :param int in_end: End of the slice; this index is not included. Defaults to ``len(buffer_in)``""" -//| :param bool swap_out: For 2- and 4-byte elements, swap the byte order for the buffer being transmitted (written)""" -//| :param bool swap_in: For 2- and 4-rx elements, swap the byte order for the buffer being received (read)""" +//| :param bool swap_out: For 2- and 4-byte elements, swap (reverse) the byte order for the buffer being transmitted (written)""" +//| :param bool swap_in: For 2- and 4-rx elements, swap (reverse) the byte order for the buffer being received (read)""" //| ... //| From 561ed3739a4b61e24999021f97879da1a7b8fca7 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 7 May 2022 07:49:16 -0500 Subject: [PATCH 029/246] fix the docstrings --- ports/raspberrypi/bindings/rp2pio/StateMachine.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ports/raspberrypi/bindings/rp2pio/StateMachine.c b/ports/raspberrypi/bindings/rp2pio/StateMachine.c index eee6e6b018..5b903fb2ad 100644 --- a/ports/raspberrypi/bindings/rp2pio/StateMachine.c +++ b/ports/raspberrypi/bindings/rp2pio/StateMachine.c @@ -378,7 +378,7 @@ STATIC mp_obj_t rp2pio_statemachine_stop(mp_obj_t self_obj) { } MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_stop_obj, rp2pio_statemachine_stop); -//| def write(self, buffer: ReadableBuffer, *, start: int = 0, end: Optional[int] = None, swap bool = False) -> None: +//| def write(self, buffer: ReadableBuffer, *, start: int = 0, end: Optional[int] = None, swap: bool = False) -> None: //| """Write the data contained in ``buffer`` to the state machine. If the buffer is empty, nothing happens. //| //| Writes to the FIFO will match the input buffer's element size. For example, bytearray elements @@ -390,7 +390,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_stop_obj, rp2pio_statemachine_stop //| //| :param ~circuitpython_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)``""" +//| :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)`` //| :param bool swap: For 2- and 4-byte elements, swap (reverse) the byte order""" //| ... //| @@ -463,7 +463,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(rp2pio_statemachine_write_obj, 2, rp2pio_statemachine //| //| Having neither ``once`` nor ``loop`` terminates an existing //| background looping write after exactly a whole loop. This is in contrast to -//| `stop_background_write, which interrupts an ongoing DMA operation. +//| `stop_background_write`, which interrupts an ongoing DMA operation. //| //| :param ~Optional[circuitpython_typing.ReadableBuffer] once: Data to be written once //| :param ~Optional[circuitpython_typing.ReadableBuffer] loop: Data to be written repeatedly @@ -577,7 +577,7 @@ const mp_obj_property_t rp2pio_statemachine_pending_obj = { MP_ROM_NONE}, }; -//| def readinto(self, buffer: WriteableBuffer, *, start: int = 0, end: Optional[int] = None, bool swap) -> None: +//| def readinto(self, buffer: WriteableBuffer, *, start: int = 0, end: Optional[int] = None, swap: bool=False) -> None: //| """Read into ``buffer``. If the number of bytes to read is 0, nothing happens. The buffer //| includes any data added to the fifo even if it was added before this was called. //| @@ -650,8 +650,8 @@ MP_DEFINE_CONST_FUN_OBJ_KW(rp2pio_statemachine_readinto_obj, 2, rp2pio_statemach //| :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]`` -//| :param int in_end: End of the slice; this index is not included. Defaults to ``len(buffer_in)``""" -//| :param bool swap_out: For 2- and 4-byte elements, swap (reverse) the byte order for the buffer being transmitted (written)""" +//| :param int in_end: End of the slice; this index is not included. Defaults to ``len(buffer_in)`` +//| :param bool swap_out: For 2- and 4-byte elements, swap (reverse) the byte order for the buffer being transmitted (written) //| :param bool swap_in: For 2- and 4-rx elements, swap (reverse) the byte order for the buffer being received (read)""" //| ... //| From 9a1c7cddd4444dca3eec68d245b1746649ad9487 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Sat, 7 May 2022 16:36:08 +0200 Subject: [PATCH 030/246] 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/en_GB.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/ru.po | 6 +++++- locale/sv.po | 6 +++++- locale/tr.po | 6 +++++- locale/zh_Latn_pinyin.po | 6 +++++- 19 files changed, 95 insertions(+), 19 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index ab78319d05..b3dd782f1e 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -1559,6 +1559,10 @@ msgstr "Penundaan mulai mikrofon harus dalam kisaran 0,0 hingga 1,0" msgid "Mismatched data size" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "Tidak menemukan Pin MISO atau MOSI" @@ -2064,7 +2068,7 @@ msgstr "Kesalahan DeInit RNG" msgid "RNG Init Error" msgstr "Kesalahan Init RNG" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 416b2cf952..f87816126a 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -1547,6 +1547,10 @@ msgstr "" msgid "Mismatched data size" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" @@ -2042,7 +2046,7 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index bf0bcafe86..029827eea2 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -1567,6 +1567,10 @@ msgstr "" msgid "Mismatched data size" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "Fehlender MISO- oder MOSI-Pin" @@ -2072,7 +2076,7 @@ msgstr "RNG DeInit-Fehler" msgid "RNG Init Error" msgstr "RNG Init-Fehler" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "RS485 wird von diesem Gerät nicht unterstützt" diff --git a/locale/el.po b/locale/el.po index cbb2d24af1..2685481acc 100644 --- a/locale/el.po +++ b/locale/el.po @@ -1540,6 +1540,10 @@ msgstr "" msgid "Mismatched data size" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" @@ -2033,7 +2037,7 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "" diff --git a/locale/en_GB.po b/locale/en_GB.po index e2a2ee778c..902fe0fc03 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -1553,6 +1553,10 @@ msgstr "Microphone startup delay must be in range 0.0 to 1.0" msgid "Mismatched data size" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "Missing MISO or MOSI pin" @@ -2055,7 +2059,7 @@ msgstr "RNG deinit Error" msgid "RNG Init Error" msgstr "RNG init Error" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "RS485 not yet supported on this device" diff --git a/locale/es.po b/locale/es.po index 606dd8ccfa..eeffad5f55 100644 --- a/locale/es.po +++ b/locale/es.po @@ -1571,6 +1571,10 @@ msgstr "Micrófono demora de inicio debe estar en el rango 0.0 a 1.0" msgid "Mismatched data size" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "Falta el pin MISO o MOSI" @@ -2082,7 +2086,7 @@ msgstr "Error de desinicialización de RNG" msgid "RNG Init Error" msgstr "Error de inicialización de RNG" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "RS485 no esta soportado todavía en este dispositivo" diff --git a/locale/fil.po b/locale/fil.po index 1c2b33a600..eb24473bcb 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -1555,6 +1555,10 @@ msgstr "Ang delay ng startup ng mikropono ay dapat na nasa 0.0 hanggang 1.0" msgid "Mismatched data size" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" @@ -2052,7 +2056,7 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 4a1a831a1f..d8b286ade6 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -1584,6 +1584,10 @@ msgstr "Le délais au démarrage du micro doit être entre 0.0 et 1.0" msgid "Mismatched data size" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "Broche MISO ou MOSI manquante" @@ -2095,7 +2099,7 @@ msgstr "Erreur de désinitialisation du RNG" msgid "RNG Init Error" msgstr "Erreur d'initialisation du RNG" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "RS485 n'est pas encore supporté sur cet appareil" diff --git a/locale/hi.po b/locale/hi.po index a9df693b31..dfb8add290 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -1540,6 +1540,10 @@ msgstr "" msgid "Mismatched data size" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" @@ -2033,7 +2037,7 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index c93101be8a..e14619c464 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -1564,6 +1564,10 @@ msgstr "" msgid "Mismatched data size" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" @@ -2067,7 +2071,7 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "" diff --git a/locale/ja.po b/locale/ja.po index ba4392c275..808bea05c3 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -1551,6 +1551,10 @@ msgstr "マイクのスタートアップディレイは 0.0 から 1.0 の間 msgid "Mismatched data size" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "MISOまたはMOSIピンがありません" @@ -2047,7 +2051,7 @@ msgstr "RNG解体エラー" msgid "RNG Init Error" msgstr "乱数生成器の初期化エラー" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index c2ebfdef98..5f556fee31 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -1543,6 +1543,10 @@ msgstr "" msgid "Mismatched data size" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" @@ -2036,7 +2040,7 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index e647163b94..3de959fa49 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -1552,6 +1552,10 @@ msgstr "Microfoon opstart vertraging moet in bereik van 0.0 tot 1.0 zijn" msgid "Mismatched data size" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "Ontbrekende MISO of MOSI Pin" @@ -2059,7 +2063,7 @@ msgstr "RNG DeInit Fout" msgid "RNG Init Error" msgstr "RNG Init Fout" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index 73ec566382..f1cf6f9604 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -1551,6 +1551,10 @@ msgstr "Opóźnienie włączenia mikrofonu musi być w zakresie od 0.0 do 1.0" msgid "Mismatched data size" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "Brak pinu MISO lub MOSI" @@ -2044,7 +2048,7 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 12fef607a9..6ed7858a6e 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -1579,6 +1579,10 @@ msgstr "O atraso na inicialização do microfone deve estar entre 0,0 e 1,0" msgid "Mismatched data size" msgstr "O tamanho dos dados é incompatível" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "O pino MISO ou MOSI está ausente" @@ -2091,7 +2095,7 @@ msgstr "Erro DeInit RNG" msgid "RNG Init Error" msgstr "Houve um erro na inicialização do RNG" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "Ainda não há suporte para o RS485 neste dispositivo" diff --git a/locale/ru.po b/locale/ru.po index 546bafb8f6..95afcbcd8d 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -1576,6 +1576,10 @@ msgstr "Задержка включения микрофона должна бы msgid "Mismatched data size" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "Отсутствует пин MISO или MOSI" @@ -2080,7 +2084,7 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index eadb26173c..df9e58e816 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -1562,6 +1562,10 @@ msgstr "" msgid "Mismatched data size" msgstr "Datastorlek matchar inte" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "MISO- eller MOSI-pinne saknas" @@ -2067,7 +2071,7 @@ msgstr "RNG DeInit-fel" msgid "RNG Init Error" msgstr "RNG Init-fel" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "RS485 stöds ännu inte på den här enheten" diff --git a/locale/tr.po b/locale/tr.po index f3a597b3ea..ab5c85bab4 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -1557,6 +1557,10 @@ msgstr "" msgid "Mismatched data size" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" @@ -2053,7 +2057,7 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index d2aa5eb907..c4218c29e4 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -1574,6 +1574,10 @@ msgstr "Màikèfēng qǐdòng yánchí bìxū zài 0.0 Dào 1.0 De fànwéi nèi msgid "Mismatched data size" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "Quēshǎo MISO huò MOSI yǐn jiǎo" @@ -2079,7 +2083,7 @@ msgstr "RNG qǔxiāo chūshǐhuà cuòwù" msgid "RNG Init Error" msgstr "RNG chūshǐhuà cuòwù" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "RS485 cǐ shè bèi shàng bù zhī chí" From b03968aee5a5ad473afb1d4d6273c8f0aea774f7 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Sat, 7 May 2022 11:49:07 -0500 Subject: [PATCH 031/246] hide vectorio objects if their containing group is hidden --- shared-module/displayio/Group.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/shared-module/displayio/Group.c b/shared-module/displayio/Group.c index 28d3d89735..613e75e00b 100644 --- a/shared-module/displayio/Group.c +++ b/shared-module/displayio/Group.c @@ -32,6 +32,9 @@ #if CIRCUITPY_VECTORIO #include "shared-bindings/vectorio/VectorShape.h" +#include "shared-bindings/vectorio/Circle.h" +#include "shared-bindings/vectorio/Rectangle.h" +#include "shared-bindings/vectorio/Polygon.h" #endif @@ -66,6 +69,26 @@ void common_hal_displayio_group_set_hidden(displayio_group_t *self, bool hidden) displayio_group_set_hidden_by_parent(layer, hidden); continue; } + #if CIRCUITPY_VECTORIO + layer = mp_obj_cast_to_native_base( + self->members->items[i], &vectorio_circle_type); + if (layer != MP_OBJ_NULL) { + common_hal_vectorio_vector_shape_set_dirty(common_hal_vectorio_circle_get_draw_protocol(layer)); + continue; + } + layer = mp_obj_cast_to_native_base( + self->members->items[i], &vectorio_rectangle_type); + if (layer != MP_OBJ_NULL) { + common_hal_vectorio_vector_shape_set_dirty(common_hal_vectorio_rectangle_get_draw_protocol(layer)); + continue; + } + layer = mp_obj_cast_to_native_base( + self->members->items[i], &vectorio_polygon_type); + if (layer != MP_OBJ_NULL) { + common_hal_vectorio_vector_shape_set_dirty(common_hal_vectorio_polygon_get_draw_protocol(layer)); + continue; + } + #endif } } From d1aab89a5933e36ca5041e5ab5ced1884345e919 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Sat, 7 May 2022 11:57:27 -0500 Subject: [PATCH 032/246] remove prints and extra whitespace --- shared-module/displayio/Group.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/shared-module/displayio/Group.c b/shared-module/displayio/Group.c index 613e75e00b..083e04678b 100644 --- a/shared-module/displayio/Group.c +++ b/shared-module/displayio/Group.c @@ -381,13 +381,7 @@ void displayio_group_construct(displayio_group_t *self, mp_obj_list_t *members, bool displayio_group_fill_area(displayio_group_t *self, const _displayio_colorspace_t *colorspace, const displayio_area_t *area, uint32_t *mask, uint32_t *buffer) { // Track if any of the layers finishes filling in the given area. We can ignore any remaining // layers at that point. - //mp_printf(&mp_plat_print, "inside fill area \n"); - //mp_printf(&mp_plat_print, "%d \n", self->hidden); - //mp_printf(&mp_plat_print, "\n"); - - //mp_printf(&mp_plat_print, "inside fill area \n"); if (self->hidden == false){ - //mp_printf(&mp_plat_print, "not hidden\n"); for (int32_t i = self->members->len - 1; i >= 0; i--) { mp_obj_t layer; #if CIRCUITPY_VECTORIO @@ -418,8 +412,6 @@ bool displayio_group_fill_area(displayio_group_t *self, const _displayio_colorsp } } } - - return false; } From c77dc3c8284916030987dd5ded7c10cdce9aa998 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Sat, 7 May 2022 11:59:26 -0500 Subject: [PATCH 033/246] code format --- shared-module/displayio/Group.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shared-module/displayio/Group.c b/shared-module/displayio/Group.c index 083e04678b..73dea23606 100644 --- a/shared-module/displayio/Group.c +++ b/shared-module/displayio/Group.c @@ -71,19 +71,19 @@ void common_hal_displayio_group_set_hidden(displayio_group_t *self, bool hidden) } #if CIRCUITPY_VECTORIO layer = mp_obj_cast_to_native_base( - self->members->items[i], &vectorio_circle_type); + self->members->items[i], &vectorio_circle_type); if (layer != MP_OBJ_NULL) { common_hal_vectorio_vector_shape_set_dirty(common_hal_vectorio_circle_get_draw_protocol(layer)); continue; } layer = mp_obj_cast_to_native_base( - self->members->items[i], &vectorio_rectangle_type); + self->members->items[i], &vectorio_rectangle_type); if (layer != MP_OBJ_NULL) { common_hal_vectorio_vector_shape_set_dirty(common_hal_vectorio_rectangle_get_draw_protocol(layer)); continue; } layer = mp_obj_cast_to_native_base( - self->members->items[i], &vectorio_polygon_type); + self->members->items[i], &vectorio_polygon_type); if (layer != MP_OBJ_NULL) { common_hal_vectorio_vector_shape_set_dirty(common_hal_vectorio_polygon_get_draw_protocol(layer)); continue; @@ -381,7 +381,7 @@ void displayio_group_construct(displayio_group_t *self, mp_obj_list_t *members, bool displayio_group_fill_area(displayio_group_t *self, const _displayio_colorspace_t *colorspace, const displayio_area_t *area, uint32_t *mask, uint32_t *buffer) { // Track if any of the layers finishes filling in the given area. We can ignore any remaining // layers at that point. - if (self->hidden == false){ + if (self->hidden == false) { for (int32_t i = self->members->len - 1; i >= 0; i--) { mp_obj_t layer; #if CIRCUITPY_VECTORIO From 330e01d8e0bb379e38ba1fc173e61d6a92e340c6 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Sat, 7 May 2022 12:27:36 -0500 Subject: [PATCH 034/246] handle groups inside of groups with vectorio hidden --- shared-module/displayio/Group.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/shared-module/displayio/Group.c b/shared-module/displayio/Group.c index 73dea23606..21b4b2410f 100644 --- a/shared-module/displayio/Group.c +++ b/shared-module/displayio/Group.c @@ -115,6 +115,26 @@ void displayio_group_set_hidden_by_parent(displayio_group_t *self, bool hidden) displayio_group_set_hidden_by_parent(layer, hidden); continue; } + #if CIRCUITPY_VECTORIO + layer = mp_obj_cast_to_native_base( + self->members->items[i], &vectorio_circle_type); + if (layer != MP_OBJ_NULL) { + common_hal_vectorio_vector_shape_set_dirty(common_hal_vectorio_circle_get_draw_protocol(layer)); + continue; + } + layer = mp_obj_cast_to_native_base( + self->members->items[i], &vectorio_rectangle_type); + if (layer != MP_OBJ_NULL) { + common_hal_vectorio_vector_shape_set_dirty(common_hal_vectorio_rectangle_get_draw_protocol(layer)); + continue; + } + layer = mp_obj_cast_to_native_base( + self->members->items[i], &vectorio_polygon_type); + if (layer != MP_OBJ_NULL) { + common_hal_vectorio_vector_shape_set_dirty(common_hal_vectorio_polygon_get_draw_protocol(layer)); + continue; + } + #endif } } From 8b026a2c38f1be9a5170ccafce105bf593705c5a Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sun, 8 May 2022 09:49:18 -0400 Subject: [PATCH 035/246] apply i2c delay fix from adafruit/esp-idf --- ports/espressif/esp-idf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/esp-idf b/ports/espressif/esp-idf index 121ddb87e5..944c01eef4 160000 --- a/ports/espressif/esp-idf +++ b/ports/espressif/esp-idf @@ -1 +1 @@ -Subproject commit 121ddb87e5130314e4fcc5e9cb260a81b7d30d36 +Subproject commit 944c01eef4fbba693f991f9d033cda3f59ca82c9 From 07917fee82cbebf2d5fa3504420b10a8df46af7c Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Sun, 8 May 2022 04:54:30 +0000 Subject: [PATCH 036/246] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (1057 of 1057 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 6ed7858a6e..43ad72c6c0 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-04-27 18:11+0000\n" +"PO-Revision-Date: 2022-05-08 16:37+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -14,7 +14,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.12.1-dev\n" +"X-Generator: Weblate 4.12.1\n" #: main.c msgid "" @@ -1581,7 +1581,7 @@ msgstr "O tamanho dos dados é incompatível" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Mismatched swap flag" -msgstr "" +msgstr "Sinalizador de troca incompatível" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" From b6a5f421a9b7e3e27534a022c1642e83d7bffdb0 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Sun, 8 May 2022 12:02:59 -0500 Subject: [PATCH 037/246] use draw protocol impl --- shared-bindings/vectorio/VectorShape.c | 1 + shared-bindings/vectorio/__init__.h | 2 ++ shared-module/displayio/Group.c | 20 ++++---------------- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/shared-bindings/vectorio/VectorShape.c b/shared-bindings/vectorio/VectorShape.c index fe6be555cd..6a3e192cb9 100644 --- a/shared-bindings/vectorio/VectorShape.c +++ b/shared-bindings/vectorio/VectorShape.c @@ -78,6 +78,7 @@ vectorio_draw_protocol_impl_t vectorio_vector_shape_draw_protocol_impl = { .draw_update_transform = (draw_update_transform_fun)vectorio_vector_shape_update_transform, .draw_finish_refresh = (draw_finish_refresh_fun)vectorio_vector_shape_finish_refresh, .draw_get_refresh_areas = (draw_get_refresh_areas_fun)vectorio_vector_shape_get_refresh_areas, + .draw_set_dirty = (draw_set_dirty_fun)common_hal_vectorio_vector_shape_set_dirty, }; // Stub checker does not approve of these shared properties. diff --git a/shared-bindings/vectorio/__init__.h b/shared-bindings/vectorio/__init__.h index a34195de26..d4f10c926c 100644 --- a/shared-bindings/vectorio/__init__.h +++ b/shared-bindings/vectorio/__init__.h @@ -17,6 +17,7 @@ typedef bool (*draw_fill_area_fun)(mp_obj_t draw_protocol_self, const _displayio typedef bool (*draw_get_dirty_area_fun)(mp_obj_t draw_protocol_self, displayio_area_t *current_dirty_area); typedef void (*draw_update_transform_fun)(mp_obj_t draw_protocol_self, displayio_buffer_transform_t *group_transform); typedef void (*draw_finish_refresh_fun)(mp_obj_t draw_protocol_self); +typedef void (*draw_set_dirty_fun)(mp_obj_t draw_protocol_self); typedef displayio_area_t *(*draw_get_refresh_areas_fun)(mp_obj_t draw_protocol_self, displayio_area_t *tail); typedef struct _vectorio_draw_protocol_impl_t { @@ -25,6 +26,7 @@ typedef struct _vectorio_draw_protocol_impl_t { draw_update_transform_fun draw_update_transform; draw_finish_refresh_fun draw_finish_refresh; draw_get_refresh_areas_fun draw_get_refresh_areas; + draw_set_dirty_fun draw_set_dirty; } vectorio_draw_protocol_impl_t; // Draw protocol diff --git a/shared-module/displayio/Group.c b/shared-module/displayio/Group.c index 21b4b2410f..40f34a8336 100644 --- a/shared-module/displayio/Group.c +++ b/shared-module/displayio/Group.c @@ -70,22 +70,10 @@ void common_hal_displayio_group_set_hidden(displayio_group_t *self, bool hidden) continue; } #if CIRCUITPY_VECTORIO - layer = mp_obj_cast_to_native_base( - self->members->items[i], &vectorio_circle_type); - if (layer != MP_OBJ_NULL) { - common_hal_vectorio_vector_shape_set_dirty(common_hal_vectorio_circle_get_draw_protocol(layer)); - continue; - } - layer = mp_obj_cast_to_native_base( - self->members->items[i], &vectorio_rectangle_type); - if (layer != MP_OBJ_NULL) { - common_hal_vectorio_vector_shape_set_dirty(common_hal_vectorio_rectangle_get_draw_protocol(layer)); - continue; - } - layer = mp_obj_cast_to_native_base( - self->members->items[i], &vectorio_polygon_type); - if (layer != MP_OBJ_NULL) { - common_hal_vectorio_vector_shape_set_dirty(common_hal_vectorio_polygon_get_draw_protocol(layer)); + const vectorio_draw_protocol_t *draw_protocol = mp_proto_get(MP_QSTR_protocol_draw, self->members->items[i]); + if (draw_protocol != NULL) { + layer = draw_protocol->draw_get_protocol_self(self->members->items[i]); + draw_protocol->draw_protocol_impl->draw_set_dirty(layer); continue; } #endif From 1c564764d6403ff75420d597a0ee25c290a1b296 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Sun, 8 May 2022 12:14:28 -0500 Subject: [PATCH 038/246] use draw protocol impl in parent hidden too --- shared-module/displayio/Group.c | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/shared-module/displayio/Group.c b/shared-module/displayio/Group.c index 40f34a8336..1a4e4eafb5 100644 --- a/shared-module/displayio/Group.c +++ b/shared-module/displayio/Group.c @@ -32,9 +32,6 @@ #if CIRCUITPY_VECTORIO #include "shared-bindings/vectorio/VectorShape.h" -#include "shared-bindings/vectorio/Circle.h" -#include "shared-bindings/vectorio/Rectangle.h" -#include "shared-bindings/vectorio/Polygon.h" #endif @@ -104,22 +101,10 @@ void displayio_group_set_hidden_by_parent(displayio_group_t *self, bool hidden) continue; } #if CIRCUITPY_VECTORIO - layer = mp_obj_cast_to_native_base( - self->members->items[i], &vectorio_circle_type); - if (layer != MP_OBJ_NULL) { - common_hal_vectorio_vector_shape_set_dirty(common_hal_vectorio_circle_get_draw_protocol(layer)); - continue; - } - layer = mp_obj_cast_to_native_base( - self->members->items[i], &vectorio_rectangle_type); - if (layer != MP_OBJ_NULL) { - common_hal_vectorio_vector_shape_set_dirty(common_hal_vectorio_rectangle_get_draw_protocol(layer)); - continue; - } - layer = mp_obj_cast_to_native_base( - self->members->items[i], &vectorio_polygon_type); - if (layer != MP_OBJ_NULL) { - common_hal_vectorio_vector_shape_set_dirty(common_hal_vectorio_polygon_get_draw_protocol(layer)); + const vectorio_draw_protocol_t *draw_protocol = mp_proto_get(MP_QSTR_protocol_draw, self->members->items[i]); + if (draw_protocol != NULL) { + layer = draw_protocol->draw_get_protocol_self(self->members->items[i]); + draw_protocol->draw_protocol_impl->draw_set_dirty(layer); continue; } #endif From 4231eedf8ebad707ae2e450d0a7868137f4bb1ff Mon Sep 17 00:00:00 2001 From: Sam Willcocks Date: Mon, 9 May 2022 19:03:59 +0100 Subject: [PATCH 039/246] Correct USB HID usage range error message. When an invalid usage was given, the error message incorrectly referenced "usage_page". --- 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 4ca6a18304..2741013d03 100644 --- a/shared-bindings/usb_hid/Device.c +++ b/shared-bindings/usb_hid/Device.c @@ -107,7 +107,7 @@ STATIC mp_obj_t usb_hid_device_make_new(const mp_obj_type_t *type, size_t n_args const uint16_t usage_page = usage_page_arg; const mp_int_t usage_arg = args[ARG_usage].u_int; - mp_arg_validate_int_range(usage_arg, 1, 0xFFFF, MP_QSTR_usage_page); + mp_arg_validate_int_range(usage_arg, 1, 0xFFFF, MP_QSTR_usage); const uint16_t usage = usage_arg; mp_obj_t report_ids = args[ARG_report_ids].u_obj; From 7ecfa6611d20fb1fa50315d8e617d33531c11c1d Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Mon, 9 May 2022 07:52:38 +0000 Subject: [PATCH 040/246] Translated using Weblate (Swedish) Currently translated at 100.0% (1057 of 1057 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 df9e58e816..5ee114c3c0 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-04-26 15:40+0000\n" +"PO-Revision-Date: 2022-05-10 08:16+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -14,7 +14,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.12.1-dev\n" +"X-Generator: Weblate 4.12.1\n" #: main.c msgid "" @@ -1564,7 +1564,7 @@ msgstr "Datastorlek matchar inte" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Mismatched swap flag" -msgstr "" +msgstr "Felaktig swapflagga" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" From d48f961d0a977cbf23bdc967f36a921aab413bb0 Mon Sep 17 00:00:00 2001 From: dahanzimin <353767514@qq.com> Date: Tue, 10 May 2022 18:56:13 +0800 Subject: [PATCH 041/246] Add MixGo CE board --- ports/espressif/boards/mixgo_ce_udisk/board.c | 48 + .../mixgo_ce_udisk/mixgoce_lib/Image.py | 58 + .../mixgoce_lib/adafruit_framebuf.py | 549 +++++++++ .../mixgoce_lib/adafruit_irremote.py | 283 +++++ .../mixgoce_lib/adafruit_minimqtt.py | 1000 +++++++++++++++++ .../mixgoce_lib/adafruit_rtttl.py | 204 ++++ .../mixgo_ce_udisk/mixgoce_lib/blynklib.py | 390 +++++++ .../mixgo_ce_udisk/mixgoce_lib/blynktimer.py | 134 +++ .../mixgo_ce_udisk/mixgoce_lib/button.py | 49 + .../mixgo_ce_udisk/mixgoce_lib/infrared.py | 41 + .../mixgo_ce_udisk/mixgoce_lib/irremote.py | 111 ++ .../boards/mixgo_ce_udisk/mixgoce_lib/led.py | 34 + .../mixgo_ce_udisk/mixgoce_lib/matcher.py | 97 ++ .../mixgo_ce_udisk/mixgoce_lib/matrix.py | 277 +++++ .../mixgo_ce_udisk/mixgoce_lib/mixgoce.py | 85 ++ .../mixgo_ce_udisk/mixgoce_lib/mixpy.py | 84 ++ .../mixgo_ce_udisk/mixgoce_lib/mmatrix.py | 139 +++ .../mixgo_ce_udisk/mixgoce_lib/msa301.py | 70 ++ .../mixgo_ce_udisk/mixgoce_lib/music.py | 102 ++ .../mixgo_ce_udisk/mixgoce_lib/mxc6655xa.py | 80 ++ .../mixgo_ce_udisk/mixgoce_lib/pixels.py | 71 ++ .../mixgo_ce_udisk/mixgoce_lib/sensor.py | 55 + .../mixgo_ce_udisk/mixgoce_lib/touchpad.py | 25 + .../boards/mixgo_ce_udisk/mpconfigboard.h | 32 + .../boards/mixgo_ce_udisk/mpconfigboard.mk | 24 + ports/espressif/boards/mixgo_ce_udisk/pins.c | 50 + .../espressif/boards/mixgo_ce_udisk/sdkconfig | 0 27 files changed, 4092 insertions(+) create mode 100644 ports/espressif/boards/mixgo_ce_udisk/board.c create mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/Image.py create mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_framebuf.py create mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_irremote.py create mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_minimqtt.py create mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_rtttl.py create mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/blynklib.py create mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/blynktimer.py create mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/button.py create mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/infrared.py create mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/irremote.py create mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/led.py create mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/matcher.py create mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/matrix.py create mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mixgoce.py create mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mixpy.py create mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mmatrix.py create mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/msa301.py create mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/music.py create mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mxc6655xa.py create mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/pixels.py create mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/sensor.py create mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/touchpad.py create mode 100644 ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.h create mode 100644 ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk create mode 100644 ports/espressif/boards/mixgo_ce_udisk/pins.c create mode 100644 ports/espressif/boards/mixgo_ce_udisk/sdkconfig diff --git a/ports/espressif/boards/mixgo_ce_udisk/board.c b/ports/espressif/boards/mixgo_ce_udisk/board.c new file mode 100644 index 0000000000..bf5980e627 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/board.c @@ -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. + */ + +#include "supervisor/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" + +void board_init(void) { + // Debug UART + #ifdef DEBUG + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); + #endif /* DEBUG */ +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} + +void board_deinit(void) { +} \ No newline at end of file diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/Image.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/Image.py new file mode 100644 index 0000000000..c799b4aadd --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/Image.py @@ -0,0 +1,58 @@ +""" +Image + +CircuitPython library for Image - MixGoCE +======================================================= + +Small Cabbage +20210721 +""" + +HEART=bytearray(b'\x00\x00\x00\x0c\x1e\x3f\x7e\xfc\x7e\x3f\x1e\x0c\x00\x00\x00\x00') +HEART_SMALL=bytearray(b'\x00\x00\x00\x00\x0c\x1e\x3c\x78\x3c\x1e\x0c\x00\x00\x00\x00\x00') +HAPPY=bytearray(b'\x00\x00\x00\x0c\x0c\x20\x40\x80\x80\x40\x20\x0c\x0c\x00\x00\x00') +SAD=bytearray(b'\x00\x00\x08\x04\x04\x84\x40\x20\x20\x40\x84\x04\x04\x08\x00\x00') +SMILE=bytearray(b'\x00\x00\x04\x02\x02\x24\x40\x80\x80\x40\x24\x02\x02\x04\x00\x00') +SILLY=bytearray(b'\x00\x00\x04\x0a\x0a\x04\x60\xa0\xa0\x60\x04\x0a\x0a\x04\x00\x00') +FABULOUS=bytearray(b'\x00\x00\x06\x05\x05\x65\xa6\xa0\xa0\xa6\x65\x05\x05\x06\x00\x00') +SURPRISED=bytearray(b'\x00\x00\x00\x00\x00\x00\x00\xbe\x00\x00\x00\x00\x00\x00\x00\x00') +ASLEEP=bytearray(b'\x00\x00\x04\x04\x04\x44\xa0\xa0\xa0\xa0\x44\x04\x04\x04\x00\x00') +ANGRY=bytearray(b'\x00\x00\x01\x02\x84\x42\x21\x10\x10\x21\x42\x84\x02\x01\x00\x00') +CONFUSED=bytearray(b'\x00\x00\x00\x00\x00\x04\x02\xa2\x12\x0c\x00\x00\x00\x00\x00\x00') +NO=bytearray(b'\x00\x00\x00\x00\x42\x24\x18\x18\x24\x42\x00\x00\x00\x00\x00\x00') +YES=bytearray(b'\x00\x00\x00\x00\x10\x20\x40\x40\x20\x10\x08\x04\x02\x00\x00\x00') +LEFT_ARROW=bytearray(b'\x00\x00\x10\x28\x54\x92\x10\x10\x10\x10\x10\x10\x10\x10\x00\x00') +RIGHT_ARROW=bytearray(b'\x00\x00\x10\x10\x10\x10\x10\x10\x10\x10\x92\x54\x28\x10\x00\x00') +DRESS=bytearray(b'\x00\x00\x00\x40\xa2\xd7\xae\xda\xae\xd7\xa2\x40\x00\x00\x00\x00') +TRANSFORMERS=bytearray(b'\x00\x00\x00\x00\x00\x9c\x64\x1a\x64\x9c\x00\x00\x00\x00\x00\x00') +SCISSORS=bytearray(b'\x00\x00\x00\x00\x00\x43\xa6\x6c\x18\x6c\xa6\x43\x00\x00\x00\x00') +EXIT=bytearray(b'\x00\x00\x00\x00\x00\x00\x28\x04\x72\x0e\x17\x25\x48\x88\x00\x00') +TREE=bytearray(b'\x00\x00\x00\x10\x18\x1c\x1e\xff\x1e\x1c\x18\x10\x00\x00\x00\x00') +PACMAN=bytearray(b'\x00\x00\x1c\x36\x63\x41\x45\x41\x49\x55\x22\x00\x00\x00\x00\x00') +TARGET=bytearray(b'\x00\x00\x00\x00\x00\x00\x38\x44\x54\x44\x38\x00\x00\x00\x00\x00') +TSHIRT=bytearray(b'\x00\x00\x00\x04\x0a\xf9\x82\x82\x82\x82\xf9\x0a\x04\x00\x00\x00') +ROLLERSKATE=bytearray(b'\x00\x00\x00\x60\x5f\x71\x11\x17\x14\x14\x74\x58\x60\x00\x00\x00') +DUCK=bytearray(b'\x00\x00\x08\x0c\x0a\xf9\x81\x83\x9e\x90\x90\x90\x50\x30\x10\x00') +HOUSE=bytearray(b'\x04\x06\xfb\x01\x01\xf9\x09\x29\x09\x09\xf9\x01\x01\xfb\x06\x04') +TORTOISE=bytearray(b'\x00\x00\x00\x00\x00\x5e\x3c\x3f\x3f\x3c\x5e\x00\x00\x00\x00\x00') +BUTTERFLY=bytearray(b'\x00\x00\x00\x00\x04\xca\xaa\x5c\x38\x5c\xaa\xca\x04\x00\x00\x00') +STICKFIGURE=bytearray(b'\x00\x00\x00\x00\x00\x90\x4a\x3d\x4a\x90\x00\x00\x00\x00\x00\x00') +GHOST=bytearray(b'\x00\x00\x00\x00\xfe\xdf\xe9\xdf\xe9\xdf\xfe\xc0\x80\x00\x00\x00') +PITCHFORK=bytearray(b'\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x3e\x49\x49\x49\x49\x49') +MUSIC_QUAVERS=bytearray(b'\x20\x10\x08\x0c\x1c\x38\x30\x10\x08\x0c\x1c\x38\x30\x10\x08\x04') +MUSIC_QUAVER=bytearray(b'\x06\x05\x05\x05\x05\x05\x05\x05\x36\x7c\xfc\xfc\xf8\x70\x00\x00') +MUSIC_CROTCHET=bytearray(b'\x02\x02\x02\x02\x02\x02\x02\x02\x1a\x3e\x7e\x7e\x7c\x38\x00\x00') +COW=bytearray(b'\x00\x1e\x1a\x1f\xfe\xfc\x1c\x1c\x1c\xfc\xfc\x08\x10\x10\x20\x00') +RABBIT=bytearray(b'\x14\x2a\x2a\x2a\x2a\x2a\x63\x41\x55\x41\x49\x49\x5d\x41\x3e\x00') +SQUARE_SMALL=bytearray(b'\x00\x00\x00\x00\x00\x00\x3c\x24\x24\x3c\x00\x00\x00\x00\x00\x00') +SQUARE=bytearray(b'\x00\x00\x00\x00\xff\x81\x81\x81\x81\x81\x81\xff\x00\x00\x00\x00') +DIAMOND_SMALL=bytearray(b'\x00\x00\x00\x00\x00\x08\x14\x2c\x14\x08\x00\x00\x00\x00\x00\x00') +DIAMOND=bytearray(b'\x00\x00\x04\x0e\x1b\x35\x6f\xdd\x6f\x35\x1b\x0e\x04\x00\x00\x00') +CHESSBOARD=bytearray(b'\x00\x00\x00\xfe\xaa\xfe\xaa\xfe\xaa\xfe\xaa\xfe\xaa\xfe\x00\x00') +TRIANGLE_LEFT=bytearray(b'\x00\x00\x00\x00\x00\x10\x38\x7c\xfe\x00\x00\x00\x00\x00\x00\x00') +TRIANGLE=bytearray(b'\x00\x00\x40\x60\x70\x78\x7c\x7e\x7e\x7c\x78\x70\x60\x40\x00\x00') +SNAKE=bytearray(b'\x00\x40\x60\x70\x38\x18\x18\x18\x18\x1f\x05\x07\x00\x00\x00\x00') +UMBRELLA=bytearray(b'\x00\x00\x00\x08\x0c\x0e\x0e\xff\x8e\xce\x0c\x08\x00\x00\x00\x00') +SKULL=bytearray(b'\x00\x00\x00\x0c\x1a\x79\x99\xd7\x99\x79\x1a\x0c\x00\x00\x00\x00') +GIRAFFE=bytearray(b'\x00\x00\x00\x00\xe0\x20\x20\xff\x03\x02\x00\x00\x00\x00\x00\x00') +SWORD=bytearray(b'\x00\x00\x18\x18\x7e\x3c\x18\x18\x18\x18\x18\x18\x18\x00\x00\x00') \ No newline at end of file diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_framebuf.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_framebuf.py new file mode 100644 index 0000000000..458dcc5410 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_framebuf.py @@ -0,0 +1,549 @@ +# The MIT License (MIT) +# +# Copyright (c) 2018 Kattni Rembor for Adafruit Industries +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION 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_framebuf` +==================================================== + +CircuitPython pure-python framebuf module, based on the micropython framebuf module. + +* Author(s): Melissa LeBlanc-Williams, Kattni Rembor, Tony DiCola, original file + created by Damien P. George + +Implementation Notes +-------------------- + +**Hardware:** + +* `Adafruit SSD1306 OLED displays `_ + +**Software and Dependencies:** + +* Adafruit CircuitPython firmware for the supported boards: + https://github.com/adafruit/circuitpython/releases + +""" + +__version__ = "0.0.0-auto.0" +__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_framebuf.git" + +import os +import struct + +# Framebuf format constants: +MVLSB = 0 # Single bit displays (like SSD1306 OLED) +RGB565 = 1 # 16-bit color displays +GS4_HMSB = 2 # Unimplemented! +MHMSB = 3 # Single bit displays like the Sharp Memory +RGB888 = 4 # Neopixels and Dotstars + + +class MHMSBFormat: + """MHMSBFormat""" + + @staticmethod + def set_pixel(framebuf, x, y, color): + """Set a given pixel to a color.""" + index = (y * framebuf.stride + x) // 8 + offset = 7 - x & 0x07 + framebuf.buf[index] = (framebuf.buf[index] & ~(0x01 << offset)) | ( + (color != 0) << offset + ) + + @staticmethod + def get_pixel(framebuf, x, y): + """Get the color of a given pixel""" + index = (y * framebuf.stride + x) // 8 + offset = 7 - x & 0x07 + return (framebuf.buf[index] >> offset) & 0x01 + + @staticmethod + def fill(framebuf, color): + """completely fill/clear the buffer with a color""" + if color: + fill = 0xFF + else: + fill = 0x00 + for i in range(len(framebuf.buf)): + framebuf.buf[i] = fill + + @staticmethod + def fill_rect(framebuf, x, y, width, height, color): + """Draw a rectangle at the given location, size and color. The ``fill_rect`` method draws + both the outline and interior.""" + # pylint: disable=too-many-arguments + for _x in range(x, x + width): + offset = 7 - _x & 0x07 + for _y in range(y, y + height): + index = (_y * framebuf.stride + _x) // 8 + framebuf.buf[index] = (framebuf.buf[index] & ~(0x01 << offset)) | ( + (color != 0) << offset + ) + + +class MVLSBFormat: + """MVLSBFormat""" + + @staticmethod + def set_pixel(framebuf, x, y, color): + """Set a given pixel to a color.""" + index = (y >> 3) * framebuf.stride + x + offset = y & 0x07 + framebuf.buf[index] = (framebuf.buf[index] & ~(0x01 << offset)) | ( + (color != 0) << offset + ) + + @staticmethod + def get_pixel(framebuf, x, y): + """Get the color of a given pixel""" + index = (y >> 3) * framebuf.stride + x + offset = y & 0x07 + return (framebuf.buf[index] >> offset) & 0x01 + + @staticmethod + def fill(framebuf, color): + """completely fill/clear the buffer with a color""" + if color: + fill = 0xFF + else: + fill = 0x00 + for i in range(len(framebuf.buf)): + framebuf.buf[i] = fill + + @staticmethod + def fill_rect(framebuf, x, y, width, height, color): + """Draw a rectangle at the given location, size and color. The ``fill_rect`` method draws + both the outline and interior.""" + # pylint: disable=too-many-arguments + while height > 0: + index = (y >> 3) * framebuf.stride + x + offset = y & 0x07 + for w_w in range(width): + framebuf.buf[index + w_w] = ( + framebuf.buf[index + w_w] & ~(0x01 << offset) + ) | ((color != 0) << offset) + y += 1 + height -= 1 + + +class RGB888Format: + """RGB888Format""" + + @staticmethod + def set_pixel(framebuf, x, y, color): + """Set a given pixel to a color.""" + index = (y * framebuf.stride + x) * 3 + if isinstance(color, tuple): + framebuf.buf[index : index + 3] = bytes(color) + else: + framebuf.buf[index : index + 3] = bytes( + ((color >> 16) & 255, (color >> 8) & 255, color & 255) + ) + + @staticmethod + def get_pixel(framebuf, x, y): + """Get the color of a given pixel""" + index = (y * framebuf.stride + x) * 3 + return ( + (framebuf.buf[index] << 16) + | (framebuf.buf[index + 1] << 8) + | framebuf.buf[index + 2] + ) + + @staticmethod + def fill(framebuf, color): + """completely fill/clear the buffer with a color""" + fill = (color >> 16) & 255, (color >> 8) & 255, color & 255 + for i in range(0, len(framebuf.buf), 3): + framebuf.buf[i : i + 3] = bytes(fill) + + @staticmethod + def fill_rect(framebuf, x, y, width, height, color): + """Draw a rectangle at the given location, size and color. The ``fill_rect`` method draws + both the outline and interior.""" + # pylint: disable=too-many-arguments + fill = (color >> 16) & 255, (color >> 8) & 255, color & 255 + for _x in range(x, x + width): + for _y in range(y, y + height): + index = (_y * framebuf.stride + _x) * 3 + framebuf.buf[index : index + 3] = bytes(fill) + + +class FrameBuffer: + """FrameBuffer object. + + :param buf: An object with a buffer protocol which must be large enough to contain every + pixel defined by the width, height and format of the FrameBuffer. + :param width: The width of the FrameBuffer in pixel + :param height: The height of the FrameBuffer in pixel + :param buf_format: Specifies the type of pixel used in the FrameBuffer; permissible values + are listed under Constants below. These set the number of bits used to + encode a color value and the layout of these bits in ``buf``. Where a + color value c is passed to a method, c is a small integer with an encoding + that is dependent on the format of the FrameBuffer. + :param stride: The number of pixels between each horizontal line of pixels in the + FrameBuffer. This defaults to ``width`` but may need adjustments when + implementing a FrameBuffer within another larger FrameBuffer or screen. The + ``buf`` size must accommodate an increased step size. + + """ + + def __init__(self, buf, width, height, buf_format=MVLSB, stride=None): + # pylint: disable=too-many-arguments + self.buf = buf + self.width = width + self.height = height + self.stride = stride + self._font = None + if self.stride is None: + self.stride = width + if buf_format == MVLSB: + self.format = MVLSBFormat() + elif buf_format == MHMSB: + self.format = MHMSBFormat() + elif buf_format == RGB888: + self.format = RGB888Format() + else: + raise ValueError("invalid format") + self._rotation = 0 + + @property + def rotation(self): + """The rotation setting of the display, can be one of (0, 1, 2, 3)""" + return self._rotation + + @rotation.setter + def rotation(self, val): + if not val in (0, 1, 2, 3): + raise RuntimeError("Bad rotation setting") + self._rotation = val + + def fill(self, color): + """Fill the entire FrameBuffer with the specified color.""" + self.format.fill(self, color) + + def fill_rect(self, x, y, width, height, color): + """Draw a rectangle at the given location, size and color. The ``fill_rect`` method draws + both the outline and interior.""" + # pylint: disable=too-many-arguments, too-many-boolean-expressions + self.rect(x, y, width, height, color, fill=True) + + def pixel(self, x, y, color=None): + """If ``color`` is not given, get the color value of the specified pixel. If ``color`` is + given, set the specified pixel to the given color.""" + if self.rotation == 1: + x, y = y, x + x = self.width - x - 1 + if self.rotation == 2: + x = self.width - x - 1 + y = self.height - y - 1 + if self.rotation == 3: + x, y = y, x + y = self.height - y - 1 + + if x < 0 or x >= self.width or y < 0 or y >= self.height: + return None + if color is None: + return self.format.get_pixel(self, x, y) + self.format.set_pixel(self, x, y, color) + return None + + def hline(self, x, y, width, color): + """Draw a horizontal line up to a given length.""" + self.rect(x, y, width, 1, color, fill=True) + + def vline(self, x, y, height, color): + """Draw a vertical line up to a given length.""" + self.rect(x, y, 1, height, color, fill=True) + + def circle(self, center_x, center_y, radius, color): + """Draw a circle at the given midpoint location, radius and color. + The ```circle``` method draws only a 1 pixel outline.""" + x = radius - 1 + y = 0 + d_x = 1 + d_y = 1 + err = d_x - (radius << 1) + while x >= y: + self.pixel(center_x + x, center_y + y, color) + self.pixel(center_x + y, center_y + x, color) + self.pixel(center_x - y, center_y + x, color) + self.pixel(center_x - x, center_y + y, color) + self.pixel(center_x - x, center_y - y, color) + self.pixel(center_x - y, center_y - x, color) + self.pixel(center_x + y, center_y - x, color) + self.pixel(center_x + x, center_y - y, color) + if err <= 0: + y += 1 + err += d_y + d_y += 2 + if err > 0: + x -= 1 + d_x += 2 + err += d_x - (radius << 1) + + def rect(self, x, y, width, height, color, *, fill=False): + """Draw a rectangle at the given location, size and color. The ```rect``` method draws only + a 1 pixel outline.""" + # pylint: disable=too-many-arguments + if self.rotation == 1: + x, y = y, x + width, height = height, width + x = self.width - x - width + if self.rotation == 2: + x = self.width - x - width + y = self.height - y - height + if self.rotation == 3: + x, y = y, x + width, height = height, width + y = self.height - y - height + + # pylint: disable=too-many-boolean-expressions + if ( + width < 1 + or height < 1 + or (x + width) <= 0 + or (y + height) <= 0 + or y >= self.height + or x >= self.width + ): + return + x_end = min(self.width - 1, x + width - 1) + y_end = min(self.height - 1, y + height - 1) + x = max(x, 0) + y = max(y, 0) + if fill: + self.format.fill_rect(self, x, y, x_end - x + 1, y_end - y + 1, color) + else: + self.format.fill_rect(self, x, y, x_end - x + 1, 1, color) + self.format.fill_rect(self, x, y, 1, y_end - y + 1, color) + self.format.fill_rect(self, x, y_end, x_end - x + 1, 1, color) + self.format.fill_rect(self, x_end, y, 1, y_end - y + 1, color) + + def line(self, x_0, y_0, x_1, y_1, color): + # pylint: disable=too-many-arguments + """Bresenham's line algorithm""" + d_x = abs(x_1 - x_0) + d_y = abs(y_1 - y_0) + x, y = x_0, y_0 + s_x = -1 if x_0 > x_1 else 1 + s_y = -1 if y_0 > y_1 else 1 + if d_x > d_y: + err = d_x / 2.0 + while x != x_1: + self.pixel(x, y, color) + err -= d_y + if err < 0: + y += s_y + err += d_x + x += s_x + else: + err = d_y / 2.0 + while y != y_1: + self.pixel(x, y, color) + err -= d_x + if err < 0: + x += s_x + err += d_y + y += s_y + self.pixel(x, y, color) + + def blit(self): + """blit is not yet implemented""" + raise NotImplementedError() + + def scroll(self, delta_x, delta_y): + """shifts framebuf in x and y direction""" + if delta_x < 0: + shift_x = 0 + xend = self.width + delta_x + dt_x = 1 + else: + shift_x = self.width - 1 + xend = delta_x - 1 + dt_x = -1 + if delta_y < 0: + y = 0 + yend = self.height + delta_y + dt_y = 1 + else: + y = self.height - 1 + yend = delta_y - 1 + dt_y = -1 + while y != yend: + x = shift_x + while x != xend: + self.format.set_pixel( + self, x, y, self.format.get_pixel(self, x - delta_x, y - delta_y) + ) + x += dt_x + y += dt_y + + # pylint: disable=too-many-arguments + def text(self, string, x, y, color, *, font_name="font5x8.bin", size=1): + """Place text on the screen in variables sizes. Breaks on \n to next line. + + Does not break on line going off screen. + """ + # determine our effective width/height, taking rotation into account + frame_width = self.width + frame_height = self.height + if self.rotation == 1 or self.rotation == 3: + frame_width, frame_height = frame_height, frame_width + + for chunk in string.split("\n"): + if not self._font or self._font.font_name != font_name: + # load the font! + self._font = BitmapFont(font_name) + width = self._font.font_width + height = self._font.font_height + for i, char in enumerate(chunk): + char_x = x + (i * (width + 1)) * size + if ( + char_x + (width * size) > 0 + and char_x < frame_width + and y + (height * size) > 0 + and y < frame_height + ): + self._font.draw_char(char, char_x, y, self, color, size=size) + y += height * size + + # pylint: enable=too-many-arguments + + def image(self, img): + """Set buffer to value of Python Imaging Library image. The image should + be in 1 bit mode and a size equal to the display size.""" + # determine our effective width/height, taking rotation into account + width = self.width + height = self.height + if self.rotation == 1 or self.rotation == 3: + width, height = height, width + + if isinstance(self.format, RGB888Format) and img.mode != "RGB": + raise ValueError("Image must be in mode RGB.") + if isinstance(self.format, (MHMSBFormat, MVLSBFormat)) and img.mode != "1": + raise ValueError("Image must be in mode 1.") + + imwidth, imheight = img.size + if imwidth != width or imheight != height: + raise ValueError( + "Image must be same dimensions as display ({0}x{1}).".format( + width, height + ) + ) + # Grab all the pixels from the image, faster than getpixel. + pixels = img.load() + # Clear buffer + for i in range(len(self.buf)): + self.buf[i] = 0 + # Iterate through the pixels + for x in range(width): # yes this double loop is slow, + for y in range(height): # but these displays are small! + if img.mode == "RGB": + self.pixel(x, y, pixels[(x, y)]) + elif pixels[(x, y)]: + self.pixel(x, y, 1) # only write if pixel is true + + +# MicroPython basic bitmap font renderer. +# Author: Tony DiCola +# License: MIT License (https://opensource.org/licenses/MIT) +class BitmapFont: + """A helper class to read binary font tiles and 'seek' through them as a + file to display in a framebuffer. We use file access so we dont waste 1KB + of RAM on a font!""" + + def __init__(self, font_name="font5x8.bin"): + # Specify the drawing area width and height, and the pixel function to + # call when drawing pixels (should take an x and y param at least). + # Optionally specify font_name to override the font file to use (default + # is font5x8.bin). The font format is a binary file with the following + # format: + # - 1 unsigned byte: font character width in pixels + # - 1 unsigned byte: font character height in pixels + # - x bytes: font data, in ASCII order covering all 255 characters. + # Each character should have a byte for each pixel column of + # data (i.e. a 5x8 font has 5 bytes per character). + self.font_name = font_name + + # Open the font file and grab the character width and height values. + # Note that only fonts up to 8 pixels tall are currently supported. + try: + self._font_code=b'\x05\x08\x00\x00\x00\x00\x00>[O[>>kOk>\x1c>|>\x1c\x18<~<\x18\x1cW}W\x1c\x1c^\x7f^\x1c\x00\x18<\x18\x00\xff\xe7\xc3\xe7\xff\x00\x18$\x18\x00\xff\xe7\xdb\xe7\xff0H:\x06\x0e&)y)&@\x7f\x05\x05\x07@\x7f\x05%?Z<\xe7\x1c\x1c\x08\x08\x1c\x1c>\x7f\x14"\x7f"\x14__\x00__\x06\t\x7f\x01\x7f\x00f\x89\x95j`````\x94\xa2\xff\xa2\x94\x08\x04~\x04\x08\x10 ~ \x10\x08\x08*\x1c\x08\x08\x1c*\x08\x08\x1e\x10\x10\x10\x10\x0c\x1e\x0c\x1e\x0c08>80\x06\x0e>\x0e\x06\x00\x00\x00\x00\x00\x00\x00_\x00\x00\x00\x07\x00\x07\x00\x14\x7f\x14\x7f\x14$*\x7f*\x12#\x13\x08db6IV P\x00\x08\x07\x03\x00\x00\x1c"A\x00\x00A"\x1c\x00*\x1c\x7f\x1c*\x08\x08>\x08\x08\x00\x80p0\x00\x08\x08\x08\x08\x08\x00\x00``\x00 \x10\x08\x04\x02>QIE>\x00B\x7f@\x00rIIIF!AIM3\x18\x14\x12\x7f\x10\'EEE9A]YN|\x12\x11\x12|\x7fIII6>AAA"\x7fAAA>\x7fIIIA\x7f\t\t\t\x01>AAQs\x7f\x08\x08\x08\x7f\x00A\x7fA\x00 @A?\x01\x7f\x08\x14"A\x7f@@@@\x7f\x02\x1c\x02\x7f\x7f\x04\x08\x10\x7f>AAA>\x7f\t\t\t\x06>AQ!^\x7f\t\x19)F&III2\x03\x01\x7f\x01\x03?@@@?\x1f @ \x1f?@8@?c\x14\x08\x14c\x03\x04x\x04\x03aYIMC\x00\x7fAAA\x02\x04\x08\x10 \x00AAA\x7f\x04\x02\x01\x02\x04@@@@@\x00\x03\x07\x08\x00 TTx@\x7f(DD88DDD(8DD(\x7f8TTT\x18\x00\x08~\t\x02\x18\xa4\xa4\x9cx\x7f\x08\x04\x04x\x00D}@\x00 @@=\x00\x7f\x10(D\x00\x00A\x7f@\x00|\x04x\x04x|\x08\x04\x04x8DDD8\xfc\x18$$\x18\x18$$\x18\xfc|\x08\x04\x04\x08HTTT$\x04\x04?D$<@@ |\x1c @ \x1c<@0@III\x00~\x01\x01\x01~*****DD_DD@QJD@@DJQ@\x00\x00\xff\x01\x03\xe0\x80\xff\x00\x00\x08\x08kk\x086\x126$6\x06\x0f\t\x0f\x06\x00\x00\x18\x18\x00\x00\x00\x10\x10\x000@\xff\x01\x01\x00\x1f\x01\x01\x1e\x00\x19\x1d\x17\x12\x00<<<<\x00\x00\x00\x00\x00' + self.font_width, self.font_height = struct.unpack("BB", b'\x05\x08') + # simple font file validation check based on expected file size + #if 2 + 256 * self.font_width != os.stat(font_name)[6]: + # raise RuntimeError("Invalid font file: " + font_name) + except OSError: + print("Could not find font file", font_name) + raise + except OverflowError: + # os.stat can throw this on boards without long int support + # just hope the font file is valid and press on + pass + + def deinit(self): + """Close the font file as cleanup.""" + #self._font.close() + + def __enter__(self): + """Initialize/open the font file""" + self.__init__() + return self + + def __exit__(self, exception_type, exception_value, traceback): + """cleanup on exit""" + #self.deinit() + pass + + def draw_char( + self, char, x, y, framebuffer, color, size=1 + ): # pylint: disable=too-many-arguments + """Draw one character at position (x,y) to a framebuffer in a given color""" + size = max(size, 1) + # Don't draw the character if it will be clipped off the visible area. + # if x < -self.font_width or x >= framebuffer.width or \ + # y < -self.font_height or y >= framebuffer.height: + # return + # Go through each column of the character. + for char_x in range(self.font_width): + # Grab the byte for the current column of font data. + #self._font.seek(2 + (ord(char) * self.font_width) + char_x) + chcode=bytes([self._font_code[(2 + (ord(char) * self.font_width) + char_x)]]) + try: + line = struct.unpack("B", chcode)[0] + except RuntimeError: + continue # maybe character isnt there? go to next + # Go through each row in the column byte. + for char_y in range(self.font_height): + # Draw a pixel for each bit that's flipped on. + if (line >> char_y) & 0x1: + framebuffer.fill_rect( + x + char_x * size, y + char_y * size, size, size, color + ) + + def width(self, text): + """Return the pixel width of the specified text message.""" + return len(text) * (self.font_width + 1) + + +class FrameBuffer1(FrameBuffer): # pylint: disable=abstract-method + """FrameBuffer1 object. Inherits from FrameBuffer.""" diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_irremote.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_irremote.py new file mode 100644 index 0000000000..e7f1476cfc --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_irremote.py @@ -0,0 +1,283 @@ +# 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. +""" +`adafruit_irremote` +==================================================== + +Demo code for Circuit Playground Express: + +.. code-block:: python + + # Circuit Playground Express Demo Code + # Adjust the pulseio 'board.PIN' if using something else + import pulseio + import board + import adafruit_irremote + + pulsein = pulseio.PulseIn(board.REMOTEIN, maxlen=120, idle_state=True) + decoder = adafruit_irremote.GenericDecode() + + + while True: + pulses = decoder.read_pulses(pulsein) + print("Heard", len(pulses), "Pulses:", pulses) + try: + code = decoder.decode_bits(pulses) + print("Decoded:", code) + except adafruit_irremote.IRNECRepeatException: # unusual short code! + print("NEC repeat!") + except adafruit_irremote.IRDecodeException as e: # failed to decode + print("Failed to decode: ", e.args) + + print("----------------------------") + +* Author(s): Scott Shawcroft + +Implementation Notes +-------------------- + +**Hardware:** + +* `CircuitPlayground Express `_ + +* `IR Receiver Sensor `_ + +**Software and Dependencies:** + +* Adafruit CircuitPython firmware for the ESP8622 and M0-based boards: + https://github.com/adafruit/circuitpython/releases + +""" + +# Pretend self matter because we may add object level config later. +# pylint: disable=no-self-use + +import array +import time + +__version__ = "0.0.0-auto.0" +__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_IRRemote.git" + + +class IRDecodeException(Exception): + """Generic decode exception""" + + +class IRNECRepeatException(Exception): + """Exception when a NEC repeat is decoded""" + + +class GenericDecode: + """Generic decoding of infrared signals""" + + def bin_data(self, pulses): + """Compute bins of pulse lengths where pulses are +-25% of the average. + + :param list pulses: Input pulse lengths + """ + bins = [[pulses[0], 0]] + + for _, pulse in enumerate(pulses): + matchedbin = False + # print(pulse, end=": ") + for b, pulse_bin in enumerate(bins): + if pulse_bin[0] * 0.75 <= pulse <= pulse_bin[0] * 1.25: + # print("matches bin") + bins[b][0] = (pulse_bin[0] + pulse) // 2 # avg em + bins[b][1] += 1 # track it + matchedbin = True + break + if not matchedbin: + bins.append([pulse, 1]) + # print(bins) + return bins + + def decode_bits(self, pulses): + """Decode the pulses into bits.""" + # pylint: disable=too-many-branches,too-many-statements + + # special exception for NEC repeat code! + if ( + (len(pulses) == 3) + and (8000 <= pulses[0] <= 10000) + and (2000 <= pulses[1] <= 3000) + and (450 <= pulses[2] <= 700) + ): + raise IRNECRepeatException() + + if len(pulses) < 10: + raise IRDecodeException("10 pulses minimum") + + # Ignore any header (evens start at 1), and any trailer. + if len(pulses) % 2 == 0: + pulses_end = -1 + else: + pulses_end = None + + evens = pulses[1:pulses_end:2] + odds = pulses[2:pulses_end:2] + + # bin both halves + even_bins = self.bin_data(evens) + odd_bins = self.bin_data(odds) + + outliers = [b[0] for b in (even_bins + odd_bins) if b[1] == 1] + even_bins = [b for b in even_bins if b[1] > 1] + odd_bins = [b for b in odd_bins if b[1] > 1] + + if not even_bins or not odd_bins: + raise IRDecodeException("Not enough data") + + if len(even_bins) == 1: + pulses = odds + pulse_bins = odd_bins + elif len(odd_bins) == 1: + pulses = evens + pulse_bins = even_bins + else: + raise IRDecodeException("Both even/odd pulses differ") + + if len(pulse_bins) == 1: + raise IRDecodeException("Pulses do not differ") + if len(pulse_bins) > 2: + raise IRDecodeException("Only mark & space handled") + + mark = min(pulse_bins[0][0], pulse_bins[1][0]) + space = max(pulse_bins[0][0], pulse_bins[1][0]) + + if outliers: + # skip outliers + pulses = [ + p + for p in pulses + if not (outliers[0] * 0.75) <= p <= (outliers[0] * 1.25) + ] + # convert marks/spaces to 0 and 1 + for i, pulse_length in enumerate(pulses): + if (space * 0.75) <= pulse_length <= (space * 1.25): + pulses[i] = False + elif (mark * 0.75) <= pulse_length <= (mark * 1.25): + pulses[i] = True + else: + raise IRDecodeException("Pulses outside mark/space") + + # convert bits to bytes! + output = [0] * ((len(pulses) + 7) // 8) + for i, pulse_length in enumerate(pulses): + output[i // 8] = output[i // 8] << 1 + if pulse_length: + output[i // 8] |= 1 + return output + + def _read_pulses_non_blocking( + self, input_pulses, max_pulse=10000, pulse_window=0.10 + ): + """Read out a burst of pulses without blocking until pulses stop for a specified + period (pulse_window), pruning pulses after a pulse longer than ``max_pulse``. + + :param ~pulseio.PulseIn input_pulses: Object to read pulses from + :param int max_pulse: Pulse duration to end a burst + :param float pulse_window: pulses are collected for this period of time + """ + received = None + recent_count = 0 + pruning = False + while True: + while input_pulses: + pulse = input_pulses.popleft() + recent_count += 1 + if pulse > max_pulse: + if received is None: + continue + pruning = True + if not pruning: + if received is None: + received = [] + received.append(pulse) + + if recent_count == 0: + return received + recent_count = 0 + time.sleep(pulse_window) + + def read_pulses( + self, + input_pulses, + *, + max_pulse=10000, + blocking=True, + pulse_window=0.10, + blocking_delay=0.10 + ): + """Read out a burst of pulses until pulses stop for a specified + period (pulse_window), pruning pulses after a pulse longer than ``max_pulse``. + + :param ~pulseio.PulseIn input_pulses: Object to read pulses from + :param int max_pulse: Pulse duration to end a burst + :param bool blocking: If True, will block until pulses found. + If False, will return None if no pulses. + Defaults to True for backwards compatibility + :param float pulse_window: pulses are collected for this period of time + :param float blocking_delay: delay between pulse checks when blocking + """ + while True: + pulses = self._read_pulses_non_blocking( + input_pulses, max_pulse, pulse_window + ) + if blocking and pulses is None: + time.sleep(blocking_delay) + continue + return pulses + + +class GenericTransmit: + """Generic infrared transmit class that handles encoding.""" + + def __init__(self, header, one, zero, trail): + self.header = header + self.one = one + self.zero = zero + self.trail = trail + + def transmit(self, pulseout, data): + """Transmit the ``data`` using the ``pulseout``. + + :param pulseio.PulseOut pulseout: PulseOut to transmit on + :param bytearray data: Data to transmit + """ + durations = array.array("H", [0] * (2 + len(data) * 8 * 2 + 1)) + durations[0] = self.header[0] + durations[1] = self.header[1] + durations[-1] = self.trail + out = 2 + for byte_index, _ in enumerate(data): + for i in range(7, -1, -1): + if (data[byte_index] & 1 << i) > 0: + durations[out] = self.one[0] + durations[out + 1] = self.one[1] + else: + durations[out] = self.zero[0] + durations[out + 1] = self.zero[1] + out += 2 + + # print(durations) + pulseout.send(durations) diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_minimqtt.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_minimqtt.py new file mode 100644 index 0000000000..4dde03eb5d --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_minimqtt.py @@ -0,0 +1,1000 @@ +# SPDX-FileCopyrightText: 2019-2021 Brent Rubell for Adafruit Industries +# +# SPDX-License-Identifier: MIT + +# Original Work Copyright (c) 2016 Paul Sokolovsky, uMQTT +# Modified Work Copyright (c) 2019 Bradley Beach, esp32spi_mqtt +# Modified Work Copyright (c) 2012-2019 Roger Light and others, Paho MQTT Python + +""" +`adafruit_minimqtt` +================================================================================ + +A minimal MQTT Library for CircuitPython. + +* Author(s): Brent Rubell + +Implementation Notes +-------------------- + +Adapted from https://github.com/micropython/micropython-lib/tree/master/umqtt.simple/umqtt + +**Software and Dependencies:** + +* Adafruit CircuitPython firmware for the supported boards: + https://github.com/adafruit/circuitpython/releases + +""" +import errno +import struct +import time +from random import randint +from micropython import const +from matcher import MQTTMatcher + +__version__ = "0.0.0-auto.0" +__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT.git" + +# Client-specific variables +MQTT_MSG_MAX_SZ = const(268435455) +MQTT_MSG_SZ_LIM = const(10000000) +MQTT_TOPIC_LENGTH_LIMIT = const(65535) +MQTT_TCP_PORT = const(1883) +MQTT_TLS_PORT = const(8883) + +# MQTT Commands +MQTT_PINGREQ = b"\xc0\0" +MQTT_PINGRESP = const(0xD0) +MQTT_SUB = b"\x82" +MQTT_UNSUB = b"\xA2" +MQTT_DISCONNECT = b"\xe0\0" + +# Variable CONNECT header [MQTT 3.1.2] +MQTT_HDR_CONNECT = bytearray(b"\x04MQTT\x04\x02\0\0") + + +CONNACK_ERRORS = { + const(0x01): "Connection Refused - Incorrect Protocol Version", + const(0x02): "Connection Refused - ID Rejected", + const(0x03): "Connection Refused - Server unavailable", + const(0x04): "Connection Refused - Incorrect username/password", + const(0x05): "Connection Refused - Unauthorized", +} + +_default_sock = None # pylint: disable=invalid-name +_fake_context = None # pylint: disable=invalid-name + + +class MMQTTException(Exception): + """MiniMQTT Exception class.""" + + # pylint: disable=unnecessary-pass + # pass + + +# Legacy ESP32SPI Socket API +def set_socket(sock, iface=None): + """Legacy API for setting the socket and network interface. + + :param sock: socket object. + :param iface: internet interface object + + """ + global _default_sock # pylint: disable=invalid-name, global-statement + global _fake_context # pylint: disable=invalid-name, global-statement + _default_sock = sock + if iface: + _default_sock.set_interface(iface) + _fake_context = _FakeSSLContext(iface) + + +class _FakeSSLSocket: + def __init__(self, socket, tls_mode): + self._socket = socket + self._mode = tls_mode + self.settimeout = socket.settimeout + self.send = socket.send + self.recv = socket.recv + self.close = socket.close + + def connect(self, address): + """connect wrapper to add non-standard mode parameter""" + try: + return self._socket.connect(address, self._mode) + except RuntimeError as error: + raise OSError(errno.ENOMEM) from error + + +class _FakeSSLContext: + def __init__(self, iface): + self._iface = iface + + def wrap_socket(self, socket, server_hostname=None): + """Return the same socket""" + # pylint: disable=unused-argument + return _FakeSSLSocket(socket, self._iface.TLS_MODE) + + +class MQTT: + """MQTT Client for CircuitPython. + + :param str broker: MQTT Broker URL or IP Address. + :param int port: Optional port definition, defaults to 8883. + :param str username: Username for broker authentication. + :param str password: Password for broker authentication. + :param network_manager: NetworkManager object, such as WiFiManager from ESPSPI_WiFiManager. + :param str client_id: Optional client identifier, defaults to a unique, generated string. + :param bool is_ssl: Sets a secure or insecure connection with the broker. + :param int keep_alive: KeepAlive interval between the broker and the MiniMQTT client. + :param socket socket_pool: A pool of socket resources available for the given radio. + :param ssl_context: SSL context for long-lived SSL connections. + :param bool use_binary_mode: Messages are passed as bytearray instead of string to callbacks. + + """ + + # pylint: disable=too-many-arguments,too-many-instance-attributes, not-callable, invalid-name, no-member + def __init__( + self, + broker, + port=None, + username=None, + password=None, + client_id=None, + is_ssl=True, + keep_alive=60, + socket_pool=None, + ssl_context=None, + use_binary_mode=False, + ): + + self._socket_pool = socket_pool + self._ssl_context = ssl_context + self._sock = None + self._backwards_compatible_sock = False + self._use_binary_mode = use_binary_mode + + self.keep_alive = keep_alive + self._user_data = None + self._is_connected = False + self._msg_size_lim = MQTT_MSG_SZ_LIM + self._pid = 0 + self._timestamp = 0 + self.logger = None + + self.broker = broker + self._username = username + self._password = password + if ( + self._password and len(password.encode("utf-8")) > MQTT_TOPIC_LENGTH_LIMIT + ): # [MQTT-3.1.3.5] + raise MMQTTException("Password length is too large.") + + self.port = MQTT_TCP_PORT + if is_ssl: + self.port = MQTT_TLS_PORT + if port: + self.port = port + + # define client identifer + if client_id: + # user-defined client_id MAY allow client_id's > 23 bytes or + # non-alpha-numeric characters + self.client_id = client_id + else: + # assign a unique client_id + self.client_id = "cpy{0}{1}".format( + randint(0, int(time.monotonic() * 100) % 1000), randint(0, 99) + ) + # generated client_id's enforce spec.'s length rules + if len(self.client_id.encode("utf-8")) > 23 or not self.client_id: + raise ValueError("MQTT Client ID must be between 1 and 23 bytes") + + # LWT + self._lw_topic = None + self._lw_qos = 0 + self._lw_topic = None + self._lw_msg = None + self._lw_retain = False + + # List of subscribed topics, used for tracking + self._subscribed_topics = [] + self._on_message_filtered = MQTTMatcher() + + # Default topic callback methods + self._on_message = None + self.on_connect = None + self.on_disconnect = None + self.on_publish = None + self.on_subscribe = None + self.on_unsubscribe = None + + # pylint: disable=too-many-branches + def _get_connect_socket(self, host, port, *, timeout=1): + """Obtains a new socket and connects to a broker. + + :param str host: Desired broker hostname + :param int port: Desired broker port + :param int timeout: Desired socket timeout + """ + # For reconnections - check if we're using a socket already and close it + if self._sock: + self._sock.close() + self._sock = None + + # Legacy API - use the interface's socket instead of a passed socket pool + if self._socket_pool is None: + self._socket_pool = _default_sock + + # Legacy API - fake the ssl context + if self._ssl_context is None: + self._ssl_context = _fake_context + + if not isinstance(port, int): + raise RuntimeError("Port must be an integer") + + if port == 8883 and not self._ssl_context: + raise RuntimeError( + "ssl_context must be set before using adafruit_mqtt for secure MQTT." + ) + + if self.logger is not None and port == MQTT_TLS_PORT: + self.logger.info( + "Establishing a SECURE SSL connection to {0}:{1}".format(host, port) + ) + elif self.logger is not None: + self.logger.info( + "Establishing an INSECURE connection to {0}:{1}".format(host, port) + ) + + addr_info = self._socket_pool.getaddrinfo( + host, port, 0, self._socket_pool.SOCK_STREAM + )[0] + + sock = None + retry_count = 0 + while retry_count < 5 and sock is None: + retry_count += 1 + + try: + sock = self._socket_pool.socket(addr_info[0], addr_info[1]) + except OSError: + continue + + connect_host = addr_info[-1][0] + if port == 8883: + sock = self._ssl_context.wrap_socket(sock, server_hostname=host) + connect_host = host + sock.settimeout(timeout) + + try: + sock.connect((connect_host, port)) + except MemoryError: + sock.close() + sock = None + except OSError: + sock.close() + sock = None + + if sock is None: + raise RuntimeError("Repeated socket failures") + + self._backwards_compatible_sock = not hasattr(sock, "recv_into") + return sock + + def __enter__(self): + return self + + def __exit__(self, exception_type, exception_value, traceback): + self.deinit() + + def _sock_exact_recv(self, bufsize): + """Reads _exact_ number of bytes from the connected socket. Will only return + string with the exact number of bytes requested. + + The semantics of native socket receive is that it returns no more than the + specified number of bytes (i.e. max size). However, it makes no guarantees in + terms of the minimum size of the buffer, which could be 1 byte. This is a + wrapper for socket recv() to ensure that no less than the expected number of + bytes is returned or trigger a timeout exception. + + :param int bufsize: number of bytes to receive + """ + stamp = time.monotonic() + rc = self._sock.recv(bufsize) + to_read = bufsize - len(rc) + assert to_read >= 0 + read_timeout = self.keep_alive + while to_read > 0: + recv = self._sock.recv(to_read) + to_read -= len(recv) + rc += recv + if time.monotonic() - stamp > read_timeout: + raise MMQTTException( + "Unable to receive {} bytes within {} seconds.".format( + to_read, read_timeout + ) + ) + return rc + + def deinit(self): + """De-initializes the MQTT client and disconnects from the mqtt broker.""" + self.disconnect() + + @property + def mqtt_msg(self): + """Returns maximum MQTT payload and topic size.""" + return self._msg_size_lim, MQTT_TOPIC_LENGTH_LIMIT + + @mqtt_msg.setter + def mqtt_msg(self, msg_size): + """Sets the maximum MQTT message payload size. + + :param int msg_size: Maximum MQTT payload size. + """ + if msg_size < MQTT_MSG_MAX_SZ: + self._msg_size_lim = msg_size + + def will_set(self, topic=None, payload=None, qos=0, retain=False): + """Sets the last will and testament properties. MUST be called before `connect()`. + + :param str topic: MQTT Broker topic. + :param int|float|str payload: Last will disconnection payload. + payloads of type int & float are converted to a string. + :param int qos: Quality of Service level, defaults to + zero. Conventional options are ``0`` (send at most once), ``1`` + (send at least once), or ``2`` (send exactly once). + + .. note:: Only options ``1`` or ``0`` are QoS levels supported by this library. + :param bool retain: Specifies if the payload is to be retained when + it is published. + """ + if self.logger is not None: + self.logger.debug("Setting last will properties") + self._valid_qos(qos) + if self._is_connected: + raise MMQTTException("Last Will should only be called before connect().") + if payload is None: + payload = "" + if isinstance(payload, (int, float, str)): + payload = str(payload).encode() + else: + raise MMQTTException("Invalid message data type.") + self._lw_qos = qos + self._lw_topic = topic + self._lw_msg = payload + self._lw_retain = retain + + def add_topic_callback(self, mqtt_topic, callback_method): + """Registers a callback_method for a specific MQTT topic. + + :param str mqtt_topic: MQTT topic identifier. + :param function callback_method: The callback method. + """ + if mqtt_topic is None or callback_method is None: + raise ValueError("MQTT topic and callback method must both be defined.") + self._on_message_filtered[mqtt_topic] = callback_method + + def remove_topic_callback(self, mqtt_topic): + """Removes a registered callback method. + + :param str mqtt_topic: MQTT topic identifier string. + """ + if mqtt_topic is None: + raise ValueError("MQTT Topic must be defined.") + try: + del self._on_message_filtered[mqtt_topic] + except KeyError: + raise KeyError( + "MQTT topic callback not added with add_topic_callback." + ) from None + + @property + def on_message(self): + """Called when a new message has been received on a subscribed topic. + + Expected method signature is ``on_message(client, topic, message)`` + """ + return self._on_message + + @on_message.setter + def on_message(self, method): + self._on_message = method + + def _handle_on_message(self, client, topic, message): + matched = False + if topic is not None: + for callback in self._on_message_filtered.iter_match(topic): + callback(client, topic, message) # on_msg with callback + matched = True + + if not matched and self.on_message: # regular on_message + self.on_message(client, topic, message) + + def username_pw_set(self, username, password=None): + """Set client's username and an optional password. + + :param str username: Username to use with your MQTT broker. + :param str password: Password to use with your MQTT broker. + + """ + if self._is_connected: + raise MMQTTException("This method must be called before connect().") + self._username = username + if password is not None: + self._password = password + + # pylint: disable=too-many-branches, too-many-statements, too-many-locals + def connect(self, clean_session=True, host=None, port=None, keep_alive=None): + """Initiates connection with the MQTT Broker. + + :param bool clean_session: Establishes a persistent session. + :param str host: Hostname or IP address of the remote broker. + :param int port: Network port of the remote broker. + :param int keep_alive: Maximum period allowed for communication, in seconds. + + """ + if host: + self.broker = host + if port: + self.port = port + if keep_alive: + self.keep_alive = keep_alive + + if self.logger is not None: + self.logger.debug("Attempting to establish MQTT connection...") + + # Get a new socket + self._sock = self._get_connect_socket(self.broker, self.port) + + # Fixed Header + fixed_header = bytearray([0x10]) + + # NOTE: Variable header is + # MQTT_HDR_CONNECT = bytearray(b"\x04MQTT\x04\x02\0\0") + # because final 4 bytes are 4, 2, 0, 0 + var_header = MQTT_HDR_CONNECT + var_header[6] = clean_session << 1 + + # Set up variable header and remaining_length + remaining_length = 12 + len(self.client_id.encode("utf-8")) + if self._username: + remaining_length += ( + 2 + + len(self._username.encode("utf-8")) + + 2 + + len(self._password.encode("utf-8")) + ) + var_header[6] |= 0xC0 + if self.keep_alive: + assert self.keep_alive < MQTT_TOPIC_LENGTH_LIMIT + var_header[7] |= self.keep_alive >> 8 + var_header[8] |= self.keep_alive & 0x00FF + if self._lw_topic: + remaining_length += ( + 2 + len(self._lw_topic.encode("utf-8")) + 2 + len(self._lw_msg) + ) + var_header[6] |= 0x4 | (self._lw_qos & 0x1) << 3 | (self._lw_qos & 0x2) << 3 + var_header[6] |= self._lw_retain << 5 + + # Remaining length calculation + large_rel_length = False + if remaining_length > 0x7F: + large_rel_length = True + # Calculate Remaining Length [2.2.3] + while remaining_length > 0: + encoded_byte = remaining_length % 0x80 + remaining_length = remaining_length // 0x80 + # if there is more data to encode, set the top bit of the byte + if remaining_length > 0: + encoded_byte |= 0x80 + fixed_header.append(encoded_byte) + if large_rel_length: + fixed_header.append(0x00) + else: + fixed_header.append(remaining_length) + fixed_header.append(0x00) + + if self.logger is not None: + self.logger.debug("Sending CONNECT to broker...") + self.logger.debug( + "Fixed Header: %s\nVariable Header: %s", fixed_header, var_header + ) + self._sock.send(fixed_header) + self._sock.send(var_header) + # [MQTT-3.1.3-4] + self._send_str(self.client_id) + if self._lw_topic: + # [MQTT-3.1.3-11] + self._send_str(self._lw_topic) + self._send_str(self._lw_msg) + if self._username is None: + self._username = None + else: + self._send_str(self._username) + self._send_str(self._password) + if self.logger is not None: + self.logger.debug("Receiving CONNACK packet from broker") + while True: + op = self._wait_for_msg() + if op == 32: + rc = self._sock_exact_recv(3) + assert rc[0] == 0x02 + if rc[2] != 0x00: + raise MMQTTException(CONNACK_ERRORS[rc[2]]) + self._is_connected = True + result = rc[0] & 1 + if self.on_connect is not None: + self.on_connect(self, self._user_data, result, rc[2]) + return result + + def disconnect(self): + """Disconnects the MiniMQTT client from the MQTT broker.""" + self.is_connected() + if self.logger is not None: + self.logger.debug("Sending DISCONNECT packet to broker") + try: + self._sock.send(MQTT_DISCONNECT) + except RuntimeError as e: + if self.logger is not None: + self.logger.warning("Unable to send DISCONNECT packet: {}".format(e)) + if self.logger is not None: + self.logger.debug("Closing socket") + self._sock.close() + self._is_connected = False + self._subscribed_topics = [] + if self.on_disconnect is not None: + self.on_disconnect(self, self._user_data, 0) + + def ping(self): + """Pings the MQTT Broker to confirm if the broker is alive or if + there is an active network connection. + Returns response codes of any messages received while waiting for PINGRESP. + """ + self.is_connected() + if self.logger is not None: + self.logger.debug("Sending PINGREQ") + self._sock.send(MQTT_PINGREQ) + ping_timeout = self.keep_alive + stamp = time.monotonic() + rc, rcs = None, [] + while rc != MQTT_PINGRESP: + rc = self._wait_for_msg() + if rc: + rcs.append(rc) + if time.monotonic() - stamp > ping_timeout: + raise MMQTTException("PINGRESP not returned from broker.") + return rcs + + # pylint: disable=too-many-branches, too-many-statements + def publish(self, topic, msg, retain=False, qos=0): + """Publishes a message to a topic provided. + + :param str topic: Unique topic identifier. + :param str|int|float|bytes msg: Data to send to the broker. + :param bool retain: Whether the message is saved by the broker. + :param int qos: Quality of Service level for the message, defaults to zero. + + """ + self.is_connected() + self._valid_topic(topic) + if "+" in topic or "#" in topic: + raise MMQTTException("Publish topic can not contain wildcards.") + # check msg/qos kwargs + if msg is None: + raise MMQTTException("Message can not be None.") + if isinstance(msg, (int, float)): + msg = str(msg).encode("ascii") + elif isinstance(msg, str): + msg = str(msg).encode("utf-8") + elif isinstance(msg, bytes): + pass + else: + raise MMQTTException("Invalid message data type.") + if len(msg) > MQTT_MSG_MAX_SZ: + raise MMQTTException("Message size larger than %d bytes." % MQTT_MSG_MAX_SZ) + assert ( + 0 <= qos <= 1 + ), "Quality of Service Level 2 is unsupported by this library." + + # fixed header. [3.3.1.2], [3.3.1.3] + pub_hdr_fixed = bytearray([0x30 | retain | qos << 1]) + + # variable header = 2-byte Topic length (big endian) + pub_hdr_var = bytearray(struct.pack(">H", len(topic.encode("utf-8")))) + pub_hdr_var.extend(topic.encode("utf-8")) # Topic name + + remaining_length = 2 + len(msg) + len(topic.encode("utf-8")) + if qos > 0: + # packet identifier where QoS level is 1 or 2. [3.3.2.2] + remaining_length += 2 + self._pid = self._pid + 1 if self._pid < 0xFFFF else 1 + pub_hdr_var.append(self._pid >> 8) + pub_hdr_var.append(self._pid & 0xFF) + + # Calculate remaining length [2.2.3] + if remaining_length > 0x7F: + while remaining_length > 0: + encoded_byte = remaining_length % 0x80 + remaining_length = remaining_length // 0x80 + if remaining_length > 0: + encoded_byte |= 0x80 + pub_hdr_fixed.append(encoded_byte) + else: + pub_hdr_fixed.append(remaining_length) + + if self.logger is not None: + self.logger.debug( + "Sending PUBLISH\nTopic: %s\nMsg: %s\ + \nQoS: %d\nRetain? %r", + topic, + msg, + qos, + retain, + ) + self._sock.send(pub_hdr_fixed) + self._sock.send(pub_hdr_var) + self._sock.send(msg) + if qos == 0 and self.on_publish is not None: + self.on_publish(self, self._user_data, topic, self._pid) + if qos == 1: + while True: + op = self._wait_for_msg() + if op == 0x40: + sz = self._sock_exact_recv(1) + assert sz == b"\x02" + rcv_pid = self._sock_exact_recv(2) + rcv_pid = rcv_pid[0] << 0x08 | rcv_pid[1] + if self._pid == rcv_pid: + if self.on_publish is not None: + self.on_publish(self, self._user_data, topic, rcv_pid) + return + + def subscribe(self, topic, qos=0): + """Subscribes to a topic on the MQTT Broker. + This method can subscribe to one topics or multiple topics. + + :param str|tuple|list topic: Unique MQTT topic identifier string. If + this is a `tuple`, then the tuple should + contain topic identifier string and qos + level integer. If this is a `list`, then + each list element should be a tuple containing + a topic identifier string and qos level integer. + :param int qos: Quality of Service level for the topic, defaults to + zero. Conventional options are ``0`` (send at most once), ``1`` + (send at least once), or ``2`` (send exactly once). + + """ + self.is_connected() + topics = None + if isinstance(topic, tuple): + topic, qos = topic + self._valid_topic(topic) + self._valid_qos(qos) + if isinstance(topic, str): + self._valid_topic(topic) + self._valid_qos(qos) + topics = [(topic, qos)] + if isinstance(topic, list): + topics = [] + for t, q in topic: + self._valid_qos(q) + self._valid_topic(t) + topics.append((t, q)) + # Assemble packet + packet_length = 2 + (2 * len(topics)) + (1 * len(topics)) + packet_length += sum(len(topic.encode("utf-8")) for topic, qos in topics) + packet_length_byte = packet_length.to_bytes(1, "big") + self._pid = self._pid + 1 if self._pid < 0xFFFF else 1 + packet_id_bytes = self._pid.to_bytes(2, "big") + # Packet with variable and fixed headers + packet = MQTT_SUB + packet_length_byte + packet_id_bytes + # attaching topic and QOS level to the packet + for t, q in topics: + topic_size = len(t.encode("utf-8")).to_bytes(2, "big") + qos_byte = q.to_bytes(1, "big") + packet += topic_size + t.encode() + qos_byte + if self.logger is not None: + for t, q in topics: + self.logger.debug("SUBSCRIBING to topic %s with QoS %d", t, q) + self._sock.send(packet) + while True: + op = self._wait_for_msg() + if op == 0x90: + rc = self._sock_exact_recv(4) + assert rc[1] == packet[2] and rc[2] == packet[3] + if rc[3] == 0x80: + raise MMQTTException("SUBACK Failure!") + for t, q in topics: + if self.on_subscribe is not None: + self.on_subscribe(self, self._user_data, t, q) + self._subscribed_topics.append(t) + return + + def unsubscribe(self, topic): + """Unsubscribes from a MQTT topic. + + :param str|list topic: Unique MQTT topic identifier string or list. + + """ + topics = None + if isinstance(topic, str): + self._valid_topic(topic) + topics = [(topic)] + if isinstance(topic, list): + topics = [] + for t in topic: + self._valid_topic(t) + topics.append((t)) + for t in topics: + if t not in self._subscribed_topics: + raise MMQTTException( + "Topic must be subscribed to before attempting unsubscribe." + ) + # Assemble packet + packet_length = 2 + (2 * len(topics)) + packet_length += sum(len(topic.encode("utf-8")) for topic in topics) + packet_length_byte = packet_length.to_bytes(1, "big") + self._pid = self._pid + 1 if self._pid < 0xFFFF else 1 + packet_id_bytes = self._pid.to_bytes(2, "big") + packet = MQTT_UNSUB + packet_length_byte + packet_id_bytes + for t in topics: + topic_size = len(t.encode("utf-8")).to_bytes(2, "big") + packet += topic_size + t.encode() + if self.logger is not None: + for t in topics: + self.logger.debug("UNSUBSCRIBING from topic %s", t) + self._sock.send(packet) + if self.logger is not None: + self.logger.debug("Waiting for UNSUBACK...") + while True: + op = self._wait_for_msg() + if op == 176: + rc = self._sock_exact_recv(3) + assert rc[0] == 0x02 + # [MQTT-3.32] + assert rc[1] == packet_id_bytes[0] and rc[2] == packet_id_bytes[1] + for t in topics: + if self.on_unsubscribe is not None: + self.on_unsubscribe(self, self._user_data, t, self._pid) + self._subscribed_topics.remove(t) + return + + def reconnect(self, resub_topics=True): + """Attempts to reconnect to the MQTT broker. + + :param bool resub_topics: Resubscribe to previously subscribed topics. + + """ + if self.logger is not None: + self.logger.debug("Attempting to reconnect with MQTT broker") + self.connect() + if self.logger is not None: + self.logger.debug("Reconnected with broker") + if resub_topics: + if self.logger is not None: + self.logger.debug( + "Attempting to resubscribe to previously subscribed topics." + ) + subscribed_topics = self._subscribed_topics.copy() + self._subscribed_topics = [] + while subscribed_topics: + feed = subscribed_topics.pop() + self.subscribe(feed) + + def loop(self, timeout=1): + """Non-blocking message loop. Use this method to + check incoming subscription messages. + Returns response codes of any messages received. + + :param int timeout: Socket timeout, in seconds. + + """ + if self._timestamp == 0: + self._timestamp = time.monotonic() + current_time = time.monotonic() + if current_time - self._timestamp >= self.keep_alive: + self._timestamp = 0 + # Handle KeepAlive by expecting a PINGREQ/PINGRESP from the server + if self.logger is not None: + self.logger.debug( + "KeepAlive period elapsed - requesting a PINGRESP from the server..." + ) + rcs = self.ping() + return rcs + self._sock.settimeout(timeout) + rc = self._wait_for_msg() + return [rc] if rc else None + + def _wait_for_msg(self, timeout=0.1): + """Reads and processes network events.""" + # CPython socket module contains a timeout attribute + if hasattr(self._socket_pool, "timeout"): + try: + res = self._sock_exact_recv(1) + except self._socket_pool.timeout: + return None + else: # socketpool, esp32spi + try: + res = self._sock_exact_recv(1) + except OSError as error: + if error.errno == errno.ETIMEDOUT: + # raised by a socket timeout if 0 bytes were present + return None + raise MMQTTException from error + + # Block while we parse the rest of the response + self._sock.settimeout(timeout) + if res in [None, b""]: + # If we get here, it means that there is nothing to be received + return None + if res[0] == MQTT_PINGRESP: + if self.logger is not None: + self.logger.debug("Got PINGRESP") + sz = self._sock_exact_recv(1)[0] + if sz != 0x00: + raise MMQTTException( + "Unexpected PINGRESP returned from broker: {}.".format(sz) + ) + return MQTT_PINGRESP + if res[0] & 0xF0 != 0x30: + return res[0] + sz = self._recv_len() + # topic length MSB & LSB + topic_len = self._sock_exact_recv(2) + topic_len = (topic_len[0] << 8) | topic_len[1] + topic = self._sock_exact_recv(topic_len) + topic = str(topic, "utf-8") + sz -= topic_len + 2 + pid = 0 + if res[0] & 0x06: + pid = self._sock_exact_recv(2) + pid = pid[0] << 0x08 | pid[1] + sz -= 0x02 + # read message contents + raw_msg = self._sock_exact_recv(sz) + msg = raw_msg if self._use_binary_mode else str(raw_msg, "utf-8") + if self.logger is not None: + self.logger.debug( + "Receiving SUBSCRIBE \nTopic: %s\nMsg: %s\n", topic, raw_msg + ) + self._handle_on_message(self, topic, msg) + if res[0] & 0x06 == 0x02: + pkt = bytearray(b"\x40\x02\0\0") + struct.pack_into("!H", pkt, 2, pid) + self._sock.send(pkt) + elif res[0] & 6 == 4: + assert 0 + return res[0] + + def _recv_len(self): + """Unpack MQTT message length.""" + n = 0 + sh = 0 + b = bytearray(1) + while True: + b = self._sock_exact_recv(1)[0] + n |= (b & 0x7F) << sh + if not b & 0x80: + return n + sh += 7 + + def _recv_into(self, buf, size=0): + """Backwards-compatible _recv_into implementation.""" + if self._backwards_compatible_sock: + size = len(buf) if size == 0 else size + b = self._sock.recv(size) + read_size = len(b) + buf[:read_size] = b + return read_size + return self._sock.recv_into(buf, size) + + def _sock_exact_recv(self, bufsize): + """Reads _exact_ number of bytes from the connected socket. Will only return + string with the exact number of bytes requested. + + The semantics of native socket receive is that it returns no more than the + specified number of bytes (i.e. max size). However, it makes no guarantees in + terms of the minimum size of the buffer, which could be 1 byte. This is a + wrapper for socket recv() to ensure that no less than the expected number of + bytes is returned or trigger a timeout exception. + + :param int bufsize: number of bytes to receive + + """ + if not self._backwards_compatible_sock: + # CPython/Socketpool Impl. + rc = bytearray(bufsize) + self._sock.recv_into(rc, bufsize) + else: # ESP32SPI Impl. + stamp = time.monotonic() + read_timeout = self.keep_alive + # This will timeout with socket timeout (not keepalive timeout) + rc = self._sock.recv(bufsize) + if not rc: + if self.logger is not None: + self.logger.debug("_sock_exact_recv timeout") + # If no bytes waiting, raise same exception as socketpool + raise OSError(errno.ETIMEDOUT) + # If any bytes waiting, try to read them all, + # or raise exception if wait longer than read_timeout + to_read = bufsize - len(rc) + assert to_read >= 0 + read_timeout = self.keep_alive + while to_read > 0: + recv = self._sock.recv(to_read) + to_read -= len(recv) + rc += recv + if time.monotonic() - stamp > read_timeout: + raise MMQTTException( + "Unable to receive {} bytes within {} seconds.".format( + to_read, read_timeout + ) + ) + return rc + + def _send_str(self, string): + """Encodes a string and sends it to a socket. + + :param str string: String to write to the socket. + + """ + if isinstance(string, str): + self._sock.send(struct.pack("!H", len(string.encode("utf-8")))) + self._sock.send(str.encode(string, "utf-8")) + else: + self._sock.send(struct.pack("!H", len(string))) + self._sock.send(string) + + @staticmethod + def _valid_topic(topic): + """Validates if topic provided is proper MQTT topic format. + + :param str topic: Topic identifier + + """ + if topic is None: + raise MMQTTException("Topic may not be NoneType") + # [MQTT-4.7.3-1] + if not topic: + raise MMQTTException("Topic may not be empty.") + # [MQTT-4.7.3-3] + if len(topic.encode("utf-8")) > MQTT_TOPIC_LENGTH_LIMIT: + raise MMQTTException("Topic length is too large.") + + @staticmethod + def _valid_qos(qos_level): + """Validates if the QoS level is supported by this library + + :param int qos_level: Desired QoS level. + + """ + if isinstance(qos_level, int): + if qos_level < 0 or qos_level > 2: + raise MMQTTException("QoS must be between 1 and 2.") + else: + raise MMQTTException("QoS must be an integer.") + + def is_connected(self): + """Returns MQTT client session status as True if connected, raises + a `MMQTTException` if `False`. + """ + if self._sock is None or self._is_connected is False: + raise MMQTTException("MiniMQTT is not connected.") + return self._is_connected + + # Logging + def enable_logger(self, logger, log_level=20): + """Enables library logging provided a logger object. + + :param logger: A python logger pacakge. + :param log_level: Numeric value of a logging level, defaults to INFO. + + """ + self.logger = logger.getLogger("log") + self.logger.setLevel(log_level) + + def disable_logger(self): + """Disables logging.""" + if not self.logger: + raise MMQTTException("Can not disable logger, no logger found.") + self.logger = None diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_rtttl.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_rtttl.py new file mode 100644 index 0000000000..75665f1bb5 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_rtttl.py @@ -0,0 +1,204 @@ +# The MIT License (MIT) +# +# Copyright (c) 2017, 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. +""" +`adafruit_rtttl` +==================================================== + +Play notes to a digialio pin using ring tone text transfer language (rtttl). + +* Author(s): Scott Shawcroft +""" + +__version__ = "2.4.2" +__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_RTTTL" + +import sys +import time +import pwmio + +AUDIOIO_AVAILABLE = False +try: + import audioio + from adafruit_waveform import sine + + AUDIOIO_AVAILABLE = True + try: + import audiocore + except ImportError: + audiocore = audioio +except ImportError: + pass + +PIANO = { + "4c": 261.626, + "4c#": 277.183, + "4d": 293.665, + "4d#": 311.127, + "4e": 329.628, + "4f": 349.228, + "4f#": 369.994, + "4g": 391.995, + "4g#": 415.305, + "4a": 440, + "4a#": 466.164, + "4b": 493.883, + "5c": 523.251, + "5c#": 554.365, + "5d": 587.330, + "5d#": 622.254, + "5e": 659.255, + "5f": 698.456, + "5f#": 739.989, + "5g": 783.991, + "5g#": 830.609, + "5a": 880, + "5a#": 932.328, + "5b": 987.767, + "6c": 1046.50, + "6c#": 1108.73, + "6d": 1174.66, + "6d#": 1244.51, + "6e": 1318.51, + "6f": 1396.91, + "6f#": 1479.98, + "6g": 1567.98, + "6g#": 1661.22, + "6a": 1760, + "6a#": 1864.66, + "6b": 1975.53, + "7c": 2093, + "7c#": 2217.46, +} + + +def _parse_note(note, duration=2, octave="6"): + note = note.strip() + piano_note = None + note_duration = duration + if note[0].isdigit() and note[1].isdigit(): + note_duration = int(note[:2]) + piano_note = note[2] + elif note[0].isdigit(): + note_duration = int(note[0]) + piano_note = note[1] + else: + piano_note = note[0] + if "." in note: + note_duration *= 1.5 + if "#" in note: + piano_note += "#" + note_octave = octave + if note[-1].isdigit(): + note_octave = note[-1] + piano_note = note_octave + piano_note + return piano_note, note_duration + + +def _get_wave(tune, octave): + """Returns the proper waveform to play the song along with the minimum + frequency in the song. + """ + min_freq = 13000 + + for note in tune.split(","): + piano_note, _ = _parse_note(note, octave=octave) + if piano_note[-1] != "p" and PIANO[piano_note] < min_freq: + min_freq = PIANO[piano_note] + return sine.sine_wave(16000, min_freq), min_freq + + +# pylint: disable-msg=too-many-arguments +def _play_to_pin(tune, base_tone, min_freq, duration, octave, tempo): + """Using the prepared input send the notes to the pin + """ + pwm = isinstance(base_tone, pwmio.PWMOut) + for note in tune.split(","): + piano_note, note_duration = _parse_note(note, duration, octave) + if piano_note in PIANO: + if pwm: + base_tone.frequency = int(PIANO[piano_note]) + base_tone.duty_cycle = 2 ** 15 + else: + # AudioOut interface changed in CP 3.x + if sys.implementation.version[0] >= 3: + pitch = int(PIANO[piano_note]) + sine_wave = sine.sine_wave(16000, pitch) + sine_wave_sample = audiocore.RawSample(sine_wave) + base_tone.play(sine_wave_sample, loop=True) + else: + base_tone.frequency = int(16000 * (PIANO[piano_note] / min_freq)) + base_tone.play(loop=True) + + time.sleep(4 / note_duration * 60 / tempo) + if pwm: + base_tone.duty_cycle = 0 + else: + base_tone.stop() + time.sleep(0.02) + + +# pylint: disable-msg=too-many-arguments +def play(pin, rtttl, octave=None, duration=None, tempo=None): + """Play notes to a digialio pin using ring tone text transfer language (rtttl). + :param ~digitalio.DigitalInOut pin: the speaker pin + :param rtttl: string containing rtttl + :param int octave: represents octave number (default 6 starts at middle c) + :param int duration: length of notes (default 4 quarter note) + :param int tempo: how fast (default 63 beats per minute) + """ + _, defaults, tune = rtttl.lower().split(":") + for default in defaults.split(","): + if default[0] == "d" and not duration: + duration = int(default[2:]) + elif default[0] == "o" and not octave: + octave = default[2:] + elif default[0] == "b" and not tempo: + tempo = int(default[2:]) + if not octave: + octave = 6 + if not duration: + duration = 4 + if not tempo: + tempo = 63 + + base_tone = None + min_freq = 440 + if AUDIOIO_AVAILABLE: + wave, min_freq = _get_wave(tune, octave) + try: + # AudioOut interface changed in CP 3.x; a waveform if now pass + # directly to .play(), generated for each note in _play_to_pin() + if sys.implementation.version[0] >= 3: + base_tone = audioio.AudioOut(pin) + else: + base_tone = audioio.AudioOut(pin, wave) + except ValueError: + # No DAC on the pin so use PWM. + pass + + # Fall back to PWM + if not base_tone: + base_tone = pwmio.PWMOut(pin, duty_cycle=0, variable_frequency=True) + + _play_to_pin(tune, base_tone, min_freq, duration, octave, tempo) + + base_tone.deinit() diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/blynklib.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/blynklib.py new file mode 100644 index 0000000000..c174d91c7f --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/blynklib.py @@ -0,0 +1,390 @@ +# Copyright (c) 2019-2020 Anton Morozenko +# Copyright (c) 2015-2019 Volodymyr Shymanskyy. +# See the file LICENSE for copying permission. +# 宋义深 2021/4/25 Modified +__version__ = '0.2.6' + +import socketpool as socket +import ssl +import struct +import time +import wifi + +LOGO = """ + ___ __ __ + / _ )/ /_ _____ / /__ + / _ / / // / _ \\/ '_/ + /____/_/\\_, /_//_/_/\\_\\ + /___/ for Python v{}\n""".format(__version__) + + +def stub_log(*args): + pass + + +def ticks_ms(): + return int(time.time() * 1000) + + +def sleep_ms(ms): + time.sleep(ms // 1000) + + +class BlynkError(Exception): + pass + + +class RedirectError(Exception): + def __init__(self, server, port): + self.server = server + self.port = port + + +class Protocol(object): + MSG_RSP = 0 + MSG_LOGIN = 2 + MSG_PING = 6 + MSG_TWEET = 12 + MSG_EMAIL = 13 + MSG_NOTIFY = 14 + MSG_BRIDGE = 15 + MSG_HW_SYNC = 16 + MSG_INTERNAL = 17 + MSG_PROPERTY = 19 + MSG_HW = 20 + MSG_REDIRECT = 41 + MSG_HEAD_LEN = 5 + + STATUS_INVALID_TOKEN = 9 + STATUS_NO_DATA = 17 + STATUS_OK = 200 + VPIN_MAX_NUM = 32 + + _msg_id = 0 + + def _get_msg_id(self, **kwargs): + if 'msg_id' in kwargs: + return kwargs['msg_id'] + self._msg_id += 1 + return self._msg_id if self._msg_id <= 0xFFFF else 1 + + def _pack_msg(self, msg_type, *args, **kwargs): + data = ('\0'.join([str(curr_arg) for curr_arg in args])).encode('utf-8') + return struct.pack('!BHH', msg_type, self._get_msg_id(**kwargs), len(data)) + data + + def parse_response(self, rsp_data, msg_buffer): + msg_args = [] + try: + msg_type, msg_id, h_data = struct.unpack('!BHH', rsp_data[:self.MSG_HEAD_LEN]) + except Exception as p_err: + print(p_err) + raise BlynkError('Message parse error: {}'.format(p_err)) + if msg_id == 0: + raise BlynkError('invalid msg_id == 0') + elif h_data >= msg_buffer: + raise BlynkError('Command too long. Length = {}'.format(h_data)) + elif msg_type in (self.MSG_RSP, self.MSG_PING): + pass + elif msg_type in (self.MSG_HW, self.MSG_BRIDGE, self.MSG_INTERNAL, self.MSG_REDIRECT): + msg_body = rsp_data[self.MSG_HEAD_LEN: self.MSG_HEAD_LEN + h_data] + msg_args = [itm.decode('utf-8') for itm in msg_body.split(b'\0')] + else: + print('unknown') + raise BlynkError("Unknown message type: '{}'".format(msg_type)) + return msg_type, msg_id, h_data, msg_args + + def heartbeat_msg(self, heartbeat, rcv_buffer): + return self._pack_msg(self.MSG_INTERNAL, 'ver', __version__, 'buff-in', rcv_buffer, 'h-beat', heartbeat, + 'dev', 'python') + + def login_msg(self, token): + return self._pack_msg(self.MSG_LOGIN, token) + + def ping_msg(self): + return self._pack_msg(self.MSG_PING) + + def response_msg(self, *args, **kwargs): + return self._pack_msg(self.MSG_RSP, *args, **kwargs) + + def virtual_write_msg(self, v_pin, *val): + return self._pack_msg(self.MSG_HW, 'vw', v_pin, *val) + + def virtual_sync_msg(self, *pins): + return self._pack_msg(self.MSG_HW_SYNC, 'vr', *pins) + + def email_msg(self, to, subject, body): + return self._pack_msg(self.MSG_EMAIL, to, subject, body) + + def tweet_msg(self, msg): + return self._pack_msg(self.MSG_TWEET, msg) + + def notify_msg(self, msg): + return self._pack_msg(self.MSG_NOTIFY, msg) + + def set_property_msg(self, pin, prop, *val): + return self._pack_msg(self.MSG_PROPERTY, pin, prop, *val) + + def internal_msg(self, *args): + return self._pack_msg(self.MSG_INTERNAL, *args) + + +class Connection(Protocol): + SOCK_MAX_TIMEOUT = 5 + SOCK_TIMEOUT = 0 + SOCK_SSL_TIMEOUT = 1 + EAGAIN = 11 + ETIMEDOUT = 60 + RETRIES_TX_DELAY = 2 + RETRIES_TX_MAX_NUM = 3 + RECONNECT_SLEEP = 1 + TASK_PERIOD_RES = 50 + DISCONNECTED = 0 + CONNECTING = 1 + AUTHENTICATING = 2 + AUTHENTICATED = 3 + + _state = None + _socket = None + _socketPool = None + _last_rcv_time = 0 + _last_ping_time = 0 + _last_send_time = 0 + + def __init__(self, token, server='blynk-cloud.com', port=80, ssl_cert=None, heartbeat=10, rcv_buffer=1024, + log=stub_log): + self.token = token + self.server = server + self.port = port + self.heartbeat = heartbeat + self.rcv_buffer = rcv_buffer + self.log = log + self.ssl_cert = ssl_cert + + def send(self, data): + retries = self.RETRIES_TX_MAX_NUM + while retries > 0: + try: + retries -= 1 + self._last_send_time = ticks_ms() + return self._socket.send(data) + except (Exception): + sleep_ms(self.RETRIES_TX_DELAY) + + def receive(self, length, timeout): + d_buff = bytearray(length) + try: + self._socket.settimeout(timeout) + recv_length = self._socket.recv_into(d_buff) + d_buff = d_buff[:recv_length] + #print(self.parse_response(bytes(d_buff), self.rcv_buffer)) + return bytes(d_buff) + except (Exception) as err: + if 'timed out' in str(err): + return b'' + if str(self.EAGAIN) in str(err) or str(self.ETIMEDOUT) in str(err): + return b'' + raise + + def is_server_alive(self): + now = ticks_ms() + h_beat_ms = self.heartbeat * 1000 + rcv_delta = now - self._last_rcv_time + ping_delta = now - self._last_ping_time + send_delta = now - self._last_send_time + if rcv_delta > h_beat_ms + (h_beat_ms // 2): + return False + if (ping_delta > h_beat_ms // 10) and (send_delta > h_beat_ms or rcv_delta > h_beat_ms): + self.send(self.ping_msg()) + self.log('Heartbeat time: {}'.format(now)) + self._last_ping_time = now + return True + + def _get_socket(self): + try: + self._state = self.CONNECTING + self._socket = socket.SocketPool(wifi.radio).socket() + self._socketPool = socket.SocketPool(wifi.radio) + self._socket.connect(self._socketPool.getaddrinfo(self.server, self.port)[0][4]) + self._socket.settimeout(self.SOCK_TIMEOUT) + if self.ssl_cert: + # system default CA certificates case + if self.ssl_cert == "default": + self.ssl_cert = None + self.log('Using SSL socket...') + ssl_context = ssl.create_default_context(cafile=self.ssl_cert) + ssl_context.verify_mode = ssl.CERT_REQUIRED + self._socket.settimeout(self.SOCK_SSL_TIMEOUT) + self._socket = ssl_context.wrap_socket(sock=self._socket, server_hostname=self.server) + self.log('Connected to blynk server') + except Exception as g_exc: + print(g_exc) + raise BlynkError('Connection with the Blynk server failed: {}'.format(g_exc)) + + def _authenticate(self): + self._state = self.AUTHENTICATING + self.send(self.login_msg(self.token)) + rsp_data = self.receive(self.rcv_buffer, self.SOCK_MAX_TIMEOUT) + if not rsp_data: + raise BlynkError('Auth stage timeout') + msg_type, _, status, args = self.parse_response(rsp_data, self.rcv_buffer) + if status != self.STATUS_OK: + if status == self.STATUS_INVALID_TOKEN: + raise BlynkError('Invalid Auth Token') + if msg_type == self.MSG_REDIRECT: + raise RedirectError(*args) + raise BlynkError('Auth stage failed. Status={}'.format(status)) + self._state = self.AUTHENTICATED + + def _set_heartbeat(self): + self.send(self.heartbeat_msg(self.heartbeat, self.rcv_buffer)) + rcv_data = self.receive(self.rcv_buffer, self.SOCK_MAX_TIMEOUT) + if not rcv_data: + raise BlynkError('Heartbeat stage timeout') + _, _, status, _ = self.parse_response(rcv_data, self.rcv_buffer) + if status != self.STATUS_OK: + raise BlynkError('Set heartbeat returned code={}'.format(status)) + self.log('Heartbeat = {} sec. MaxCmdBuffer = {} bytes'.format(self.heartbeat, self.rcv_buffer)) + + def connected(self): + return True if self._state == self.AUTHENTICATED else False + + +class Blynk(Connection): + _CONNECT_TIMEOUT = 30 # 30sec + _VPIN_WILDCARD = '*' + _VPIN_READ = 'read v' + _VPIN_WRITE = 'write v' + _INTERNAL = 'internal_' + _CONNECT = 'connect' + _DISCONNECT = 'disconnect' + _VPIN_READ_ALL = '{}{}'.format(_VPIN_READ, _VPIN_WILDCARD) + _VPIN_WRITE_ALL = '{}{}'.format(_VPIN_WRITE, _VPIN_WILDCARD) + _events = {} + + def __init__(self, token, **kwargs): + Connection.__init__(self, token, **kwargs) + self._start_time = ticks_ms() + self._last_rcv_time = ticks_ms() + self._last_send_time = ticks_ms() + self._last_ping_time = ticks_ms() + self._state = self.DISCONNECTED + print(LOGO) + + def connect(self, timeout=_CONNECT_TIMEOUT): + end_time = time.time() + timeout + while not self.connected(): + if self._state == self.DISCONNECTED: + try: + self._get_socket() + print('[Connecting 1/5] Socket got.') + self._authenticate() + print('[Connecting 2/5] Authenticated.') + self._set_heartbeat() + print('[Connecting 3/5] Heartbeat sent.') + self._last_rcv_time = ticks_ms() + print('[Connecting 4/5] Last receive time set.') + self.log('Registered events: {}\n'.format(list(self._events.keys()))) + print('[Connecting 5/5] Events registered.') + self.call_handler(self._CONNECT) + return True + except BlynkError as b_err: + self.disconnect(b_err) + sleep_ms(self.TASK_PERIOD_RES) + except RedirectError as r_err: + self.disconnect() + self.server = r_err.server + self.port = r_err.port + sleep_ms(self.TASK_PERIOD_RES) + if time.time() >= end_time: + return False + + def disconnect(self, err_msg=None): + self.call_handler(self._DISCONNECT) + if self._socket: + self._socket.close() + self._state = self.DISCONNECTED + if err_msg: + self.log('[ERROR]: {}\nConnection closed'.format(err_msg)) + self._msg_id = 0 + time.sleep(self.RECONNECT_SLEEP) + + def virtual_write(self, v_pin, *val): + return self.send(self.virtual_write_msg(v_pin, *val)) + + def virtual_sync(self, *v_pin): + return self.send(self.virtual_sync_msg(*v_pin)) + + def email(self, to, subject, body): + return self.send(self.email_msg(to, subject, body)) + + def tweet(self, msg): + return self.send(self.tweet_msg(msg)) + + def notify(self, msg): + return self.send(self.notify_msg(msg)) + + def set_property(self, v_pin, property_name, *val): + return self.send(self.set_property_msg(v_pin, property_name, *val)) + + def internal(self, *args): + return self.send(self.internal_msg(*args)) + + def handle_event(blynk, event_name): + class Deco(object): + def __init__(self, func): + self.func = func + # wildcard 'read V*' and 'write V*' events handling + if str(event_name).lower() in (blynk._VPIN_READ_ALL, blynk._VPIN_WRITE_ALL): + event_base_name = str(event_name).split(blynk._VPIN_WILDCARD)[0] + for i in range(blynk.VPIN_MAX_NUM + 1): + blynk._events['{}{}'.format(event_base_name.lower(), i)] = func + else: + blynk._events[str(event_name).lower()] = func + + def __call__(self): + return self.func() + + return Deco + + def call_handler(self, event, *args, **kwargs): + if event in self._events.keys(): + self.log("Event: ['{}'] -> {}".format(event, args)) + self._events[event](*args, **kwargs) + + def process(self, msg_type, msg_id, msg_len, msg_args): + if msg_type == self.MSG_RSP: + self.log('Response status: {}'.format(msg_len)) + elif msg_type == self.MSG_PING: + self.send(self.response_msg(self.STATUS_OK, msg_id=msg_id)) + elif msg_type in (self.MSG_HW, self.MSG_BRIDGE, self.MSG_INTERNAL): + if msg_type == self.MSG_INTERNAL: + self.call_handler("{}{}".format(self._INTERNAL, msg_args[0]), msg_args[1:]) + elif len(msg_args) >= 3 and msg_args[0] == 'vw': + self.call_handler("{}{}".format(self._VPIN_WRITE, msg_args[1]), int(msg_args[1]), msg_args[2:]) + elif len(msg_args) == 2 and msg_args[0] == 'vr': + self.call_handler("{}{}".format(self._VPIN_READ, msg_args[1]), int(msg_args[1])) + + def read_response(self, timeout=0.5): + end_time = time.time() + timeout + while time.time() <= end_time: + rsp_data = self.receive(self.rcv_buffer, self.SOCK_TIMEOUT) + if rsp_data: + self._last_rcv_time = ticks_ms() + msg_type, msg_id, h_data, msg_args = self.parse_response(rsp_data, self.rcv_buffer) + self.process(msg_type, msg_id, h_data, msg_args) + + def run(self): + if not self.connected(): + self.connect() + else: + try: + self.read_response(timeout=self.SOCK_TIMEOUT) + if not self.is_server_alive(): + self.disconnect('Blynk server is offline') + except KeyboardInterrupt: + raise + except BlynkError as b_err: + self.log(b_err) + self.disconnect() + except Exception as g_exc: + self.log(g_exc) diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/blynktimer.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/blynktimer.py new file mode 100644 index 0000000000..8fe26ad3f6 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/blynktimer.py @@ -0,0 +1,134 @@ +# Copyright (c) 2019-2020 Anton Morozenko +# 宋义深 2021/4/25 Modified +""" +Polling timers for functions. +Registers timers and performs run once or periodical function execution after defined time intervals. +""" +# select.select call used as polling waiter where it is possible +# cause time.sleep sometimes may load CPU up to 100% with small polling wait interval +try: + # cpython + import time + import select + + polling_wait = lambda x: select.select([], [], [], x) + polling_wait(0.01) +except OSError: + # windows case where select.select call fails + polling_wait = lambda x: time.sleep(x) + +except ImportError: + # micropython + import time + + try: + from uselect import select as s_select + + polling_wait = lambda x: s_select([], [], [], x) + except ImportError: + # case when micropython port does not support select.select + polling_wait = lambda x: time.sleep(x) + +WAIT_SEC = 0.05 +MAX_TIMERS = 16 +DEFAULT_INTERVAL = 10 + + +class TimerError(Exception): + pass + + +class Timer(object): + timers = {} + + def __init__(self, no_timers_err=True): + self.no_timers_err = no_timers_err + + def _get_func_name(self, obj): + """retrieves a suitable name for a function""" + if hasattr(obj, 'func'): + # handles nested decorators + return self._get_func_name(obj.func) + # simply returns 'timer' if on port without function attrs + return getattr(obj, '__name__', 'timer') + + def register(blynk, *args, **kwargs): + # kwargs with defaults are used cause PEP 3102 no supported by Python2 + interval = kwargs.pop('interval', DEFAULT_INTERVAL) + run_once = kwargs.pop('run_once', False) + stopped = kwargs.pop('stopped', False) + + class Deco(object): + def __init__(self, func): + self.func = func + if len(list(Timer.timers.keys())) >= MAX_TIMERS: + raise TimerError('Max allowed timers num={}'.format(MAX_TIMERS)) + _timer = _Timer(interval, func, run_once, stopped, *args, **kwargs) + Timer.timers['{}_{}'.format(len(list(Timer.timers.keys())), blynk._get_func_name(func))] = _timer + + def __call__(self, *f_args, **f_kwargs): + return self.func(*f_args, **f_kwargs) + + return Deco + + @staticmethod + def stop(t_id): + timer = Timer.timers.get(t_id, None) + if timer is None: + raise TimerError('Timer id={} not found'.format(t_id)) + Timer.timers[t_id].stopped = True + + @staticmethod + def start(t_id): + timer = Timer.timers.get(t_id, None) + if timer is None: + raise TimerError('Timer id={} not found'.format(t_id)) + Timer.timers[t_id].stopped = False + Timer.timers[t_id].fire_time = None + Timer.timers[t_id].fire_time_prev = None + + @staticmethod + def is_stopped(t_id): + timer = Timer.timers.get(t_id, None) + if timer is None: + raise TimerError('Timer id={} not found'.format(t_id)) + return timer.stopped + + def get_timers(self): + states = {True: 'Stopped', False: 'Running'} + return {k: states[v.stopped] for k, v in self.timers.items()} + + def run(self): + polling_wait(WAIT_SEC) + timers_intervals = [curr_timer.run() for curr_timer in Timer.timers.values() if not curr_timer.stopped] + if not timers_intervals and self.no_timers_err: + raise TimerError('Running timers not found') + return timers_intervals + + +class _Timer(object): + def __init__(self, interval, deco, run_once, stopped, *args, **kwargs): + self.interval = interval + self.deco = deco + self.args = args + self.run_once = run_once + self.kwargs = kwargs + self.fire_time = None + self.fire_time_prev = None + self.stopped = stopped + + def run(self): + timer_real_interval = 0 + if self.fire_time is None: + self.fire_time = time.time() + self.interval + if self.fire_time_prev is None: + self.fire_time_prev = time.time() + curr_time = time.time() + if curr_time >= self.fire_time: + self.deco(*self.args, **self.kwargs) + if self.run_once: + self.stopped = True + timer_real_interval = curr_time - self.fire_time_prev + self.fire_time_prev = self.fire_time + self.fire_time = curr_time + self.interval + return timer_real_interval diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/button.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/button.py new file mode 100644 index 0000000000..e7b3087802 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/button.py @@ -0,0 +1,49 @@ +""" +Button + +CircuitPython library for Button - MixGoCE +======================================================= +Small Cabbage +20210721 +dahanzimin +20210423 +""" + +import time +import board +from digitalio import DigitalInOut, Direction, Pull + +class Button(): + + def __init__(self, pin): + self.pin = DigitalInOut(pin) + self.pin.direction = Direction.INPUT + self.pin.pull = Pull.UP + self.flag = True + + def is_pressed(self): + return self.pin.value == False + + def get_presses(self, delay=1): + last_time, presses = time.monotonic(), 0 + while time.monotonic()< last_time + delay: + time.sleep(0.05) + if self.was_pressed(): + presses += 1 + return presses + + def was_pressed(self): + if self.pin.value != self.flag: + self.flag = self.pin.value + time.sleep(0.01) + if self.flag == False: + return True + else: + return False + +button_A1 = Button(board.IO14) +button_A2 = Button(board.IO21) +button_A3 = Button(board.IO36) +button_A4 = Button(board.IO37) +button_B1 = Button(board.IO0) +button_B2 = Button(board.IO35) \ No newline at end of file diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/infrared.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/infrared.py new file mode 100644 index 0000000000..508b9dd7f8 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/infrared.py @@ -0,0 +1,41 @@ +""" +Infrared Sensor + +CircuitPython library for Infrared Sensor - MixGoCE +======================================================= + +Small Cabbage +20210721 +dahanzimin +20210423 +""" + +from mixgoce import version +import board +from pwmio import PWMOut + +if version:#new + def near(x, val=10000): + from analogio import AnalogIn + + pwm = PWMOut(board.IO39, frequency=50000, duty_cycle=65535) + if x == 'left': + IR=AnalogIn(board.IO3) + reaction = IR.value-10000 #fix + if x == 'right': + IR=AnalogIn(board.IO16) + reaction = IR.value + IR.deinit() + pwm.deinit() + return reaction > val +else:#old + def near(x, val=10000): + from digitalio import DigitalInOut, Direction + + IR = DigitalInOut(board.IO38) + IR.direction = Direction.INPUT + pwm = PWMOut(board.IO39, frequency=53000, duty_cycle=100) + reaction = IR.value + IR.deinit() + pwm.deinit() + return reaction \ No newline at end of file diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/irremote.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/irremote.py new file mode 100644 index 0000000000..30445e3503 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/irremote.py @@ -0,0 +1,111 @@ +""" +IR Remote + +CircuitPython library for IR Remote - MixGoCE +======================================================= + +Small Cabbage +20210811 +""" + +import pulseio +import board +import adafruit_irremote + +first_init =True + +def encode2hex(code): + res = "0X" + for c in code: + c = hex(c)[2:] + if len(c) == 1: + c = "0" + c + res = res + c.upper() + return res + +def decode2list(string): + res = [0, 0, 0, 0] + prefix = "0" * (8 - len(string[2:])) + string = prefix + string[2:] + for i in range(4): + res[i] = int(string[2*i:2*(i+1)], 16) + return res + +def ir_receive_hex(pin=board.IO38, flag=False): + global first_init + global decoder + global pulsein + + if first_init : + pulsein = pulseio.PulseIn(pin, maxlen=120, idle_state=True) + decoder = adafruit_irremote.GenericDecode() + first_init=False + + pulses = decoder.read_pulses(pulsein, blocking=False) + if pulses: + try: + # print("Heard", len(pulses), "Pulses:", pulses) + code = decoder.decode_bits(pulses) + res = encode2hex(code) + if flag: + print("Decoded:", res) + # pulsein.deinit() + return res + except adafruit_irremote.IRNECRepeatException: # unusual short code! + print("NEC repeat!") + except adafruit_irremote.IRDecodeException as e: # failed to decode + if flag: + print("Failed to decode: ", e.args) + # except TypeError as e: + # pass + # finally: + # pulsein.deinit() + +def ir_receive(pin=board.IO38,flag=False): + global first_init + global decoder + global pulsein + + if first_init : + pulsein = pulseio.PulseIn(pin, maxlen=120, idle_state=True) + decoder = adafruit_irremote.GenericDecode() + first_init=False + + pulses = decoder.read_pulses(pulsein, blocking=False) + if pulses: + try: + code = decoder.decode_bits(pulses) + if flag: + print("Decoded:", code) + return code + except adafruit_irremote.IRNECRepeatException: # unusual short code! + print("NEC repeat!") + except adafruit_irremote.IRDecodeException as e: # failed to decode + if flag: + print("Failed to decode: ", e.args) + +def ir_send(content=[255, 0, 0, 0], pin=board.IO39): + pulseout = pulseio.PulseOut(pin, frequency=38000, duty_cycle=2 ** 15) + # Create an encoder that will take numbers and turn them into NEC IR pulses + encoder = adafruit_irremote.GenericTransmit( + header=[9500, 4500], one=[550, 550], zero=[550, 1700], trail=550 + ) + encoder.transmit(pulseout, content) + print("IR signal sent!") + pulseout.deinit() + +def ir_send_hex(content="0XFF000000", pin=board.IO39): # [255, 0, 0, 0] + pulseout = pulseio.PulseOut(pin, frequency=38000, duty_cycle=2 ** 15) + # Create an encoder that will take numbers and turn them into NEC IR pulses + encoder = adafruit_irremote.GenericTransmit( + header=[9500, 4500], one=[550, 550], zero=[550, 1700], trail=550 + ) + encoder.transmit(pulseout, decode2list(content)) + print("IR signal sent!") + pulseout.deinit() + + + + + + \ No newline at end of file diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/led.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/led.py new file mode 100644 index 0000000000..33d556a90c --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/led.py @@ -0,0 +1,34 @@ +""" +Led + +CircuitPython library for Led - MixGoCE +======================================================= + +Small Cabbage +20210721 +dahanzimin +20210423 +""" +import board +from pwmio import PWMOut + +class Led(object): #fix + def __init__(self, pin): + self.pin = PWMOut(pin, frequency=5000, duty_cycle=65535) + + def setbrightness(self, val): + self.pin.duty_cycle = 65535 - val + + def setonoff(self, val): + if val == 1: + self.pin.duty_cycle = 0 + elif val == 0: + self.pin.duty_cycle = 65535 + else: + self.pin.duty_cycle = 65535 - self.pin.duty_cycle + + def getonoff(self): + return (65535 - self.pin.duty_cycle) // 65535 + +led_L1 = Led(board.IO33) +led_L2 = Led(board.IO34) \ No newline at end of file diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/matcher.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/matcher.py new file mode 100644 index 0000000000..5d641ccbf3 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/matcher.py @@ -0,0 +1,97 @@ +# SPDX-FileCopyrightText: 2017 Yoch +# +# SPDX-License-Identifier: EPL-1.0 + +""" +`matcher` +==================================================================================== + +MQTT topic filter matcher from the Eclipse Project's Paho.MQTT.Python +https://github.com/eclipse/paho.mqtt.python/blob/master/src/paho/mqtt/matcher.py +* Author(s): Yoch (https://github.com/yoch) +""" + + +class MQTTMatcher: + """Intended to manage topic filters including wildcards. + + Internally, MQTTMatcher use a prefix tree (trie) to store + values associated with filters, and has an iter_match() + method to iterate efficiently over all filters that match + some topic name. + """ + + # pylint: disable=too-few-public-methods + class Node: + """Individual node on the MQTT prefix tree.""" + + __slots__ = "children", "content" + + def __init__(self): + self.children = {} + self.content = None + + def __init__(self): + self._root = self.Node() + + def __setitem__(self, key, value): + """Add a topic filter :key to the prefix tree + and associate it to :value""" + node = self._root + for sym in key.split("/"): + node = node.children.setdefault(sym, self.Node()) + node.content = value + + def __getitem__(self, key): + """Retrieve the value associated with some topic filter :key""" + try: + node = self._root + for sym in key.split("/"): + node = node.children[sym] + if node.content is None: + raise KeyError(key) + return node.content + except KeyError: + raise KeyError(key) from None + + def __delitem__(self, key): + """Delete the value associated with some topic filter :key""" + lst = [] + try: + parent, node = None, self._root + for k in key.split("/"): + parent, node = node, node.children[k] + lst.append((parent, k, node)) + node.content = None + except KeyError: + raise KeyError(key) from None + else: # cleanup + for parent, k, node in reversed(lst): + if node.children or node.content is not None: + break + del parent.children[k] + + def iter_match(self, topic): + """Return an iterator on all values associated with filters + that match the :topic""" + lst = topic.split("/") + normal = not topic.startswith("$") + + def rec(node, i=0): + if i == len(lst): + if node.content is not None: + yield node.content + else: + part = lst[i] + if part in node.children: + for content in rec(node.children[part], i + 1): + yield content + if "+" in node.children and (normal or i > 0): + for content in rec(node.children["+"], i + 1): + yield content + if "#" in node.children and (normal or i > 0): + content = node.children["#"].content + if content is not None: + yield content + + return rec(self._root) diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/matrix.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/matrix.py new file mode 100644 index 0000000000..5ff56ccb3b --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/matrix.py @@ -0,0 +1,277 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016 Radomir Dopieralski & Tony DiCola for Adafruit Industries +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION 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_ht16k33.ht16k33` +=========================== + +* Authors: Radomir Dopieralski & Tony DiCola for Adafruit Industries + +""" +from adafruit_bus_device import i2c_device +from micropython import const + +__version__ = "0.0.0-auto.0" +__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_HT16K33.git" + +_HT16K33_BLINK_CMD = const(0x80) +_HT16K33_BLINK_DISPLAYON = const(0x01) +_HT16K33_CMD_BRIGHTNESS = const(0xE0) +_HT16K33_OSCILATOR_ON = const(0x21) + + +class HT16K33: + """ + The base class for all displays. Contains common methods. + + :param int address: The I2C addess of the HT16K33. + :param bool auto_write: True if the display should immediately change when + set. If False, `show` must be called explicitly. + :param float brightness: 0.0 - 1.0 default brightness level. + """ + + def __init__(self, i2c, address=0x70, auto_write=True, brightness=1.0): + self.i2c_device = i2c_device.I2CDevice(i2c, address) + self._temp = bytearray(1) + self._buffer = bytearray(17) + self._auto_write = auto_write + self.fill(0) + self._write_cmd(_HT16K33_OSCILATOR_ON) + self._blink_rate = None + self._brightness = None + self.blink_rate = 0 + self.brightness = brightness + + def _write_cmd(self, byte): + self._temp[0] = byte + with self.i2c_device: + self.i2c_device.write(self._temp) + + @property + def blink_rate(self): + """The blink rate. Range 0-3.""" + return self._blink_rate + + @blink_rate.setter + def blink_rate(self, rate=None): + if not 0 <= rate <= 3: + raise ValueError("Blink rate must be an integer in the range: 0-3") + rate = rate & 0x03 + self._blink_rate = rate + self._write_cmd(_HT16K33_BLINK_CMD | _HT16K33_BLINK_DISPLAYON | rate << 1) + + @property + def brightness(self): + """The brightness. Range 0.0-1.0""" + return self._brightness + + @brightness.setter + def brightness(self, brightness): + if not 0.0 <= brightness <= 1.0: + raise ValueError( + "Brightness must be a decimal number in the range: 0.0-1.0" + ) + + self._brightness = brightness + xbright = round(15 * brightness) + xbright = xbright & 0x0F + self._write_cmd(_HT16K33_CMD_BRIGHTNESS | xbright) + + @property + def auto_write(self): + """Auto write updates to the display.""" + return self._auto_write + + @auto_write.setter + def auto_write(self, auto_write): + if isinstance(auto_write, bool): + self._auto_write = auto_write + else: + raise ValueError("Must set to either True or False.") + + def show(self): + """Refresh the display and show the changes.""" + with self.i2c_device: + # Byte 0 is 0x00, address of LED data register. The remaining 16 + # bytes are the display register data to set. + self.i2c_device.write(self._buffer) + + def fill(self, color): + """Fill the whole display with the given color.""" + fill = 0xFF if color else 0x00 + for i in range(16): + self._buffer[i + 1] = fill + if self._auto_write: + self.show() + + def _pixel(self, x, y, color=None): + addr = 2 * y + x // 8 + mask = 1 << x % 8 + if color is None: + return bool(self._buffer[addr + 1] & mask) + if color: + # set the bit + self._buffer[addr + 1] |= mask + else: + # clear the bit + self._buffer[addr + 1] &= ~mask + if self._auto_write: + self.show() + return None + + def _set_buffer(self, i, value): + self._buffer[i + 1] = value # Offset by 1 to move past register address. + + def _get_buffer(self, i): + return self._buffer[i + 1] # Offset by 1 to move past register address. + +class MatrixBackpack16x8(HT16K33): + """A single matrix.""" + + _columns = 16 + _rows = 8 + + def pixel(self, x, y, color=None): + """Get or set the color of a given pixel.""" + if not 0 <= x <= 15: + return None + if not 0 <= y <= 7: + return None + return super()._pixel(x, y, color) + + def __getitem__(self, key): + x, y = key + return self.pixel(x, y) + + def __setitem__(self, key, value): + x, y = key + self.pixel(x, y, value) + + # pylint: disable=too-many-branches + def shift(self, x, y, rotate=False): + """ + Shift pixels by x and y + + :param rotate: (Optional) Rotate the shifted pixels to the left side (default=False) + """ + auto_write = self.auto_write + self._auto_write = False + if x > 0: # Shift Right + for _ in range(x): + for row in range(0, self.rows): + last_pixel = self[self.columns - 1, row] if rotate else 0 + for col in range(self.columns - 1, 0, -1): + self[col, row] = self[col - 1, row] + self[0, row] = last_pixel + elif x < 0: # Shift Left + for _ in range(-x): + for row in range(0, self.rows): + last_pixel = self[0, row] if rotate else 0 + for col in range(0, self.columns - 1): + self[col, row] = self[col + 1, row] + self[self.columns - 1, row] = last_pixel + if y > 0: # Shift Up + for _ in range(y): + for col in range(0, self.columns): + last_pixel = self[col, self.rows - 1] if rotate else 0 + for row in range(self.rows - 1, 0, -1): + self[col, row] = self[col, row - 1] + self[col, 0] = last_pixel + elif y < 0: # Shift Down + for _ in range(-y): + for col in range(0, self.columns): + last_pixel = self[col, 0] if rotate else 0 + for row in range(0, self.rows - 1): + self[col, row] = self[col, row + 1] + self[col, self.rows - 1] = last_pixel + self._auto_write = auto_write + if auto_write: + self.show() + + # pylint: enable=too-many-branches + + def shift_right(self, rotate=False): + """ + Shift all pixels right + + :param rotate: (Optional) Rotate the shifted pixels to the left side (default=False) + """ + self.shift(1, 0, rotate) + + def shift_left(self, rotate=False): + """ + Shift all pixels left + + :param rotate: (Optional) Rotate the shifted pixels to the right side (default=False) + """ + self.shift(-1, 0, rotate) + + def shift_up(self, rotate=False): + """ + Shift all pixels up + + :param rotate: (Optional) Rotate the shifted pixels to bottom (default=False) + """ + self.shift(0, 1, rotate) + + def shift_down(self, rotate=False): + """ + Shift all pixels down + + :param rotate: (Optional) Rotate the shifted pixels to top (default=False) + """ + self.shift(0, -1, rotate) + + def image(self, img): + """Set buffer to value of Python Imaging Library image. The image should + be in 1 bit mode and a size equal to the display size.""" + imwidth, imheight = img.size + if imwidth != self.columns or imheight != self.rows: + raise ValueError( + "Image must be same dimensions as display ({0}x{1}).".format( + self.columns, self.rows + ) + ) + # Grab all the pixels from the image, faster than getpixel. + pixels = img.convert("1").load() + # Iterate through the pixels + for x in range(self.columns): # yes this double loop is slow, + for y in range(self.rows): # but these displays are small! + self.pixel(x, y, pixels[(x, y)]) + if self._auto_write: + self.show() + + @property + def columns(self): + """Read-only property for number of columns""" + return self._columns + + @property + def rows(self): + """Read-only property for number of rows""" + return self._rows + + + + + + diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mixgoce.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mixgoce.py new file mode 100644 index 0000000000..9042c5c814 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mixgoce.py @@ -0,0 +1,85 @@ +# Paste mixgoce.py + +import board +from rtc import RTC +from busio import I2C + +def do_connect(username, password): + import wifi + from time import sleep + + wifi.radio.connect(ssid=username.encode(), password=password.encode()) + while not wifi.radio.ipv4_address: + sleep(0.1) + print("Wi-Fi connected!") + return wifi.radio + +rtc_clock = RTC() + +try: + i2c = I2C(board.IO41, board.IO42,frequency=400000) + while not i2c.try_lock(): + pass + if 0x6a in i2c.scan(): + version = 99 + elif 0x15 in i2c.scan(): + version = 1 + else: + version = 0 + + i2c.unlock() + + if version == 99: + i2c.deinit() + elif version:#new + import mxc6655xa + acc = mxc6655xa.MXC6655XA(i2c) + + def get_temperature(): + return acc.get_temperature() + else:#old + import msa301 + acc = msa301.MSA301(i2c) + +except Exception as e: + print(e) + +ADDITIONAL_TOPIC = 'b640a0ce465fa2a4150c36b305c1c11b' +WILL_TOPIC = '9d634e1a156dc0c1611eb4c3cff57276' + +def ntp(url='http://mixio.mixly.org/time.php'): + import ssl + import wifi + import socketpool + import adafruit_requests + #TEXT_URL = 'http://mixio.mixly.org/time.php' + #TEXT_URL = url + pool = socketpool.SocketPool(wifi.radio) + requests = adafruit_requests.Session(pool, ssl.create_default_context()) + # print("Fetching text from", TEXT_URL) + response = requests.get(url) + # print("-" * 40) + # print(tuple(response.text.split(","))) + # print("-" * 40) + return tuple(response.text.split(",")) + +def analyse_sharekey(url): + import ssl + import wifi + import socketpool + import adafruit_requests + import json + #TEXT_URL = 'http://mixio.mixly.org/time.php' + #TEXT_URL = url + pool = socketpool.SocketPool(wifi.radio) + requests = adafruit_requests.Session(pool, ssl.create_default_context()) + # print("Fetching text from", TEXT_URL) + response = requests.get(url) + # print("-" * 40) + # print(tuple(response.text.split(","))) + # print("-" * 40) + if response.text == '-1': + print('Invalid share key') + else: + result = json.loads(response.text) + return (result['0'], result['1'], result['2']) \ No newline at end of file diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mixpy.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mixpy.py new file mode 100644 index 0000000000..7aa9b9bc38 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mixpy.py @@ -0,0 +1,84 @@ +#coding=utf-8 +import math + +def math_map(v, al, ah, bl, bh): + if al==ah: + return bl + if al > ah: + al, ah = ah, al + if v > ah: + v = ah + if v < al: + v = al + return bl + (bh - bl) * (v - al) / (ah - al) + +def math_mean(myList): + localList = [e for e in myList if type(e) == int or type(e) == float] + if not localList: return + return float(sum(localList)) / len(localList) + +def math_median(myList): + localList = sorted([e for e in myList if type(e) == int or type(e) == float]) + if not localList: return + if len(localList) % 2 == 0: + return (localList[len(localList) // 2 - 1] + localList[len(localList) // 2]) / 2.0 + else: + return localList[(len(localList) - 1) // 2] + +def math_modes(some_list): + modes = [] + # Using a lists of [item, count] to keep count rather than dict + # to avoid "unhashable" errors when the counted item is itself a list or dict. + counts = [] + maxCount = 1 + for item in some_list: + found = False + for count in counts: + if count[0] == item: + count[1] += 1 + maxCount = max(maxCount, count[1]) + found = True + if not found: + counts.append([item, 1]) + for counted_item, item_count in counts: + if item_count == maxCount: + modes.append(counted_item) + return modes + +def math_standard_deviation(numbers): + n = len(numbers) + if n == 0: return + mean = float(sum(numbers)) / n + variance = sum((x - mean) ** 2 for x in numbers) / n + return math.sqrt(variance) + +def lists_sort(my_list, type, reverse): + def try_float(s): + try: + return float(s) + except: + return 0 + key_funcs = { + "NUMERIC": try_float, + "TEXT": str, + "IGNORE_CASE": lambda s: str(s).lower() + } + key_func = key_funcs[type] + list_cpy = list(my_list) + return sorted(list_cpy, key=key_func, reverse=reverse) + +def format_content(mydict, cid): + if 'lat' in mydict and 'long' in mydict: + res = '{'+'"lat": "{}", "long": "{}", "clientid": "{}"'.format(mydict.pop('lat'),mydict.pop('long'),cid) + if len(mydict)>0: + res += ', "message": [' + for d in mydict: + res += '{{"label": "{}", "value": "{}"}},'.format(d,mydict[d]) + res = res[:-1] + "]" + res += '}' + return res + else: + print('Invalid Input') + +def format_str(d): + return str(d).replace("'",'"') \ No newline at end of file diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mmatrix.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mmatrix.py new file mode 100644 index 0000000000..eb46f4862a --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mmatrix.py @@ -0,0 +1,139 @@ +""" +Matrix + +CircuitPython library for Matrix - MixGoCE +======================================================= + +Small Cabbage +20210721 +""" +import time +from mixgoce import i2c +from matrix import MatrixBackpack16x8 +from adafruit_framebuf import FrameBuffer,MVLSB + +buf = bytearray(16) +fb = FrameBuffer(buf, 16, 8, MVLSB) + +class MixGoMatrix(MatrixBackpack16x8): + + def show_dynamic(self, to_show, delay=200): + # self.fill(0) + if type(to_show)==str or type(to_show)==int: + for i in to_show: + fb.fill(0) + fb.text(i, 5, 0, color=1) + # turn all LEDs off + self.fill(0) + for x in range(16): + # using the FrameBuffer text result + bite = buf[x] + for y in range(8): + bit = 1 << y & bite + # if bit > 0 then set the pixel brightness + if bit: + self[x, y] = 1 + self.show() + if len(to_show)>1: + time.sleep(delay/1000) + elif type(to_show)==list or type(to_show)==tuple: + for i in to_show: + #if type(i)!=str and type(i)!=type(Image.HEART): + if type(i)!=str and type(i)!=type(bytearray(16)): + pass + for i in to_show: + self.show_dynamic(i) + time.sleep(delay/1000) + elif type(to_show)==type(bytearray(16)): + buf = to_show + # turn all LEDs off + self.fill(0) + # print(buf) + for x in range(16): + # using the FrameBuffer text result + bite = buf[x] + # print(bite,end=" ") + for y in range(8): + bit = 1 << y & bite + # if bit > 0 then set the pixel brightness + if bit: + self[x, y] = 1 + self.show() + + def scroll(self, text_to_show, delay=0): + for i in range(len(text_to_show) * 6 + 26): + fb.fill(0) + fb.text(text_to_show, -i + 16, 0, color=1) + # turn all LEDs off + self.fill(0) + for x in range(16): + # using the FrameBuffer text result + bite = buf[x] + for y in range(8): + bit = 1 << y & bite + # if bit > 0 then set the pixel brightness + if bit: + self[x, y] = 1 + self.show() + time.sleep(delay/1000) + + def show_static(self, text_to_show): + fb.fill(0) + if len(text_to_show)==2: + l = 3 + elif len(text_to_show)==1: + l = 5 + else: + l = 0 + fb.text(text_to_show, l, 0, color=1) + # turn all LEDs off + self.fill(0) + for x in range(16): + # using the FrameBuffer text result + bite = buf[x] + for y in range(8): + bit = 1 << y & bite + # if bit > 0 then set the pixel brightness + if bit: + self[x, y] = 1 + self.show() + + def set_brightness(self, val): + self.brightness = max(min(val, 1), 0) + + def get_brightness(self): + return self.brightness + + def set_pixel(self, x, y, val): + self[x, y] = val + self.show() + + def get_pixel(self, x, y): + return int(self[x, y]) + + def clear(self): + self.fill(0) + self.show() + + def up(self, times, rotate=False): + for i in range(times): + self.shift_down(rotate) + self.show() + + def down(self, times, rotate=False): + for i in range(times): + self.shift_up(rotate) + self.show() + + def left(self, times, rotate=False): + for i in range(times): + self.shift_left(rotate) + self.show() + + def right(self, times, rotate=False): + for i in range(times): + self.shift_right(rotate) + self.show() + +display = MixGoMatrix(i2c, auto_write=False, brightness=0.1) +display.clear() \ No newline at end of file diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/msa301.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/msa301.py new file mode 100644 index 0000000000..141f5e15b0 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/msa301.py @@ -0,0 +1,70 @@ +""" +MSA301 + +CircuitPython library for the MSA301 Accelerometer +======================================================= + +dahanzimin +20210411 +mixly +""" +import time +import adafruit_bus_device.i2c_device as i2c_device +from micropython import const + +MSA301_ADDRESS = const(0x26) + +MSA301_REG_DEVICE_ID = const(0x01) +MSA301_REG_DATA = const(0x02) +MSA301_REG_ODR = const(0x10) +MSA301_REG_POWERMODE = const(0x11) +MSA301_REG_RESRANGE = const(0x0F) + + +_STANDARD_GRAVITY = 9.806 + +class MSA301: + + _BUFFER = bytearray(2) + data_reg = bytearray(6) + + def __init__(self, i2c_bus): + self._device = i2c_device.I2CDevice(i2c_bus, MSA301_ADDRESS) + if self._chip_id() != 0x13: + raise AttributeError("Cannot find a MSA301") + + self._write_u8(MSA301_REG_ODR,0X09) #RATE_500_HZ + self._write_u8(MSA301_REG_POWERMODE,0X12) #NORMAL & WIDTH_250_HZ + self._write_u8(MSA301_REG_RESRANGE,0X02) #RESOLUTION_14_BIT & RANGE_8_G + + def _read_u8(self, address): + # Read an 8-bit unsigned value from the specified 8-bit address. + with self._device: + self._BUFFER[0] = address & 0xFF + self._device.write(self._BUFFER, end=1) + self._device.readinto(self._BUFFER, end=1) + return self._BUFFER[0] + + def _write_u8(self, address, val): + # Write an 8-bit unsigned value to the specified 8-bit address. + with self._device: + self._BUFFER[0] = address & 0xFF + self._BUFFER[1] = val & 0xFF + self._device.write(self._BUFFER, end=2) + + def _chip_id(self): + return self._read_u8(MSA301_REG_DEVICE_ID) + + def u2s(self,n): + return n if n < (1 << 7) else n - (1 << 8) + + @property + def acceleration(self): + for i in range(0,6): + self.data_reg[i]=self._read_u8(MSA301_REG_DATA+i) + x_acc=((self.u2s(self.data_reg[1])<<8|self.data_reg[0])>>2)/1024.0 + y_acc=((self.u2s(self.data_reg[3])<<8|self.data_reg[2])>>2)/1024.0 + z_acc=((self.u2s(self.data_reg[5])<<8|self.data_reg[4])>>2)/1024.0 + return (-y_acc,-x_acc,z_acc) + + diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/music.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/music.py new file mode 100644 index 0000000000..fbf7f1a4ea --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/music.py @@ -0,0 +1,102 @@ +""" +Music + +CircuitPython library for Music - MixGoCE +======================================================= + +Small Cabbage +20210721 +""" + + +import time +from mixgoce import version + +class Music: + def __init__(self, pin, duration='4', octave='6', tempo='63'): + import pwmio + self.pin = pin + self.pwm = pwmio.PWMOut(pin, duty_cycle=0, variable_frequency=True) + self.duration = duration + self.octave = octave + self.tempo = tempo + + def set_duration(self, duration='4'): + self.duration = duration + + def set_octave(self, octave='6'): + self.octave = octave + + def sef_tempo(self, tempo='63'): + self.tempo = tempo + + def set_duration_tempo(self, duration, tempo):#这项等于原来的set_tempo + self.duration = duration + self.tempo = tempo + + def reset(self): + self.set_duration() + self.set_octave() + self.set_tempo() + + def get_duration(self): + return self.duration + + def get_octave(self): + return self.octave + + def get_tempo(self): + return (self.tempo) + + def play_demo(self, demo): + import adafruit_rtttl + if self.pwm: + self.pwm.deinit() + adafruit_rtttl.play(self.pin, demo) + + def play_demo_print(self, demo): + import adafruit_rtttl + if self.pwm: + self.pwm.deinit() + adafruit_rtttl.play(self.pin, demo) + _, defaults, tune = demo.lower().split(":") + print(tune) + + def play(self, note, duration=None): + import pwmio + if self.pwm: + self.pwm.deinit() + self.pwm = pwmio.PWMOut(self.pin, duty_cycle=0, variable_frequency=True) + self.pwm.frequency = int(note) + self.pwm.duty_cycle = 2 ** 15 + if duration: + # print(1) + time.sleep(duration/1000) + self.pwm.duty_cycle = 0 + + def stop(self): + self.pwm.duty_cycle = 0 + self.pwm.deinit() + +BA_DING = "itchy:d=4,o=4,b=300:4b5,2g5" +JUMP_UP = "itchy:d=4,o=5,b=300:c,d,e,f,g" +JUMP_DOWN = "itchy:d=4,o=5,b=300:g,f,e,d,c" +POWER_UP = "itchy:d=4,o=4,b=300:4g4,4c5,4e5,2g5,4e5,1g5" +POWER_DOWN = "itchy:d=4,o=4,b=300:4g5,4d#5,4c5,2g4,4b4,1c5" +DADADADUM = "itchy:d=4,o=4,b=200:2p,g,g,g,1d#,p,f,f,f,1d" +#ENTERTAINER = "itchy:d=4,o=4,b=300:4d4,d#4,e4,2c5,4e4,2c5,4e4,1c5,c5,d5,d#5,e5,c5,d5,2e5,b4,2d5,1c5" +BIRTHDAY = "itchy:d=4,o=4,b=180:6c,12c,4d,4c,4f,2e,6c,12c,4d,4c,4g,2f,6c,12c,4c5,4a,4f,4e,4d,6a#,12a#,4a,4f,4g,2f" +#BLUES = "itchy:d=4,o=4,b=400:2c,4e,4g,4a,4a#,4a,4g,4e,2c,4e,4g,4a,4a#,4a,4g,4e,4f,4a,2c,4d,4d#,4d,4c,4a,2c,4e,4g,4a,4a#,4a,4g,4e,4g,4b,4d,4f,4f,4a,4c,4d#,2c,e,g,e,g,f,e,d" +#PYTHON = "itchy:d=4,o=4,b=380:d5,4b4,p,b4,b4,a#4,b4,g5,p,d5,d5,r,b4,c5,p,c5,c5,p,d5,1e5,p,c5,a4,p,a4,a4,g#4,a4,f#5,p,e5,e5,p,c5,b4,p,b4,b4,p,c5,1d5,p,d5,4b4,p,b4,b4,a#4,b4,b5,p,g5,g5,p,d5,c#5,p,a5,a5,p,a5,1a5,p,g5,f#5,p,a5,a5,g#5,a5,e5,p,a5,a5,g#5,a5,d5,p,c#5,d5,p,c#5,2d5,3p" + +import board + +if version:#new + buzzer = Music(board.IO40) +else:#old + from digitalio import DigitalInOut, Direction + + buzzer = Music(board.IO17) + spk_en = DigitalInOut(board.IO40) + spk_en.direction = Direction.OUTPUT + spk_en.value = True \ No newline at end of file diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mxc6655xa.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mxc6655xa.py new file mode 100644 index 0000000000..0a5c83dbe0 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mxc6655xa.py @@ -0,0 +1,80 @@ +""" +MXC6655XA + +CircuitPython library for the MXC6655XA Accelerometer +======================================================= + +dahanzimin +20210411 +mixly +""" +import time +import adafruit_bus_device.i2c_device as i2c_device +from micropython import const + +MXC6655XA_ADDRESS = const(0x15) + +MXC6655XA_REG_DATA = const(0x03) +MXC6655XA_REG_CTRL = const(0x0D) +MXC6655XA_REG_DEVICE_ID = const(0x0E) + +MXC6655XA_CMD_8G_POWER_ON = const(0x40) +MXC6655XA_CMD_4G_POWER_ON = const(0x20) +MXC6655XA_CMD_2G_POWER_ON = const(0x00) + +MXC6655XA_2G_SENSITIVITY =1024 +MXC6655XA_4G_SENSITIVITY =512 +MXC6655XA_8G_SENSITIVITY =256 +MXC6655XA_T_ZERO =25 +MXC6655XA_T_SENSITIVITY =0.586 + +class MXC6655XA: + + _BUFFER = bytearray(2) + data_reg = bytearray(7) + + def __init__(self, i2c_bus): + self._device = i2c_device.I2CDevice(i2c_bus, MXC6655XA_ADDRESS) + if self._chip_id() != 0x02: + raise AttributeError("Cannot find a MXC6655XA") + self._Enable() #star + time.sleep(0.3) + self.range = MXC6655XA_8G_SENSITIVITY #SET 8g range + + def _read_u8(self, address): + # Read an 8-bit unsigned value from the specified 8-bit address. + with self._device: + self._BUFFER[0] = address & 0xFF + self._device.write(self._BUFFER, end=1) + self._device.readinto(self._BUFFER, end=1) + return self._BUFFER[0] + + def _write_u8(self, address, val): + # Write an 8-bit unsigned value to the specified 8-bit address. + with self._device: + self._BUFFER[0] = address & 0xFF + self._BUFFER[1] = val & 0xFF + self._device.write(self._BUFFER, end=2) + + def _chip_id(self): + return self._read_u8(MXC6655XA_REG_DEVICE_ID) + + def _Enable(self): + self._write_u8(MXC6655XA_REG_CTRL,MXC6655XA_CMD_8G_POWER_ON) + + def u2s(self,n): + return n if n < (1 << 7) else n - (1 << 8) + + @property + def acceleration(self): + for i in range(0,6): + self.data_reg[i]=self._read_u8(MXC6655XA_REG_DATA+i) + x_acc=float((self.u2s(self.data_reg[0])<<8|self.data_reg[1])>>4)/self.range + y_acc=float((self.u2s(self.data_reg[2])<<8|self.data_reg[3])>>4)/self.range + z_acc=float((self.u2s(self.data_reg[4])<<8|self.data_reg[5])>>4)/self.range + #t_acc=float(self.u2s(self.data_reg[6]))*MXC6655XA_T_SENSITIVITY + MXC6655XA_T_ZERO + return (-y_acc,-x_acc,z_acc) + + def get_temperature(self): + t_acc=float(self.u2s(self._read_u8(MXC6655XA_REG_DATA+6)))*MXC6655XA_T_SENSITIVITY + MXC6655XA_T_ZERO + return round(t_acc,1) diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/pixels.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/pixels.py new file mode 100644 index 0000000000..f51055e510 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/pixels.py @@ -0,0 +1,71 @@ +""" +RGB + +CircuitPython library for RGB - MixGoCE +======================================================= + +Small Cabbage +20210721 +""" + + +import time +import board +import neopixel + +def wheel(pos): + # 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) + + +class RGB(object): + def __init__(self,pin=board.IO8,num=4,flag="RGB"): + self.pin = pin + self.num = num + self.pixels = neopixel.NeoPixel(pin, num, brightness=0.3, auto_write=False, pixel_order = flag) + + def show_all(self, R, G, B): + color = (R, G, B) + self.pixels.fill(color) + + def show_one(self, index, R, G, B): + color = (R, G, B) + self.pixels[index - 1] = color + + def write(self): + self.pixels.show() + + def color_chase(self, R, G, B, wait): + color = (R, G, B) + for i in range(self.num): + self.pixels[i] = color + time.sleep(wait/1000) + self.pixels.show() + + def rainbow_cycle(self, wait): + for j in range(255): + for i in range(self.num): + rc_index = (i * 256 // self.num) + j + self.pixels[i] = wheel(rc_index & 255) + self.pixels.show() + time.sleep(wait/1000/256) + + def change_mod(self,flag): + import time + if flag in ("RGB","GRB"): + self.pixels.deinit() + time.sleep(0.1) + self.pixels = neopixel.NeoPixel(self.pin, self.num, brightness=0.3, auto_write=False, pixel_order = flag) + +rgb = RGB() +rgb.show_all(0,0,0) +rgb.write() \ No newline at end of file diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/sensor.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/sensor.py new file mode 100644 index 0000000000..56d6465201 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/sensor.py @@ -0,0 +1,55 @@ +""" +Analog Sensor + +CircuitPython library for Analog Sensor - MixGoCE +======================================================= + +Small Cabbage +20210721 +dahanzimin +20210423 +""" +from mixgoce import version + +class ADCSensor: + import board + __pins=[board.IO13,board.IO15,board.IO16] + __species = {} + __first_init = True + def __new__(cls, pin, *args, **kwargs): + if pin not in cls.__species.keys(): + cls.__first_init = True + cls.__species[pin]=object.__new__(cls) + return cls.__species[pin] + + def __init__(self,pin): + from analogio import AnalogIn + if self.__first_init: + self.__first_init = False + self.pin = AnalogIn(self.__pins[pin]) + + def read(self): + return self.pin.value + +def get_brightness(): + return ADCSensor(1).read() + +def get_soundlevel(): #fix + value_d= [] + for _ in range(5): + values = [] + for _ in range(5): + val = ADCSensor(0).read() + values.append(val) + value_d.append(max(values) - min(values)) + return max(value_d) + + +if version:#new + from mixgoce import acc + def get_temperature(): + return acc.get_temperature() +else:#old + def get_temperature(): + adc_val = ADCSensor(2).read() + return adc_val * 3.9 / 5900 \ No newline at end of file diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/touchpad.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/touchpad.py new file mode 100644 index 0000000000..1aa9b78c6b --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/touchpad.py @@ -0,0 +1,25 @@ +""" +TouchPad + +CircuitPython library for TouchPad - MixGoCE +======================================================= + +Small Cabbage +20210721 +dahanzimin +20210423 +""" +import board +from touchio import TouchIn +class TouchPad(): + def __init__(self,pin,v=18000): + self.pin = TouchIn(pin) + self.v = v + + def is_touched(self): + return self.pin.raw_value > self.v + +touch_T1 = TouchPad(board.IO4) +touch_T2 = TouchPad(board.IO5) +touch_T3 = TouchPad(board.IO6) +touch_T4 = TouchPad(board.IO7) \ No newline at end of file diff --git a/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.h b/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.h new file mode 100644 index 0000000000..187687c8f5 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/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 "MixGo CE" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO45) diff --git a/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk b/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk new file mode 100644 index 0000000000..c81df98381 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk @@ -0,0 +1,24 @@ +USB_VID = 0x239A +USB_PID = 0x80A8 +USB_PRODUCT = "MixGo CE" +USB_MANUFACTURER = "Espressif" + +IDF_TARGET = esp32s2 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE=dio +CIRCUITPY_ESP_FLASH_FREQ=40m +CIRCUITPY_ESP_FLASH_SIZE=4MB + +CIRCUITPY_MODULE=wroom + +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel +FROZEN_MPY_DIRS += boards/$(BOARD)/mixgoce_lib + diff --git a/ports/espressif/boards/mixgo_ce_udisk/pins.c b/ports/espressif/boards/mixgo_ce_udisk/pins.c new file mode 100644 index 0000000000..ca4eb12bf7 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/pins.c @@ -0,0 +1,50 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_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_GPIO45) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/mixgo_ce_udisk/sdkconfig b/ports/espressif/boards/mixgo_ce_udisk/sdkconfig new file mode 100644 index 0000000000..e69de29bb2 From 58646a936e06fecec9f21ba482621bcfaebd8766 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 10 May 2022 14:01:30 -0400 Subject: [PATCH 042/246] Correct errno messages --- locale/circuitpython.pot | 12 ++++++++---- py/moduerrno.c | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 3f8322c8dd..cbaa54b90e 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -1749,6 +1749,10 @@ msgstr "" msgid "No space left on device" msgstr "" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "" @@ -1856,6 +1860,10 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" @@ -2521,10 +2529,6 @@ msgstr "" msgid "Unsupported format" msgstr "" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" diff --git a/py/moduerrno.c b/py/moduerrno.c index 56d903f115..743be0b85d 100644 --- a/py/moduerrno.c +++ b/py/moduerrno.c @@ -140,7 +140,7 @@ const char *mp_common_errno_to_str(mp_obj_t errno_val, char *buf, size_t len) { const compressed_string_t *desc = NULL; switch (MP_OBJ_SMALL_INT_VALUE(errno_val)) { case EPERM: - desc = MP_ERROR_TEXT("Permission denied"); + desc = MP_ERROR_TEXT("Operation not permitted"); break; case ENOENT: desc = MP_ERROR_TEXT("No such file/directory"); @@ -155,7 +155,7 @@ const char *mp_common_errno_to_str(mp_obj_t errno_val, char *buf, size_t len) { desc = MP_ERROR_TEXT("File exists"); break; case ENODEV: - desc = MP_ERROR_TEXT("Unsupported operation"); + desc = MP_ERROR_TEXT("No such device"); break; case EINVAL: desc = MP_ERROR_TEXT("Invalid argument"); From 8d7390992a0518af84b7eeeee70c6ed523f39ce5 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 10 May 2022 12:28:43 -0700 Subject: [PATCH 043/246] Fix BLE autoreload The trigger was happening when reload was suspended and therefore ignored. Now, manage reload in one place in the file. This may trigger reloads on BLE command error but that should be rare. Fixes #6258 --- supervisor/shared/bluetooth/file_transfer.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/supervisor/shared/bluetooth/file_transfer.c b/supervisor/shared/bluetooth/file_transfer.c index 6c206f35c0..a6a2f8062a 100644 --- a/supervisor/shared/bluetooth/file_transfer.c +++ b/supervisor/shared/bluetooth/file_transfer.c @@ -325,7 +325,6 @@ STATIC uint8_t _process_write(const uint8_t *raw_buf, size_t command_len) { if (chunk_size == 0) { // Don't reload until everything is written out of the packet buffer. common_hal_bleio_packet_buffer_flush(&_transfer_packet_buffer); - autoreload_trigger(); return ANY_COMMAND; } @@ -382,7 +381,6 @@ STATIC uint8_t _process_write_data(const uint8_t *raw_buf, size_t command_len) { #endif // Don't reload until everything is written out of the packet buffer. common_hal_bleio_packet_buffer_flush(&_transfer_packet_buffer); - autoreload_trigger(); return ANY_COMMAND; } return WRITE_DATA; @@ -463,7 +461,6 @@ STATIC uint8_t _process_delete(const uint8_t *raw_buf, size_t command_len) { if (result == FR_OK) { // Don't reload until everything is written out of the packet buffer. common_hal_bleio_packet_buffer_flush(&_transfer_packet_buffer); - autoreload_trigger(); } return ANY_COMMAND; } @@ -517,7 +514,6 @@ STATIC uint8_t _process_mkdir(const uint8_t *raw_buf, size_t command_len) { if (result == FR_OK) { // Don't reload until everything is written out of the packet buffer. common_hal_bleio_packet_buffer_flush(&_transfer_packet_buffer); - autoreload_trigger(); } return ANY_COMMAND; } @@ -664,7 +660,6 @@ STATIC uint8_t _process_move(const uint8_t *raw_buf, size_t command_len) { if (result == FR_OK) { // Don't reload until everything is written out of the packet buffer. common_hal_bleio_packet_buffer_flush(&_transfer_packet_buffer); - autoreload_trigger(); } return ANY_COMMAND; } @@ -740,6 +735,14 @@ void supervisor_bluetooth_file_transfer_background(void) { } if (next_command == ANY_COMMAND) { autoreload_resume(AUTORELOAD_SUSPEND_BLE); + // Trigger a reload if the command may have mutated the file system. + if (current_state == WRITE || + current_state == WRITE_DATA || + current_state == DELETE || + current_state == MKDIR || + current_state == MOVE) { + autoreload_trigger(); + } } } running = false; From 8ed10faf1a63fa2911ccf4ea94da7e410a0ffb07 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 10 May 2022 21:51:09 +0200 Subject: [PATCH 044/246] 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 | 15 +++++++++++---- locale/cs.po | 12 ++++++++---- locale/de_DE.po | 15 +++++++++++---- locale/el.po | 12 ++++++++---- locale/en_GB.po | 15 +++++++++++---- locale/es.po | 15 +++++++++++---- locale/fil.po | 15 +++++++++++---- locale/fr.po | 15 +++++++++++---- locale/hi.po | 12 ++++++++---- locale/it_IT.po | 15 +++++++++++---- locale/ja.po | 15 +++++++++++---- locale/ko.po | 12 ++++++++---- locale/nl.po | 15 +++++++++++---- locale/pl.po | 15 +++++++++++---- locale/pt_BR.po | 15 +++++++++++---- locale/ru.po | 12 ++++++++---- locale/sv.po | 15 +++++++++++---- locale/tr.po | 12 ++++++++---- locale/zh_Latn_pinyin.po | 15 +++++++++++---- 19 files changed, 191 insertions(+), 76 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index b3dd782f1e..da7bbd0915 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -1768,6 +1768,10 @@ msgstr "Tidak ada pull-down pada pin; 1Mohm direkomendasikan" msgid "No space left on device" msgstr "Tidak ada ruang yang tersisa di perangkat" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Tidak ada file/direktori" @@ -1880,6 +1884,10 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" @@ -2556,10 +2564,6 @@ msgstr "Tipe bus tampilan tidak didukung" msgid "Unsupported format" msgstr "Format tidak didukung" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Operasi yang tidak didukung" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" @@ -4676,6 +4680,9 @@ msgstr "zi harus berjenis float" msgid "zi must be of shape (n_section, 2)" msgstr "Zi harus berbentuk (n_section, 2)" +#~ msgid "Unsupported operation" +#~ msgstr "Operasi yang tidak didukung" + #~ msgid "" #~ "\n" #~ "Code stopped by auto-reload.\n" diff --git a/locale/cs.po b/locale/cs.po index f87816126a..22f48b15a6 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -1756,6 +1756,10 @@ msgstr "" msgid "No space left on device" msgstr "" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "" @@ -1863,6 +1867,10 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" @@ -2530,10 +2538,6 @@ msgstr "" msgid "Unsupported format" msgstr "" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 029827eea2..6c52a0e8f6 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -1776,6 +1776,10 @@ msgstr "Kein Pulldown-Widerstand am Pin; 1 MOhm wird vorgeschlagen" msgid "No space left on device" msgstr "Kein Speicherplatz mehr verfügbar auf dem Gerät" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Keine solche Datei/Verzeichnis" @@ -1889,6 +1893,10 @@ msgstr "Nur eine alarm-time kann gesetzt werden." msgid "Only one color can be transparent at a time" msgstr "Nur eine Farbe kann transparent sein zu einer Zeit" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "Vorgang oder Funktion wird nicht unterstützt" @@ -2577,10 +2585,6 @@ msgstr "Nicht unterstützter display bus type" msgid "Unsupported format" msgstr "Nicht unterstütztes Format" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Nicht unterstützte Operation" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "Update fehlgeschlagen" @@ -4738,6 +4742,9 @@ msgstr "zi muss eine Gleitkommazahl sein" msgid "zi must be of shape (n_section, 2)" msgstr "zi muss die Form (n_section, 2) haben" +#~ msgid "Unsupported operation" +#~ msgstr "Nicht unterstützte Operation" + #~ msgid "divisor must be 4" #~ msgstr "Teiler muss 4 sein" diff --git a/locale/el.po b/locale/el.po index 2685481acc..4ecf46679d 100644 --- a/locale/el.po +++ b/locale/el.po @@ -1749,6 +1749,10 @@ msgstr "" msgid "No space left on device" msgstr "" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "" @@ -1856,6 +1860,10 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" @@ -2521,10 +2529,6 @@ msgstr "" msgid "Unsupported format" msgstr "" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" diff --git a/locale/en_GB.po b/locale/en_GB.po index 902fe0fc03..de542c4b92 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -1762,6 +1762,10 @@ msgstr "No pulldown on pin; 1Mohm recommended" msgid "No space left on device" msgstr "No space left on device" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "No such file/directory" @@ -1873,6 +1877,10 @@ msgstr "Only one alarm.time alarm can be set." msgid "Only one color can be transparent at a time" msgstr "Only one colour can be transparent at a time" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "Operation or feature not supported" @@ -2552,10 +2560,6 @@ msgstr "Unsupported display bus type" msgid "Unsupported format" msgstr "Unsupported format" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Unsupported operation" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "Update failed" @@ -4677,6 +4681,9 @@ msgstr "zi must be of float type" msgid "zi must be of shape (n_section, 2)" msgstr "zi must be of shape (n_section, 2)" +#~ msgid "Unsupported operation" +#~ msgstr "Unsupported operation" + #~ msgid "" #~ "\n" #~ "Code stopped by auto-reload.\n" diff --git a/locale/es.po b/locale/es.po index eeffad5f55..72cedf0de4 100644 --- a/locale/es.po +++ b/locale/es.po @@ -1784,6 +1784,10 @@ msgstr "No hay pulldown en el pin; 1Mohm recomendado" msgid "No space left on device" msgstr "No queda espacio en el dispositivo" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "No existe el archivo/directorio" @@ -1897,6 +1901,10 @@ msgstr "Solamente una alarm.time puede ser configurada." msgid "Only one color can be transparent at a time" msgstr "Solo un color puede ser transparente a la vez" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "Operación no característica no soportada" @@ -2583,10 +2591,6 @@ msgstr "Sin capacidad de bus tipo display" msgid "Unsupported format" msgstr "Formato no soportado" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Operación no soportada" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "La actualización fallo" @@ -4724,6 +4728,9 @@ msgstr "zi debe ser de tipo flotante" msgid "zi must be of shape (n_section, 2)" msgstr "zi debe ser una forma (n_section,2)" +#~ msgid "Unsupported operation" +#~ msgstr "Operación no soportada" + #~ msgid "" #~ "\n" #~ "Code stopped by auto-reload.\n" diff --git a/locale/fil.po b/locale/fil.po index eb24473bcb..b40891ffbb 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -1764,6 +1764,10 @@ msgstr "" msgid "No space left on device" msgstr "" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Walang file/directory" @@ -1874,6 +1878,10 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" @@ -2543,10 +2551,6 @@ msgstr "Hindi supportadong tipo ng bitmap" msgid "Unsupported format" msgstr "Hindi supportadong format" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Hindi sinusuportahang operasyon" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" @@ -4687,6 +4691,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "Unsupported operation" +#~ msgstr "Hindi sinusuportahang operasyon" + #~ msgid "Brightness must be between 0 and 255" #~ msgstr "Ang liwanag ay dapat sa gitna ng 0 o 255" diff --git a/locale/fr.po b/locale/fr.po index d8b286ade6..ffe3184243 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -1795,6 +1795,10 @@ msgstr "Pas de pulldown sur la broche ; 1Mohm recommandé" msgid "No space left on device" msgstr "Aucun espace libre sur le dispositif" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Fichier/répertoire introuvable" @@ -1908,6 +1912,10 @@ msgstr "Seulement une alarme alarm.time peut être réglée." msgid "Only one color can be transparent at a time" msgstr "Une seule couleur peut être transparente à la fois" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "Opération ou fonction non supportée" @@ -2600,10 +2608,6 @@ msgstr "Type de bus d'affichage non supporté" msgid "Unsupported format" msgstr "Format non supporté" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Opération non supportée" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "Mise-à-jour échouée" @@ -4755,6 +4759,9 @@ msgstr "zi doit être de type float" msgid "zi must be of shape (n_section, 2)" msgstr "zi doit être de forme (n_section, 2)" +#~ msgid "Unsupported operation" +#~ msgstr "Opération non supportée" + #~ msgid "divisor must be 4" #~ msgstr "le diviseur doit être 4" diff --git a/locale/hi.po b/locale/hi.po index dfb8add290..6a4b71b40d 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -1749,6 +1749,10 @@ msgstr "" msgid "No space left on device" msgstr "" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "" @@ -1856,6 +1860,10 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" @@ -2521,10 +2529,6 @@ msgstr "" msgid "Unsupported format" msgstr "" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index e14619c464..16c8264ecc 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -1773,6 +1773,10 @@ msgstr "" msgid "No space left on device" msgstr "Non che spazio sul dispositivo" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Nessun file/directory esistente" @@ -1884,6 +1888,10 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" @@ -2560,10 +2568,6 @@ msgstr "tipo di bitmap non supportato" msgid "Unsupported format" msgstr "Formato non supportato" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Operazione non supportata" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" @@ -4707,6 +4711,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "Unsupported operation" +#~ msgstr "Operazione non supportata" + #~ msgid "" #~ "\n" #~ "Code stopped by auto-reload.\n" diff --git a/locale/ja.po b/locale/ja.po index 808bea05c3..8ff4dd0907 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -1760,6 +1760,10 @@ msgstr "ピンにプルダウンがありません。1Mオーム推奨" msgid "No space left on device" msgstr "デバイスに空き容量が残っていません" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "指定されたファイル/ディレクトリはありません" @@ -1869,6 +1873,10 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" @@ -2536,10 +2544,6 @@ msgstr "" msgid "Unsupported format" msgstr "非対応の形式" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "非対応の操作" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" @@ -4663,6 +4667,9 @@ msgstr "ziはfloat値でなければなりません" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "Unsupported operation" +#~ msgstr "非対応の操作" + #~ msgid "Brightness must be between 0 and 255" #~ msgstr "Brightnessは0から255の間でなければなりません" diff --git a/locale/ko.po b/locale/ko.po index 5f556fee31..d02997cd6b 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -1752,6 +1752,10 @@ msgstr "" msgid "No space left on device" msgstr "" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "" @@ -1859,6 +1863,10 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" @@ -2525,10 +2533,6 @@ msgstr "" msgid "Unsupported format" msgstr "" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 3de959fa49..fc71d36d20 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -1761,6 +1761,10 @@ msgstr "Geen pulldown op pin; 1MOhm aangeraden" msgid "No space left on device" msgstr "Geen ruimte meer beschikbaar op apparaat" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Bestand/map bestaat niet" @@ -1874,6 +1878,10 @@ msgstr "Slechts één alarm.time alarm kan worden ingesteld." msgid "Only one color can be transparent at a time" msgstr "Er kan maar één kleur per keer transparant zijn" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" @@ -2549,10 +2557,6 @@ msgstr "Niet-ondersteund beeldscherm bus type" msgid "Unsupported format" msgstr "Niet-ondersteunde format" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Niet-ondersteunde operatie" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "Update Mislukt" @@ -4683,6 +4687,9 @@ msgstr "zi moet van type float zijn" msgid "zi must be of shape (n_section, 2)" msgstr "zi moet vorm (n_section, 2) hebben" +#~ msgid "Unsupported operation" +#~ msgstr "Niet-ondersteunde operatie" + #~ msgid "Brightness must be between 0 and 255" #~ msgstr "Helderheid moet tussen de 0 en 255 liggen" diff --git a/locale/pl.po b/locale/pl.po index f1cf6f9604..d0b725ade5 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -1760,6 +1760,10 @@ msgstr "" msgid "No space left on device" msgstr "Brak miejsca" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Brak pliku/katalogu" @@ -1867,6 +1871,10 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "W danym momencie przezroczysty może być tylko jeden kolor" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" @@ -2532,10 +2540,6 @@ msgstr "Zły typ magistrali wyświetlaczy" msgid "Unsupported format" msgstr "Zły format" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Zła operacja" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" @@ -4654,6 +4658,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "Unsupported operation" +#~ msgstr "Zła operacja" + #~ msgid "Brightness must be between 0 and 255" #~ msgstr "Jasność musi być pomiędzy 0 a 255" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 43ad72c6c0..06e8f706c4 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -1790,6 +1790,10 @@ msgstr "Não há pulldown no pino; É recomendável utilizar um resistor de 1M o msgid "No space left on device" msgstr "Não resta espaço no dispositivo" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Este arquivo/diretório não existe" @@ -1902,6 +1906,10 @@ msgstr "Apenas um alarme alarm.time pode ser definido." msgid "Only one color can be transparent at a time" msgstr "Apenas uma cor pode ser transparente de cada vez" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "A operação ou o recurso não é suportado" @@ -2596,10 +2604,6 @@ msgstr "Não há suporte para o tipo do display bus" msgid "Unsupported format" msgstr "Formato não suportado" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Operação não suportada" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "A atualização falou" @@ -4748,6 +4752,9 @@ msgstr "zi deve ser de um tipo float" msgid "zi must be of shape (n_section, 2)" msgstr "zi deve estar na forma (n_section, 2)" +#~ msgid "Unsupported operation" +#~ msgstr "Operação não suportada" + #~ msgid "divisor must be 4" #~ msgstr "o divisor deve ser 4" diff --git a/locale/ru.po b/locale/ru.po index 95afcbcd8d..5c426cecf3 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -1787,6 +1787,10 @@ msgstr "Отсутствует подтяжка к земле на пине; Р msgid "No space left on device" msgstr "На устройстве не осталось свободного места" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Файл/директория не существует" @@ -1898,6 +1902,10 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" @@ -2570,10 +2578,6 @@ msgstr "" msgid "Unsupported format" msgstr "" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index 5ee114c3c0..33c18e3b31 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -1771,6 +1771,10 @@ msgstr "Ingen pulldown på pinnen; 1Mohm rekommenderas" msgid "No space left on device" msgstr "Inget utrymme kvar på enheten" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Ingen sådan fil/katalog" @@ -1883,6 +1887,10 @@ msgstr "Endast ett alarm.time kan ställas in." msgid "Only one color can be transparent at a time" msgstr "Bara en färg kan vara genomskinlig i taget" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "Operation eller funktion stöds inte" @@ -2567,10 +2575,6 @@ msgstr "Busstyp för display stöds inte" msgid "Unsupported format" msgstr "Formatet stöds inte" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Åtgärd som inte stöds" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "Uppdateringen misslyckades" @@ -4705,6 +4709,9 @@ msgstr "zi måste vara av typ float" msgid "zi must be of shape (n_section, 2)" msgstr "zi måste vara i formen (n_section, 2)" +#~ msgid "Unsupported operation" +#~ msgstr "Åtgärd som inte stöds" + #~ msgid "divisor must be 4" #~ msgstr "divisor måste vara 4" diff --git a/locale/tr.po b/locale/tr.po index ab5c85bab4..ecaf732da0 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -1766,6 +1766,10 @@ msgstr "" msgid "No space left on device" msgstr "" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "" @@ -1873,6 +1877,10 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" @@ -2541,10 +2549,6 @@ msgstr "" msgid "Unsupported format" msgstr "" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index c4218c29e4..63c27e3a1f 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -1784,6 +1784,10 @@ msgstr "Yǐn jiǎo shàng méiyǒu xiàlā; 1Mohm tuījiàn" msgid "No space left on device" msgstr "Shèbèi shàng méiyǒu kònggé" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Méiyǒu cǐ lèi wénjiàn/mùlù" @@ -1896,6 +1900,10 @@ msgstr "zhǐ néng shè zhì yí gè bào jǐng." msgid "Only one color can be transparent at a time" msgstr "Yīcì zhǐ néng yǒuyī zhǒng yánsè shì tòumíng de" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "bù zhī chí cāo zuò huò gōng néng" @@ -2578,10 +2586,6 @@ msgstr "Bù zhīchí de gōnggòng qìchē lèixíng" msgid "Unsupported format" msgstr "Bù zhīchí de géshì" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Bù zhīchí de cāozuò" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "gēng xīn shī bài" @@ -4717,6 +4721,9 @@ msgstr "zi bìxū wèi fú diǎn xíng" msgid "zi must be of shape (n_section, 2)" msgstr "zi bìxū jùyǒu xíngzhuàng (n_section,2)" +#~ msgid "Unsupported operation" +#~ msgstr "Bù zhīchí de cāozuò" + #~ msgid "divisor must be 4" #~ msgstr "èr chóng zòu bì xū shì 4" From e7735a363150142c2dd530063f115d140a3126c7 Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Thu, 28 Apr 2022 13:41:34 +0200 Subject: [PATCH 045/246] Add new board pewpew_lcd --- .gitmodules | 3 + frozen/pew-pewpew-lcd | 1 + ports/atmel-samd/boards/pewpew_lcd/board.c | 104 ++++++++++++++++++ .../boards/pewpew_lcd/mpconfigboard.h | 16 +++ .../boards/pewpew_lcd/mpconfigboard.mk | 57 ++++++++++ ports/atmel-samd/boards/pewpew_lcd/pins.c | 28 +++++ 6 files changed, 209 insertions(+) create mode 160000 frozen/pew-pewpew-lcd create mode 100644 ports/atmel-samd/boards/pewpew_lcd/board.c create mode 100644 ports/atmel-samd/boards/pewpew_lcd/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/pewpew_lcd/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/pewpew_lcd/pins.c diff --git a/.gitmodules b/.gitmodules index 9a10cc21e2..93eed8c4c3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -286,3 +286,6 @@ [submodule "frozen/Adafruit_CircuitPython_FakeRequests"] path = frozen/Adafruit_CircuitPython_FakeRequests url = https://github.com/adafruit/Adafruit_CircuitPython_FakeRequests.git +[submodule "frozen/pew-pewpew-lcd"] + path = frozen/pew-pewpew-lcd + url = https://github.com/pypewpew/pew-pewpew-lcd.git diff --git a/frozen/pew-pewpew-lcd b/frozen/pew-pewpew-lcd new file mode 160000 index 0000000000..837f3e5f16 --- /dev/null +++ b/frozen/pew-pewpew-lcd @@ -0,0 +1 @@ +Subproject commit 837f3e5f16accae5b3677954921b5ddd517f0799 diff --git a/ports/atmel-samd/boards/pewpew_lcd/board.c b/ports/atmel-samd/boards/pewpew_lcd/board.c new file mode 100644 index 0000000000..8198a3c83d --- /dev/null +++ b/ports/atmel-samd/boards/pewpew_lcd/board.c @@ -0,0 +1,104 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" + +#include "shared-bindings/board/__init__.h" +#include "shared-bindings/displayio/FourWire.h" +#include "shared-module/displayio/__init__.h" +#include "shared-module/displayio/mipi_constants.h" +#include "shared-bindings/busio/SPI.h" + +displayio_fourwire_obj_t board_display_obj; + +#define DELAY 0x80 + +uint8_t display_init_sequence[] = { + 0xe2, 0, // reset + 0x2f, 0, // power on + 0x80, 0, // contrast 0 + 0xa4, 0, // display normal + 0xaf, 0, // display on + 0x40, 0, // start line 0 +}; + +void board_init(void) { + busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus; + common_hal_busio_spi_construct(spi, &pin_PA23, &pin_PA22, NULL, false); + common_hal_busio_spi_never_reset(spi); + + displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus; + bus->base.type = &displayio_fourwire_type; + common_hal_displayio_fourwire_construct(bus, + spi, + NULL, // Command or data + &pin_PA19, // Chip select + &pin_PA18, // Reset + 40000000LL, // Baudrate + 0, // Polarity + 0); // Phase + + displayio_display_obj_t *display = &displays[0].display; + display->base.type = &displayio_display_type; + common_hal_displayio_display_construct(display, + bus, + 96, // Width + 68, // Height + 0, // column start + 0, // row start + 180, // rotation + 1, // Color depth + true, // grayscale + false, // pixels in byte share row. Only used with depth < 8 + 1, // bytes per cell. Only valid for depths < 8 + false, // reverse_pixels_in_byte. Only valid for depths < 8 + false, // reverse_pixels_in_word + 0, // Set column command + 0, // Set row command + 0, // Write memory command + display_init_sequence, + sizeof(display_init_sequence), + NULL, // &pin_PA17, // brightness pin + NO_BRIGHTNESS_COMMAND, + 0.0f, // brightness + false, // auto_brightness + false, // single_byte_bounds + true, // data as commands + true, // auto_refresh + 2, // native_frames_per_second + true, // backlight_on_high + true); // SH1107_addressing +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} + +void board_deinit(void) { +} diff --git a/ports/atmel-samd/boards/pewpew_lcd/mpconfigboard.h b/ports/atmel-samd/boards/pewpew_lcd/mpconfigboard.h new file mode 100644 index 0000000000..4123e7a135 --- /dev/null +++ b/ports/atmel-samd/boards/pewpew_lcd/mpconfigboard.h @@ -0,0 +1,16 @@ +#define MICROPY_HW_BOARD_NAME "PewPew LCD" +#define MICROPY_HW_MCU_NAME "samd21e18" + +#define MICROPY_PORT_A (0) +#define MICROPY_PORT_B (0) +#define MICROPY_PORT_C (0) + +#define CIRCUITPY_INTERNAL_NVM_SIZE 0 +#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (48 * 1024) + +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 + +#define SAMD21_BOD33_LEVEL (6) +#define CIRCUITPY_REPL_LOGO (0) diff --git a/ports/atmel-samd/boards/pewpew_lcd/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew_lcd/mpconfigboard.mk new file mode 100644 index 0000000000..2bf4992e25 --- /dev/null +++ b/ports/atmel-samd/boards/pewpew_lcd/mpconfigboard.mk @@ -0,0 +1,57 @@ +USB_VID = 0x1209 +USB_PID = 0xD1B5 +USB_PRODUCT = "PewPew LCD" +USB_MANUFACTURER = "Radomir Dopieralski" + +CHIP_VARIANT = SAMD21E18A +CHIP_FAMILY = samd21 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = NONE + +CIRCUITPY_FULL_BUILD = 0 + +CIRCUITPY_DISPLAYIO = 1 +CIRCUITPY_TOUCHIO = 1 +CIRCUITPY_PWMIO = 1 +CIRCUITPY_MATH = 0 + +CIRCUITPY_ANALOGIO = 0 +CIRCUITPY_AUDIOBUSIO = 0 +CIRCUITPY_AUDIOBUSIO_I2SOUT = 0 +CIRCUITPY_AUDIOCORE = 0 +CIRCUITPY_AUDIOIO = 0 +CIRCUITPY_AUDIOMIXER = 0 +CIRCUITPY_AUDIOMP3 = 0 +CIRCUITPY_AUDIOPWMIO = 0 +CIRCUITPY_BITBANG_APA102 = 0 +CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BITMAPTOOLS = 0 +CIRCUITPY_BITMAPTOOLS = 0 +CIRCUITPY_BLEIO = 0 +CIRCUITPY_BUSDEVICE = 0 +CIRCUITPY_FRAMEBUFFERIO = 0 +CIRCUITPY_FREQUENCYIO = 0 +CIRCUITPY_I2CPERIPHERAL = 0 +CIRCUITPY_MSGPACK = 0 +CIRCUITPY_NEOPIXEL_WRITE = 0 +CIRCUITPY_NVM = 0 +CIRCUITPY_PIXELBUF = 0 +CIRCUITPY_PS2IO = 0 +CIRCUITPY_PULSEIO = 0 +CIRCUITPY_RGBMATRIX = 0 +CIRCUITPY_ROTARYIO = 0 +CIRCUITPY_ROTARYIO = 0 +CIRCUITPY_RTC = 0 +CIRCUITPY_SAMD = 0 +CIRCUITPY_ULAB = 0 +CIRCUITPY_USB_HID = 0 +CIRCUITPY_USB_MIDI = 0 +CIRCUITPY_USB_VENDOR = 0 +CIRCUITPY_VECTORIO = 0 +CIRCUITPY_RAINBOWIO = 0 + +CIRCUITPY_DISPLAY_FONT = $(TOP)/ports/atmel-samd/boards/ugame10/brutalist-6.bdf +OPTIMIZATION_FLAGS = -Os +FROZEN_MPY_DIRS += $(TOP)/frozen/pew-pewpew-lcd diff --git a/ports/atmel-samd/boards/pewpew_lcd/pins.c b/ports/atmel-samd/boards/pewpew_lcd/pins.c new file mode 100644 index 0000000000..13bcf06f4e --- /dev/null +++ b/ports/atmel-samd/boards/pewpew_lcd/pins.c @@ -0,0 +1,28 @@ +#include "shared-bindings/board/__init__.h" +#include "shared-module/displayio/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR__SCK), MP_ROM_PTR(&pin_PA23) }, + { MP_ROM_QSTR(MP_QSTR__MOSI), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR__CS), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR__RST), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR__BL), MP_ROM_PTR(&pin_PA17) }, + + { MP_ROM_QSTR(MP_QSTR__UP), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR__DOWN), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR__LEFT), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR__RIGHT), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR__O), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR__X), MP_ROM_PTR(&pin_PA07) }, + + { MP_ROM_QSTR(MP_QSTR_P1), MP_ROM_PTR(&pin_PA30) }, + { MP_ROM_QSTR(MP_QSTR_P2), MP_ROM_PTR(&pin_PA31) }, + { MP_ROM_QSTR(MP_QSTR_P3), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_P4), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_P5), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_P6), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_P7), MP_ROM_PTR(&pin_PA14) }, + + { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display)} +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From 88c331d7495a4ddaf7d9fda3814d96dfe114e771 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Tue, 10 May 2022 21:28:15 +0000 Subject: [PATCH 046/246] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (1058 of 1058 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 06e8f706c4..06287c37ed 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-05-08 16:37+0000\n" +"PO-Revision-Date: 2022-05-10 23:52+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -1792,7 +1792,7 @@ msgstr "Não resta espaço no dispositivo" #: py/moduerrno.c msgid "No such device" -msgstr "" +msgstr "Não existe tal dispositivo" #: py/moduerrno.c msgid "No such file/directory" @@ -1908,7 +1908,7 @@ msgstr "Apenas uma cor pode ser transparente de cada vez" #: py/moduerrno.c msgid "Operation not permitted" -msgstr "" +msgstr "A operação não é permitida" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" From 720d1c86f98a00ce67ff1c26461a362da859bf89 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Tue, 10 May 2022 20:44:38 +0000 Subject: [PATCH 047/246] Translated using Weblate (Swedish) Currently translated at 100.0% (1058 of 1058 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 33c18e3b31..23d29a3b90 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-05-10 08:16+0000\n" +"PO-Revision-Date: 2022-05-10 23:52+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -1773,7 +1773,7 @@ msgstr "Inget utrymme kvar på enheten" #: py/moduerrno.c msgid "No such device" -msgstr "" +msgstr "Ingen sådan enhet" #: py/moduerrno.c msgid "No such file/directory" @@ -1889,7 +1889,7 @@ msgstr "Bara en färg kan vara genomskinlig i taget" #: py/moduerrno.c msgid "Operation not permitted" -msgstr "" +msgstr "Åtgärden inte tillåten" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" From 142ed2a0242daa6ece7f8e84226d3d5501920ad5 Mon Sep 17 00:00:00 2001 From: Kong Wai Weng Date: Wed, 11 May 2022 15:18:31 +0800 Subject: [PATCH 048/246] Added Maker Feather AIoT S3. --- .../cytron_maker_feather_aiot_s3/board.c | 49 ++++++++++ .../mpconfigboard.h | 45 ++++++++++ .../mpconfigboard.mk | 20 +++++ .../cytron_maker_feather_aiot_s3/pins.c | 90 +++++++++++++++++++ .../cytron_maker_feather_aiot_s3/sdkconfig | 34 +++++++ 5 files changed, 238 insertions(+) create mode 100644 ports/espressif/boards/cytron_maker_feather_aiot_s3/board.c create mode 100644 ports/espressif/boards/cytron_maker_feather_aiot_s3/mpconfigboard.h create mode 100644 ports/espressif/boards/cytron_maker_feather_aiot_s3/mpconfigboard.mk create mode 100644 ports/espressif/boards/cytron_maker_feather_aiot_s3/pins.c create mode 100644 ports/espressif/boards/cytron_maker_feather_aiot_s3/sdkconfig diff --git a/ports/espressif/boards/cytron_maker_feather_aiot_s3/board.c b/ports/espressif/boards/cytron_maker_feather_aiot_s3/board.c new file mode 100644 index 0000000000..af35cbbe2d --- /dev/null +++ b/ports/espressif/boards/cytron_maker_feather_aiot_s3/board.c @@ -0,0 +1,49 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "components/driver/include/driver/gpio.h" +#include "components/hal/include/hal/gpio_hal.h" +#include "common-hal/microcontroller/Pin.h" + +void board_init(void) { + reset_board(); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + // Turn on VP by default. + gpio_set_direction(38, GPIO_MODE_DEF_OUTPUT); + gpio_set_level(38, true); +} + +void board_deinit(void) { +} diff --git a/ports/espressif/boards/cytron_maker_feather_aiot_s3/mpconfigboard.h b/ports/espressif/boards/cytron_maker_feather_aiot_s3/mpconfigboard.h new file mode 100644 index 0000000000..478a06c70a --- /dev/null +++ b/ports/espressif/boards/cytron_maker_feather_aiot_s3/mpconfigboard.h @@ -0,0 +1,45 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Micropython setup + +#define MICROPY_HW_BOARD_NAME "Cytron Maker Feather AIoT S3" +#define MICROPY_HW_MCU_NAME "ESP32S3" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO46) +#define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO13) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO41) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO42) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO6) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO10) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO5) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO11) +#define DEFAULT_UART_BUS_TX (&pin_GPIO4) + +#define DOUBLE_TAP_PIN (&pin_GPIO17) diff --git a/ports/espressif/boards/cytron_maker_feather_aiot_s3/mpconfigboard.mk b/ports/espressif/boards/cytron_maker_feather_aiot_s3/mpconfigboard.mk new file mode 100644 index 0000000000..4a444b3d64 --- /dev/null +++ b/ports/espressif/boards/cytron_maker_feather_aiot_s3/mpconfigboard.mk @@ -0,0 +1,20 @@ +USB_VID = 0x303A +USB_PID = 0x80F9 +USB_PRODUCT = "Cytron Maker Feather AIoT S3" +USB_MANUFACTURER = "Cytron" + +IDF_TARGET = esp32s3 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE=dio +CIRCUITPY_ESP_FLASH_FREQ=80m +CIRCUITPY_ESP_FLASH_SIZE=8MB + +# Include these Python libraries in firmware. +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel \ No newline at end of file diff --git a/ports/espressif/boards/cytron_maker_feather_aiot_s3/pins.c b/ports/espressif/boards/cytron_maker_feather_aiot_s3/pins.c new file mode 100644 index 0000000000..92e8e7cfc1 --- /dev/null +++ b/ports/espressif/boards/cytron_maker_feather_aiot_s3/pins.c @@ -0,0 +1,90 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_BOOT0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO14) }, + + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_VIN), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_VBATT), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_GPIO34) }, + { MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO37) }, + + { MP_ROM_QSTR(MP_QSTR_VP_EN), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_GPIO38) }, + + { MP_ROM_QSTR(MP_QSTR_BUZZER), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO39) }, + + { MP_ROM_QSTR(MP_QSTR_D40), MP_ROM_PTR(&pin_GPIO40) }, + + { MP_ROM_QSTR(MP_QSTR_D41), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO41) }, + + { MP_ROM_QSTR(MP_QSTR_D42), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO42) }, + + { MP_ROM_QSTR(MP_QSTR_D45), MP_ROM_PTR(&pin_GPIO45) }, + + { MP_ROM_QSTR(MP_QSTR_RGB), MP_ROM_PTR(&pin_GPIO46) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO46) }, + { MP_ROM_QSTR(MP_QSTR_D46), MP_ROM_PTR(&pin_GPIO46) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) } +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/cytron_maker_feather_aiot_s3/sdkconfig b/ports/espressif/boards/cytron_maker_feather_aiot_s3/sdkconfig new file mode 100644 index 0000000000..f508f4a67c --- /dev/null +++ b/ports/espressif/boards/cytron_maker_feather_aiot_s3/sdkconfig @@ -0,0 +1,34 @@ +CONFIG_ESP32S3_SPIRAM_SUPPORT=y +# +# SPI RAM config +# +# CONFIG_SPIRAM_MODE_QUAD is not set +CONFIG_SPIRAM_MODE_OCT=y +# CONFIG_SPIRAM_TYPE_AUTO is not set +CONFIG_SPIRAM_TYPE_ESPPSRAM64=y +CONFIG_SPIRAM_SIZE=8388608 +# end of SPI RAM config + +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +# +# PSRAM Clock and CS IO for ESP32S3 +# +CONFIG_DEFAULT_PSRAM_CS_IO=26 +# end of PSRAM Clock and CS IO for ESP32S3 + +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +CONFIG_SPIRAM_SPEED_80M=y +# CONFIG_SPIRAM_SPEED_40M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="espressif-esp32s3" +# end of LWIP From 466f2a3644d01fabc85c3454465a72ad293b8b25 Mon Sep 17 00:00:00 2001 From: Kong Wai Weng Date: Wed, 11 May 2022 15:25:32 +0800 Subject: [PATCH 049/246] Updated copyright information. --- ports/espressif/boards/cytron_maker_feather_aiot_s3/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/boards/cytron_maker_feather_aiot_s3/board.c b/ports/espressif/boards/cytron_maker_feather_aiot_s3/board.c index af35cbbe2d..5c71b80fc0 100644 --- a/ports/espressif/boards/cytron_maker_feather_aiot_s3/board.c +++ b/ports/espressif/boards/cytron_maker_feather_aiot_s3/board.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2022 Wai Weng for Cytron Technologies * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal From b9c28742beb6f2d3a1f1df5a171474baf1eff023 Mon Sep 17 00:00:00 2001 From: Kong Wai Weng Date: Wed, 11 May 2022 15:30:45 +0800 Subject: [PATCH 050/246] Added newline at the end of the file. --- .../boards/cytron_maker_feather_aiot_s3/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/boards/cytron_maker_feather_aiot_s3/mpconfigboard.mk b/ports/espressif/boards/cytron_maker_feather_aiot_s3/mpconfigboard.mk index 4a444b3d64..7a7a032e2c 100644 --- a/ports/espressif/boards/cytron_maker_feather_aiot_s3/mpconfigboard.mk +++ b/ports/espressif/boards/cytron_maker_feather_aiot_s3/mpconfigboard.mk @@ -17,4 +17,4 @@ CIRCUITPY_ESP_FLASH_FREQ=80m CIRCUITPY_ESP_FLASH_SIZE=8MB # Include these Python libraries in firmware. -FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel \ No newline at end of file +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel From e08502fa857d49ac4a55774a6c93367cac9b772d Mon Sep 17 00:00:00 2001 From: Neradoc Date: Sun, 17 Apr 2022 02:04:03 +0200 Subject: [PATCH 051/246] list frozen modules in the support matrix - fix the list of frozen modules in the board info, separate it from the builtin modules - frozen modules are listed along with the link to their repository - get the repository by running the git command in the frozen directory - frozen modules are listed at the end - they copy the style of the other modules - frozen modules in build_board_info don't need the URLs, they are filtered out --- conf.py | 8 +++-- docs/shared_bindings_matrix.py | 52 +++++++++++++++++++++++++++--- docs/static/filter.css | 17 ++++++++-- docs/static/filter.js | 4 +-- shared-bindings/support_matrix.rst | 12 +++++-- tools/build_board_info.py | 26 ++++++--------- 6 files changed, 90 insertions(+), 29 deletions(-) diff --git a/conf.py b/conf.py index df468d3d0e..c92e8bb719 100644 --- a/conf.py +++ b/conf.py @@ -53,9 +53,13 @@ subprocess.check_output(["make", "stubs"]) modules_support_matrix = shared_bindings_matrix.support_matrix_by_board() modules_support_matrix_reverse = defaultdict(list) for board, modules in modules_support_matrix.items(): - for module in modules: + for module in modules[0]: modules_support_matrix_reverse[module].append(board) -modules_support_matrix_reverse = dict((module, sorted(boards)) for module, boards in modules_support_matrix_reverse.items()) + +modules_support_matrix_reverse = dict( + (module, sorted(boards)) + for module, boards in modules_support_matrix_reverse.items() +) html_context = { 'support_matrix': modules_support_matrix, diff --git a/docs/shared_bindings_matrix.py b/docs/shared_bindings_matrix.py index 44554e1ad7..6f35e67f21 100644 --- a/docs/shared_bindings_matrix.py +++ b/docs/shared_bindings_matrix.py @@ -62,9 +62,14 @@ additional_modules = { "fontio": "CIRCUITPY_DISPLAYIO", "terminalio": "CIRCUITPY_DISPLAYIO", "adafruit_bus_device": "CIRCUITPY_BUSDEVICE", - "adafruit_pixelbuf": "CIRCUITPY_PIXELBUF" + "adafruit_pixelbuf": "CIRCUITPY_PIXELBUF", + "usb": "CIRCUITPY_USB_HOST", } +frozen_excludes = ["examples", "docs", "tests", "utils", "conf.py", "setup.py"] +"""Files and dirs at the root of a frozen directory that should be ignored. +This is the same list as in the preprocess_frozen_modules script.""" + def get_circuitpython_root_dir(): """ The path to the root './circuitpython' directory """ @@ -162,6 +167,40 @@ def get_settings_from_makefile(port_dir, board_name): return settings +def get_repository_url(directory): + contents = subprocess.run( + ["git", "remote", "get-url", "origin"], + encoding="utf-8", + errors="replace", + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + cwd=directory + ) + return contents.stdout.strip() + +def frozen_modules_from_dirs(frozen_mpy_dirs): + """ + Go through the list of frozen directories and extract the python modules. + Paths are of the type: + $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground + $(TOP)/frozen/circuitpython-stage/meowbit + Python modules are at the root of the path, and are python files or directories + containing python files. Except the ones in the frozen_excludes list. + """ + frozen_modules = [] + for frozen_path in filter(lambda x: x, frozen_mpy_dirs.split(" ")): + source_dir = get_circuitpython_root_dir() / frozen_path[7:] + url_repository = get_repository_url(source_dir) + for sub in source_dir.glob("*"): + if sub.name in frozen_excludes: + continue + if sub.name.endswith(".py"): + frozen_modules.append((sub.name[:-3], url_repository)) + continue + if next(sub.glob("**/*.py"), None): # tests if not empty + frozen_modules.append((sub.name, url_repository)) + return frozen_modules + def lookup_setting(settings, key, default=''): while True: value = settings.get(key, default) @@ -207,8 +246,14 @@ def support_matrix_by_board(use_branded_name=True): board_modules.append(base[module]['name']) board_modules.sort() + frozen_modules = [] + if "FROZEN_MPY_DIRS" in settings: + frozen_modules = frozen_modules_from_dirs(settings["FROZEN_MPY_DIRS"]) + if frozen_modules: + frozen_modules.sort() + # generate alias boards too - board_matrix = [(board_name, board_modules)] + board_matrix = [(board_name, (board_modules, frozen_modules))] if entry.name in aliases_by_board: for alias in aliases_by_board[entry.name]: if use_branded_name: @@ -216,7 +261,7 @@ def support_matrix_by_board(use_branded_name=True): alias = aliases_brand_names[alias] else: alias = alias.replace("_"," ").title() - board_matrix.append( (alias, board_modules) ) + board_matrix.append( (alias, (board_modules, frozen_modules)) ) return board_matrix # this is now a list of (board,modules) @@ -225,7 +270,6 @@ def support_matrix_by_board(use_branded_name=True): # flatmap with comprehensions boards = dict(sorted([board for matrix in mapped_exec for board in matrix])) - # print(json.dumps(boards, indent=2)) return boards if __name__ == '__main__': diff --git a/docs/static/filter.css b/docs/static/filter.css index 12efe14a40..7de9641d34 100644 --- a/docs/static/filter.css +++ b/docs/static/filter.css @@ -7,8 +7,21 @@ right: 10px; top: 4px; } -.support-matrix-table .this_module code, -.support-matrix-table .this_module span { + +.support-matrix-table .reference.external { + box-sizing: border-box; + font-weight: 700; + color: #404050; + font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", Courier, monospace; + padding: 2px 5px; + background: white; + border: 1px solid #e1e4e5; + font-size: 75%; +} + +.support-matrix-table .this_module, +.support-matrix-table .this_module.reference.external, +.support-matrix-table .this_module * { background: black; color: white; } diff --git a/docs/static/filter.js b/docs/static/filter.js index 9dc46a9eed..034c9cb463 100644 --- a/docs/static/filter.js +++ b/docs/static/filter.js @@ -44,14 +44,14 @@ $(() => { var nvisible = 0; $(".support-matrix-table tbody tr").each( (index,item) => { var name = $(item).find("td:first-child p").html(); - var modules = $(item).find("a.reference.internal"); + var modules = $(item).find("code, a.reference.external"); var matching_all = true; // list_search.forEach((sstring) => { var matching = (sstring[0] == "-"); for(var modi = 0; modi < modules.length; ++modi) { module = modules[modi]; - var mod_name = module.firstChild.firstChild.textContent; + var mod_name = module.firstChild.textContent; if(sstring[0] == "-") { if(mod_name.match(sstring.substr(1))) { matching = false; diff --git a/shared-bindings/support_matrix.rst b/shared-bindings/support_matrix.rst index 2385183c98..e007e27b47 100644 --- a/shared-bindings/support_matrix.rst +++ b/shared-bindings/support_matrix.rst @@ -4,7 +4,7 @@ Module Support Matrix - Which Modules Are Available on Which Boards =================================================================== The following table lists the available built-in modules for each CircuitPython -capable board. +capable board, as well as each :term:`frozen module` included on it. .. raw:: html @@ -21,6 +21,14 @@ capable board. {% for key, value in support_matrix|dictsort %} {{ '.. _' ~ key|replace(" ", "-") ~ ':' }} * - {{ key }} - - {{ ':py:mod:`' ~ value|join("`, :py:mod:`") ~ '`' }} + - {{ ':py:mod:`' ~ value[0]|join("`, :py:mod:`") ~ '`' }} + + {% for module in value[1] %}\ + {% if loop.index == 1 %}**Frozen Modules:** {% endif %}\ + {% if loop.index > 1 %}, {% endif %}\ + {% if module[1] %}{{ '`' ~ module[0] ~ ' <' ~ module[1] ~ '>`__' }}\ + {% else %}{{ '`' ~ module[0] ~ ' <#>`__' }}\ + {% endif %}\ + {% endfor %} {% endfor %} diff --git a/tools/build_board_info.py b/tools/build_board_info.py index 97192adee7..edef661bca 100755 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -13,14 +13,15 @@ import base64 from datetime import date from sh.contrib import git -sys.path.append("../docs") -import shared_bindings_matrix - sys.path.append("adabot") import adabot.github_requests as github -from shared_bindings_matrix import SUPPORTED_PORTS -from shared_bindings_matrix import aliases_by_board +sys.path.append("../docs") +from shared_bindings_matrix import ( + SUPPORTED_PORTS, + aliases_by_board, + support_matrix_by_board, +) BIN = ("bin",) UF2 = ("uf2",) @@ -124,20 +125,11 @@ def get_board_mapping(): extensions = extension_by_port[port] extensions = extension_by_board.get(board_path.name, extensions) aliases = aliases_by_board.get(board_path.name, []) - frozen_libraries = [] - with open(os.path.join(board_path, "mpconfigboard.mk")) as mpconfig: - frozen_lines = [ - line for line in mpconfig if line.startswith("FROZEN_MPY_DIRS") - ] - frozen_libraries.extend( - [line[line.rfind("/") + 1 :].strip() for line in frozen_lines] - ) boards[board_id] = { "port": port, "extensions": extensions, "download_count": 0, "aliases": aliases, - "frozen_libraries": frozen_libraries, } for alias in aliases: boards[alias] = { @@ -284,7 +276,7 @@ def generate_download_info(): languages = get_languages() - support_matrix = shared_bindings_matrix.support_matrix_by_board(use_branded_name=False) + support_matrix = support_matrix_by_board(use_branded_name=False) new_stable = "-" not in new_tag @@ -321,10 +313,10 @@ def generate_download_info(): new_version = { "stable": new_stable, "version": new_tag, - "modules": support_matrix[alias], + "modules": support_matrix[alias][0], "languages": languages, "extensions": board_info["extensions"], - "frozen_libraries": board_info["frozen_libraries"], + "frozen_libraries": [frozen[0] for frozen in support_matrix[alias][1]], } current_info[alias]["downloads"] = alias_info["download_count"] current_info[alias]["versions"].append(new_version) From f8922a56f96b3a8478a1fb396f46b3eb46ba8051 Mon Sep 17 00:00:00 2001 From: Neradoc Date: Wed, 4 May 2022 10:32:42 +0200 Subject: [PATCH 052/246] extract documentation URL from frozen directory README.rst --- docs/shared_bindings_matrix.py | 44 +++++++++++++++++++++++++++------- docs/static/filter.css | 2 +- 2 files changed, 36 insertions(+), 10 deletions(-) diff --git a/docs/shared_bindings_matrix.py b/docs/shared_bindings_matrix.py index 6f35e67f21..961b38370d 100644 --- a/docs/shared_bindings_matrix.py +++ b/docs/shared_bindings_matrix.py @@ -70,6 +70,9 @@ frozen_excludes = ["examples", "docs", "tests", "utils", "conf.py", "setup.py"] """Files and dirs at the root of a frozen directory that should be ignored. This is the same list as in the preprocess_frozen_modules script.""" +repository_urls = {} +"""Cache of repository URLs for frozen modules.""" + def get_circuitpython_root_dir(): """ The path to the root './circuitpython' directory """ @@ -168,15 +171,38 @@ def get_settings_from_makefile(port_dir, board_name): return settings def get_repository_url(directory): - contents = subprocess.run( - ["git", "remote", "get-url", "origin"], - encoding="utf-8", - errors="replace", - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - cwd=directory - ) - return contents.stdout.strip() + if directory in repository_urls: + return repository_urls[directory] + readme = None + for readme_path in ( + os.path.join(directory, "README.rst"), + os.path.join(os.path.dirname(directory), "README.rst") + ): + if os.path.exists(readme_path): + readme = readme_path + break + path = None + if readme: + with open(readme, "r") as fp: + for line in fp.readlines(): + if m := re.match("\s+:target:\s+(http\S+(docs.circuitpython|readthedocs)\S+)\s*", line): + path = m.group(1) + break + if m := re.search("<(http[^>]+)>", line): + path = m.group(1) + break + if path is None: + contents = subprocess.run( + ["git", "remote", "get-url", "origin"], + encoding="utf-8", + errors="replace", + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + cwd=directory + ) + path = contents.stdout.strip() + repository_urls[directory] = path + return path def frozen_modules_from_dirs(frozen_mpy_dirs): """ diff --git a/docs/static/filter.css b/docs/static/filter.css index 7de9641d34..021f850f4b 100644 --- a/docs/static/filter.css +++ b/docs/static/filter.css @@ -11,7 +11,7 @@ .support-matrix-table .reference.external { box-sizing: border-box; font-weight: 700; - color: #404050; + color: #404040; font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", Courier, monospace; padding: 2px 5px; background: white; From 3afec13e8211b64c3b52caabf6a16ac2c0947a5e Mon Sep 17 00:00:00 2001 From: Neradoc Date: Wed, 11 May 2022 14:49:29 +0200 Subject: [PATCH 053/246] add frozen submodules to CI deps for docs and website --- tools/ci_fetch_deps.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/ci_fetch_deps.py b/tools/ci_fetch_deps.py index d31b0d47aa..f8854965c5 100644 --- a/tools/ci_fetch_deps.py +++ b/tools/ci_fetch_deps.py @@ -66,14 +66,14 @@ submodules = [] if target == "test": submodules = ["extmod/", "lib/", "tools/", "extmod/ulab", "lib/berkeley-db-1.xx"] elif target == "docs": - submodules = ["extmod/ulab/"] + submodules = ["extmod/ulab/", "frozen/"] elif target == "mpy-cross-mac": submodules = ["tools/"] # for huffman elif target == "windows": # This builds one board from a number of ports so fill out a bunch of submodules submodules = ["extmod/", "lib/", "tools/", "ports/", "data/nvm.toml/"] elif target == "website": - submodules = ["tools/adabot/"] + submodules = ["tools/adabot/", "frozen/"] else: p = list(pathlib.Path(".").glob(f"ports/*/boards/{target}/mpconfigboard.mk")) if not p: From d4b02e22ae7fc7aa47e6ae46f9bd364e196ca57a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E6=B1=89=E5=AD=90=E6=B0=91?= <48112196+dahanzimin@users.noreply.github.com> Date: Thu, 12 May 2022 09:38:13 +0800 Subject: [PATCH 054/246] Thank you. I have applied for PID in espressif --- ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk b/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk index c81df98381..dbd55bc52a 100644 --- a/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk +++ b/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk @@ -1,5 +1,5 @@ -USB_VID = 0x239A -USB_PID = 0x80A8 +USB_VID = 0x303A +USB_PID = 0x80FC USB_PRODUCT = "MixGo CE" USB_MANUFACTURER = "Espressif" From cb2bf41be6bec85f655fcff9c73b8a8a646a9a56 Mon Sep 17 00:00:00 2001 From: Jonah Date: Wed, 11 May 2022 23:45:37 -0400 Subject: [PATCH 055/246] Add fetch-modules to `make help` for main makefile --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 55a35082b7..b35b5c66b9 100644 --- a/Makefile +++ b/Makefile @@ -61,6 +61,7 @@ TRANSLATE_SOURCES_EXC = -path "ports/*/build-*" \ help: @echo "Please use \`make ' where is one of" + @echo " fetch-submodules to fetch dependencies from submodules, run this right after you clone the repo" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" From 0d1740ad27ebb8589accd09262f1bc7f5e256edd Mon Sep 17 00:00:00 2001 From: SimonVail <35699287+SimonVail@users.noreply.github.com> Date: Thu, 12 May 2022 11:39:39 -0400 Subject: [PATCH 056/246] Create Lilygo-T-oi-Plus-ESP32C3 --- ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3 | 1 + 1 file changed, 1 insertion(+) create mode 100644 ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3 diff --git a/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3 b/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3 new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3 @@ -0,0 +1 @@ + From f86ebe71b6a60bbabeea15faa70e4b55a80b3278 Mon Sep 17 00:00:00 2001 From: SimonVail <35699287+SimonVail@users.noreply.github.com> Date: Thu, 12 May 2022 11:40:16 -0400 Subject: [PATCH 057/246] Delete Lilygo-T-oi-Plus-ESP32C3 --- ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3 | 1 - 1 file changed, 1 deletion(-) delete mode 100644 ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3 diff --git a/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3 b/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3 deleted file mode 100644 index 8b13789179..0000000000 --- a/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3 +++ /dev/null @@ -1 +0,0 @@ - From 35d78c135a094f12280ce7809c17ed6274cc6fd3 Mon Sep 17 00:00:00 2001 From: SimonVail <35699287+SimonVail@users.noreply.github.com> Date: Thu, 12 May 2022 11:41:29 -0400 Subject: [PATCH 058/246] Create sdkconfig --- ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/sdkconfig | 1 + 1 file changed, 1 insertion(+) create mode 100644 ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/sdkconfig diff --git a/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/sdkconfig b/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/sdkconfig new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/sdkconfig @@ -0,0 +1 @@ + From b9ea7458ab5a3034988b26efe3fcd78dce04c481 Mon Sep 17 00:00:00 2001 From: SimonVail <35699287+SimonVail@users.noreply.github.com> Date: Thu, 12 May 2022 11:41:53 -0400 Subject: [PATCH 059/246] Add files via upload --- .../boards/Lilygo-T-oi-Plus-ESP32C3/board.c | 34 ++++++++++++++++++ .../Lilygo-T-oi-Plus-ESP32C3/mpconfigboard.h | 13 +++++++ .../Lilygo-T-oi-Plus-ESP32C3/mpconfigboard.mk | 10 ++++++ .../boards/Lilygo-T-oi-Plus-ESP32C3/pins.c | 36 +++++++++++++++++++ .../boards/Lilygo-T-oi-Plus-ESP32C3/sdkconfig | 6 +++- 5 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/board.c create mode 100644 ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/mpconfigboard.h create mode 100644 ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/mpconfigboard.mk create mode 100644 ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/pins.c diff --git a/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/board.c b/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/board.c new file mode 100644 index 0000000000..13cdffc11c --- /dev/null +++ b/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/board.c @@ -0,0 +1,34 @@ +#include "shared-bindings/microcontroller/Pin.h" +#include "supervisor/board.h" + +#include "components/driver/include/driver/gpio.h" + +void board_init(void) { + +} + +bool board_requests_safe_mode(void) { + return false; +} + +bool espressif_board_reset_pin_number(gpio_num_t pin_number) { + // Pull LED down on reset rather than the default up + if (pin_number == MICROPY_HW_LED_STATUS->number) { + gpio_config_t cfg = { + .pin_bit_mask = BIT64(pin_number), + .mode = GPIO_MODE_DISABLE, + .pull_up_en = false, + .pull_down_en = true, + .intr_type = GPIO_INTR_DISABLE, + }; + gpio_config(&cfg); + return true; + } + return false; +} + +void reset_board(void) { +} + +void board_deinit(void) { +} diff --git a/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/mpconfigboard.h b/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/mpconfigboard.h new file mode 100644 index 0000000000..71987994e7 --- /dev/null +++ b/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/mpconfigboard.h @@ -0,0 +1,13 @@ +// Define board +#define MICROPY_HW_BOARD_NAME "LILYGO TTGO T-OI PLUS" +#define MICROPY_HW_MCU_NAME "ESP32-C3" + +#define MICROPY_HW_LED_STATUS (&pin_GPIO3) + +// I2C +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO18, .sda = &pin_GPIO19}} + +// UART +#define CIRCUITPY_BOARD_UART (1) +#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO21, .rx = &pin_GPIO20}} diff --git a/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/mpconfigboard.mk b/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/mpconfigboard.mk new file mode 100644 index 0000000000..21cd460152 --- /dev/null +++ b/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/mpconfigboard.mk @@ -0,0 +1,10 @@ +CIRCUITPY_CREATOR_ID = 0xC3C30000 +CIRCUITPY_CREATION_ID = 0x00C30001 + +IDF_TARGET = esp32c3 + +INTERNAL_FLASH_FILESYSTEM = 1 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB \ No newline at end of file diff --git a/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/pins.c b/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/pins.c new file mode 100644 index 0000000000..668c76b186 --- /dev/null +++ b/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/pins.c @@ -0,0 +1,36 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_IO20), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_IO19), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/sdkconfig b/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/sdkconfig index 8b13789179..7c85db8776 100644 --- a/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/sdkconfig +++ b/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/sdkconfig @@ -1 +1,5 @@ - +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="LILYGO TTGO T-OI PLUS" +# end of LWIP From b6e6ee7505ba3ad87d7f87dc216ab85a561fe446 Mon Sep 17 00:00:00 2001 From: SimonVail <35699287+SimonVail@users.noreply.github.com> Date: Thu, 12 May 2022 11:57:44 -0400 Subject: [PATCH 060/246] Update ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/mpconfigboard.mk Co-authored-by: Neradoc --- .../espressif/boards/Lilygo-T-oi-Plus-ESP32C3/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/mpconfigboard.mk b/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/mpconfigboard.mk index 21cd460152..d40c9b6722 100644 --- a/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/mpconfigboard.mk +++ b/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/mpconfigboard.mk @@ -7,4 +7,4 @@ INTERNAL_FLASH_FILESYSTEM = 1 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 80m -CIRCUITPY_ESP_FLASH_SIZE = 4MB \ No newline at end of file +CIRCUITPY_ESP_FLASH_SIZE = 4MB From 6908f5a97efca64285c77b6a5e77e579d3e452e3 Mon Sep 17 00:00:00 2001 From: SimonVail <35699287+SimonVail@users.noreply.github.com> Date: Thu, 12 May 2022 11:57:52 -0400 Subject: [PATCH 061/246] Update ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/board.c Co-authored-by: Neradoc --- ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/board.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/board.c b/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/board.c index 13cdffc11c..a5f8a704b0 100644 --- a/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/board.c +++ b/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/board.c @@ -4,7 +4,6 @@ #include "components/driver/include/driver/gpio.h" void board_init(void) { - } bool board_requests_safe_mode(void) { From 6fe728a9d26b82d224d1f39fb0a127e16a4ad0b8 Mon Sep 17 00:00:00 2001 From: SimonVail <35699287+SimonVail@users.noreply.github.com> Date: Thu, 12 May 2022 11:57:59 -0400 Subject: [PATCH 062/246] Update ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/pins.c Co-authored-by: Neradoc --- ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/pins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/pins.c b/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/pins.c index 668c76b186..12f146ba39 100644 --- a/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/pins.c +++ b/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/pins.c @@ -22,7 +22,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_IO19), MP_ROM_PTR(&pin_GPIO19) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO18) }, { MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) }, - + { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, { MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, { MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, From 0b586e9c9497c48b98782a653ec8d6a2fe89461b Mon Sep 17 00:00:00 2001 From: SimonVail <35699287+SimonVail@users.noreply.github.com> Date: Thu, 12 May 2022 12:43:52 -0400 Subject: [PATCH 063/246] Update board.c --- .../boards/Lilygo-T-oi-Plus-ESP32C3/board.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/board.c b/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/board.c index a5f8a704b0..aa0cf7657a 100644 --- a/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/board.c +++ b/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/board.c @@ -10,22 +10,6 @@ bool board_requests_safe_mode(void) { return false; } -bool espressif_board_reset_pin_number(gpio_num_t pin_number) { - // Pull LED down on reset rather than the default up - if (pin_number == MICROPY_HW_LED_STATUS->number) { - gpio_config_t cfg = { - .pin_bit_mask = BIT64(pin_number), - .mode = GPIO_MODE_DISABLE, - .pull_up_en = false, - .pull_down_en = true, - .intr_type = GPIO_INTR_DISABLE, - }; - gpio_config(&cfg); - return true; - } - return false; -} - void reset_board(void) { } From 6903faee5f3f1b4be5a367cd83495b4eac44b34c Mon Sep 17 00:00:00 2001 From: SimonVail <35699287+SimonVail@users.noreply.github.com> Date: Thu, 12 May 2022 12:48:55 -0400 Subject: [PATCH 064/246] Add files via upload --- tools/build_board_info.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/build_board_info.py b/tools/build_board_info.py index 97192adee7..34f751d6c2 100755 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -75,6 +75,7 @@ extension_by_board = { "espressif_esp32c3_devkitm_1_n4": BIN, "lilygo_ttgo_t-01c3": BIN, "microdev_micro_c3": BIN, + "lilygo_ttgo_t-oi_plus":BIN, # broadcom "raspberrypi_zero": KERNEL_IMG, "raspberrypi_zero_w": KERNEL_IMG, From 5a014e62a3f6af777204e163f4f484c239952e4c Mon Sep 17 00:00:00 2001 From: SimonVail <35699287+SimonVail@users.noreply.github.com> Date: Thu, 12 May 2022 12:51:46 -0400 Subject: [PATCH 065/246] Update build_board_info.py --- tools/build_board_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build_board_info.py b/tools/build_board_info.py index 34f751d6c2..ac9006ca32 100755 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -75,7 +75,7 @@ extension_by_board = { "espressif_esp32c3_devkitm_1_n4": BIN, "lilygo_ttgo_t-01c3": BIN, "microdev_micro_c3": BIN, - "lilygo_ttgo_t-oi_plus":BIN, + "lilygo_ttgo_t-oi_plus": BIN, # broadcom "raspberrypi_zero": KERNEL_IMG, "raspberrypi_zero_w": KERNEL_IMG, From 4827502b98ed30e709e59129f8905beae46429a3 Mon Sep 17 00:00:00 2001 From: Alec Delaney <89490472+tekktrik@users.noreply.github.com> Date: Thu, 12 May 2022 13:05:27 -0400 Subject: [PATCH 066/246] Add additional builtins, links to CPython documentation --- docs/library/builtins.rst | 46 +++++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/docs/library/builtins.rst b/docs/library/builtins.rst index 8532dc2531..678bb2763d 100644 --- a/docs/library/builtins.rst +++ b/docs/library/builtins.rst @@ -4,11 +4,18 @@ All builtin functions and exceptions are described here. They are also available via ``builtins`` module. +For more information about built-ins, see the following CPython documentation: + +* `Builtin CPython Functions `_ +* `Builtin CPython Exceptions `_ +* `Builtin CPython Constants `_ + +.. note:: Not all of these functions, types, exceptions, and constants are turned + on in all CircuitPython ports, for space reasons. + Functions and types ------------------- -Not all of these functions and types are turned on in all CircuitPython ports, for space reasons. - .. function:: abs() .. function:: all() @@ -160,33 +167,57 @@ Not all of these functions and types are turned on in all CircuitPython ports, f Exceptions ---------- +.. exception:: ArithmeticError + .. exception:: AssertionError .. exception:: AttributeError +.. exception:: BaseException + +.. exception:: BrokenPipeError + +.. exception:: ConnectionError + +.. exception:: EOFError + .. exception:: Exception .. exception:: ImportError +.. exception:: IndentationError + .. exception:: IndexError .. exception:: KeyboardInterrupt .. exception:: KeyError +.. exception:: LookupError + .. exception:: MemoryError +.. exception:: MpyError + + Not a part of the CPython standard library + .. exception:: NameError .. exception:: NotImplementedError .. exception:: OSError +.. exception:: OverflowError + .. exception:: RuntimeError .. exception:: ReloadException `ReloadException` is used internally to deal with soft restarts. + + Not a part of the CPython standard library + +.. exception:: StopAsyncIteration .. exception:: StopIteration @@ -194,12 +225,19 @@ Exceptions .. exception:: SystemExit - |see_cpython| :py:class:`cpython:SystemExit`. +.. exception:: TimeoutError .. exception:: TypeError - |see_cpython| :py:class:`cpython:TypeError`. +.. exception:: UnicodeError .. exception:: ValueError .. exception:: ZeroDivisionError + +Constants +--------- + +.. data:: Ellipsis + +.. data:: NotImplemented From a4f505dcab08b4756c6f45ec737b2d65473531e2 Mon Sep 17 00:00:00 2001 From: SimonVail <35699287+SimonVail@users.noreply.github.com> Date: Thu, 12 May 2022 13:17:17 -0400 Subject: [PATCH 067/246] Delete ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3 directory --- .../boards/Lilygo-T-oi-Plus-ESP32C3/board.c | 17 --------- .../Lilygo-T-oi-Plus-ESP32C3/mpconfigboard.h | 13 ------- .../Lilygo-T-oi-Plus-ESP32C3/mpconfigboard.mk | 10 ------ .../boards/Lilygo-T-oi-Plus-ESP32C3/pins.c | 36 ------------------- .../boards/Lilygo-T-oi-Plus-ESP32C3/sdkconfig | 5 --- 5 files changed, 81 deletions(-) delete mode 100644 ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/board.c delete mode 100644 ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/mpconfigboard.h delete mode 100644 ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/mpconfigboard.mk delete mode 100644 ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/pins.c delete mode 100644 ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/sdkconfig diff --git a/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/board.c b/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/board.c deleted file mode 100644 index aa0cf7657a..0000000000 --- a/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/board.c +++ /dev/null @@ -1,17 +0,0 @@ -#include "shared-bindings/microcontroller/Pin.h" -#include "supervisor/board.h" - -#include "components/driver/include/driver/gpio.h" - -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} diff --git a/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/mpconfigboard.h b/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/mpconfigboard.h deleted file mode 100644 index 71987994e7..0000000000 --- a/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/mpconfigboard.h +++ /dev/null @@ -1,13 +0,0 @@ -// Define board -#define MICROPY_HW_BOARD_NAME "LILYGO TTGO T-OI PLUS" -#define MICROPY_HW_MCU_NAME "ESP32-C3" - -#define MICROPY_HW_LED_STATUS (&pin_GPIO3) - -// I2C -#define CIRCUITPY_BOARD_I2C (1) -#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO18, .sda = &pin_GPIO19}} - -// UART -#define CIRCUITPY_BOARD_UART (1) -#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO21, .rx = &pin_GPIO20}} diff --git a/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/mpconfigboard.mk b/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/mpconfigboard.mk deleted file mode 100644 index d40c9b6722..0000000000 --- a/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/mpconfigboard.mk +++ /dev/null @@ -1,10 +0,0 @@ -CIRCUITPY_CREATOR_ID = 0xC3C30000 -CIRCUITPY_CREATION_ID = 0x00C30001 - -IDF_TARGET = esp32c3 - -INTERNAL_FLASH_FILESYSTEM = 1 - -CIRCUITPY_ESP_FLASH_MODE = dio -CIRCUITPY_ESP_FLASH_FREQ = 80m -CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/pins.c b/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/pins.c deleted file mode 100644 index 12f146ba39..0000000000 --- a/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/pins.c +++ /dev/null @@ -1,36 +0,0 @@ -#include "shared-bindings/board/__init__.h" - -STATIC const mp_rom_map_elem_t board_module_globals_table[] = { - CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS - - { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_GPIO2) }, - { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO2) }, - { MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) }, - - { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, - { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, - - { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO20) }, - { MP_ROM_QSTR(MP_QSTR_IO20), MP_ROM_PTR(&pin_GPIO20) }, - { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO21) }, - { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, - - { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO3) }, - { MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) }, - - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO19) }, - { MP_ROM_QSTR(MP_QSTR_IO19), MP_ROM_PTR(&pin_GPIO19) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO18) }, - { MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) }, - - { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, - { MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, - { MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, - { MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) }, - { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, - - { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, - { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, - { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, -}; -MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/sdkconfig b/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/sdkconfig deleted file mode 100644 index 7c85db8776..0000000000 --- a/ports/espressif/boards/Lilygo-T-oi-Plus-ESP32C3/sdkconfig +++ /dev/null @@ -1,5 +0,0 @@ -# -# LWIP -# -CONFIG_LWIP_LOCAL_HOSTNAME="LILYGO TTGO T-OI PLUS" -# end of LWIP From f69a293795402e68967df404c03c26a81914c6d8 Mon Sep 17 00:00:00 2001 From: SimonVail <35699287+SimonVail@users.noreply.github.com> Date: Thu, 12 May 2022 13:18:17 -0400 Subject: [PATCH 068/246] Create sdkconfig --- ports/espressif/boards/lilygo_ttgo_t-oi-plus/sdkconfig | 1 + 1 file changed, 1 insertion(+) create mode 100644 ports/espressif/boards/lilygo_ttgo_t-oi-plus/sdkconfig diff --git a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/sdkconfig b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/sdkconfig new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/sdkconfig @@ -0,0 +1 @@ + From 6bdd128fb33a928c096fe75adb68b815e8fffe42 Mon Sep 17 00:00:00 2001 From: SimonVail <35699287+SimonVail@users.noreply.github.com> Date: Thu, 12 May 2022 13:18:39 -0400 Subject: [PATCH 069/246] Add files via upload --- .../boards/lilygo_ttgo_t-oi-plus/board.c | 34 ++++++++++++++++++ .../lilygo_ttgo_t-oi-plus/mpconfigboard.h | 13 +++++++ .../lilygo_ttgo_t-oi-plus/mpconfigboard.mk | 10 ++++++ .../boards/lilygo_ttgo_t-oi-plus/pins.c | 36 +++++++++++++++++++ .../boards/lilygo_ttgo_t-oi-plus/sdkconfig | 6 +++- 5 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 ports/espressif/boards/lilygo_ttgo_t-oi-plus/board.c create mode 100644 ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.h create mode 100644 ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.mk create mode 100644 ports/espressif/boards/lilygo_ttgo_t-oi-plus/pins.c diff --git a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/board.c b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/board.c new file mode 100644 index 0000000000..13cdffc11c --- /dev/null +++ b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/board.c @@ -0,0 +1,34 @@ +#include "shared-bindings/microcontroller/Pin.h" +#include "supervisor/board.h" + +#include "components/driver/include/driver/gpio.h" + +void board_init(void) { + +} + +bool board_requests_safe_mode(void) { + return false; +} + +bool espressif_board_reset_pin_number(gpio_num_t pin_number) { + // Pull LED down on reset rather than the default up + if (pin_number == MICROPY_HW_LED_STATUS->number) { + gpio_config_t cfg = { + .pin_bit_mask = BIT64(pin_number), + .mode = GPIO_MODE_DISABLE, + .pull_up_en = false, + .pull_down_en = true, + .intr_type = GPIO_INTR_DISABLE, + }; + gpio_config(&cfg); + return true; + } + return false; +} + +void reset_board(void) { +} + +void board_deinit(void) { +} diff --git a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.h b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.h new file mode 100644 index 0000000000..71987994e7 --- /dev/null +++ b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.h @@ -0,0 +1,13 @@ +// Define board +#define MICROPY_HW_BOARD_NAME "LILYGO TTGO T-OI PLUS" +#define MICROPY_HW_MCU_NAME "ESP32-C3" + +#define MICROPY_HW_LED_STATUS (&pin_GPIO3) + +// I2C +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO18, .sda = &pin_GPIO19}} + +// UART +#define CIRCUITPY_BOARD_UART (1) +#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO21, .rx = &pin_GPIO20}} diff --git a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.mk b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.mk new file mode 100644 index 0000000000..21cd460152 --- /dev/null +++ b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.mk @@ -0,0 +1,10 @@ +CIRCUITPY_CREATOR_ID = 0xC3C30000 +CIRCUITPY_CREATION_ID = 0x00C30001 + +IDF_TARGET = esp32c3 + +INTERNAL_FLASH_FILESYSTEM = 1 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB \ No newline at end of file diff --git a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/pins.c b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/pins.c new file mode 100644 index 0000000000..668c76b186 --- /dev/null +++ b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/pins.c @@ -0,0 +1,36 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_IO20), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_IO19), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/sdkconfig b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/sdkconfig index 8b13789179..7c85db8776 100644 --- a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/sdkconfig +++ b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/sdkconfig @@ -1 +1,5 @@ - +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="LILYGO TTGO T-OI PLUS" +# end of LWIP From c5db1280ee5f7e29e2203cb0d8e5584f4bfc9a9f Mon Sep 17 00:00:00 2001 From: SimonVail <35699287+SimonVail@users.noreply.github.com> Date: Thu, 12 May 2022 13:21:58 -0400 Subject: [PATCH 070/246] Update mpconfigboard.mk --- ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.mk b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.mk index 21cd460152..d40c9b6722 100644 --- a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.mk +++ b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.mk @@ -7,4 +7,4 @@ INTERNAL_FLASH_FILESYSTEM = 1 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 80m -CIRCUITPY_ESP_FLASH_SIZE = 4MB \ No newline at end of file +CIRCUITPY_ESP_FLASH_SIZE = 4MB From a4f4effb447918420c623f827264e233cb193bf9 Mon Sep 17 00:00:00 2001 From: Alec Delaney <89490472+tekktrik@users.noreply.github.com> Date: Thu, 12 May 2022 14:53:01 -0400 Subject: [PATCH 071/246] Update qrio documentation --- shared-bindings/qrio/__init__.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/shared-bindings/qrio/__init__.c b/shared-bindings/qrio/__init__.c index b848190d7e..e052f752b1 100644 --- a/shared-bindings/qrio/__init__.c +++ b/shared-bindings/qrio/__init__.c @@ -31,9 +31,15 @@ #include "py/obj.h" #include "py/enum.h" -//| """`qrio` module. +//| """Low-level QR code decoding //| -//| Provides the `QRDecoder` object.""" +//| Provides the `QRDecoder` object used for decoding QR codes. For more +//| information about working with QR codes, see +//| `this Learn guide `_. +//| +//| .. note:: This library only handles decoding QR codes. If you are looking +//| to generate a QR code, use the +//| `adafruit_miniqr library `_""" //| STATIC const mp_rom_map_elem_t qrio_module_globals_table[] = { From 9c0dbbab2e98720f229da620b94e0dde0f050533 Mon Sep 17 00:00:00 2001 From: Alec Delaney <89490472+tekktrik@users.noreply.github.com> Date: Thu, 12 May 2022 15:21:46 -0400 Subject: [PATCH 072/246] Add links to information for fontio --- shared-bindings/fontio/__init__.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/shared-bindings/fontio/__init__.c b/shared-bindings/fontio/__init__.c index fc5c011eb3..3aadd93a53 100644 --- a/shared-bindings/fontio/__init__.c +++ b/shared-bindings/fontio/__init__.c @@ -35,6 +35,12 @@ //| """Core font related data structures""" //| +//| .. note:: This library is intended only for low-level usage. For working with +//| fonts in CircuitPython see the +//| `adafruit_bitmap_font library `_. +//| For infromation on creating custom fonts for use in CircuitPython, see +//| `this Learn guide `_ +//| STATIC const mp_rom_map_elem_t fontio_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_fontio) }, From aa74f2132148d8fe86871afe06da325c55425825 Mon Sep 17 00:00:00 2001 From: Alec Delaney <89490472+tekktrik@users.noreply.github.com> Date: Thu, 12 May 2022 15:31:00 -0400 Subject: [PATCH 073/246] Add note about REPL in terminalio --- shared-bindings/terminalio/__init__.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/shared-bindings/terminalio/__init__.c b/shared-bindings/terminalio/__init__.c index 38313dc757..5fd1a2751a 100644 --- a/shared-bindings/terminalio/__init__.c +++ b/shared-bindings/terminalio/__init__.c @@ -38,7 +38,12 @@ //| """Displays text in a TileGrid //| //| The `terminalio` module contains classes to display a character stream on a display. The built -//| in font is available as ``terminalio.FONT``.""" +//| in font is available as ``terminalio.FONT``. +//| +//| .. note:: This module does not give access to the +//| `REPL `_. +//| +//| """ //| //| FONT: fontio.BuiltinFont //| """The built in font""" From b035277e1584ddad6a9ba2fd6b1e335675e27936 Mon Sep 17 00:00:00 2001 From: Alec Delaney <89490472+tekktrik@users.noreply.github.com> Date: Thu, 12 May 2022 15:33:11 -0400 Subject: [PATCH 074/246] Mention other hardware in microcontroller module --- shared-bindings/microcontroller/__init__.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shared-bindings/microcontroller/__init__.c b/shared-bindings/microcontroller/__init__.c index ceba9be1ba..707080cfbf 100644 --- a/shared-bindings/microcontroller/__init__.c +++ b/shared-bindings/microcontroller/__init__.c @@ -43,8 +43,9 @@ //| """Pin references and cpu functionality //| -//| The `microcontroller` module defines the pins from the perspective of the -//| microcontroller. See :py:mod:`board` for board-specific pin mappings.""" +//| The `microcontroller` module defines the pins and other bare-metal hardware +//| from the perspective of the microcontroller. See :py:mod:`board` for +//| board-specific pin mappings.""" //| //| from nvm import ByteArray //| from watchdog import WatchDogTimer From 269d51d0231cc52e49d81bb42ad76abf61e75a33 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 12 May 2022 13:18:44 -0700 Subject: [PATCH 075/246] Add two stage reset for BLE This lets the BLE stack run through the wait period after a VM run when it may be waiting for more writes due to an auto-reload. User BLE functionality will have their events stopped. Scanning and advertising is also stopped. --- main.c | 21 +++++++++++++++---- ports/espressif/common-hal/_bleio/__init__.c | 11 ++++++++++ .../espressif/common-hal/_bleio/ble_events.c | 12 +++++++++++ .../espressif/common-hal/_bleio/ble_events.h | 1 + ports/espressif/supervisor/port.c | 4 ---- ports/nrf/bluetooth/ble_drv.c | 12 +++++++++++ ports/nrf/bluetooth/ble_drv.h | 1 + ports/nrf/common-hal/_bleio/PacketBuffer.c | 6 ++++-- ports/nrf/common-hal/_bleio/__init__.c | 11 ++++++++++ ports/nrf/supervisor/port.c | 4 ---- py/gc.h | 9 ++++++-- shared-bindings/_bleio/__init__.h | 5 +++++ 12 files changed, 81 insertions(+), 16 deletions(-) diff --git a/main.c b/main.c index a3cc01d165..17fe8167f2 100644 --- a/main.c +++ b/main.c @@ -277,10 +277,10 @@ STATIC void cleanup_after_vm(supervisor_allocation *heap, mp_obj_t exception) { memorymonitor_reset(); #endif - filesystem_flush(); - stop_mp(); - free_memory(heap); - supervisor_move_memory(); + // Disable user related BLE state that uses the micropython heap. + #if CIRCUITPY_BLEIO + bleio_user_reset(); + #endif #if CIRCUITPY_CANIO common_hal_canio_reset(); @@ -297,6 +297,12 @@ STATIC void cleanup_after_vm(supervisor_allocation *heap, mp_obj_t exception) { #endif reset_port(); reset_board(); + + // Free the heap last because other modules may reference heap memory and need to shut down. + filesystem_flush(); + stop_mp(); + free_memory(heap); + supervisor_move_memory(); } STATIC void print_code_py_status_message(safe_mode_t safe_mode) { @@ -645,6 +651,12 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool first_run, bool *simulate_re // Done waiting, start the board back up. + // We delay resetting BLE until after the wait in case we're transferring + // more files over. + #if CIRCUITPY_BLEIO + bleio_reset(); + #endif + // free code allocation if unused if ((next_code_options & next_code_stickiness_situation) == 0) { free_memory(next_code_allocation); @@ -888,6 +900,7 @@ int __attribute__((used)) main(void) { serial_init(); #if CIRCUITPY_BLEIO + bleio_reset(); supervisor_bluetooth_enable_workflow(); supervisor_start_bluetooth(); #endif diff --git a/ports/espressif/common-hal/_bleio/__init__.c b/ports/espressif/common-hal/_bleio/__init__.c index 7eba47d6a1..e25f9b0ef1 100644 --- a/ports/espressif/common-hal/_bleio/__init__.c +++ b/ports/espressif/common-hal/_bleio/__init__.c @@ -42,6 +42,17 @@ // #include "common-hal/_bleio/bonding.h" #include "common-hal/_bleio/ble_events.h" +void bleio_user_reset() { + // Stop any user scanning or advertising. + common_hal_bleio_adapter_stop_scan(&common_hal_bleio_adapter_obj); + common_hal_bleio_adapter_stop_advertising(&common_hal_bleio_adapter_obj); + + ble_event_remove_heap_handlers(); + + // Maybe start advertising the BLE workflow. + supervisor_bluetooth_background(); +} + // Turn off BLE on a reset or reload. void bleio_reset() { // Set this explicitly to save data. diff --git a/ports/espressif/common-hal/_bleio/ble_events.c b/ports/espressif/common-hal/_bleio/ble_events.c index 1ccd72cb61..a072a80623 100644 --- a/ports/espressif/common-hal/_bleio/ble_events.c +++ b/ports/espressif/common-hal/_bleio/ble_events.c @@ -31,6 +31,7 @@ #include #include +#include "py/gc.h" #include "py/misc.h" #include "py/mpstate.h" #include "py/runtime.h" @@ -44,6 +45,17 @@ void ble_event_reset(void) { MP_STATE_VM(ble_event_handler_entries) = NULL; } +void ble_event_remove_heap_handlers(void) { + ble_event_handler_entry_t *it = MP_STATE_VM(ble_event_handler_entries); + while (it != NULL) { + // If the param is on the heap, then delete the handler. + if (HEAP_PTR(it->param)) { + ble_event_remove_handler(it->func, it->param); + } + it = it->next; + } +} + void ble_event_add_handler_entry(ble_event_handler_entry_t *entry, ble_gap_event_fn *func, void *param) { ble_event_handler_entry_t *it = MP_STATE_VM(ble_event_handler_entries); diff --git a/ports/espressif/common-hal/_bleio/ble_events.h b/ports/espressif/common-hal/_bleio/ble_events.h index 03ff351118..cc6c9e92f7 100644 --- a/ports/espressif/common-hal/_bleio/ble_events.h +++ b/ports/espressif/common-hal/_bleio/ble_events.h @@ -40,6 +40,7 @@ typedef struct ble_event_handler_entry { } ble_event_handler_entry_t; void ble_event_reset(void); +void ble_event_remove_heap_handlers(void); void ble_event_add_handler(ble_gap_event_fn *func, void *param); void ble_event_remove_handler(ble_gap_event_fn *func, void *param); diff --git a/ports/espressif/supervisor/port.c b/ports/espressif/supervisor/port.c index 11709eda40..bf606ad159 100644 --- a/ports/espressif/supervisor/port.c +++ b/ports/espressif/supervisor/port.c @@ -283,10 +283,6 @@ void reset_port(void) { watchdog_reset(); #endif - #if CIRCUITPY_BLEIO - bleio_reset(); - #endif - #if CIRCUITPY_WIFI wifi_reset(); #endif diff --git a/ports/nrf/bluetooth/ble_drv.c b/ports/nrf/bluetooth/ble_drv.c index f5d2f96715..cf3f9382d7 100644 --- a/ports/nrf/bluetooth/ble_drv.c +++ b/ports/nrf/bluetooth/ble_drv.c @@ -35,6 +35,7 @@ #include "nrf_sdm.h" #include "nrf_soc.h" #include "nrfx_power.h" +#include "py/gc.h" #include "py/misc.h" #include "py/mpstate.h" @@ -56,6 +57,17 @@ void ble_drv_reset() { sd_flash_operation_status = SD_FLASH_OPERATION_DONE; } +void ble_drv_remove_heap_handlers(void) { + ble_drv_evt_handler_entry_t *it = MP_STATE_VM(ble_drv_evt_handler_entries); + while (it != NULL) { + // If the param is on the heap, then delete the handler. + if (HEAP_PTR(it->param)) { + ble_drv_remove_event_handler(it->func, it->param); + } + it = it->next; + } +} + void ble_drv_add_event_handler_entry(ble_drv_evt_handler_entry_t *entry, ble_drv_evt_handler_t func, void *param) { ble_drv_evt_handler_entry_t *it = MP_STATE_VM(ble_drv_evt_handler_entries); while (it != NULL) { diff --git a/ports/nrf/bluetooth/ble_drv.h b/ports/nrf/bluetooth/ble_drv.h index e7649fceee..798e70e1fb 100644 --- a/ports/nrf/bluetooth/ble_drv.h +++ b/ports/nrf/bluetooth/ble_drv.h @@ -67,6 +67,7 @@ typedef struct ble_drv_evt_handler_entry { } ble_drv_evt_handler_entry_t; void ble_drv_reset(void); +void ble_drv_remove_heap_handlers(void); void ble_drv_add_event_handler(ble_drv_evt_handler_t func, void *param); void ble_drv_remove_event_handler(ble_drv_evt_handler_t func, void *param); diff --git a/ports/nrf/common-hal/_bleio/PacketBuffer.c b/ports/nrf/common-hal/_bleio/PacketBuffer.c index f7d35cbdb5..38dcdd9041 100644 --- a/ports/nrf/common-hal/_bleio/PacketBuffer.c +++ b/ports/nrf/common-hal/_bleio/PacketBuffer.c @@ -380,9 +380,11 @@ mp_int_t common_hal_bleio_packet_buffer_write(bleio_packet_buffer_obj_t *self, c !mp_hal_is_interrupted()) { RUN_BACKGROUND_TASKS; } + if (mp_hal_is_interrupted()) { + return -1; + } } - if (self->conn_handle == BLE_CONN_HANDLE_INVALID || - mp_hal_is_interrupted()) { + if (self->conn_handle == BLE_CONN_HANDLE_INVALID) { return -1; } diff --git a/ports/nrf/common-hal/_bleio/__init__.c b/ports/nrf/common-hal/_bleio/__init__.c index e02cf306af..1d59983896 100644 --- a/ports/nrf/common-hal/_bleio/__init__.c +++ b/ports/nrf/common-hal/_bleio/__init__.c @@ -94,6 +94,17 @@ void check_sec_status(uint8_t sec_status) { } } +void bleio_user_reset() { + // Stop any user scanning or advertising. + common_hal_bleio_adapter_stop_scan(&common_hal_bleio_adapter_obj); + common_hal_bleio_adapter_stop_advertising(&common_hal_bleio_adapter_obj); + + ble_drv_remove_heap_handlers(); + + // Maybe start advertising the BLE workflow. + supervisor_bluetooth_background(); +} + // Turn off BLE on a reset or reload. void bleio_reset() { // Set this explicitly to save data. diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 5c1139271d..0d1f71e886 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -246,10 +246,6 @@ void reset_port(void) { timers_reset(); - #if CIRCUITPY_BLEIO - bleio_reset(); - #endif - #if CIRCUITPY_WATCHDOG watchdog_reset(); #endif diff --git a/py/gc.h b/py/gc.h index ddd07fb4c0..b9036ff4ba 100644 --- a/py/gc.h +++ b/py/gc.h @@ -35,11 +35,16 @@ #define WORDS_PER_BLOCK ((MICROPY_BYTES_PER_GC_BLOCK) / MP_BYTES_PER_OBJ_WORD) #define BYTES_PER_BLOCK (MICROPY_BYTES_PER_GC_BLOCK) +#define HEAP_PTR(ptr) ( \ + MP_STATE_MEM(gc_pool_start) != 0 /* Not on the heap if it isn't inited */ \ + && ptr >= (void *)MP_STATE_MEM(gc_pool_start) /* must be above start of pool */ \ + && ptr < (void *)MP_STATE_MEM(gc_pool_end) /* must be below end of pool */ \ + ) + // ptr should be of type void* #define VERIFY_PTR(ptr) ( \ ((uintptr_t)(ptr) & (BYTES_PER_BLOCK - 1)) == 0 /* must be aligned on a block */ \ - && ptr >= (void *)MP_STATE_MEM(gc_pool_start) /* must be above start of pool */ \ - && ptr < (void *)MP_STATE_MEM(gc_pool_end) /* must be below end of pool */ \ + && HEAP_PTR(ptr) \ ) void gc_init(void *start, void *end); diff --git a/shared-bindings/_bleio/__init__.h b/shared-bindings/_bleio/__init__.h index 55b527cfa5..f34df306b7 100644 --- a/shared-bindings/_bleio/__init__.h +++ b/shared-bindings/_bleio/__init__.h @@ -54,6 +54,11 @@ extern const mp_obj_type_t mp_type_bleio_BluetoothError; extern const mp_obj_type_t mp_type_bleio_RoleError; extern const mp_obj_type_t mp_type_bleio_SecurityError; +// Resets all user created BLE state in preparation for the heap disappearing. +// It will maintain BLE workflow and connections. +void bleio_user_reset(void); + +// Completely resets the BLE stack including BLE connections. void bleio_reset(void); extern mp_obj_t bleio_set_adapter(mp_obj_t adapter_obj); From 83cd533785f29b02442e518409a1a344ffa64a4e Mon Sep 17 00:00:00 2001 From: SimonVail <35699287+SimonVail@users.noreply.github.com> Date: Thu, 12 May 2022 17:26:39 -0400 Subject: [PATCH 076/246] Update build_board_info.py --- tools/build_board_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build_board_info.py b/tools/build_board_info.py index ac9006ca32..237a310756 100755 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -75,7 +75,7 @@ extension_by_board = { "espressif_esp32c3_devkitm_1_n4": BIN, "lilygo_ttgo_t-01c3": BIN, "microdev_micro_c3": BIN, - "lilygo_ttgo_t-oi_plus": BIN, + "lilygo_ttgo_t-oi-plus": BIN, # broadcom "raspberrypi_zero": KERNEL_IMG, "raspberrypi_zero_w": KERNEL_IMG, From b1935975a2881183c3b3563f8fca193948bcac96 Mon Sep 17 00:00:00 2001 From: SimonVail <35699287+SimonVail@users.noreply.github.com> Date: Thu, 12 May 2022 17:27:48 -0400 Subject: [PATCH 077/246] Update board.c --- ports/espressif/boards/lilygo_ttgo_t-oi-plus/board.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/board.c b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/board.c index 13cdffc11c..f48c91c686 100644 --- a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/board.c +++ b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/board.c @@ -3,8 +3,7 @@ #include "components/driver/include/driver/gpio.h" -void board_init(void) { - +void board_init(void) { } bool board_requests_safe_mode(void) { From 0d92b0a155c09c90661e787c3e7192d71b6b008f Mon Sep 17 00:00:00 2001 From: SimonVail <35699287+SimonVail@users.noreply.github.com> Date: Thu, 12 May 2022 17:46:49 -0400 Subject: [PATCH 078/246] Update board.c --- .../boards/lilygo_ttgo_t-oi-plus/board.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/board.c b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/board.c index f48c91c686..aa0cf7657a 100644 --- a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/board.c +++ b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/board.c @@ -3,29 +3,13 @@ #include "components/driver/include/driver/gpio.h" -void board_init(void) { +void board_init(void) { } bool board_requests_safe_mode(void) { return false; } -bool espressif_board_reset_pin_number(gpio_num_t pin_number) { - // Pull LED down on reset rather than the default up - if (pin_number == MICROPY_HW_LED_STATUS->number) { - gpio_config_t cfg = { - .pin_bit_mask = BIT64(pin_number), - .mode = GPIO_MODE_DISABLE, - .pull_up_en = false, - .pull_down_en = true, - .intr_type = GPIO_INTR_DISABLE, - }; - gpio_config(&cfg); - return true; - } - return false; -} - void reset_board(void) { } From ef4d298ca8b633e32666c90fd0c66532ef184e90 Mon Sep 17 00:00:00 2001 From: SimonVail <35699287+SimonVail@users.noreply.github.com> Date: Thu, 12 May 2022 17:49:48 -0400 Subject: [PATCH 079/246] Update pins.c --- ports/espressif/boards/lilygo_ttgo_t-oi-plus/pins.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/pins.c b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/pins.c index 668c76b186..963115bf1c 100644 --- a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/pins.c +++ b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/pins.c @@ -2,33 +2,26 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS - { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_GPIO2) }, { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO2) }, { MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) }, - { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, - { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO20) }, { MP_ROM_QSTR(MP_QSTR_IO20), MP_ROM_PTR(&pin_GPIO20) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO21) }, { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, - { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO3) }, { MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) }, - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO19) }, { MP_ROM_QSTR(MP_QSTR_IO19), MP_ROM_PTR(&pin_GPIO19) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO18) }, { MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) }, - { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, { MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, { MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, { MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) }, { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, - { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, From 3e85cfe26bf642c7872996424918cb0c30f90400 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 12 May 2022 15:23:26 -0700 Subject: [PATCH 080/246] Fix ESP and HCI build --- devices/ble_hci/common-hal/_bleio/__init__.c | 5 +++++ ports/espressif/common-hal/_bleio/Adapter.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/devices/ble_hci/common-hal/_bleio/__init__.c b/devices/ble_hci/common-hal/_bleio/__init__.c index d8a222ecfe..a22bcfb082 100644 --- a/devices/ble_hci/common-hal/_bleio/__init__.c +++ b/devices/ble_hci/common-hal/_bleio/__init__.c @@ -57,6 +57,11 @@ bool vm_used_ble; // } // } +void bleio_user_reset() { + // HCI doesn't support the BLE workflow so just do a full reset. + bleio_reset(); +} + // Turn off BLE on a reset or reload. void bleio_reset() { // Create a UUID object for all CCCD's. diff --git a/ports/espressif/common-hal/_bleio/Adapter.c b/ports/espressif/common-hal/_bleio/Adapter.c index d72f9dbf02..943e44e7cd 100644 --- a/ports/espressif/common-hal/_bleio/Adapter.c +++ b/ports/espressif/common-hal/_bleio/Adapter.c @@ -574,6 +574,9 @@ void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool } void common_hal_bleio_adapter_stop_advertising(bleio_adapter_obj_t *self) { + if (!common_hal_bleio_adapter_get_advertising(self)) { + return; + } int err_code = ble_gap_ext_adv_stop(0); self->user_advertising = false; From e30d510192a6b110d132bca9366ed2d84d29bd85 Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Fri, 13 May 2022 11:14:48 -0400 Subject: [PATCH 081/246] Reformatting for fontio module --- shared-bindings/fontio/__init__.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/shared-bindings/fontio/__init__.c b/shared-bindings/fontio/__init__.c index 3aadd93a53..86c3bd6eb4 100644 --- a/shared-bindings/fontio/__init__.c +++ b/shared-bindings/fontio/__init__.c @@ -33,14 +33,16 @@ #include "shared-bindings/fontio/BuiltinFont.h" #include "shared-bindings/fontio/Glyph.h" -//| """Core font related data structures""" +//| """Core font related data structures //| //| .. note:: This library is intended only for low-level usage. For working with -//| fonts in CircuitPython see the -//| `adafruit_bitmap_font library `_. -//| For infromation on creating custom fonts for use in CircuitPython, see +//| fonts in CircuitPython see the `adafruit_bitmap_font library +//| `_. +//| For information on creating custom fonts for use in CircuitPython, see //| `this Learn guide `_ //| +//| """ +//| STATIC const mp_rom_map_elem_t fontio_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_fontio) }, From 78a87c3bb23ade285015386f310c19c349ae66c3 Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Fri, 13 May 2022 11:15:05 -0400 Subject: [PATCH 082/246] Added link to Learn guide for audiomp3 --- shared-bindings/audiomp3/__init__.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/shared-bindings/audiomp3/__init__.c b/shared-bindings/audiomp3/__init__.c index d6c408b143..13f02b1ea9 100644 --- a/shared-bindings/audiomp3/__init__.c +++ b/shared-bindings/audiomp3/__init__.c @@ -31,7 +31,12 @@ #include "shared-bindings/audiomp3/MP3Decoder.h" -//| """Support for MP3-compressed audio files""" +//| """Support for MP3-compressed audio files +//| +//| For more infomration about working with MP3 files in CircuitPython, +//| see `this CircuitPython Essentials Learn guide page +//| `_. +//| """ //| STATIC const mp_rom_map_elem_t audiomp3_module_globals_table[] = { From 289fdc124163e0e6fa8e4f418d7153b7349f88b9 Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Fri, 13 May 2022 11:15:26 -0400 Subject: [PATCH 083/246] Added link to library and guide for rp2pio --- ports/raspberrypi/bindings/rp2pio/__init__.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ports/raspberrypi/bindings/rp2pio/__init__.c b/ports/raspberrypi/bindings/rp2pio/__init__.c index b3b45dc923..941ede2e12 100644 --- a/ports/raspberrypi/bindings/rp2pio/__init__.c +++ b/ports/raspberrypi/bindings/rp2pio/__init__.c @@ -30,7 +30,14 @@ #include "bindings/rp2pio/StateMachine.h" #include "bindings/rp2pio/__init__.h" -//| """Hardware interface to RP2 series' programmable IO (PIO) peripheral.""" +//| """Hardware interface to RP2 series' programmable IO (PIO) peripheral. +//| +//| .. note:: This module is intended to be used with the `adafruit_pioasm library +//| `_. For an +//| introduction and guide to working with PIO in CircuitPython, see `this +//| Learn guide `_. +//| +//| """ //| //| def pins_are_sequential(pins: List[microcontroller.Pin]) -> bool: From a51b1353ea2c72323d89555523ff93c97e43cda7 Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Fri, 13 May 2022 11:24:02 -0400 Subject: [PATCH 084/246] Add link to Learn guide for alarm module --- shared-bindings/alarm/__init__.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shared-bindings/alarm/__init__.c b/shared-bindings/alarm/__init__.c index 2d532664b9..7fd14b7641 100644 --- a/shared-bindings/alarm/__init__.c +++ b/shared-bindings/alarm/__init__.c @@ -55,6 +55,9 @@ //| //| For both light sleep and deep sleep, if CircuitPython is connected to a host computer, //| maintaining the connection takes priority and power consumption may not be reduced. +//| +//| For more information about working with alarms and light/deep sleep in CircuitPython, +//| see `this Learn guide `_. //| """ //| sleep_memory: SleepMemory From 82810085b5c9059ecb7de6d1a0fddb906595f8bf Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Fri, 13 May 2022 11:47:21 -0400 Subject: [PATCH 085/246] Add note about display guide to bitmaptools --- shared-bindings/bitmaptools/__init__.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/shared-bindings/bitmaptools/__init__.c b/shared-bindings/bitmaptools/__init__.c index df6292afec..5122d039e8 100644 --- a/shared-bindings/bitmaptools/__init__.c +++ b/shared-bindings/bitmaptools/__init__.c @@ -43,7 +43,13 @@ #include "extmod/vfs_posix.h" #endif -//| """Collection of bitmap manipulation tools""" +//| """Collection of bitmap manipulation tools +//| +//| .. note:: If you're looking for information about displaying bitmaps on +//| screens in CircuitPython, see `this Learn guide +//| `_ +//| for information about using the :py:mod:`displayio` module. +//| """ //| STATIC int16_t validate_point(mp_obj_t point, int16_t default_value) { From cb3932ce29ec8883b5706513a52b19fc804f3fa7 Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Fri, 13 May 2022 11:51:30 -0400 Subject: [PATCH 086/246] Make other documentation links prettier --- shared-bindings/analogio/__init__.c | 9 ++++----- shared-bindings/board/__init__.c | 6 +++--- shared-bindings/digitalio/__init__.c | 9 ++++----- shared-bindings/displayio/__init__.c | 6 +++--- shared-bindings/neopixel_write/__init__.c | 8 ++++---- shared-bindings/pwmio/__init__.c | 5 ++--- shared-bindings/storage/__init__.c | 6 +++--- 7 files changed, 23 insertions(+), 26 deletions(-) diff --git a/shared-bindings/analogio/__init__.c b/shared-bindings/analogio/__init__.c index 89096ae9aa..eb956d0eb7 100644 --- a/shared-bindings/analogio/__init__.c +++ b/shared-bindings/analogio/__init__.c @@ -59,12 +59,11 @@ //| :py:meth:`~analogio.AnalogIn.deinit` the hardware. The last step is optional //| because CircuitPython will do it automatically after the program finishes. //| -//| For the essentials of `analogio`, see the CircuitPython Essentials -//| Learn guide: -//| https://learn.adafruit.com/circuitpython-essentials/circuitpython-analog-in +//| For the essentials of `analogio`, see the `CircuitPython Essentials +//| Learn guide `_ //| -//| For more information on using `analogio`, see this additional Learn guide: -//| https://learn.adafruit.com/circuitpython-basics-analog-inputs-and-outputs +//| For more information on using `analogio`, see `this additional Learn guide +//| `_ //| """ //| diff --git a/shared-bindings/board/__init__.c b/shared-bindings/board/__init__.c index a496ff0b9c..e4003d4f6b 100644 --- a/shared-bindings/board/__init__.c +++ b/shared-bindings/board/__init__.c @@ -47,9 +47,9 @@ //| the default pins and settings. For more information about serial communcication //| in CircuitPython, see the :mod:`busio`. //| -//| For more information regarding the typical usage of :py:mod:`board`, refer to the CircuitPython -//| Essentials Learn guide: -//| https://learn.adafruit.com/circuitpython-essentials/circuitpython-pins-and-modules +//| For more information regarding the typical usage of :py:mod:`board`, refer to the `CircuitPython +//| Essentials Learn guide +//| `_ //| //| .. warning:: The board module varies by board. The APIs documented here may or may not be //| available on a specific board.""" diff --git a/shared-bindings/digitalio/__init__.c b/shared-bindings/digitalio/__init__.c index 8bc872be99..9a9db69816 100644 --- a/shared-bindings/digitalio/__init__.c +++ b/shared-bindings/digitalio/__init__.c @@ -73,12 +73,11 @@ //| led.value = False //| time.sleep(0.1) //| -//| For the essentials of `digitalio`, see the CircuitPython Essentials -//| Learn guide: -//| https://learn.adafruit.com/circuitpython-essentials/circuitpython-digital-in-out +//| For the essentials of `digitalio`, see the `CircuitPython Essentials +//| Learn guide `_ //| -//| For more information on using `digitalio`, see this additional Learn guide: -//| https://learn.adafruit.com/circuitpython-digital-inputs-and-outputs +//| For more information on using `digitalio`, see `this additional Learn guide +//| `_ //| """ STATIC const mp_rom_map_elem_t digitalio_module_globals_table[] = { diff --git a/shared-bindings/displayio/__init__.c b/shared-bindings/displayio/__init__.c index 931ec3f77a..2e52f12e84 100644 --- a/shared-bindings/displayio/__init__.c +++ b/shared-bindings/displayio/__init__.c @@ -51,9 +51,9 @@ //| The `displayio` module contains classes to manage display output //| including synchronizing with refresh rates and partial updating. //| -//| For more a more thorugh explanation and guide for using `displayio`, please -//| refer to this Learn guide: -//| https://learn.adafruit.com/circuitpython-display-support-using-displayio +//| For more a more thorough explanation and guide for using `displayio`, please +//| refer to `this Learn guide +//| `_. //| """ //| diff --git a/shared-bindings/neopixel_write/__init__.c b/shared-bindings/neopixel_write/__init__.c index 9375beab06..94d44ebac1 100644 --- a/shared-bindings/neopixel_write/__init__.c +++ b/shared-bindings/neopixel_write/__init__.c @@ -97,11 +97,11 @@ STATIC void check_for_deinit(digitalio_digitalinout_obj_t *self) { //| //| This library is typically not used by user level code. //| -//| For more information on actually using NeoPixels, refer to the CircuitPython -//| Essentials Learn guide: https://learn.adafruit.com/circuitpython-essentials/circuitpython-neopixel +//| For more information on actually using NeoPixels, refer to the `CircuitPython +//| Essentials Learn guide `_ //| -//| For a much more thorough guide about using NeoPixels, refer to the Adadfruit NeoPixel Überguide: -//| https://learn.adafruit.com/adafruit-neopixel-uberguide +//| For a much more thorough guide about using NeoPixels, refer to the `Adafruit NeoPixel Überguide +//| `_. //| //| """ //| diff --git a/shared-bindings/pwmio/__init__.c b/shared-bindings/pwmio/__init__.c index dbe487d580..90aff45819 100644 --- a/shared-bindings/pwmio/__init__.c +++ b/shared-bindings/pwmio/__init__.c @@ -59,9 +59,8 @@ //| hardware after program completion. Use ``deinit()`` or a ``with`` statement //| to do it yourself. //| -//| For the essentials of `pwmio`, see the CircuitPython Essentials -//| Learn guide: -//| https://learn.adafruit.com/circuitpython-essentials/circuitpython-pwm +//| For the essentials of `pwmio`, see the `CircuitPython Essentials +//| Learn guide `_. //| """ //| diff --git a/shared-bindings/storage/__init__.c b/shared-bindings/storage/__init__.c index 4a3a8384b1..277c8343e0 100644 --- a/shared-bindings/storage/__init__.c +++ b/shared-bindings/storage/__init__.c @@ -42,9 +42,9 @@ //| CircuitPython does not have an OS, so this module provides this functionality //| directly. -//| For more information regarding using the `storage` module, refer to the CircuitPython -//| Essentials Learn guide: -//| https://learn.adafruit.com/circuitpython-essentials/circuitpython-storage +//| For more information regarding using the `storage` module, refer to the `CircuitPython +//| Essentials Learn guide +//| `_. //| """ //| From bc9ed81b758ced1230e9e353e61822581d621eae Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Fri, 13 May 2022 12:03:14 -0400 Subject: [PATCH 087/246] Fix builtins.rst formatting via pre-commit --- docs/library/builtins.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/library/builtins.rst b/docs/library/builtins.rst index 678bb2763d..a3be5ae16e 100644 --- a/docs/library/builtins.rst +++ b/docs/library/builtins.rst @@ -214,7 +214,7 @@ Exceptions .. exception:: ReloadException `ReloadException` is used internally to deal with soft restarts. - + Not a part of the CPython standard library .. exception:: StopAsyncIteration From ae8347f5e58c27de027863d1c504f3a0893e79e5 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 13 May 2022 12:54:46 -0400 Subject: [PATCH 088/246] add error msg for SH1107 fix --- locale/circuitpython.pot | 6 +++++- shared-bindings/displayio/Display.c | 10 ++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 3bec8b622b..ed60df4069 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -107,6 +107,10 @@ msgstr "" msgid "%q must be %d-%d" msgstr "" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" @@ -623,7 +627,7 @@ msgstr "" msgid "Buffer length must be a multiple of 512" msgstr "" -#: ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/sdioio/SDCard.c shared-bindings/floppyio/__init__.c msgid "Buffer must be a multiple of 512 bytes" msgstr "" diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index b187d1329f..11621211e0 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -170,6 +170,12 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a mp_raise_ValueError(translate("Display rotation must be in 90 degree increments")); } + const bool sh1107_addressing = args[ARG_SH1107_addressing].u_bool; + const mp_int_t color_depth = args[ARG_color_depth].u_int; + if (sh1107_addressing && color_depth != 1) { + mp_raise_ValueError_varg(translate("%q must be 1 when %q is True"), MP_QSTR_color_depth, MP_QSTR_SH1107_addressing); + } + primary_display_t *disp = allocate_display_or_raise(); displayio_display_obj_t *self = &disp->display; @@ -177,7 +183,7 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a common_hal_displayio_display_construct( self, display_bus, args[ARG_width].u_int, args[ARG_height].u_int, args[ARG_colstart].u_int, args[ARG_rowstart].u_int, rotation, - args[ARG_color_depth].u_int, args[ARG_grayscale].u_bool, + color_depth, args[ARG_grayscale].u_bool, args[ARG_pixels_in_byte_share_row].u_bool, args[ARG_bytes_per_cell].u_bool, args[ARG_reverse_pixels_in_byte].u_bool, @@ -194,7 +200,7 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a args[ARG_auto_refresh].u_bool, args[ARG_native_frames_per_second].u_int, args[ARG_backlight_on_high].u_bool, - args[ARG_SH1107_addressing].u_bool + sh1107_addressing ); return self; From fca1a9bb5f5a86ffcb68fe07c1d4f00eaabd2ad4 Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Fri, 13 May 2022 14:00:09 -0400 Subject: [PATCH 089/246] Change "library" to "module" --- shared-bindings/fontio/__init__.c | 2 +- shared-bindings/neopixel_write/__init__.c | 2 +- shared-bindings/qrio/__init__.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/shared-bindings/fontio/__init__.c b/shared-bindings/fontio/__init__.c index 86c3bd6eb4..ea1b8a628b 100644 --- a/shared-bindings/fontio/__init__.c +++ b/shared-bindings/fontio/__init__.c @@ -35,7 +35,7 @@ //| """Core font related data structures //| -//| .. note:: This library is intended only for low-level usage. For working with +//| .. note:: This module is intended only for low-level usage. For working with //| fonts in CircuitPython see the `adafruit_bitmap_font library //| `_. //| For information on creating custom fonts for use in CircuitPython, see diff --git a/shared-bindings/neopixel_write/__init__.c b/shared-bindings/neopixel_write/__init__.c index 94d44ebac1..d0234fe451 100644 --- a/shared-bindings/neopixel_write/__init__.c +++ b/shared-bindings/neopixel_write/__init__.c @@ -95,7 +95,7 @@ STATIC void check_for_deinit(digitalio_digitalinout_obj_t *self) { //| //| .. note:: //| -//| This library is typically not used by user level code. +//| This module is typically not used by user level code. //| //| For more information on actually using NeoPixels, refer to the `CircuitPython //| Essentials Learn guide `_ diff --git a/shared-bindings/qrio/__init__.c b/shared-bindings/qrio/__init__.c index e052f752b1..04c86fd1ee 100644 --- a/shared-bindings/qrio/__init__.c +++ b/shared-bindings/qrio/__init__.c @@ -37,7 +37,7 @@ //| information about working with QR codes, see //| `this Learn guide `_. //| -//| .. note:: This library only handles decoding QR codes. If you are looking +//| .. note:: This module only handles decoding QR codes. If you are looking //| to generate a QR code, use the //| `adafruit_miniqr library `_""" //| From 1f0bdad0832c51c6fbce4a1ede058a61b82658e5 Mon Sep 17 00:00:00 2001 From: SimonVail <35699287+SimonVail@users.noreply.github.com> Date: Fri, 13 May 2022 15:02:26 -0400 Subject: [PATCH 090/246] Update ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.mk Co-authored-by: Scott Shawcroft --- ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.mk b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.mk index d40c9b6722..2f66e69415 100644 --- a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.mk +++ b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.mk @@ -1,5 +1,5 @@ CIRCUITPY_CREATOR_ID = 0xC3C30000 -CIRCUITPY_CREATION_ID = 0x00C30001 +CIRCUITPY_CREATION_ID = 0x00C30002 IDF_TARGET = esp32c3 From 28b14e05e3b362cf21cf0909cb7f2c7932d9f73f Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 13 May 2022 15:45:12 -0400 Subject: [PATCH 091/246] shrink thunderpack_v12 --- ports/espressif/esp-idf | 2 +- ports/stm/boards/thunderpack_v12/mpconfigboard.mk | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/espressif/esp-idf b/ports/espressif/esp-idf index 121ddb87e5..944c01eef4 160000 --- a/ports/espressif/esp-idf +++ b/ports/espressif/esp-idf @@ -1 +1 @@ -Subproject commit 121ddb87e5130314e4fcc5e9cb260a81b7d30d36 +Subproject commit 944c01eef4fbba693f991f9d033cda3f59ca82c9 diff --git a/ports/stm/boards/thunderpack_v12/mpconfigboard.mk b/ports/stm/boards/thunderpack_v12/mpconfigboard.mk index 526415ca30..f7905f6945 100644 --- a/ports/stm/boards/thunderpack_v12/mpconfigboard.mk +++ b/ports/stm/boards/thunderpack_v12/mpconfigboard.mk @@ -14,6 +14,7 @@ EXTERNAL_FLASH_DEVICES = GD25Q16C CIRCUITPY_NVM = 1 CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_BLEIO_HCI = 0 +CIRCUITPY_ONEWIREIO = 0 CIRCUITPY_ZLIB = 0 MCU_SERIES = F4 From d2d08fc94474fbecb5a33bc42ac2cff74326872a Mon Sep 17 00:00:00 2001 From: Tod Kurt Date: Fri, 13 May 2022 16:48:13 -0700 Subject: [PATCH 092/246] fix SPI pin names qtpy esp32s3 --- .../adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h | 2 +- .../boards/adafruit_qtpy_esp32s3_nopsram/pins.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h index 388041b115..f6e51ea583 100644 --- a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h +++ b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h @@ -37,7 +37,7 @@ {.scl = &pin_GPIO40, .sda = &pin_GPIO41}} #define CIRCUITPY_BOARD_SPI (1) -#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO35, .mosi = &pin_GPIO34, .miso = &pin_GPIO36}} +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO36, .mosi = &pin_GPIO35, .miso = &pin_GPIO37}} #define CIRCUITPY_BOARD_UART (1) #define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO5, .rx = &pin_GPIO16}} diff --git a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/pins.c b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/pins.c index 0a7bcdb165..5d0a3c0baa 100644 --- a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/pins.c +++ b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/pins.c @@ -36,15 +36,15 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO16) }, { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO16) }, - { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO34) }, - { MP_ROM_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_GPIO34) }, - - { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO35) }, { MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO35) }, - { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, { MP_ROM_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_GPIO38) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO39) }, From 341941c0be65a66ebea1df7052db30cdd3f6d272 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Sat, 14 May 2022 02:37:37 +0200 Subject: [PATCH 093/246] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 4 ++++ locale/cs.po | 4 ++++ locale/de_DE.po | 4 ++++ locale/el.po | 4 ++++ locale/en_GB.po | 4 ++++ locale/es.po | 4 ++++ locale/fil.po | 4 ++++ locale/fr.po | 4 ++++ locale/hi.po | 4 ++++ locale/it_IT.po | 4 ++++ locale/ja.po | 4 ++++ locale/ko.po | 4 ++++ locale/nl.po | 4 ++++ locale/pl.po | 4 ++++ locale/pt_BR.po | 4 ++++ locale/ru.po | 4 ++++ locale/sv.po | 4 ++++ locale/tr.po | 4 ++++ locale/zh_Latn_pinyin.po | 4 ++++ 19 files changed, 76 insertions(+) diff --git a/locale/ID.po b/locale/ID.po index da7bbd0915..c16258bf52 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -113,6 +113,10 @@ msgstr "%q panjang harus >= 1" msgid "%q must be %d-%d" msgstr "%q harus %d-%d" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "%q harus <= %d" diff --git a/locale/cs.po b/locale/cs.po index 22f48b15a6..5a87f5bc06 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -112,6 +112,10 @@ msgstr "%q délka musí být >= 1" msgid "%q must be %d-%d" msgstr "%q musí být %d-%d" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "%q musí být <= %d" diff --git a/locale/de_DE.po b/locale/de_DE.po index 6c52a0e8f6..498b1fdaf4 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -115,6 +115,10 @@ msgstr "%q Länge muss >= 1 sein" msgid "%q must be %d-%d" msgstr "%q muss %d-%d sein" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "%q muss <= %d sein" diff --git a/locale/el.po b/locale/el.po index 4ecf46679d..2c21d3b972 100644 --- a/locale/el.po +++ b/locale/el.po @@ -107,6 +107,10 @@ msgstr "" msgid "%q must be %d-%d" msgstr "" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" diff --git a/locale/en_GB.po b/locale/en_GB.po index de542c4b92..399fbfd5e7 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -114,6 +114,10 @@ msgstr "%q length must be >= 1" msgid "%q must be %d-%d" msgstr "%q must be %d-%d" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" diff --git a/locale/es.po b/locale/es.po index 72cedf0de4..d1e4f3205e 100644 --- a/locale/es.po +++ b/locale/es.po @@ -116,6 +116,10 @@ msgstr "" msgid "%q must be %d-%d" msgstr "%q debe ser %d-%d" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" diff --git a/locale/fil.po b/locale/fil.po index b40891ffbb..ea43686206 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -108,6 +108,10 @@ msgstr "" msgid "%q must be %d-%d" msgstr "" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index ffe3184243..27fdb3a54a 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -116,6 +116,10 @@ msgstr "La longueur de %q doit être >= 1" msgid "%q must be %d-%d" msgstr "%q doit être %d-%d" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "%q doit être <= %d" diff --git a/locale/hi.po b/locale/hi.po index 6a4b71b40d..5f18b16a23 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -107,6 +107,10 @@ msgstr "" msgid "%q must be %d-%d" msgstr "" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 16c8264ecc..08fd145a80 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -114,6 +114,10 @@ msgstr "" msgid "%q must be %d-%d" msgstr "" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" diff --git a/locale/ja.po b/locale/ja.po index 8ff4dd0907..d5615d92f8 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -112,6 +112,10 @@ msgstr "" msgid "%q must be %d-%d" msgstr "" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index d02997cd6b..21e4bd346a 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -108,6 +108,10 @@ msgstr "" msgid "%q must be %d-%d" msgstr "" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index fc71d36d20..a2dc9ab51f 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -110,6 +110,10 @@ msgstr "" msgid "%q must be %d-%d" msgstr "" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index d0b725ade5..2b1d6ea123 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -112,6 +112,10 @@ msgstr "" msgid "%q must be %d-%d" msgstr "" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 06287c37ed..259adfde7a 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -116,6 +116,10 @@ msgstr "o comprimento %q deve ser >=1" msgid "%q must be %d-%d" msgstr "o %q deve ser %d-%d" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "%q deve ser <= %d" diff --git a/locale/ru.po b/locale/ru.po index 5c426cecf3..9b8778f71b 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -115,6 +115,10 @@ msgstr "Длинна %q должна быть >= 1" msgid "%q must be %d-%d" msgstr "%q должен быть %d-%d" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "%q должен быть <= %d" diff --git a/locale/sv.po b/locale/sv.po index 23d29a3b90..4d0763c7e0 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -115,6 +115,10 @@ msgstr "längden på %q måste vara >= 1" msgid "%q must be %d-%d" msgstr "%q måste vara %d-%d" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "%q måste vara <= %d" diff --git a/locale/tr.po b/locale/tr.po index ecaf732da0..c64c90b204 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -119,6 +119,10 @@ msgstr "%q boyutu >=1 olmalıdır" msgid "%q must be %d-%d" msgstr "%q, %d-%d olmalıdır" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "%q <= %d olmalıdır" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 63c27e3a1f..5e1b146532 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -118,6 +118,10 @@ msgstr "%q cháng dù bì xū >= 1" msgid "%q must be %d-%d" msgstr "%q bì xū wéi %d-%d" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "%q bì xū <= %d" From df024733aa1960db78d491eaafda18d514d6e98a Mon Sep 17 00:00:00 2001 From: Neradoc Date: Sat, 14 May 2022 04:10:37 +0200 Subject: [PATCH 094/246] fix readthedocs frozen modules --- .readthedocs.yml | 1 + tools/ci_fetch_deps.py | 1 + 2 files changed, 2 insertions(+) diff --git a/.readthedocs.yml b/.readthedocs.yml index 9743a70494..460ac8f5d8 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -16,6 +16,7 @@ build: submodules: include: - extmod/ulab + - frozen formats: - pdf diff --git a/tools/ci_fetch_deps.py b/tools/ci_fetch_deps.py index f8854965c5..9932d68e45 100644 --- a/tools/ci_fetch_deps.py +++ b/tools/ci_fetch_deps.py @@ -66,6 +66,7 @@ submodules = [] if target == "test": submodules = ["extmod/", "lib/", "tools/", "extmod/ulab", "lib/berkeley-db-1.xx"] elif target == "docs": + # NOTE: must match .readthedocs.yml as this script is not run by readthedocs submodules = ["extmod/ulab/", "frozen/"] elif target == "mpy-cross-mac": submodules = ["tools/"] # for huffman From 860f0b823973dc566955db5606ff11cc40435257 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Sat, 14 May 2022 01:59:39 +0000 Subject: [PATCH 095/246] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (1059 of 1059 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 259adfde7a..e9cf974632 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-05-10 23:52+0000\n" +"PO-Revision-Date: 2022-05-14 12:35+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -14,7 +14,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.12.1\n" +"X-Generator: Weblate 4.13-dev\n" #: main.c msgid "" @@ -118,7 +118,7 @@ msgstr "o %q deve ser %d-%d" #: shared-bindings/displayio/Display.c msgid "%q must be 1 when %q is True" -msgstr "" +msgstr "%q deve ser 1 quando %q for verdadeiro" #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" From 1de1460ea8dff7a7166ce5e39ab002015ee48b7b Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Sat, 14 May 2022 11:18:38 +0000 Subject: [PATCH 096/246] Translated using Weblate (Swedish) Currently translated at 100.0% (1059 of 1059 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 4d0763c7e0..80a5d6cb27 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-05-10 23:52+0000\n" +"PO-Revision-Date: 2022-05-14 12:35+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -14,7 +14,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.12.1\n" +"X-Generator: Weblate 4.13-dev\n" #: main.c msgid "" @@ -117,7 +117,7 @@ msgstr "%q måste vara %d-%d" #: shared-bindings/displayio/Display.c msgid "%q must be 1 when %q is True" -msgstr "" +msgstr "%q måste vara 1 när %q är sann" #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" From 55f1a2f9e288f457e3d1ebdd2c60b4d2cda9a110 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sat, 14 May 2022 08:54:15 -0400 Subject: [PATCH 097/246] frozen update --- frozen/Adafruit_CircuitPython_LSM6DS | 2 +- frozen/Adafruit_CircuitPython_RFM9x | 2 +- frozen/Adafruit_CircuitPython_ST7789 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frozen/Adafruit_CircuitPython_LSM6DS b/frozen/Adafruit_CircuitPython_LSM6DS index 2dfd61a0d5..3d1aab0daf 160000 --- a/frozen/Adafruit_CircuitPython_LSM6DS +++ b/frozen/Adafruit_CircuitPython_LSM6DS @@ -1 +1 @@ -Subproject commit 2dfd61a0d5ffc8048e72d24e5ecdac9a74bb2bc3 +Subproject commit 3d1aab0daf63c3b4476f73cba39cf5da49e1e4aa diff --git a/frozen/Adafruit_CircuitPython_RFM9x b/frozen/Adafruit_CircuitPython_RFM9x index 742ac7c8fb..2d8310f19d 160000 --- a/frozen/Adafruit_CircuitPython_RFM9x +++ b/frozen/Adafruit_CircuitPython_RFM9x @@ -1 +1 @@ -Subproject commit 742ac7c8fb52bb85d9fd367b60a7f80475d7ed14 +Subproject commit 2d8310f19d1bdce817df13e807b409b5b057fc21 diff --git a/frozen/Adafruit_CircuitPython_ST7789 b/frozen/Adafruit_CircuitPython_ST7789 index 5fdd62ab69..850c3dc512 160000 --- a/frozen/Adafruit_CircuitPython_ST7789 +++ b/frozen/Adafruit_CircuitPython_ST7789 @@ -1 +1 @@ -Subproject commit 5fdd62ab69fda70407644acc6f9b45681da9ef68 +Subproject commit 850c3dc512f7feae1eaad20bdc1c5e4c63c92f08 From 624a00ac4550d3b5d25de5cf0017d908cca78000 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sat, 14 May 2022 08:54:46 -0400 Subject: [PATCH 098/246] shrink circuitplayground_express_displayio --- .../boards/circuitplayground_express_displayio/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk index fd9e6cc2e6..0ae0c58b42 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk @@ -12,6 +12,7 @@ EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C" # Turn off features and optimizations for displayio build to make room for additional frozen libs. LONGINT_IMPL = NONE CIRCUITPY_KEYPAD = 0 +CIRCUITPY_ONEWIREIO = 0 CIRCUITPY_PIXELBUF = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 From bb4c63699a768f15e46150e026c39d28e064b72e Mon Sep 17 00:00:00 2001 From: Neradoc Date: Sat, 14 May 2022 16:46:09 +0200 Subject: [PATCH 099/246] Fetch the submodules in readthedocs with ci_fetch_deps.py --- .readthedocs.yml | 16 +++++++--------- tools/ci_fetch_deps.py | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index 460ac8f5d8..94ba8750b0 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -9,17 +9,15 @@ version: 2 build: - os: ubuntu-20.04 - tools: - python: "3" - -submodules: - include: - - extmod/ulab - - frozen + os: ubuntu-20.04 + tools: + python: "3" + jobs: + post_install: + - python tools/ci_fetch_deps.py docs HEAD formats: - - pdf + - pdf python: install: diff --git a/tools/ci_fetch_deps.py b/tools/ci_fetch_deps.py index 1b0f5b57dc..491d8da0e5 100644 --- a/tools/ci_fetch_deps.py +++ b/tools/ci_fetch_deps.py @@ -68,7 +68,7 @@ submodules = [] if target == "test": submodules = ["extmod/", "lib/", "tools/", "extmod/ulab", "lib/berkeley-db-1.xx"] elif target == "docs": - # NOTE: must match .readthedocs.yml as this script is not run by readthedocs + # used in .readthedocs.yml to generate RTD submodules = ["extmod/ulab/", "frozen/"] elif target == "mpy-cross-mac": submodules = ["tools/"] # for huffman From 8987bf18d02032cbe16ef1331e51bf60672d0b57 Mon Sep 17 00:00:00 2001 From: Neradoc Date: Mon, 16 May 2022 22:39:25 +0200 Subject: [PATCH 100/246] Add Winbond flash substitute to boards --- ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/monster_m4sk/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/pygamer/mpconfigboard.mk | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.mk index 1154d0bb1f..51fccc56e5 100644 --- a/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.mk @@ -7,5 +7,5 @@ CHIP_VARIANT = SAMD51J19A CHIP_FAMILY = samd51 QSPI_FLASH_FILESYSTEM = 1 -EXTERNAL_FLASH_DEVICES = GD25Q64C +EXTERNAL_FLASH_DEVICES = "GD25Q64C,W25Q64JVxQ" LONGINT_IMPL = MPZ diff --git a/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.mk b/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.mk index 86a04be87f..56dab1d788 100644 --- a/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.mk +++ b/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.mk @@ -7,5 +7,5 @@ CHIP_VARIANT = SAMD51J19A CHIP_FAMILY = samd51 QSPI_FLASH_FILESYSTEM = 1 -EXTERNAL_FLASH_DEVICES = GD25Q64C +EXTERNAL_FLASH_DEVICES = "GD25Q64C,W25Q64JVxQ" LONGINT_IMPL = MPZ diff --git a/ports/atmel-samd/boards/pygamer/mpconfigboard.mk b/ports/atmel-samd/boards/pygamer/mpconfigboard.mk index 26c3fe9d9b..578952d37d 100644 --- a/ports/atmel-samd/boards/pygamer/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pygamer/mpconfigboard.mk @@ -7,7 +7,7 @@ CHIP_VARIANT = SAMD51J19A CHIP_FAMILY = samd51 QSPI_FLASH_FILESYSTEM = 1 -EXTERNAL_FLASH_DEVICES = GD25Q64C +EXTERNAL_FLASH_DEVICES = "GD25Q64C,W25Q64JVxQ" LONGINT_IMPL = MPZ CIRCUITPY_AESIO = 0 From 4487f614042c15fd682eb326e3f9dc00d6332ab6 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 18 May 2022 11:37:13 -0400 Subject: [PATCH 101/246] Restore automatic gc_collect() after an import --- locale/circuitpython.pot | 4 ++++ py/builtinimport.c | 4 ++++ shared-module/rgbmatrix/RGBMatrix.c | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 9f4bf97a73..acf7e24b9f 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -1022,6 +1022,10 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/raspberrypi/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" diff --git a/py/builtinimport.c b/py/builtinimport.c index dbacc3d657..10539d01a4 100644 --- a/py/builtinimport.c +++ b/py/builtinimport.c @@ -455,6 +455,10 @@ STATIC mp_obj_t process_import_at_level(qstr full_mod_name, qstr level_mod_name, // not a package. This will be caught on the next iteration // because the file will not exist. } + + // Loading a module thrashes the heap significantly so we explicitly clean up + // afterwards. + gc_collect(); } if (outer_module_obj != MP_OBJ_NULL && VERIFY_PTR(MP_OBJ_TO_PTR(outer_module_obj))) { diff --git a/shared-module/rgbmatrix/RGBMatrix.c b/shared-module/rgbmatrix/RGBMatrix.c index 0bfed0aa6c..c6dbfc02b0 100644 --- a/shared-module/rgbmatrix/RGBMatrix.c +++ b/shared-module/rgbmatrix/RGBMatrix.c @@ -123,7 +123,7 @@ void common_hal_rgbmatrix_rgbmatrix_reconstruct(rgbmatrix_rgbmatrix_obj_t *self, mp_raise_ValueError(translate("Invalid argument")); break; case PROTOMATTER_ERR_MALLOC: - mp_raise_msg(&mp_type_MemoryError, NULL); + mp_raise_msg_varg(&mp_type_MemoryError, translate("Failed to allocate %q buffer"), MP_QSTR_RGBMatrix); break; default: mp_raise_msg_varg(&mp_type_RuntimeError, From a30de85d575833d4f38001fe48a65b915040dad6 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 18 May 2022 14:01:35 -0700 Subject: [PATCH 102/246] Add dotenv read support os.getenv() will use it (when available) to load variables from /.env This will also be useful when we need secrets or config for CircuitPython outside of the VM (like WiFi credentials.) Fixes #4212 --- py/circuitpy_defns.mk | 4 + py/circuitpy_mpconfig.mk | 3 + shared-bindings/dotenv/__init__.c | 105 ++++++++++++++ shared-bindings/dotenv/__init__.h | 39 ++++++ shared-bindings/os/__init__.c | 20 +++ shared-bindings/os/__init__.h | 1 + shared-module/dotenv/__init__.c | 221 ++++++++++++++++++++++++++++++ shared-module/dotenv/__init__.h | 28 ++++ shared-module/os/__init__.c | 14 ++ 9 files changed, 435 insertions(+) create mode 100644 shared-bindings/dotenv/__init__.c create mode 100644 shared-bindings/dotenv/__init__.h create mode 100644 shared-module/dotenv/__init__.c create mode 100644 shared-module/dotenv/__init__.h diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 0ae3341b3a..4d6456b258 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -158,6 +158,9 @@ endif ifeq ($(CIRCUITPY_DISPLAYIO),1) SRC_PATTERNS += displayio/% endif +ifeq ($(CIRCUITPY_DOTENV),1) +SRC_PATTERNS += dotenv/% +endif ifeq ($(CIRCUITPY_PARALLELDISPLAY),1) SRC_PATTERNS += paralleldisplay/% endif @@ -548,6 +551,7 @@ SRC_SHARED_MODULE_ALL = \ displayio/TileGrid.c \ displayio/area.c \ displayio/__init__.c \ + dotenv/__init__.c \ floppyio/__init__.c \ fontio/BuiltinFont.c \ fontio/__init__.c \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 1899541099..20691a0304 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -199,6 +199,9 @@ CFLAGS += -DCIRCUITPY_BITMAPTOOLS=$(CIRCUITPY_BITMAPTOOLS) CFLAGS += -DCIRCUITPY_FRAMEBUFFERIO=$(CIRCUITPY_FRAMEBUFFERIO) CFLAGS += -DCIRCUITPY_VECTORIO=$(CIRCUITPY_VECTORIO) +CIRCUITPY_DOTENV ?= $(CIRCUITPY_FULL_BUILD) +CFLAGS += -DCIRCUITPY_DOTENV=$(CIRCUITPY_DOTENV) + CIRCUITPY_DUALBANK ?= 0 CFLAGS += -DCIRCUITPY_DUALBANK=$(CIRCUITPY_DUALBANK) diff --git a/shared-bindings/dotenv/__init__.c b/shared-bindings/dotenv/__init__.c new file mode 100644 index 0000000000..89f6fe6792 --- /dev/null +++ b/shared-bindings/dotenv/__init__.c @@ -0,0 +1,105 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * SPDX-FileCopyrightText: Copyright (c) 2022 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include "extmod/vfs.h" +#include "lib/oofatfs/ff.h" +#include "lib/oofatfs/diskio.h" +#include "py/mpstate.h" +#include "py/obj.h" +#include "py/objstr.h" +#include "py/runtime.h" +#include "shared-bindings/dotenv/__init__.h" + +//| """Functions to manage environment variables from a .env file. +//| +//| A subset of the CPython `dotenv library `_. It does +//| not support variables or double quotes. +//| +//| The simplest way to define keys and values is to put them in single quotes. \ and ' are +//| escaped by \ in single quotes. Newlines can occur in quotes for multiline values. Comments +//| start with # and apply for the rest of the line. +//| +//| File format example: +//| +//| .. code-block:: +//| +//| key=value +//| key2 = value2 +//| 'key3' = 'value with spaces' +//| # comment +//| key4 = value3 # comment 2 +//| 'key5'=value4 +//| key=value5 # overrides the first one +//| multiline = 'hello +//| world +//| how are you?' +//| +//| """ +//| +//| import typing + +//| def get_key(dotenv_path: str, key_to_get: str) -> Optional[str]: +//| """Get the value for the given key from the given .env file. If the key occurs multiple +//| times in the file, then the last value will be returned. +//| +//| Returns None if the key isn't found or doesn't have a value.""" +//| ... +//| +STATIC mp_obj_t _dotenv_get_key(mp_obj_t path_in, mp_obj_t key_to_get_in) { + return common_hal_dotenv_get_key(mp_obj_str_get_str(path_in), + mp_obj_str_get_str(key_to_get_in)); +} +MP_DEFINE_CONST_FUN_OBJ_2(dotenv_get_key_obj, _dotenv_get_key); + +//| def load_dotenv() -> None: +//| """Does nothing in CircuitPython because os.getenv will automatically read .env when +//| available. +//| +//| Present in CircuitPython so CPython-compatible code can use it without error.""" +//| ... +//| +STATIC mp_obj_t dotenv_load_dotenv(void) { + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_0(dotenv_load_dotenv_obj, dotenv_load_dotenv); + +STATIC const mp_rom_map_elem_t dotenv_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_dotenv) }, + + { MP_ROM_QSTR(MP_QSTR_get_key), MP_ROM_PTR(&dotenv_get_key_obj) }, + { MP_ROM_QSTR(MP_QSTR_load_dotenv), MP_ROM_PTR(&dotenv_load_dotenv_obj) }, +}; + +STATIC MP_DEFINE_CONST_DICT(dotenv_module_globals, dotenv_module_globals_table); + +const mp_obj_module_t dotenv_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t *)&dotenv_module_globals, +}; + +MP_REGISTER_MODULE(MP_QSTR_dotenv, dotenv_module, CIRCUITPY_DOTENV); diff --git a/shared-bindings/dotenv/__init__.h b/shared-bindings/dotenv/__init__.h new file mode 100644 index 0000000000..18a6c280dd --- /dev/null +++ b/shared-bindings/dotenv/__init__.h @@ -0,0 +1,39 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_DOTENV___INIT___H +#define MICROPY_INCLUDED_SHARED_BINDINGS_DOTENV___INIT___H + +#include +#include + +#include "py/objtuple.h" + +#include "shared-module/dotenv/__init__.h" + +mp_obj_t common_hal_dotenv_get_key(const char *path, const char *key); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_DOTENV___INIT___H diff --git a/shared-bindings/os/__init__.c b/shared-bindings/os/__init__.c index 2daca52b85..a8545d9079 100644 --- a/shared-bindings/os/__init__.c +++ b/shared-bindings/os/__init__.c @@ -83,6 +83,25 @@ STATIC mp_obj_t os_getcwd(void) { } MP_DEFINE_CONST_FUN_OBJ_0(os_getcwd_obj, os_getcwd); +//| def getenv(key: str, default: Optional[str] = None) -> Optional[str]: +//| """Get the environment variable value for the given key or return ``default``. +//| +//| This may load values from disk so cache the result instead of calling this often.""" +//| ... +//| +STATIC mp_obj_t os_getenv(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_key, ARG_default }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_key, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_default, MP_ARG_OBJ, {.u_obj = mp_const_none} }, + }; + 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); + + return common_hal_os_getenv(mp_obj_str_get_str(args[ARG_key].u_obj), args[ARG_default].u_obj); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_KW(os_getenv_obj, 1, os_getenv); + //| def listdir(dir: str) -> str: //| """With no argument, list the current directory. Otherwise list the given directory.""" //| ... @@ -220,6 +239,7 @@ STATIC const mp_rom_map_elem_t os_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_chdir), MP_ROM_PTR(&os_chdir_obj) }, { MP_ROM_QSTR(MP_QSTR_getcwd), MP_ROM_PTR(&os_getcwd_obj) }, + { MP_ROM_QSTR(MP_QSTR_getenv), MP_ROM_PTR(&os_getenv_obj) }, { MP_ROM_QSTR(MP_QSTR_listdir), MP_ROM_PTR(&os_listdir_obj) }, { MP_ROM_QSTR(MP_QSTR_mkdir), MP_ROM_PTR(&os_mkdir_obj) }, { MP_ROM_QSTR(MP_QSTR_remove), MP_ROM_PTR(&os_remove_obj) }, diff --git a/shared-bindings/os/__init__.h b/shared-bindings/os/__init__.h index f6f0a25c93..5a27f309b4 100644 --- a/shared-bindings/os/__init__.h +++ b/shared-bindings/os/__init__.h @@ -37,6 +37,7 @@ 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); mp_obj_t common_hal_os_getcwd(void); +mp_obj_t common_hal_os_getenv(const char *key, mp_obj_t default_); mp_obj_t common_hal_os_listdir(const char *path); void common_hal_os_mkdir(const char *path); void common_hal_os_remove(const char *path); diff --git a/shared-module/dotenv/__init__.c b/shared-module/dotenv/__init__.c new file mode 100644 index 0000000000..3efec3c346 --- /dev/null +++ b/shared-module/dotenv/__init__.c @@ -0,0 +1,221 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * SPDX-FileCopyrightText: Copyright (c) 2022 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include "shared-bindings/dotenv/__init__.h" + +#include "extmod/vfs.h" +#include "extmod/vfs_fat.h" +#include "py/mpstate.h" +#include "py/objstr.h" + +STATIC uint8_t consume_spaces(FIL *active_file) { + uint8_t character = ' '; + size_t quantity_read = 1; + while (unichar_isspace(character) && quantity_read > 0) { + f_read(active_file, &character, 1, &quantity_read); + } + return character; +} + +// Starting at the start of a new line, determines if the key matches the given +// key. File pointer is left after the = after the key. +STATIC bool key_matches(FIL *active_file, const char *key) { + uint8_t character = ' '; + size_t quantity_read = 1; + character = consume_spaces(active_file); + bool quoted = false; + if (character == '\'') { + quoted = true; + f_read(active_file, &character, 1, &quantity_read); + } + size_t key_pos = 0; + bool escaped = false; + bool matches = true; + size_t key_len = strlen(key); + while (quantity_read > 0) { + if (character == '\\' && !escaped && quoted) { + escaped = true; + } else if (!escaped && quoted && character == '\'') { + quoted = false; + // Move past the quoted before breaking so we can check the validity of data past it. + f_read(active_file, &character, 1, &quantity_read); + break; + } else if (!quoted && (unichar_isspace(character) || character == '=' || character == '\n' || character == '#')) { + break; + } else { + matches = matches && key[key_pos] == character; + escaped = false; + key_pos++; + } + + f_read(active_file, &character, 1, &quantity_read); + } + if (unichar_isspace(character)) { + character = consume_spaces(active_file); + } + if (character == '=' || character == '\n' || character == '#') { + // Rewind one so the value can find it. + f_lseek(active_file, f_tell(active_file) - 1); + } else { + // We're followed by something else that is invalid syntax. + matches = false; + } + return matches && key_pos == key_len; +} + +STATIC bool next_line(FIL *active_file) { + uint8_t character = ' '; + size_t quantity_read = 1; + bool quoted = false; + bool escaped = false; + // Track comments because they last until the end of the line. + bool comment = false; + FRESULT result = FR_OK; + // Consume all characters while quoted or others up to \n. + while (result == FR_OK && quantity_read > 0 && (quoted || character != '\n')) { + if (character == '#' || comment) { + // Comments consume any escaping. + comment = true; + } else if (!escaped) { + if (character == '\'') { + quoted = !quoted; + } else if (character == '\\') { + escaped = true; + } + } else { + escaped = false; + } + result = f_read(active_file, &character, 1, &quantity_read); + } + return result == FR_OK && quantity_read > 0; +} + +STATIC mp_int_t read_value(FIL *active_file, char *value, size_t value_len) { + uint8_t character = ' '; + size_t quantity_read = 1; + // Consume spaces before = + character = consume_spaces(active_file); + if (character != '=') { + if (character == '#' || character == '\n') { + // Keys without an = after them are valid with the value None. + return 0; + } + // All other characters are invalid. + return -1; + } + character = ' '; + // Consume space after = + while (unichar_isspace(character) && quantity_read > 0) { + f_read(active_file, &character, 1, &quantity_read); + } + bool quoted = false; + if (character == '\'') { + quoted = true; + f_read(active_file, &character, 1, &quantity_read); + } + if (character == '"') { + // We don't support double quoted values. + return -1; + } + // Copy the value over. + size_t value_pos = 0; + bool escaped = false; + // Count trailing spaces so we can ignore them at the end of unquoted + // values. + size_t trailing_spaces = 0; + while (quantity_read > 0) { + // Consume the first \ if the value is quoted. + if (quoted && character == '\\' && !escaped) { + escaped = true; + // Drop this slash by short circuiting the rest of the loop. + f_read(active_file, &character, 1, &quantity_read); + continue; + } + if (quoted && !escaped && character == '\'') { + // trailing ' means the value is done. + break; + } + // Unquoted values are ended by a newline or comment. + if (!quoted && (character == '\n' || character == '#')) { + break; + } + if (!quoted && unichar_isspace(character)) { + trailing_spaces += 1; + } else { + trailing_spaces = 0; + } + escaped = false; + // Only copy the value over if we have space. Otherwise, we'll just + // count the overall length. + if (value_pos < value_len) { + value[value_pos] = character; + } + value_pos++; + f_read(active_file, &character, 1, &quantity_read); + } + + return value_pos - trailing_spaces; +} + +mp_int_t dotenv_get_key(const char *path, const char *key, char *value, mp_int_t value_len) { + FIL active_file; + FATFS *fs = &((fs_user_mount_t *)MP_STATE_VM(vfs_mount_table)->obj)->fatfs; + FRESULT result = f_open(fs, &active_file, path, FA_READ); + if (result != FR_OK) { + return -1; + } + + mp_int_t actual_value_len = -1; + bool read_ok = true; + while (read_ok) { + if (key_matches(&active_file, key)) { + actual_value_len = read_value(&active_file, value, value_len); + } + + read_ok = next_line(&active_file); + } + f_close(&active_file); + return actual_value_len; +} + +mp_obj_t common_hal_dotenv_get_key(const char *path, const char *key) { + // Use the stack for short values. Longer values will require a heap allocation after we know + // the length. + char value[64]; + mp_int_t actual_len = dotenv_get_key(path, key, value, sizeof(value)); + if (actual_len <= 0) { + return mp_const_none; + } + if ((size_t)actual_len >= sizeof(value)) { + mp_obj_str_t *str = MP_OBJ_TO_PTR(mp_obj_new_str_copy(&mp_type_str, NULL, actual_len + 1)); + dotenv_get_key(path, key, (char *)str->data, actual_len + 1); + str->hash = qstr_compute_hash(str->data, actual_len); + return MP_OBJ_FROM_PTR(str); + } + return mp_obj_new_str(value, actual_len); +} diff --git a/shared-module/dotenv/__init__.h b/shared-module/dotenv/__init__.h new file mode 100644 index 0000000000..6cfb209324 --- /dev/null +++ b/shared-module/dotenv/__init__.h @@ -0,0 +1,28 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Allocation free version that returns the full length of the value. +mp_int_t dotenv_get_key(const char *path, const char *key, char *value, mp_int_t value_len); diff --git a/shared-module/os/__init__.c b/shared-module/os/__init__.c index 89c7952671..35933ebaf6 100644 --- a/shared-module/os/__init__.c +++ b/shared-module/os/__init__.c @@ -36,6 +36,10 @@ #include "py/runtime.h" #include "shared-bindings/os/__init__.h" +#if CIRCUITPY_DOTENV +#include "shared-bindings/dotenv/__init__.h" +#endif + // This provides all VFS related OS functions so that ports can share the code // as needed. It does not provide uname. @@ -107,6 +111,16 @@ mp_obj_t common_hal_os_getcwd(void) { return mp_vfs_getcwd(); } +mp_obj_t common_hal_os_getenv(const char *key, mp_obj_t default_) { + #if CIRCUITPY_DOTENV + mp_obj_t env_obj = common_hal_dotenv_get_key("/.env", key); + if (env_obj != mp_const_none) { + return env_obj; + } + #endif + return default_; +} + mp_obj_t common_hal_os_listdir(const char *path) { mp_obj_t path_out; mp_vfs_mount_t *vfs = lookup_dir_path(path, &path_out); From a01dec1df971e8382ebaa76a0afc028f57fa4815 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 13 May 2022 15:33:43 -0400 Subject: [PATCH 103/246] message consolidation and more use of validators --- .../common-hal/_bleio/Characteristic.c | 6 +- extmod/vfs_fat.c | 35 +- extmod/vfs_fat_file.c | 2 +- locale/circuitpython.pot | 566 ++++-------------- .../common-hal/alarm/pin/PinAlarm.c | 4 +- .../common-hal/alarm/time/TimeAlarm.c | 2 +- .../atmel-samd/common-hal/analogio/AnalogIn.c | 3 +- .../common-hal/analogio/AnalogOut.c | 2 +- .../atmel-samd/common-hal/audiobusio/I2SOut.c | 2 +- .../atmel-samd/common-hal/audioio/AudioOut.c | 11 +- ports/atmel-samd/common-hal/busio/I2C.c | 12 +- ports/atmel-samd/common-hal/busio/SPI.c | 4 +- ports/atmel-samd/common-hal/busio/UART.c | 9 +- .../common-hal/frequencyio/FrequencyIn.c | 13 +- .../common-hal/i2cperipheral/I2CPeripheral.c | 3 +- .../imagecapture/ParallelImageCapture.c | 2 +- .../common-hal/microcontroller/__init__.c | 2 +- ports/atmel-samd/common-hal/ps2io/Ps2.c | 40 +- ports/atmel-samd/common-hal/ps2io/Ps2.h | 2 +- ports/atmel-samd/common-hal/pulseio/PulseIn.c | 10 +- ports/atmel-samd/common-hal/pwmio/PWMOut.c | 2 +- ports/atmel-samd/common-hal/rtc/RTC.c | 8 +- ports/atmel-samd/common-hal/touchio/TouchIn.c | 3 +- ports/broadcom/common-hal/busio/I2C.c | 2 +- ports/broadcom/common-hal/busio/SPI.c | 2 +- ports/broadcom/common-hal/busio/UART.c | 13 +- ports/cxd56/common-hal/analogio/AnalogIn.c | 7 +- ports/cxd56/common-hal/analogio/AnalogOut.c | 2 +- ports/cxd56/common-hal/busio/I2C.c | 3 +- ports/cxd56/common-hal/busio/SPI.c | 3 +- ports/cxd56/common-hal/busio/UART.c | 17 +- ports/cxd56/common-hal/camera/Camera.c | 4 +- .../cxd56/common-hal/digitalio/DigitalInOut.c | 3 +- ports/cxd56/common-hal/gnss/GNSS.c | 2 +- .../common-hal/microcontroller/__init__.c | 2 +- ports/cxd56/common-hal/pulseio/PulseIn.c | 4 +- ports/cxd56/common-hal/pwmio/PWMOut.c | 4 +- ports/cxd56/common-hal/rtc/RTC.c | 2 +- ports/cxd56/common-hal/sdioio/SDCard.c | 7 +- .../common-hal/alarm/touch/TouchAlarm.c | 3 +- .../espressif/common-hal/analogio/AnalogIn.c | 4 +- .../espressif/common-hal/analogio/AnalogOut.c | 2 +- ports/espressif/common-hal/busio/I2C.c | 2 +- ports/espressif/common-hal/busio/SPI.c | 3 +- ports/espressif/common-hal/busio/UART.c | 4 +- ports/espressif/common-hal/canio/CAN.c | 2 +- .../common-hal/frequencyio/FrequencyIn.c | 9 +- .../common-hal/i2cperipheral/I2CPeripheral.c | 5 +- .../imagecapture/ParallelImageCapture.c | 4 +- ports/espressif/common-hal/pulseio/PulseIn.c | 2 +- ports/espressif/common-hal/pwmio/PWMOut.c | 2 +- ports/espressif/common-hal/rtc/RTC.c | 2 +- ports/espressif/common-hal/touchio/TouchIn.c | 3 +- ports/espressif/common-hal/wifi/Radio.c | 7 +- .../mimxrt10xx/common-hal/analogio/AnalogIn.c | 2 +- .../common-hal/analogio/AnalogOut.c | 2 +- ports/mimxrt10xx/common-hal/busio/I2C.c | 2 +- ports/mimxrt10xx/common-hal/busio/SPI.c | 2 +- ports/mimxrt10xx/common-hal/busio/UART.c | 4 +- .../common-hal/microcontroller/__init__.c | 2 +- ports/mimxrt10xx/common-hal/pwmio/PWMOut.c | 2 +- ports/mimxrt10xx/common-hal/rtc/RTC.c | 2 +- ports/mimxrt10xx/common-hal/usb_host/Port.c | 5 +- ports/nrf/common-hal/alarm/pin/PinAlarm.c | 4 +- ports/nrf/common-hal/alarm/time/TimeAlarm.c | 2 +- ports/nrf/common-hal/analogio/AnalogIn.c | 3 +- ports/nrf/common-hal/analogio/AnalogOut.c | 2 +- ports/nrf/common-hal/audiopwmio/PWMAudioOut.c | 5 +- ports/nrf/common-hal/busio/I2C.c | 3 +- ports/nrf/common-hal/busio/UART.c | 12 +- ports/nrf/common-hal/pulseio/PulseIn.c | 4 +- ports/nrf/common-hal/pwmio/PWMOut.c | 2 +- ports/nrf/common-hal/rtc/RTC.c | 2 +- .../bindings/rp2pio/StateMachine.c | 45 +- .../common-hal/analogio/AnalogIn.c | 3 +- .../common-hal/analogio/AnalogOut.c | 2 +- ports/raspberrypi/common-hal/busio/I2C.c | 9 +- ports/raspberrypi/common-hal/busio/SPI.c | 2 +- ports/raspberrypi/common-hal/busio/UART.c | 14 +- .../raspberrypi/common-hal/pulseio/PulseIn.c | 4 +- ports/raspberrypi/common-hal/pwmio/PWMOut.c | 2 +- ports/raspberrypi/common-hal/rtc/RTC.c | 2 +- ports/stm/common-hal/alarm/time/TimeAlarm.c | 2 +- ports/stm/common-hal/analogio/AnalogIn.c | 2 +- ports/stm/common-hal/analogio/AnalogOut.c | 2 +- ports/stm/common-hal/busio/I2C.c | 6 +- ports/stm/common-hal/busio/SPI.c | 14 +- ports/stm/common-hal/busio/UART.c | 19 +- ports/stm/common-hal/canio/CAN.c | 4 +- ports/stm/common-hal/pulseio/PulseIn.c | 5 +- ports/stm/common-hal/sdioio/SDCard.c | 2 +- py/argcheck.c | 42 +- py/builtinimport.c | 2 +- py/runtime.h | 8 +- shared-bindings/_bleio/Address.c | 2 +- shared-bindings/_bleio/Characteristic.c | 8 +- shared-bindings/_bleio/CharacteristicBuffer.c | 10 +- shared-bindings/_bleio/Descriptor.c | 6 +- shared-bindings/_bleio/PacketBuffer.c | 5 +- shared-bindings/adafruit_pixelbuf/PixelBuf.c | 12 +- shared-bindings/aesio/aes.c | 13 +- shared-bindings/alarm/SleepMemory.c | 5 +- shared-bindings/analogio/AnalogOut.c | 6 +- shared-bindings/audiomixer/Mixer.c | 20 +- shared-bindings/bitbangio/I2C.c | 4 +- shared-bindings/bitbangio/SPI.c | 16 +- shared-bindings/bitops/__init__.c | 11 +- shared-bindings/busio/I2C.c | 4 +- shared-bindings/busio/SPI.c | 17 +- shared-bindings/busio/UART.c | 10 +- shared-bindings/canio/Message.c | 10 +- shared-bindings/digitalio/DigitalInOut.c | 2 +- shared-bindings/displayio/FourWire.c | 16 +- shared-bindings/displayio/Group.c | 11 +- shared-bindings/displayio/I2CDisplay.c | 7 +- shared-bindings/displayio/Shape.c | 10 +- shared-bindings/displayio/TileGrid.c | 5 +- shared-bindings/fontio/BuiltinFont.c | 5 +- .../memorymonitor/AllocationAlarm.c | 13 +- shared-bindings/microcontroller/Pin.c | 8 + shared-bindings/microcontroller/Pin.h | 2 + shared-bindings/microcontroller/__init__.c | 2 +- shared-bindings/msgpack/ExtType.c | 6 +- shared-bindings/nvm/ByteArray.c | 5 +- shared-bindings/paralleldisplay/ParallelBus.c | 6 +- shared-bindings/ps2io/Ps2.c | 12 +- shared-bindings/ps2io/Ps2.h | 2 +- shared-bindings/pwmio/PWMOut.c | 12 +- shared-bindings/rgbmatrix/RGBMatrix.c | 20 +- shared-bindings/sdioio/SDCard.c | 8 +- shared-bindings/supervisor/__init__.c | 5 +- shared-bindings/synthio/__init__.c | 6 +- shared-bindings/usb_hid/Device.c | 14 +- shared-bindings/wifi/Monitor.c | 11 +- shared-bindings/wifi/Radio.c | 12 +- shared-module/_bleio/Attribute.c | 2 +- shared-module/adafruit_pixelbuf/PixelBuf.c | 4 +- shared-module/audiocore/WaveFile.c | 10 +- shared-module/audiomixer/Mixer.c | 4 +- shared-module/audiomp3/MP3Decoder.c | 9 +- shared-module/bitbangio/SPI.c | 12 +- shared-module/displayio/Group.c | 6 +- shared-module/displayio/OnDiskBitmap.c | 2 +- .../framebufferio/FramebufferDisplay.c | 5 +- shared-module/rgbmatrix/RGBMatrix.c | 4 +- shared-module/synthio/MidiTrack.c | 14 +- shared-module/usb_hid/Device.c | 15 +- shared-module/vectorio/Circle.c | 2 +- shared-module/vectorio/Polygon.c | 7 +- shared-module/vectorio/Rectangle.c | 2 +- shared-module/vectorio/VectorShape.c | 8 +- 151 files changed, 557 insertions(+), 1035 deletions(-) diff --git a/devices/ble_hci/common-hal/_bleio/Characteristic.c b/devices/ble_hci/common-hal/_bleio/Characteristic.c index e2f9cad0ef..b6e144f191 100644 --- a/devices/ble_hci/common-hal/_bleio/Characteristic.c +++ b/devices/ble_hci/common-hal/_bleio/Characteristic.c @@ -57,9 +57,9 @@ void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self, 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) { - mp_raise_ValueError(translate("max_length must be <= 512")); - } + + mp_arg_validate_int_range(max_length, 0, max_length_max, MP_QSTR_max_length); + self->max_length = max_length; self->fixed_length = fixed_length; diff --git a/extmod/vfs_fat.c b/extmod/vfs_fat.c index 208cf101f9..ed5cc6095f 100644 --- a/extmod/vfs_fat.c +++ b/extmod/vfs_fat.c @@ -30,6 +30,11 @@ #define mp_obj_fat_vfs_t fs_user_mount_t +// Factoring this common call saves about 90 bytes. +STATIC NORETURN void mp_raise_OSError_fresult(FRESULT res) { + mp_raise_OSError(fresult_to_errno_table[res]); +} + STATIC mp_import_stat_t fat_vfs_import_stat(void *vfs_in, const char *path) { fs_user_mount_t *vfs = vfs_in; FILINFO fno; @@ -64,7 +69,7 @@ STATIC mp_obj_t fat_vfs_make_new(const mp_obj_type_t *type, size_t n_args, size_ // don't error out if no filesystem, to let mkfs()/mount() create one if wanted vfs->blockdev.flags |= MP_BLOCKDEV_FLAG_NO_FILESYSTEM; } else if (res != FR_OK) { - mp_raise_OSError(fresult_to_errno_table[res]); + mp_raise_OSError_fresult(res); } return MP_OBJ_FROM_PTR(vfs); @@ -97,7 +102,7 @@ STATIC mp_obj_t fat_vfs_mkfs(mp_obj_t bdev_in) { res = f_mkfs(&vfs->fatfs, FM_FAT32, 0, working_buf, sizeof(working_buf)); } if (res != FR_OK) { - mp_raise_OSError(fresult_to_errno_table[res]); + mp_raise_OSError_fresult(res); } return mp_const_none; @@ -172,7 +177,7 @@ STATIC mp_obj_t fat_vfs_ilistdir_func(size_t n_args, const mp_obj_t *args) { iter->is_str = is_str_type; FRESULT res = f_opendir(&self->fatfs, &iter->dir, path); if (res != FR_OK) { - mp_raise_OSError(fresult_to_errno_table[res]); + mp_raise_OSError_fresult(res); } return MP_OBJ_FROM_PTR(iter); @@ -188,7 +193,7 @@ STATIC mp_obj_t fat_vfs_remove_internal(mp_obj_t vfs_in, mp_obj_t path_in, mp_in FRESULT res = f_stat(&self->fatfs, path, &fno); if (res != FR_OK) { - mp_raise_OSError(fresult_to_errno_table[res]); + mp_raise_OSError_fresult(res); } // check if path is a file or directory @@ -196,7 +201,7 @@ STATIC mp_obj_t fat_vfs_remove_internal(mp_obj_t vfs_in, mp_obj_t path_in, mp_in res = f_unlink(&self->fatfs, path); if (res != FR_OK) { - mp_raise_OSError(fresult_to_errno_table[res]); + mp_raise_OSError_fresult(res); } return mp_const_none; } else { @@ -226,7 +231,7 @@ STATIC mp_obj_t fat_vfs_rename(mp_obj_t vfs_in, mp_obj_t path_in, mp_obj_t path_ FILINFO fno; FRESULT res = f_stat(&self->fatfs, old_path, &fno); if (res != FR_OK) { - mp_raise_OSError(fresult_to_errno_table[res]); + mp_raise_OSError_fresult(res); } if ((fno.fattrib & AM_DIR) != 0 && strlen(new_path) > strlen(old_path) && @@ -245,7 +250,7 @@ STATIC mp_obj_t fat_vfs_rename(mp_obj_t vfs_in, mp_obj_t path_in, mp_obj_t path_ if (res == FR_OK) { return mp_const_none; } else { - mp_raise_OSError(fresult_to_errno_table[res]); + mp_raise_OSError_fresult(res); } } @@ -259,7 +264,7 @@ STATIC mp_obj_t fat_vfs_mkdir(mp_obj_t vfs_in, mp_obj_t path_o) { if (res == FR_OK) { return mp_const_none; } else { - mp_raise_OSError(fresult_to_errno_table[res]); + mp_raise_OSError_fresult(res); } } STATIC MP_DEFINE_CONST_FUN_OBJ_2(fat_vfs_mkdir_obj, fat_vfs_mkdir); @@ -273,7 +278,7 @@ STATIC mp_obj_t fat_vfs_chdir(mp_obj_t vfs_in, mp_obj_t path_in) { FRESULT res = f_chdir(&self->fatfs, path); if (res != FR_OK) { - mp_raise_OSError(fresult_to_errno_table[res]); + mp_raise_OSError_fresult(res); } return mp_const_none; @@ -286,7 +291,7 @@ STATIC mp_obj_t fat_vfs_getcwd(mp_obj_t vfs_in) { char buf[MICROPY_ALLOC_PATH_MAX + 1]; FRESULT res = f_getcwd(&self->fatfs, buf, sizeof(buf)); if (res != FR_OK) { - mp_raise_OSError(fresult_to_errno_table[res]); + mp_raise_OSError_fresult(res); } return mp_obj_new_str(buf, strlen(buf)); } @@ -307,7 +312,7 @@ STATIC mp_obj_t fat_vfs_stat(mp_obj_t vfs_in, mp_obj_t path_in) { } else { FRESULT res = f_stat(&self->fatfs, path, &fno); if (res != FR_OK) { - mp_raise_OSError(fresult_to_errno_table[res]); + mp_raise_OSError_fresult(res); } } @@ -357,7 +362,7 @@ STATIC mp_obj_t fat_vfs_statvfs(mp_obj_t vfs_in, mp_obj_t path_in) { FATFS *fatfs = &self->fatfs; FRESULT res = f_getfree(fatfs, &nclst); if (FR_OK != res) { - mp_raise_OSError(fresult_to_errno_table[res]); + mp_raise_OSError_fresult(res); } mp_obj_tuple_t *t = MP_OBJ_TO_PTR(mp_obj_new_tuple(10, NULL)); @@ -395,7 +400,7 @@ STATIC mp_obj_t vfs_fat_mount(mp_obj_t self_in, mp_obj_t readonly, mp_obj_t mkfs res = f_mkfs(&self->fatfs, FM_FAT | FM_SFD, 0, working_buf, sizeof(working_buf)); } if (res != FR_OK) { - mp_raise_OSError(fresult_to_errno_table[res]); + mp_raise_OSError_fresult(res); } self->blockdev.flags &= ~MP_BLOCKDEV_FLAG_NO_FILESYSTEM; @@ -416,7 +421,7 @@ STATIC mp_obj_t vfs_fat_getlabel(mp_obj_t self_in) { char working_buf[12]; FRESULT res = f_getlabel(&self->fatfs, working_buf, NULL); if (res != FR_OK) { - mp_raise_OSError(fresult_to_errno_table[res]); + mp_raise_OSError_fresult(res); } return mp_obj_new_str(working_buf, strlen(working_buf)); } @@ -431,7 +436,7 @@ STATIC mp_obj_t vfs_fat_setlabel(mp_obj_t self_in, mp_obj_t label_in) { if (res == FR_WRITE_PROTECTED) { mp_raise_msg(&mp_type_OSError, MP_ERROR_TEXT("Read-only filesystem")); } - mp_raise_OSError(fresult_to_errno_table[res]); + mp_raise_OSError_fresult(res); } return mp_const_none; } diff --git a/extmod/vfs_fat_file.c b/extmod/vfs_fat_file.c index 65ee5f9024..2415f7d3c1 100644 --- a/extmod/vfs_fat_file.c +++ b/extmod/vfs_fat_file.c @@ -182,7 +182,7 @@ STATIC mp_obj_t file_open(fs_user_mount_t *vfs, const mp_obj_type_t *type, mp_ar } if (rwxa_count != 1 || plus_count > 1 || bt_count > 1 || bad_mode) { - mp_raise_ValueError(translate("Invalid mode")); + mp_arg_error_invalid(MP_QSTR_mode); } assert(vfs != NULL); diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 9f4bf97a73..fdd4d09887 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -66,6 +66,16 @@ msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "" +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "" @@ -82,12 +92,7 @@ msgstr "" msgid "%q in use" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "" @@ -95,14 +100,34 @@ msgstr "" msgid "%q indices must be integers, not %s" msgstr "" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "" @@ -119,14 +144,10 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.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 "" @@ -135,13 +156,8 @@ msgstr "" msgid "%q must be a string" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" +#: py/argcheck.c +msgid "%q must be an int" msgstr "" #: py/argcheck.c @@ -160,8 +176,12 @@ msgstr "" msgid "%q 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/raspberrypi/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#: shared-bindings/canio/Match.c +#: ports/stm/common-hal/pulseio/PulseIn.c shared-bindings/canio/Match.c msgid "%q out of range" msgstr "" @@ -169,10 +189,6 @@ msgstr "" msgid "%q pin invalid" msgstr "" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "" @@ -335,10 +351,6 @@ msgstr "" msgid "'yield' outside function" msgstr "" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "" - #: py/compile.c msgid "*x must be assignment target" msgstr "" @@ -374,10 +386,6 @@ msgstr "" msgid "Address must be %d bytes long" msgstr "" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "" @@ -468,25 +476,6 @@ msgstr "" msgid "Already scanning for wifi networks" 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 -#: ports/raspberrypi/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/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "" @@ -556,11 +545,6 @@ msgstr "" msgid "Bit clock and word select must share a clock unit" msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "" @@ -602,11 +586,6 @@ msgstr "" msgid "Buffer elements must be 4 bytes long or less" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "" - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "" @@ -616,7 +595,6 @@ msgstr "" msgid "Buffer is too small" msgstr "" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -631,10 +609,6 @@ msgstr "" msgid "Buffer must be a multiple of 512 bytes" msgstr "" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -656,10 +630,6 @@ msgstr "" msgid "Byte buffer must be 16 bytes." msgstr "" -#: shared-bindings/alarm/SleepMemory.c 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 "" @@ -732,7 +702,7 @@ msgid "Cannot pull on input-only pin." msgstr "" #: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." +msgid "Cannot read without MISO pin" msgstr "" #: shared-bindings/audiobusio/PDMIn.c @@ -746,7 +716,7 @@ 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." +msgid "Cannot reset into bootloader because no bootloader is present" msgstr "" #: ports/espressif/common-hal/socketpool/Socket.c @@ -767,20 +737,23 @@ msgid "Cannot subclass slice" msgstr "" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." +msgid "Cannot transfer without MOSI and MISO pins" msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge, only level" +msgstr "" + +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge. Only level." msgstr "" #: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." +msgid "Cannot write without MOSI pin" msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -795,10 +768,6 @@ msgstr "" msgid "CircuitPython was unable to allocate the heap." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "" - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "" @@ -807,11 +776,6 @@ msgstr "" msgid "Clock unit in use" msgstr "" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/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 " @@ -822,16 +786,9 @@ msgstr "" msgid "Corrupt .mpy file" 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 "" - +#: ports/cxd56/common-hal/camera/Camera.c ports/cxd56/common-hal/gnss/GNSS.c #: ports/cxd56/common-hal/sdioio/SDCard.c -msgid "Could not initialize SDCard" +msgid "Could not initialize %q" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c @@ -871,20 +828,6 @@ msgstr "" 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 "" @@ -932,10 +875,6 @@ msgstr "" 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." @@ -991,11 +930,6 @@ msgstr "" msgid "Expected an alarm" msgstr "" -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "" - #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." @@ -1022,22 +956,6 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/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/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/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/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "" @@ -1106,11 +1024,6 @@ msgstr "" msgid "Format not supported" msgstr "" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" -msgstr "" - #: ports/mimxrt10xx/common-hal/microcontroller/Processor.c msgid "" "Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" @@ -1152,16 +1065,12 @@ 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 "" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" +msgid "I2C init error" msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c @@ -1269,75 +1178,39 @@ msgstr "" msgid "Internal error #%d" msgstr "" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: py/argcheck.c msgid "Invalid %q" msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c 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 ports/stm/common-hal/sdioio/SDCard.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/canio/CAN.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 "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "" - #: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/common-hal/busio/I2C.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "" @@ -1345,42 +1218,11 @@ msgstr "" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" 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 "" @@ -1389,32 +1231,10 @@ msgstr "" msgid "Invalid memory access." msgstr "" -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" 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 -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.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 "" @@ -1423,44 +1243,10 @@ msgstr "" 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/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c -#: shared-bindings/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c shared-bindings/busio/UART.c msgid "Invalid pins" 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 "" - #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" @@ -1473,23 +1259,6 @@ msgstr "" msgid "Invalid state" 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/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "" @@ -1503,25 +1272,17 @@ msgid "LHS of keyword arg must be an id" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer already in a group." +msgid "Layer already in a group" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." +msgid "Layer must be a Group or TileGrid subclass" msgstr "" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "" - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "" - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "" @@ -1531,10 +1292,6 @@ msgstr "" msgid "Maximum x value when mirrored is %d" msgstr "" -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" @@ -1548,10 +1305,14 @@ msgstr "" msgid "Mismatched swap flag" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1587,11 +1348,6 @@ msgstr "" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" @@ -1652,15 +1408,23 @@ msgid "No I2C device at address: 0x%x" msgstr "" #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "No MISO pin" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1699,16 +1463,6 @@ msgstr "" 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/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "" @@ -1853,10 +1607,13 @@ msgid "Only one address is allowed" msgstr "" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "" @@ -1888,11 +1645,6 @@ msgstr "" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "" @@ -1901,11 +1653,6 @@ msgstr "" msgid "PDMIn not available" 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." @@ -1927,29 +1674,18 @@ msgstr "" msgid "Permission denied" msgstr "" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" +#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c +msgid "Pin cannot wake from deep sleep" msgstr "" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2016,18 +1752,10 @@ msgstr "" msgid "Program does OUT without loading OSR" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "" - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -2050,7 +1778,7 @@ msgid "RNG Init Error" msgstr "" #: ports/nrf/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" +msgid "RS485" msgstr "" #: ports/espressif/common-hal/busio/UART.c @@ -2058,12 +1786,6 @@ msgstr "" msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "" @@ -2132,29 +1854,20 @@ msgstr "" 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 "" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" 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" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-initialization error" msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c @@ -2175,14 +1888,6 @@ msgstr "" msgid "Server side context cannot have hostname" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "" @@ -2218,10 +1923,6 @@ msgstr "" msgid "Splitting with sub-captures" msgstr "" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "" @@ -2307,10 +2008,6 @@ msgstr "" 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 "" @@ -2330,6 +2027,9 @@ msgid "To exit, please reset the board without " msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample" +msgstr "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -2362,19 +2062,15 @@ msgid "Tuple or struct_time argument required" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" +msgid "UART de-init error" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" +msgid "UART 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" +msgid "UART re-init error" msgstr "" #: ports/stm/common-hal/busio/UART.c @@ -2515,9 +2211,7 @@ msgid "" "declined or ignored." msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/I2C.c ports/espressif/common-hal/busio/UART.c msgid "Unsupported baudrate" msgstr "" @@ -2533,6 +2227,10 @@ msgstr "" msgid "Unsupported format" msgstr "" +#: ports/atmel-samd/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +msgid "Unsupported frequency" +msgstr "" + #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" @@ -2595,10 +2293,6 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" -msgstr "" - #: main.c msgid "Woken up by alarm.\n" msgstr "" @@ -2751,10 +2445,6 @@ msgstr "" msgid "bits must be 32 or less" msgstr "" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -2792,11 +2482,6 @@ msgstr "" msgid "byteorder is not a string" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/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 "" @@ -2805,7 +2490,7 @@ msgstr "" msgid "bytes value out of range" msgstr "" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "" @@ -2813,12 +2498,9 @@ msgstr "" msgid "calibration is read only" msgstr "" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" +msgid "can only have one parent" msgstr "" #: py/emitinlinethumb.c @@ -3001,10 +2683,6 @@ msgstr "" 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/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "" @@ -3679,10 +3357,6 @@ msgstr "" msgid "matrix is not positive definite" msgstr "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3690,10 +3364,6 @@ 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 "" - #: extmod/ulab/code/ndarray.c msgid "maximum number of dimensions is 4" msgstr "" @@ -4064,10 +3734,6 @@ msgstr "" msgid "poll on file not available on win32" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" @@ -4114,14 +3780,6 @@ msgstr "" msgid "pull masks conflict with direction masks" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "" @@ -4292,10 +3950,6 @@ msgstr "" 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 "" @@ -4344,10 +3998,6 @@ msgstr "" msgid "threshold must be in the range 0-65536" msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "" @@ -4367,10 +4017,6 @@ msgstr "" msgid "timeout must be < 655.35 secs" 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 "" @@ -4570,13 +4216,7 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" diff --git a/ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c b/ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c index eda111639b..b771c5b998 100644 --- a/ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c +++ b/ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c @@ -234,7 +234,7 @@ static void pinalarm_set_alarms_light(size_t n_alarms, const mp_obj_t *alarms) { // raise ValueError here MP_FALLTHROUGH case PINALARM_ERR_NOEXTINT: - mp_raise_RuntimeError(translate("No hardware support on pin")); + raise_ValueError_invalid_pin(); case PINALARM_ERR_NOCHANNEL: mp_raise_RuntimeError(translate("A hardware interrupt channel is already in use")); default: @@ -261,7 +261,7 @@ static void pinalarm_set_alarms_deep(size_t n_alarms, const mp_obj_t *alarms) { } } if (t->n < 0) { - mp_raise_ValueError(translate("Pin cannot wake from Deep Sleep")); + mp_raise_ValueError(translate("Pin cannot wake from deep sleep")); } // It is strange, but to my experiment, interrupt during sleep diff --git a/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c b/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c index 14a7346c17..3f116f07e3 100644 --- a/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c +++ b/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c @@ -100,7 +100,7 @@ void alarm_time_timealarm_set_alarms(bool deep_sleep, size_t n_alarms, const mp_ continue; } if (timealarm_set) { - mp_raise_ValueError(translate("Only one alarm.time alarm can be set.")); + mp_raise_ValueError(translate("Only one alarm.time alarm can be set")); } timealarm = MP_OBJ_TO_PTR(alarms[i]); timealarm_set = true; diff --git a/ports/atmel-samd/common-hal/analogio/AnalogIn.c b/ports/atmel-samd/common-hal/analogio/AnalogIn.c index 262e44350c..4140324a1c 100644 --- a/ports/atmel-samd/common-hal/analogio/AnalogIn.c +++ b/ports/atmel-samd/common-hal/analogio/AnalogIn.c @@ -36,6 +36,7 @@ #include "samd/adc.h" #include "shared-bindings/analogio/AnalogIn.h" +#include "shared-bindings/microcontroller/Pin.h" #include "supervisor/shared/translate.h" #include "atmel_start_pins.h" @@ -60,7 +61,7 @@ void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self, } if (adc_channel == 0xff) { // No ADC function on that pin - mp_raise_ValueError(translate("Pin does not have ADC capabilities")); + raise_ValueError_invalid_pin(); } claim_pin(pin); diff --git a/ports/atmel-samd/common-hal/analogio/AnalogOut.c b/ports/atmel-samd/common-hal/analogio/AnalogOut.c index 91782387b8..2f38fce700 100644 --- a/ports/atmel-samd/common-hal/analogio/AnalogOut.c +++ b/ports/atmel-samd/common-hal/analogio/AnalogOut.c @@ -70,7 +70,7 @@ void common_hal_analogio_analogout_construct(analogio_analogout_obj_t *self, #endif default: - mp_raise_ValueError(translate("AnalogOut not supported on given pin")); + raise_ValueError_invalid_pin(); return; } diff --git a/ports/atmel-samd/common-hal/audiobusio/I2SOut.c b/ports/atmel-samd/common-hal/audiobusio/I2SOut.c index a434e2541b..f5531f2bab 100644 --- a/ports/atmel-samd/common-hal/audiobusio/I2SOut.c +++ b/ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -255,7 +255,7 @@ void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t *self, } uint8_t channel_count = audiosample_channel_count(sample); if (channel_count > 2) { - mp_raise_ValueError(translate("Too many channels in sample.")); + mp_raise_ValueError(translate("Too many channels in sample")); } #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; diff --git a/ports/atmel-samd/common-hal/audioio/AudioOut.c b/ports/atmel-samd/common-hal/audioio/AudioOut.c index 7be7cf7c4c..87a6ee62ad 100644 --- a/ports/atmel-samd/common-hal/audioio/AudioOut.c +++ b/ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -136,7 +136,7 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t *self, mp_raise_ValueError(translate("Right channel unsupported")); } if (left_channel != &pin_PA02) { - mp_raise_ValueError(translate("Invalid pin")); + raise_ValueError_invalid_pin(); } claim_pin(left_channel); #endif @@ -376,14 +376,13 @@ void common_hal_audioio_audioout_play(audioio_audioout_obj_t *self, audio_dma_result result = AUDIO_DMA_OK; uint32_t sample_rate = audiosample_sample_rate(sample); #ifdef SAMD21 - uint32_t max_sample_rate = 350000; + const uint32_t max_sample_rate = 350000; #endif #ifdef SAM_D5X_E5X - uint32_t max_sample_rate = 1000000; + const uint32_t max_sample_rate = 1000000; #endif - if (sample_rate > max_sample_rate) { - mp_raise_ValueError_varg(translate("Sample rate too high. It must be less than %d"), max_sample_rate); - } + mp_arg_validate_int_max(sample_rate, max_sample_rate, MP_QSTR_sample_rate); + #ifdef SAMD21 result = audio_dma_setup_playback(&self->left_dma, sample, loop, true, 0, false /* output unsigned */, diff --git a/ports/atmel-samd/common-hal/busio/I2C.c b/ports/atmel-samd/common-hal/busio/I2C.c index 48ee26a9b6..4124faff4a 100644 --- a/ports/atmel-samd/common-hal/busio/I2C.c +++ b/ports/atmel-samd/common-hal/busio/I2C.c @@ -34,6 +34,7 @@ #include "samd/sercom.h" #include "shared-bindings/microcontroller/__init__.h" +#include "shared-bindings/microcontroller/Pin.h" #include "supervisor/shared/translate.h" #include "common-hal/busio/__init__.h" @@ -76,7 +77,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, self->sda_pin = NO_PIN; Sercom *sercom = samd_i2c_get_sercom(scl, sda, &sercom_index, &sda_pinmux, &scl_pinmux); if (sercom == NULL) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } #if CIRCUITPY_REQUIRE_I2C_PULLUPS @@ -122,15 +123,12 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, // The maximum frequency divisor gives a clock rate of around 48MHz/2/255 // but set_baudrate does not diagnose this problem. (This is not the // exact cutoff, but no frequency well under 100kHz is available) - if (frequency < 95000) { - mp_raise_ValueError(translate("Unsupported baudrate")); - } - - if (i2c_m_sync_set_baudrate(&self->i2c_desc, 0, frequency / 1000) != ERR_NONE) { + if (frequency < 95000 && + i2c_m_sync_set_baudrate(&self->i2c_desc, 0, frequency / 1000) != ERR_NONE) { reset_pin_number(sda->number); reset_pin_number(scl->number); common_hal_busio_i2c_deinit(self); - mp_raise_ValueError(translate("Unsupported baudrate")); + mp_raise_ValueError(translate("Unsupported frequency")); } self->sda_pin = sda->number; diff --git a/ports/atmel-samd/common-hal/busio/SPI.c b/ports/atmel-samd/common-hal/busio/SPI.c index 0f6f38461c..fde15824c8 100644 --- a/ports/atmel-samd/common-hal/busio/SPI.c +++ b/ports/atmel-samd/common-hal/busio/SPI.c @@ -25,6 +25,7 @@ */ #include "shared-bindings/busio/SPI.h" +#include "shared-bindings/microcontroller/Pin.h" #include "py/mperrno.h" #include "py/runtime.h" @@ -33,7 +34,6 @@ #include "supervisor/board.h" #include "common-hal/busio/__init__.h" -#include "common-hal/microcontroller/Pin.h" #include "hal/include/hal_gpio.h" #include "hal/include/hal_spi_m_sync.h" @@ -133,7 +133,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, } } if (sercom == NULL) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } // Set up SPI clocks on SERCOM. diff --git a/ports/atmel-samd/common-hal/busio/UART.c b/ports/atmel-samd/common-hal/busio/UART.c index 194f1c0217..0af363ae44 100644 --- a/ports/atmel-samd/common-hal/busio/UART.c +++ b/ports/atmel-samd/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" @@ -79,9 +80,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, 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")); - } + mp_arg_validate_int_max(bits, 8, MP_QSTR_bits); bool have_tx = tx != NULL; bool have_rx = rx != NULL; @@ -145,7 +144,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } } if (sercom == NULL) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } if (!have_tx) { tx_pad = 0; @@ -175,7 +174,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, 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)); + m_malloc_fail(self->buffer_length * sizeof(uint8_t)); } } } else { diff --git a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c index 4e06b77b56..4a6a620603 100644 --- a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +++ b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c @@ -45,6 +45,7 @@ #include "peripheral_clk_config.h" #include "hpl_gclk_config.h" +#include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/time/__init__.h" #include "supervisor/shared/tick.h" #include "supervisor/shared/translate.h" @@ -282,11 +283,11 @@ static void frequencyin_samd51_stop_dpll(void) { void common_hal_frequencyio_frequencyin_construct(frequencyio_frequencyin_obj_t* self, const mcu_pin_obj_t* pin, const uint16_t capture_period) { if (!pin->has_extint) { - mp_raise_RuntimeError(translate("No hardware support on pin")); - } - if ((capture_period == 0) || (capture_period > 500)) { - mp_raise_ValueError(translate("Invalid capture period. Valid range: 1 - 500")); + raise_ValueError_invalid_pin(); } + + mp_arg_validate_int_range(capture_period, 0, 500, MP_QSTR_capture_period); + uint32_t mask = 1 << pin->extint_channel; if (eic_get_enable() == 1 && #ifdef SAMD21 @@ -569,9 +570,7 @@ uint16_t common_hal_frequencyio_frequencyin_get_capture_period(frequencyio_frequ } void common_hal_frequencyio_frequencyin_set_capture_period(frequencyio_frequencyin_obj_t *self, uint16_t capture_period) { - if ((capture_period == 0) || (capture_period > 500)) { - mp_raise_ValueError(translate("Invalid capture period. Valid range: 1 - 500")); - } + mp_arg_validate_int_range(capture_period, 1, 500, MP_QSTR_capture_period); self->capture_period = capture_period; diff --git a/ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c b/ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c index e1849a6b15..ae118c1909 100644 --- a/ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c +++ b/ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c @@ -25,6 +25,7 @@ */ #include "shared-bindings/i2cperipheral/I2CPeripheral.h" +#include "shared-bindings/microcontroller/Pin.h" #include "common-hal/busio/I2C.h" #include "shared/runtime/interrupt_char.h" @@ -42,7 +43,7 @@ void common_hal_i2cperipheral_i2c_peripheral_construct(i2cperipheral_i2c_periphe uint32_t sda_pinmux, scl_pinmux; Sercom *sercom = samd_i2c_get_sercom(scl, sda, &sercom_index, &sda_pinmux, &scl_pinmux); if (sercom == NULL) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } self->sercom = sercom; diff --git a/ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c b/ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c index 8e41f50d8d..1f23b27590 100644 --- a/ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c +++ b/ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c @@ -63,7 +63,7 @@ void common_hal_imagecapture_parallelimagecapture_construct(imagecapture_paralle } // The peripheral supports 8, 10, 12, or 14 data bits, but the code only supports 8 at present if (data_count != 8) { - mp_raise_ValueError_varg(translate("Invalid data_count %d"), data_count); + mp_arg_error_invalid(MP_QSTR_datacount); } if (vertical_sync && vertical_sync->number != PIN_PCC_DEN1) { mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_vsync); diff --git a/ports/atmel-samd/common-hal/microcontroller/__init__.c b/ports/atmel-samd/common-hal/microcontroller/__init__.c index 983af7a647..6856f4a48b 100644 --- a/ports/atmel-samd/common-hal/microcontroller/__init__.c +++ b/ports/atmel-samd/common-hal/microcontroller/__init__.c @@ -66,7 +66,7 @@ void common_hal_mcu_enable_interrupts(void) { void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) { if (runmode == RUNMODE_BOOTLOADER) { if (!bootloader_available()) { - mp_raise_ValueError(translate("Cannot reset into bootloader because no bootloader is present.")); + mp_raise_ValueError(translate("Cannot reset into bootloader because no bootloader is present")); } // Pretend to be the first of the two reset presses needed to enter the // bootloader. That way one reset will end in the bootloader. diff --git a/ports/atmel-samd/common-hal/ps2io/Ps2.c b/ports/atmel-samd/common-hal/ps2io/Ps2.c index 6e2fb58e51..ad7b110803 100644 --- a/ports/atmel-samd/common-hal/ps2io/Ps2.c +++ b/ports/atmel-samd/common-hal/ps2io/Ps2.c @@ -79,7 +79,7 @@ static void resume_interrupt(ps2io_ps2_obj_t *self) { disable_interrupt(self); self->state = STATE_IDLE; - gpio_set_pin_function(self->clk_pin, GPIO_PIN_FUNCTION_A); + gpio_set_pin_function(self->clock_pin, GPIO_PIN_FUNCTION_A); uint32_t mask = 1 << self->channel; EIC->INTFLAG.reg = mask << EIC_INTFLAG_EXTINT_Pos; EIC->INTENSET.reg = mask << EIC_INTENSET_EXTINT_Pos; @@ -90,14 +90,14 @@ static void resume_interrupt(ps2io_ps2_obj_t *self) { static void clk_hi(ps2io_ps2_obj_t *self) { // External pull-up // Must set pull after setting direction. - gpio_set_pin_direction(self->clk_pin, GPIO_DIRECTION_IN); - gpio_set_pin_pull_mode(self->clk_pin, GPIO_PULL_OFF); + gpio_set_pin_direction(self->clock_pin, GPIO_DIRECTION_IN); + gpio_set_pin_pull_mode(self->clock_pin, GPIO_PULL_OFF); } static bool wait_clk_lo(ps2io_ps2_obj_t *self, uint32_t us) { clk_hi(self); common_hal_mcu_delay_us(1); - while (gpio_get_pin_level(self->clk_pin) && us) { + while (gpio_get_pin_level(self->clock_pin) && us) { --us; common_hal_mcu_delay_us(1); } @@ -107,7 +107,7 @@ static bool wait_clk_lo(ps2io_ps2_obj_t *self, uint32_t us) { static bool wait_clk_hi(ps2io_ps2_obj_t *self, uint32_t us) { clk_hi(self); common_hal_mcu_delay_us(1); - while (!gpio_get_pin_level(self->clk_pin) && us) { + while (!gpio_get_pin_level(self->clock_pin) && us) { --us; common_hal_mcu_delay_us(1); } @@ -115,9 +115,9 @@ static bool wait_clk_hi(ps2io_ps2_obj_t *self, uint32_t us) { } static void clk_lo(ps2io_ps2_obj_t *self) { - gpio_set_pin_pull_mode(self->clk_pin, GPIO_PULL_OFF); - gpio_set_pin_direction(self->clk_pin, GPIO_DIRECTION_OUT); - gpio_set_pin_level(self->clk_pin, 0); + gpio_set_pin_pull_mode(self->clock_pin, GPIO_PULL_OFF); + gpio_set_pin_direction(self->clock_pin, GPIO_DIRECTION_OUT); + gpio_set_pin_level(self->clock_pin, 0); } static void data_hi(ps2io_ps2_obj_t *self) { @@ -244,19 +244,19 @@ void ps2_interrupt_handler(uint8_t channel) { } void common_hal_ps2io_ps2_construct(ps2io_ps2_obj_t *self, - const mcu_pin_obj_t *data_pin, const mcu_pin_obj_t *clk_pin) { - if (!clk_pin->has_extint) { - mp_raise_RuntimeError(translate("No hardware support on clk pin")); + const mcu_pin_obj_t *data_pin, const mcu_pin_obj_t *clock_pin) { + if (!clock_pin->has_extint) { + mp_arg_error_invalid(MP_QSTR_clock_pin); } - if (eic_get_enable() && !eic_channel_free(clk_pin->extint_channel)) { + if (eic_get_enable() && !eic_channel_free(clock_pin->extint_channel)) { mp_raise_RuntimeError(translate("EXTINT channel already in use")); } clk_hi(self); data_hi(self); - self->channel = clk_pin->extint_channel; - self->clk_pin = clk_pin->number; + self->channel = clock_pin->extint_channel; + self->clock_pin = clock_pin->number; self->data_pin = data_pin->number; self->state = STATE_IDLE; self->bufcount = 0; @@ -264,19 +264,19 @@ void common_hal_ps2io_ps2_construct(ps2io_ps2_obj_t *self, self->bufposw = 0; self->waiting_cmd_response = false; - set_eic_channel_data(clk_pin->extint_channel, (void *)self); + set_eic_channel_data(clock_pin->extint_channel, (void *)self); // Check to see if the EIC is enabled and start it up if its not.' if (eic_get_enable() == 0) { turn_on_external_interrupt_controller(); } - gpio_set_pin_function(clk_pin->number, GPIO_PIN_FUNCTION_A); + gpio_set_pin_function(clock_pin->number, GPIO_PIN_FUNCTION_A); gpio_set_pin_function(data_pin->number, GPIO_PIN_FUNCTION_A); turn_on_cpu_interrupt(self->channel); - claim_pin(clk_pin); + claim_pin(clock_pin); claim_pin(data_pin); // Set config will enable the EIC. @@ -284,7 +284,7 @@ void common_hal_ps2io_ps2_construct(ps2io_ps2_obj_t *self, } bool common_hal_ps2io_ps2_deinited(ps2io_ps2_obj_t *self) { - return self->clk_pin == NO_PIN; + return self->clock_pin == NO_PIN; } void common_hal_ps2io_ps2_deinit(ps2io_ps2_obj_t *self) { @@ -293,9 +293,9 @@ void common_hal_ps2io_ps2_deinit(ps2io_ps2_obj_t *self) { } set_eic_handler(self->channel, EIC_HANDLER_NO_INTERRUPT); turn_off_eic_channel(self->channel); - reset_pin_number(self->clk_pin); + reset_pin_number(self->clock_pin); reset_pin_number(self->data_pin); - self->clk_pin = NO_PIN; + self->clock_pin = NO_PIN; self->data_pin = NO_PIN; } diff --git a/ports/atmel-samd/common-hal/ps2io/Ps2.h b/ports/atmel-samd/common-hal/ps2io/Ps2.h index 588dfdd8be..fa8defdbeb 100644 --- a/ports/atmel-samd/common-hal/ps2io/Ps2.h +++ b/ports/atmel-samd/common-hal/ps2io/Ps2.h @@ -35,7 +35,7 @@ typedef struct { mp_obj_base_t base; uint8_t channel; - uint8_t clk_pin; + uint8_t clock_pin; uint8_t data_pin; uint8_t state; diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.c b/ports/atmel-samd/common-hal/pulseio/PulseIn.c index 0927faa00a..4f00fac027 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -41,6 +41,7 @@ #include "samd/pins.h" #include "samd/timers.h" #include "shared-bindings/microcontroller/__init__.h" +#include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/pulseio/PulseIn.h" #include "supervisor/shared/tick.h" #include "supervisor/shared/translate.h" @@ -152,7 +153,7 @@ void pulsein_reset() { void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self, const mcu_pin_obj_t *pin, uint16_t maxlen, bool idle_state) { if (!pin->has_extint) { - mp_raise_RuntimeError(translate("No hardware support on pin")); + raise_ValueError_invalid_pin(); } if (eic_get_enable() && !eic_channel_free(pin->extint_channel)) { mp_raise_RuntimeError(translate("EXTINT channel already in use")); @@ -160,7 +161,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self, 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)); + m_malloc_fail(maxlen * sizeof(uint16_t)); } self->channel = pin->extint_channel; self->pin = pin->number; @@ -344,15 +345,14 @@ bool common_hal_pulseio_pulsein_get_paused(pulseio_pulsein_obj_t *self) { return (EIC->INTENSET.reg & (mask << EIC_INTENSET_EXTINT_Pos)) == 0; } -uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t *self, - int16_t index) { +uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t *self, int16_t index) { common_hal_mcu_disable_interrupts(); if (index < 0) { index += self->len; } if (index < 0 || index >= self->len) { common_hal_mcu_enable_interrupts(); - mp_raise_IndexError_varg(translate("%q index out of range"), MP_QSTR_PulseIn); + mp_raise_IndexError_varg(translate("%q out of range"), MP_QSTR_index); } uint16_t value = self->buffer[(self->start + index) % self->maxlen]; common_hal_mcu_enable_interrupts(); diff --git a/ports/atmel-samd/common-hal/pwmio/PWMOut.c b/ports/atmel-samd/common-hal/pwmio/PWMOut.c index eaec10463d..854e70094f 100644 --- a/ports/atmel-samd/common-hal/pwmio/PWMOut.c +++ b/ports/atmel-samd/common-hal/pwmio/PWMOut.c @@ -377,7 +377,7 @@ void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t *self, uint32_t frequency) { uint32_t system_clock = common_hal_mcu_processor_get_frequency(); if (frequency == 0 || frequency > system_clock / 2) { - mp_raise_ValueError(translate("Invalid PWM frequency")); + mp_arg_error_invalid(MP_QSTR_frequency); } const pin_timer_t *t = self->timer; uint8_t resolution; diff --git a/ports/atmel-samd/common-hal/rtc/RTC.c b/ports/atmel-samd/common-hal/rtc/RTC.c index e2a67bd174..455f176763 100644 --- a/ports/atmel-samd/common-hal/rtc/RTC.c +++ b/ports/atmel-samd/common-hal/rtc/RTC.c @@ -68,13 +68,7 @@ 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 - } + mp_arg_validate_int_range(calibration, -127, 127, MP_QSTR_calibration); hri_rtcmode0_write_FREQCORR_SIGN_bit(RTC, calibration < 0 ? 0 : 1); hri_rtcmode0_write_FREQCORR_VALUE_bf(RTC, abs(calibration)); diff --git a/ports/atmel-samd/common-hal/touchio/TouchIn.c b/ports/atmel-samd/common-hal/touchio/TouchIn.c index 89979b620f..1c0062d52a 100644 --- a/ports/atmel-samd/common-hal/touchio/TouchIn.c +++ b/ports/atmel-samd/common-hal/touchio/TouchIn.c @@ -31,6 +31,7 @@ #include "py/runtime.h" #include "py/binary.h" #include "py/mphal.h" +#include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/touchio/TouchIn.h" #include "supervisor/shared/translate.h" @@ -60,7 +61,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) { if (!pin->has_touch) { - mp_raise_ValueError(translate("Invalid pin")); + raise_ValueError_invalid_pin(); } claim_pin(pin); diff --git a/ports/broadcom/common-hal/busio/I2C.c b/ports/broadcom/common-hal/busio/I2C.c index e84810cffd..3142fda145 100644 --- a/ports/broadcom/common-hal/busio/I2C.c +++ b/ports/broadcom/common-hal/busio/I2C.c @@ -90,7 +90,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, } } if (instance_index == NUM_I2C) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } i2c_in_use[instance_index] = true; self->index = instance_index; diff --git a/ports/broadcom/common-hal/busio/SPI.c b/ports/broadcom/common-hal/busio/SPI.c index feba34521d..017674dfc0 100644 --- a/ports/broadcom/common-hal/busio/SPI.c +++ b/ports/broadcom/common-hal/busio/SPI.c @@ -104,7 +104,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, break; } if (instance_index == NUM_SPI) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } self->clock = clock; diff --git a/ports/broadcom/common-hal/busio/UART.c b/ports/broadcom/common-hal/busio/UART.c index ff17d5ff1d..52d1b7a418 100644 --- a/ports/broadcom/common-hal/busio/UART.c +++ b/ports/broadcom/common-hal/busio/UART.c @@ -162,13 +162,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_float_t timeout, uint16_t receiver_buffer_size, byte *receiver_buffer, bool sigint_enabled) { - if (bits > 8) { - mp_raise_ValueError(translate("Invalid word/bit length")); - } - - if (receiver_buffer_size == 0) { - mp_raise_ValueError(translate("Invalid buffer size")); - } + mp_arg_validate_int_max(bits, 8, MP_QSTR_bits); + mp_arg_validate_int_min(receiver_buffer_size, 1, MP_QSTR_receiver_buffer_size); if ((rs485_dir != NULL) || (rs485_invert)) { mp_raise_NotImplementedError(translate("RS485 Not yet supported on this device")); @@ -203,7 +198,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, break; } if (instance_index == NUM_UART) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } self->rx_pin = rx; @@ -224,7 +219,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, // in the long-lived pool is not strictly necessary) // (This is a macro.) if (!ringbuf_alloc(&self->ringbuf, receiver_buffer_size, true)) { - mp_raise_msg(&mp_type_MemoryError, translate("Failed to allocate RX buffer")); + m_malloc_fail(receiver_buffer_size); } } } diff --git a/ports/cxd56/common-hal/analogio/AnalogIn.c b/ports/cxd56/common-hal/analogio/AnalogIn.c index d1bd68cfbe..bb19d02c25 100644 --- a/ports/cxd56/common-hal/analogio/AnalogIn.c +++ b/ports/cxd56/common-hal/analogio/AnalogIn.c @@ -34,6 +34,7 @@ #include "py/runtime.h" #include "shared-bindings/analogio/AnalogIn.h" +#include "shared-bindings/microcontroller/Pin.h" typedef struct { const char *devpath; @@ -52,7 +53,7 @@ STATIC analogin_dev_t analogin_dev[] = { void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self, const mcu_pin_obj_t *pin) { if (!pin->analog) { - mp_raise_ValueError(translate("AnalogIn not supported on given pin")); + raise_ValueError_invalid_pin(); } self->number = -1; @@ -65,13 +66,13 @@ void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self, const } if (self->number < 0) { - mp_raise_ValueError(translate("Pin does not have ADC capabilities")); + raise_ValueError_invalid_pin(); } if (analogin_dev[self->number].fd < 0) { analogin_dev[self->number].fd = open(analogin_dev[self->number].devpath, O_RDONLY); if (analogin_dev[self->number].fd < 0) { - mp_raise_ValueError(translate("Pin does not have ADC capabilities")); + raise_ValueError_invalid_pin(); } } diff --git a/ports/cxd56/common-hal/analogio/AnalogOut.c b/ports/cxd56/common-hal/analogio/AnalogOut.c index 3f1abe80d1..b57dc8e323 100644 --- a/ports/cxd56/common-hal/analogio/AnalogOut.c +++ b/ports/cxd56/common-hal/analogio/AnalogOut.c @@ -29,7 +29,7 @@ #include "shared-bindings/analogio/AnalogOut.h" void common_hal_analogio_analogout_construct(analogio_analogout_obj_t *self, const mcu_pin_obj_t *pin) { - mp_raise_RuntimeError(translate("AnalogOut functionality not supported")); + mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_AnalogOut); } void common_hal_analogio_analogout_deinit(analogio_analogout_obj_t *self) { diff --git a/ports/cxd56/common-hal/busio/I2C.c b/ports/cxd56/common-hal/busio/I2C.c index 82b52ca179..ad85860a9d 100644 --- a/ports/cxd56/common-hal/busio/I2C.c +++ b/ports/cxd56/common-hal/busio/I2C.c @@ -32,6 +32,7 @@ #include "py/runtime.h" #include "shared-bindings/busio/I2C.h" +#include "shared-bindings/microcontroller/Pin.h" 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) { @@ -40,7 +41,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, const mcu_pin_obj_t * } if (scl->number != PIN_I2C0_BCK || sda->number != PIN_I2C0_BDT) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } claim_pin(scl); diff --git a/ports/cxd56/common-hal/busio/SPI.c b/ports/cxd56/common-hal/busio/SPI.c index c248b5cc9a..75f530eda1 100644 --- a/ports/cxd56/common-hal/busio/SPI.c +++ b/ports/cxd56/common-hal/busio/SPI.c @@ -33,6 +33,7 @@ #include "py/runtime.h" #include "shared-bindings/busio/SPI.h" +#include "shared-bindings/microcontroller/Pin.h" 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, bool half_duplex) { @@ -55,7 +56,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, const mcu_pin_obj_t * } if (port < 0) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } claim_pin(clock); diff --git a/ports/cxd56/common-hal/busio/UART.c b/ports/cxd56/common-hal/busio/UART.c index 91fbe52441..735d0a3e40 100644 --- a/ports/cxd56/common-hal/busio/UART.c +++ b/ports/cxd56/common-hal/busio/UART.c @@ -40,6 +40,7 @@ #include "py/runtime.h" #include "shared-bindings/busio/UART.h" +#include "shared-bindings/microcontroller/Pin.h" typedef struct { const char *devpath; @@ -68,17 +69,9 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_raise_ValueError(translate("RTS/CTS/RS485 Not yet supported on this device")); } - if (bits != 8) { - mp_raise_ValueError(translate("Could not initialize UART")); - } - - if (parity != BUSIO_UART_PARITY_NONE) { - mp_raise_ValueError(translate("Could not initialize UART")); - } - - if (stop != 1) { - mp_raise_ValueError(translate("Could not initialize UART")); - } + mp_arg_validate_int(bits, 8, MP_QSTR_bits); + mp_arg_validate_int(parity, BUSIO_UART_PARITY_NONE, MP_QSTR_parity); + mp_arg_validate_int(stop, 1, MP_QSTR_stop); self->number = -1; @@ -91,7 +84,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } if (self->number < 0) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } if (busio_uart_dev[self->number].fd < 0) { diff --git a/ports/cxd56/common-hal/camera/Camera.c b/ports/cxd56/common-hal/camera/Camera.c index 5e159d61dc..7471b12af7 100644 --- a/ports/cxd56/common-hal/camera/Camera.c +++ b/ports/cxd56/common-hal/camera/Camera.c @@ -121,11 +121,11 @@ static void camera_start_preview() { 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")); + mp_raise_ValueError_varg(translate("Could not initialize %q"), MP_QSTR_Camera); } camera_dev.fd = open(camera_dev.devpath, 0); if (camera_dev.fd < 0) { - mp_raise_ValueError(translate("Could not initialize Camera")); + mp_raise_ValueError_varg(translate("Could not initialize %q"), MP_QSTR_Camera); } } diff --git a/ports/cxd56/common-hal/digitalio/DigitalInOut.c b/ports/cxd56/common-hal/digitalio/DigitalInOut.c index 37b695567d..cfb39301df 100644 --- a/ports/cxd56/common-hal/digitalio/DigitalInOut.c +++ b/ports/cxd56/common-hal/digitalio/DigitalInOut.c @@ -29,10 +29,11 @@ #include "py/runtime.h" #include "shared-bindings/digitalio/DigitalInOut.h" +#include "shared-bindings/microcontroller/Pin.h" digitalinout_result_t common_hal_digitalio_digitalinout_construct(digitalio_digitalinout_obj_t *self, const mcu_pin_obj_t *pin) { if (pin->analog) { - mp_raise_ValueError(translate("DigitalInOut not supported on given pin")); + raise_ValueError_invalid_pin(); } claim_pin(pin); diff --git a/ports/cxd56/common-hal/gnss/GNSS.c b/ports/cxd56/common-hal/gnss/GNSS.c index f345f5261d..11b83d07b1 100644 --- a/ports/cxd56/common-hal/gnss/GNSS.c +++ b/ports/cxd56/common-hal/gnss/GNSS.c @@ -56,7 +56,7 @@ 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) { - mp_raise_ValueError(translate("Could not initialize GNSS")); + mp_raise_ValueError_varg(translate("Could not initialize %q"), MP_QSTR_GNSS); } } diff --git a/ports/cxd56/common-hal/microcontroller/__init__.c b/ports/cxd56/common-hal/microcontroller/__init__.c index 499e0e5f04..dd9a54063f 100644 --- a/ports/cxd56/common-hal/microcontroller/__init__.c +++ b/ports/cxd56/common-hal/microcontroller/__init__.c @@ -72,7 +72,7 @@ void common_hal_mcu_enable_interrupts(void) { void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) { if (runmode == RUNMODE_BOOTLOADER) { - mp_raise_ValueError(translate("Cannot reset into bootloader because no bootloader is present.")); + mp_raise_ValueError(translate("Cannot reset into bootloader because no bootloader is present")); } else if (runmode == RUNMODE_SAFE_MODE) { safe_mode_on_next_reset(PROGRAMMATIC_SAFE_MODE); } diff --git a/ports/cxd56/common-hal/pulseio/PulseIn.c b/ports/cxd56/common-hal/pulseio/PulseIn.c index 264f11a714..165e2a6ece 100644 --- a/ports/cxd56/common-hal/pulseio/PulseIn.c +++ b/ports/cxd56/common-hal/pulseio/PulseIn.c @@ -87,7 +87,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self, const mcu_pin_obj_t *pin, uint16_t maxlen, bool idle_state) { 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)); + m_malloc_fail(maxlen * sizeof(uint16_t)); } self->pin = pin; @@ -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_varg(translate("%q index out of range"), MP_QSTR_PulseIn); + mp_raise_IndexError_varg(translate("%q out of range"), MP_QSTR_index); } uint16_t value = self->buffer[(self->start + index) % self->maxlen]; common_hal_mcu_enable_interrupts(); diff --git a/ports/cxd56/common-hal/pwmio/PWMOut.c b/ports/cxd56/common-hal/pwmio/PWMOut.c index e9bffd21e9..7e27817aab 100644 --- a/ports/cxd56/common-hal/pwmio/PWMOut.c +++ b/ports/cxd56/common-hal/pwmio/PWMOut.c @@ -74,7 +74,7 @@ pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t *self, self->variable_frequency = variable_frequency; if (ioctl(pwmout_dev[self->number].fd, PWMIOC_SETCHARACTERISTICS, (unsigned long)((uintptr_t)&self->info)) < 0) { - mp_raise_ValueError(translate("Invalid PWM frequency")); + mp_arg_error_invalid(MP_QSTR_frequency); } ioctl(pwmout_dev[self->number].fd, PWMIOC_START, 0); @@ -116,7 +116,7 @@ void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t *self, uint32_t fr self->info.frequency = frequency; if (ioctl(pwmout_dev[self->number].fd, PWMIOC_SETCHARACTERISTICS, (unsigned long)((uintptr_t)&self->info)) < 0) { - mp_raise_ValueError(translate("Invalid PWM frequency")); + mp_arg_error_invalid(MP_QSTR_frequency); } } diff --git a/ports/cxd56/common-hal/rtc/RTC.c b/ports/cxd56/common-hal/rtc/RTC.c index ce65e6acde..0024e56cb2 100644 --- a/ports/cxd56/common-hal/rtc/RTC.c +++ b/ports/cxd56/common-hal/rtc/RTC.c @@ -50,5 +50,5 @@ int common_hal_rtc_get_calibration(void) { } void common_hal_rtc_set_calibration(int calibration) { - mp_raise_NotImplementedError(translate("RTC calibration is not supported on this board")); + mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_calibration); } diff --git a/ports/cxd56/common-hal/sdioio/SDCard.c b/ports/cxd56/common-hal/sdioio/SDCard.c index 56fe5f7057..c86e052ea5 100644 --- a/ports/cxd56/common-hal/sdioio/SDCard.c +++ b/ports/cxd56/common-hal/sdioio/SDCard.c @@ -31,6 +31,7 @@ #include "py/mperrno.h" #include "py/runtime.h" +#include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/sdioio/SDCard.h" #include "shared-bindings/util.h" @@ -42,7 +43,7 @@ void common_hal_sdioio_sdcard_construct(sdioio_sdcard_obj_t *self, struct geometry geo; if (clock->number != PIN_SDIO_CLK || command->number != PIN_SDIO_CMD) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } uint8_t data_pins_num = 0; @@ -54,11 +55,11 @@ void common_hal_sdioio_sdcard_construct(sdioio_sdcard_obj_t *self, } if (data_pins_num != DATA_PINS_NUM) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } if (open_blockdriver("/dev/mmcsd0", 0, &self->inode) < 0) { - mp_raise_ValueError(translate("Could not initialize SDCard")); + mp_raise_ValueError_varg(translate("Could not initialize %q"), MP_QSTR_SDCard); } self->inode->u.i_bops->geometry(self->inode, &geo); diff --git a/ports/espressif/common-hal/alarm/touch/TouchAlarm.c b/ports/espressif/common-hal/alarm/touch/TouchAlarm.c index 6ae2421e4c..941b99d6fd 100644 --- a/ports/espressif/common-hal/alarm/touch/TouchAlarm.c +++ b/ports/espressif/common-hal/alarm/touch/TouchAlarm.c @@ -26,6 +26,7 @@ #include "shared-bindings/alarm/touch/TouchAlarm.h" #include "shared-bindings/microcontroller/__init__.h" +#include "shared-bindings/microcontroller/Pin.h" #include "esp_sleep.h" #include "peripherals/touch.h" @@ -36,7 +37,7 @@ static volatile bool woke_up = false; void common_hal_alarm_touch_touchalarm_construct(alarm_touch_touchalarm_obj_t *self, const mcu_pin_obj_t *pin) { if (pin->touch_channel == TOUCH_PAD_MAX) { - mp_raise_ValueError(translate("Invalid pin")); + raise_ValueError_invalid_pin(); } claim_pin(pin); self->pin = pin; diff --git a/ports/espressif/common-hal/analogio/AnalogIn.c b/ports/espressif/common-hal/analogio/AnalogIn.c index adb8b15065..4d390e615c 100644 --- a/ports/espressif/common-hal/analogio/AnalogIn.c +++ b/ports/espressif/common-hal/analogio/AnalogIn.c @@ -51,7 +51,7 @@ 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")); + raise_ValueError_invalid_pin(); } common_hal_mcu_pin_claim(pin); self->pin = pin; @@ -80,7 +80,7 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { } else if (self->pin->adc_index == ADC_UNIT_2) { adc2_config_channel_atten((adc2_channel_t)self->pin->adc_channel, ATTENUATION); } else { - mp_raise_ValueError(translate("Invalid Pin")); + raise_ValueError_invalid_pin(); } // Automatically select calibration process depending on status of efuse diff --git a/ports/espressif/common-hal/analogio/AnalogOut.c b/ports/espressif/common-hal/analogio/AnalogOut.c index 2b5f9d0b35..2bceefc9f7 100644 --- a/ports/espressif/common-hal/analogio/AnalogOut.c +++ b/ports/espressif/common-hal/analogio/AnalogOut.c @@ -49,7 +49,7 @@ void common_hal_analogio_analogout_construct(analogio_analogout_obj_t *self, } else if (pin == &pin_GPIO18) { self->channel = DAC_CHANNEL_2; } else { - mp_raise_ValueError(translate("Invalid DAC pin supplied")); + raise_ValueError_invalid_pin(); } dac_output_enable(self->channel); #else diff --git a/ports/espressif/common-hal/busio/I2C.c b/ports/espressif/common-hal/busio/I2C.c index 0706de1df5..5af9e8a4dc 100644 --- a/ports/espressif/common-hal/busio/I2C.c +++ b/ports/espressif/common-hal/busio/I2C.c @@ -42,7 +42,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, // // 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")); + raise_ValueError_invalid_pins(); } #if CIRCUITPY_REQUIRE_I2C_PULLUPS diff --git a/ports/espressif/common-hal/busio/SPI.c b/ports/espressif/common-hal/busio/SPI.c index 4eff1be54c..0b894fa215 100644 --- a/ports/espressif/common-hal/busio/SPI.c +++ b/ports/espressif/common-hal/busio/SPI.c @@ -28,6 +28,7 @@ #include "py/runtime.h" #include "shared-bindings/busio/SPI.h" +#include "shared-bindings/microcontroller/Pin.h" #include "driver/spi_common_internal.h" @@ -101,7 +102,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, 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")); + raise_ValueError_invalid_pins(); } set_spi_config(self, 250000, 0, 0, 8); diff --git a/ports/espressif/common-hal/busio/UART.c b/ports/espressif/common-hal/busio/UART.c index 0c44107e60..9d0fd1dbf7 100644 --- a/ports/espressif/common-hal/busio/UART.c +++ b/ports/espressif/common-hal/busio/UART.c @@ -101,9 +101,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_float_t timeout, uint16_t receiver_buffer_size, byte *receiver_buffer, bool sigint_enabled) { - if (bits > 8) { - mp_raise_NotImplementedError(translate("bytes > 8 bits not supported")); - } + mp_arg_validate_int_max(bits, 8, MP_QSTR_bytes); bool have_tx = tx != NULL; bool have_rx = rx != NULL; diff --git a/ports/espressif/common-hal/canio/CAN.c b/ports/espressif/common-hal/canio/CAN.c index fb2e35f1b1..c9f585b9be 100644 --- a/ports/espressif/common-hal/canio/CAN.c +++ b/ports/espressif/common-hal/canio/CAN.c @@ -133,7 +133,7 @@ void common_hal_canio_can_construct(canio_can_obj_t *self, const mcu_pin_obj_t * 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")); + raise_ValueError_invalid_pins(); } else if (result != ESP_OK) { mp_raise_OSError_msg_varg(translate("twai_driver_install returned esp-idf error #%d"), (int)result); } diff --git a/ports/espressif/common-hal/frequencyio/FrequencyIn.c b/ports/espressif/common-hal/frequencyio/FrequencyIn.c index e4d65c95bd..a50ec27683 100644 --- a/ports/espressif/common-hal/frequencyio/FrequencyIn.c +++ b/ports/espressif/common-hal/frequencyio/FrequencyIn.c @@ -130,9 +130,7 @@ static void init_timer(frequencyio_frequencyin_obj_t *self) { void common_hal_frequencyio_frequencyin_construct(frequencyio_frequencyin_obj_t *self, const mcu_pin_obj_t *pin, const uint16_t capture_period) { - if ((capture_period == 0) || (capture_period > 500)) { - mp_raise_ValueError(translate("Invalid capture period. Valid range: 1 - 500")); - } + mp_arg_validate_int_range(capture_period, 1, 500, MP_QSTR_capture_period); self->pin = pin->number; self->handle = NULL; @@ -188,9 +186,8 @@ uint16_t common_hal_frequencyio_frequencyin_get_capture_period(frequencyio_frequ } void common_hal_frequencyio_frequencyin_set_capture_period(frequencyio_frequencyin_obj_t *self, uint16_t capture_period) { - if ((capture_period == 0) || (capture_period > 500)) { - mp_raise_ValueError(translate("Invalid capture period. Valid range: 1 - 500")); - } + mp_arg_validate_int_range(capture_period, 1, 500, MP_QSTR_capture_period); + self->capture_period = capture_period; common_hal_frequencyio_frequencyin_clear(self); timer_set_alarm_value(self->timer.group, self->timer.idx, capture_period * 1000000); diff --git a/ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c b/ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c index d073a8a362..6bd71cc797 100644 --- a/ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +++ b/ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c @@ -30,6 +30,7 @@ #include "py/runtime.h" #include "common-hal/i2cperipheral/I2CPeripheral.h" +#include "shared-bindings/microcontroller/Pin.h" 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, @@ -39,7 +40,7 @@ void common_hal_i2cperipheral_i2c_peripheral_construct(i2cperipheral_i2c_periphe // support I2C on these pins. // Also 46 is 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")); + raise_ValueError_invalid_pins(); } if (num_addresses > 1) { @@ -72,7 +73,7 @@ void common_hal_i2cperipheral_i2c_peripheral_construct(i2cperipheral_i2c_periphe if (err == ESP_FAIL) { mp_raise_OSError(MP_EIO); } else { - mp_raise_ValueError(translate("Invalid argument")); + mp_arg_error_invalid(MP_QSTR_I2CPeripheral); } } diff --git a/ports/espressif/common-hal/imagecapture/ParallelImageCapture.c b/ports/espressif/common-hal/imagecapture/ParallelImageCapture.c index b167b5c734..7456e474a9 100644 --- a/ports/espressif/common-hal/imagecapture/ParallelImageCapture.c +++ b/ports/espressif/common-hal/imagecapture/ParallelImageCapture.c @@ -41,9 +41,7 @@ void common_hal_imagecapture_parallelimagecapture_construct(imagecapture_paralle const mcu_pin_obj_t *horizontal_reference) { // only 8 bits is supported at present - if (data_count < 8 || data_count > 16) { - mp_raise_ValueError_varg(translate("%q must be between %d and %d"), MP_QSTR_data_count, 8, 16); - } + mp_arg_validate_int_range(data_count, 8, 16, MP_QSTR_data_count); // This will throw if unsuccessful. Everything following is guaranteed to succeed. port_i2s_allocate_i2s0(); diff --git a/ports/espressif/common-hal/pulseio/PulseIn.c b/ports/espressif/common-hal/pulseio/PulseIn.c index 95d69b6a2f..41c1dcb189 100644 --- a/ports/espressif/common-hal/pulseio/PulseIn.c +++ b/ports/espressif/common-hal/pulseio/PulseIn.c @@ -88,7 +88,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self, const mcu uint16_t maxlen, bool idle_state) { 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)); + m_malloc_fail(maxlen * sizeof(uint16_t)); } self->pin = pin; self->maxlen = maxlen; diff --git a/ports/espressif/common-hal/pwmio/PWMOut.c b/ports/espressif/common-hal/pwmio/PWMOut.c index 9ca39c223b..b96c154be6 100644 --- a/ports/espressif/common-hal/pwmio/PWMOut.c +++ b/ports/espressif/common-hal/pwmio/PWMOut.c @@ -217,7 +217,7 @@ void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t *self, uint32_t fr // Calculate duty cycle uint32_t duty_bits = calculate_duty_cycle(frequency); if (duty_bits == 0) { - mp_raise_ValueError(translate("Invalid PWM frequency")); + mp_arg_error_invalid(MP_QSTR_frequency); } self->duty_resolution = duty_bits; ledc_set_freq(LEDC_LOW_SPEED_MODE, self->tim_handle.timer_num, frequency); diff --git a/ports/espressif/common-hal/rtc/RTC.c b/ports/espressif/common-hal/rtc/RTC.c index a78c2fb613..866f9b65a0 100644 --- a/ports/espressif/common-hal/rtc/RTC.c +++ b/ports/espressif/common-hal/rtc/RTC.c @@ -48,5 +48,5 @@ int common_hal_rtc_get_calibration(void) { } void common_hal_rtc_set_calibration(int calibration) { - mp_raise_NotImplementedError(translate("RTC calibration is not supported on this board")); + mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_calibration); } diff --git a/ports/espressif/common-hal/touchio/TouchIn.c b/ports/espressif/common-hal/touchio/TouchIn.c index 53bc335d30..14a27637c8 100644 --- a/ports/espressif/common-hal/touchio/TouchIn.c +++ b/ports/espressif/common-hal/touchio/TouchIn.c @@ -28,6 +28,7 @@ #include "py/runtime.h" #include "peripherals/touch.h" +#include "shared-bindings/microcontroller/Pin.h" static uint16_t get_raw_reading(touchio_touchin_obj_t *self) { uint32_t touch_value; @@ -41,7 +42,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) { if (pin->touch_channel == TOUCH_PAD_MAX) { - mp_raise_ValueError(translate("Invalid pin")); + raise_ValueError_invalid_pin(); } claim_pin(pin); diff --git a/ports/espressif/common-hal/wifi/Radio.c b/ports/espressif/common-hal/wifi/Radio.c index 4f92425c87..8ee1c80926 100644 --- a/ports/espressif/common-hal/wifi/Radio.c +++ b/ports/espressif/common-hal/wifi/Radio.c @@ -209,7 +209,7 @@ void common_hal_wifi_radio_start_ap(wifi_radio_obj_t *self, uint8_t *ssid, size_ authmode = WIFI_AUTH_WPA_WPA2_PSK; break; default: - mp_raise_ValueError(translate("Invalid AuthMode")); + mp_arg_error_invalid(MP_QSTR_authmode); break; } @@ -221,9 +221,8 @@ void common_hal_wifi_radio_start_ap(wifi_radio_obj_t *self, uint8_t *ssid, size_ config->ap.channel = channel; config->ap.authmode = authmode; - if (max_connections < 0 || max_connections > 10) { - mp_raise_ValueError(translate("max_connections must be between 0 and 10")); - } + mp_arg_validate_int_range(max_connections, 0, 10, MP_QSTR_max_connections); + config->ap.max_connection = max_connections; esp_wifi_set_config(WIFI_IF_AP, config); diff --git a/ports/mimxrt10xx/common-hal/analogio/AnalogIn.c b/ports/mimxrt10xx/common-hal/analogio/AnalogIn.c index 2d809c258c..3f3147971f 100644 --- a/ports/mimxrt10xx/common-hal/analogio/AnalogIn.c +++ b/ports/mimxrt10xx/common-hal/analogio/AnalogIn.c @@ -42,7 +42,7 @@ void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self, adc_config_t config = {0}; if (pin->adc == NULL) { - mp_raise_ValueError(translate("Pin does not have ADC capabilities")); + raise_ValueError_invalid_pin(); } ADC_GetDefaultConfig(&config); diff --git a/ports/mimxrt10xx/common-hal/analogio/AnalogOut.c b/ports/mimxrt10xx/common-hal/analogio/AnalogOut.c index bf21e30df3..de807e7e5c 100644 --- a/ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +++ b/ports/mimxrt10xx/common-hal/analogio/AnalogOut.c @@ -32,7 +32,7 @@ #include "supervisor/shared/translate.h" void common_hal_analogio_analogout_construct(analogio_analogout_obj_t *self, const mcu_pin_obj_t *pin) { - mp_raise_NotImplementedError(translate("AnalogOut functionality not supported")); + mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_AnalogOut); } bool common_hal_analogio_analogout_deinited(analogio_analogout_obj_t *self) { diff --git a/ports/mimxrt10xx/common-hal/busio/I2C.c b/ports/mimxrt10xx/common-hal/busio/I2C.c index 77df979e4d..50aae54aba 100644 --- a/ports/mimxrt10xx/common-hal/busio/I2C.c +++ b/ports/mimxrt10xx/common-hal/busio/I2C.c @@ -138,7 +138,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, } if (self->sda == NULL || self->scl == NULL) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } else { self->i2c = mcu_i2c_banks[self->sda->bank_idx - 1]; } diff --git a/ports/mimxrt10xx/common-hal/busio/SPI.c b/ports/mimxrt10xx/common-hal/busio/SPI.c index 608fae7fbe..0048c2aeb2 100644 --- a/ports/mimxrt10xx/common-hal/busio/SPI.c +++ b/ports/mimxrt10xx/common-hal/busio/SPI.c @@ -168,7 +168,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, if (spi_taken) { mp_raise_ValueError(translate("Hardware busy, try alternative pins")); } else { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } } diff --git a/ports/mimxrt10xx/common-hal/busio/UART.c b/ports/mimxrt10xx/common-hal/busio/UART.c index 57eaada7ef..8615002811 100644 --- a/ports/mimxrt10xx/common-hal/busio/UART.c +++ b/ports/mimxrt10xx/common-hal/busio/UART.c @@ -117,7 +117,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, self->timeout_ms = timeout * 1000; if (self->character_bits != 7 && self->character_bits != 8) { - mp_raise_ValueError(translate("Invalid word/bit length")); + mp_arg_validate_int_range(self->character_bits, 7, 8, MP_QSTR_bits); } DBGPrintf(&mp_plat_print, "uart_construct: tx:%p rx:%p rts:%p cts:%p rs485:%p\n", tx, rx, rts, cts, rs485_dir); @@ -350,7 +350,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, if (!self->ringbuf) { LPUART_Deinit(self->uart); - mp_raise_msg(&mp_type_MemoryError, translate("Failed to allocate RX buffer")); + m_malloc_fail(receiver_buffer_size); } LPUART_TransferCreateHandle(self->uart, &self->handle, LPUART_UserCallback, self); diff --git a/ports/mimxrt10xx/common-hal/microcontroller/__init__.c b/ports/mimxrt10xx/common-hal/microcontroller/__init__.c index e6edd6dfc9..3ea454a2b3 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/__init__.c +++ b/ports/mimxrt10xx/common-hal/microcontroller/__init__.c @@ -70,7 +70,7 @@ void common_hal_mcu_enable_interrupts(void) { void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) { if (runmode == RUNMODE_BOOTLOADER) { if (!bootloader_available()) { - mp_raise_ValueError(translate("Cannot reset into bootloader because no bootloader is present.")); + mp_raise_ValueError(translate("Cannot reset into bootloader because no bootloader is present")); } // Pretend to be the first of the two reset presses needed to enter the // bootloader. That way one reset will end in the bootloader. diff --git a/ports/mimxrt10xx/common-hal/pwmio/PWMOut.c b/ports/mimxrt10xx/common-hal/pwmio/PWMOut.c index a42bbef7d7..29f72e21e4 100644 --- a/ports/mimxrt10xx/common-hal/pwmio/PWMOut.c +++ b/ports/mimxrt10xx/common-hal/pwmio/PWMOut.c @@ -301,7 +301,7 @@ void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t *self, int pulse_count = calculate_pulse_count(frequency, &self->prescaler); if (pulse_count == 0) { - mp_raise_ValueError(translate("Invalid PWM frequency")); + mp_arg_error_invalid(MP_QSTR_frequency); } self->pulse_count = pulse_count; diff --git a/ports/mimxrt10xx/common-hal/rtc/RTC.c b/ports/mimxrt10xx/common-hal/rtc/RTC.c index 04aa799ce5..a58b37ae62 100644 --- a/ports/mimxrt10xx/common-hal/rtc/RTC.c +++ b/ports/mimxrt10xx/common-hal/rtc/RTC.c @@ -75,5 +75,5 @@ int common_hal_rtc_get_calibration(void) { void common_hal_rtc_set_calibration(int calibration) { // SNVS has HPCALB_VAL bits for calibration. - mp_raise_NotImplementedError(translate("RTC calibration is not supported on this board")); + mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_calibration); } diff --git a/ports/mimxrt10xx/common-hal/usb_host/Port.c b/ports/mimxrt10xx/common-hal/usb_host/Port.c index 52ac12dc86..126160c69c 100644 --- a/ports/mimxrt10xx/common-hal/usb_host/Port.c +++ b/ports/mimxrt10xx/common-hal/usb_host/Port.c @@ -24,9 +24,8 @@ * THE SOFTWARE. */ -#include "shared-bindings/usb_host/Port.h" - #include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/usb_host/Port.h" #include "py/runtime.h" @@ -43,7 +42,7 @@ void common_hal_usb_host_port_construct(usb_host_port_obj_t *self, const mcu_pin supported_dm = &pin_USB_OTG2_DN; } if (dp != supported_dp || dm != supported_dm) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } self->init = true; usb_host_init = true; diff --git a/ports/nrf/common-hal/alarm/pin/PinAlarm.c b/ports/nrf/common-hal/alarm/pin/PinAlarm.c index 4bf412d85b..9d0f8f4b88 100644 --- a/ports/nrf/common-hal/alarm/pin/PinAlarm.c +++ b/ports/nrf/common-hal/alarm/pin/PinAlarm.c @@ -49,10 +49,10 @@ extern uint32_t reset_reason_saved; void common_hal_alarm_pin_pinalarm_construct(alarm_pin_pinalarm_obj_t *self, const mcu_pin_obj_t *pin, bool value, bool edge, bool pull) { if (edge) { - mp_raise_ValueError(translate("Cannot wake on pin edge. Only level.")); + mp_raise_ValueError(translate("Cannot wake on pin edge, only level")); } if (pin->number >= NUMBER_OF_PINS) { - mp_raise_ValueError(translate("Invalid pin")); + raise_ValueError_invalid_pin(); } self->pin = pin; self->value = value; diff --git a/ports/nrf/common-hal/alarm/time/TimeAlarm.c b/ports/nrf/common-hal/alarm/time/TimeAlarm.c index c5f3bfd705..03b91068f9 100644 --- a/ports/nrf/common-hal/alarm/time/TimeAlarm.c +++ b/ports/nrf/common-hal/alarm/time/TimeAlarm.c @@ -85,7 +85,7 @@ void alarm_time_timealarm_set_alarms(bool deep_sleep, size_t n_alarms, const mp_ continue; } if (timealarm_set) { - mp_raise_ValueError(translate("Only one alarm.time alarm can be set.")); + mp_raise_ValueError(translate("Only one alarm.time alarm can be set")); } timealarm = MP_OBJ_TO_PTR(alarms[i]); timealarm_set = true; diff --git a/ports/nrf/common-hal/analogio/AnalogIn.c b/ports/nrf/common-hal/analogio/AnalogIn.c index c64e51ec09..8498e20f29 100644 --- a/ports/nrf/common-hal/analogio/AnalogIn.c +++ b/ports/nrf/common-hal/analogio/AnalogIn.c @@ -27,6 +27,7 @@ #include "common-hal/analogio/AnalogIn.h" #include "shared-bindings/analogio/AnalogIn.h" +#include "shared-bindings/microcontroller/Pin.h" #include "py/runtime.h" #include "supervisor/shared/translate.h" @@ -48,7 +49,7 @@ void analogin_init(void) { void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self, const mcu_pin_obj_t *pin) { if (pin->adc_channel == 0) { - mp_raise_ValueError(translate("Pin does not have ADC capabilities")); + raise_ValueError_invalid_pin(); } nrf_gpio_cfg_default(pin->number); diff --git a/ports/nrf/common-hal/analogio/AnalogOut.c b/ports/nrf/common-hal/analogio/AnalogOut.c index 7afa773d30..4efd56795a 100644 --- a/ports/nrf/common-hal/analogio/AnalogOut.c +++ b/ports/nrf/common-hal/analogio/AnalogOut.c @@ -34,7 +34,7 @@ #include "supervisor/shared/translate.h" void common_hal_analogio_analogout_construct(analogio_analogout_obj_t *self, const mcu_pin_obj_t *pin) { - mp_raise_RuntimeError(translate("AnalogOut functionality not supported")); + mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_AnalogOut); } bool common_hal_analogio_analogout_deinited(analogio_analogout_obj_t *self) { diff --git a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c index c3da519454..6728bf1e44 100644 --- a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +++ b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c @@ -263,9 +263,8 @@ void common_hal_audiopwmio_pwmaudioout_play(audiopwmio_pwmaudioout_obj_t *self, &spacing); self->sample_channel_count = audiosample_channel_count(sample); - if (max_buffer_length > UINT16_MAX) { - mp_raise_ValueError_varg(translate("Buffer length %d too big. It must be less than %d"), max_buffer_length, UINT16_MAX); - } + mp_arg_validate_length_max(max_buffer_length, UINT16_MAX, MP_QSTR_buffer); + uint16_t buffer_length = (uint16_t)max_buffer_length; self->buffers[0] = m_malloc(buffer_length * 2 * sizeof(uint16_t), false); if (!self->single_buffer) { diff --git a/ports/nrf/common-hal/busio/I2C.c b/ports/nrf/common-hal/busio/I2C.c index 322b5f2faa..6c645a512b 100644 --- a/ports/nrf/common-hal/busio/I2C.c +++ b/ports/nrf/common-hal/busio/I2C.c @@ -29,6 +29,7 @@ #include "shared-bindings/busio/I2C.h" #include "shared-bindings/microcontroller/__init__.h" +#include "shared-bindings/microcontroller/Pin.h" #include "py/mperrno.h" #include "py/runtime.h" #include "supervisor/shared/translate.h" @@ -96,7 +97,7 @@ static uint8_t twi_error_to_mp(const nrfx_err_t err) { 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) { if (scl->number == sda->number) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } // Find a free instance. diff --git a/ports/nrf/common-hal/busio/UART.c b/ports/nrf/common-hal/busio/UART.c index 132f5d9272..5c08f50012 100644 --- a/ports/nrf/common-hal/busio/UART.c +++ b/ports/nrf/common-hal/busio/UART.c @@ -164,12 +164,10 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_float_t timeout, uint16_t receiver_buffer_size, byte *receiver_buffer, bool sigint_enabled) { - if (bits != 8) { - mp_raise_ValueError(translate("Invalid word/bit length")); - } + mp_arg_validate_int(bits, 8, MP_QSTR_bits); if ((rs485_dir != NULL) || (rs485_invert)) { - mp_raise_ValueError(translate("RS485 Not yet supported on this device")); + mp_raise_NotImplementedError(translate("RS485")); } // Find a free UART peripheral. @@ -189,9 +187,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_raise_ValueError(translate("tx and rx cannot both be None")); } - if (receiver_buffer_size == 0) { - mp_raise_ValueError(translate("Invalid buffer size")); - } + mp_arg_validate_int_min(receiver_buffer_size, 1, MP_QSTR_receiver_buffer_size); if (parity == BUSIO_UART_PARITY_ODD) { mp_raise_ValueError(translate("Odd parity is not supported")); @@ -234,7 +230,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, // (This is a macro.) } else if (!ringbuf_alloc(&self->ringbuf, receiver_buffer_size, true)) { nrfx_uarte_uninit(self->uarte); - mp_raise_msg(&mp_type_MemoryError, translate("Failed to allocate RX buffer")); + m_malloc_fail(receiver_buffer_size); } self->rx_pin_number = rx->number; diff --git a/ports/nrf/common-hal/pulseio/PulseIn.c b/ports/nrf/common-hal/pulseio/PulseIn.c index 4ab5d609f2..757c56a4ac 100644 --- a/ports/nrf/common-hal/pulseio/PulseIn.c +++ b/ports/nrf/common-hal/pulseio/PulseIn.c @@ -129,7 +129,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self, const mcu 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)); + m_malloc_fail(maxlen * sizeof(uint16_t)); } if (refcount == 0) { @@ -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_varg(translate("%q index out of range"), MP_QSTR_PulseIn); + mp_raise_IndexError_varg(translate("%q out of range"), MP_QSTR_index); } uint16_t value = self->buffer[(self->start + index) % self->maxlen]; diff --git a/ports/nrf/common-hal/pwmio/PWMOut.c b/ports/nrf/common-hal/pwmio/PWMOut.c index 27c0b79b5a..619acdfab6 100644 --- a/ports/nrf/common-hal/pwmio/PWMOut.c +++ b/ports/nrf/common-hal/pwmio/PWMOut.c @@ -297,7 +297,7 @@ void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t *self, uint32_t fr uint16_t countertop; nrf_pwm_clk_t base_clock; if (frequency == 0 || !convert_frequency(frequency, &countertop, &base_clock)) { - mp_raise_ValueError(translate("Invalid PWM frequency")); + mp_arg_error_invalid(MP_QSTR_frequency); } self->frequency = frequency; diff --git a/ports/nrf/common-hal/rtc/RTC.c b/ports/nrf/common-hal/rtc/RTC.c index 0b7115a14f..ecc687b5e9 100644 --- a/ports/nrf/common-hal/rtc/RTC.c +++ b/ports/nrf/common-hal/rtc/RTC.c @@ -80,5 +80,5 @@ int common_hal_rtc_get_calibration(void) { } void common_hal_rtc_set_calibration(int calibration) { - mp_raise_NotImplementedError(translate("RTC calibration is not supported on this board")); + mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_calibration); } diff --git a/ports/raspberrypi/bindings/rp2pio/StateMachine.c b/ports/raspberrypi/bindings/rp2pio/StateMachine.c index a69089696e..2c7efb09d8 100644 --- a/ports/raspberrypi/bindings/rp2pio/StateMachine.c +++ b/ports/raspberrypi/bindings/rp2pio/StateMachine.c @@ -223,50 +223,31 @@ STATIC mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n // We don't validate pin in use here because we may be ok sharing them within a PIO. const mcu_pin_obj_t *first_out_pin = validate_obj_is_pin_or_none(args[ARG_first_out_pin].u_obj); - if (args[ARG_out_pin_count].u_int < 1) { - mp_raise_ValueError(translate("Pin count must be at least 1")); - } + mp_int_t out_pin_count = mp_arg_validate_int_min(args[ARG_out_pin_count].u_int, 1, MP_QSTR_out_pin_count); + const mcu_pin_obj_t *first_in_pin = validate_obj_is_pin_or_none(args[ARG_first_in_pin].u_obj); - if (args[ARG_in_pin_count].u_int < 1) { - mp_raise_ValueError(translate("Pin count must be at least 1")); - } + mp_int_t in_pin_count = mp_arg_validate_int_min(args[ARG_in_pin_count].u_int, 1, MP_QSTR_in_pin_count); + const mcu_pin_obj_t *first_set_pin = validate_obj_is_pin_or_none(args[ARG_first_set_pin].u_obj); - if (args[ARG_set_pin_count].u_int < 1) { - mp_raise_ValueError(translate("Pin count must be at least 1")); - } - if (args[ARG_set_pin_count].u_int > 5) { - mp_raise_ValueError(translate("Set pin count must be between 1 and 5")); - } + mp_int_t set_pin_count = mp_arg_validate_int_range(args[ARG_set_pin_count].u_int, 1, 5, MP_QSTR_set_pin_count); + const mcu_pin_obj_t *first_sideset_pin = validate_obj_is_pin_or_none(args[ARG_first_sideset_pin].u_obj); - if (args[ARG_sideset_pin_count].u_int < 1) { - mp_raise_ValueError(translate("Pin count must be at least 1")); - } - if (args[ARG_sideset_pin_count].u_int > 5) { - mp_raise_ValueError(translate("Side set pin count must be between 1 and 5")); - } + mp_int_t sideset_pin_count = mp_arg_validate_int_range(args[ARG_sideset_pin_count].u_int, 1, 5, MP_QSTR_set_pin_count); const mcu_pin_obj_t *jmp_pin = validate_obj_is_pin_or_none(args[ARG_jmp_pin].u_obj); digitalio_pull_t jmp_pin_pull = validate_pull(args[ARG_jmp_pin_pull].u_rom_obj, MP_QSTR_jmp_pull); - mp_int_t pull_threshold = args[ARG_pull_threshold].u_int; - mp_int_t push_threshold = args[ARG_push_threshold].u_int; - if (pull_threshold < 1 || pull_threshold > 32) { - mp_raise_ValueError(translate("pull_threshold must be between 1 and 32")); - } - if (push_threshold < 1 || push_threshold > 32) { - mp_raise_ValueError(translate("push_threshold must be between 1 and 32")); - } + mp_int_t pull_threshold = + mp_arg_validate_int_range(args[ARG_pull_threshold].u_int, 1, 32, MP_QSTR_pull_threshold); + mp_int_t push_threshold = + mp_arg_validate_int_range(args[ARG_push_threshold].u_int, 1, 32, MP_QSTR_push_threshold); - if (bufinfo.len < 2) { - mp_raise_ValueError(translate("Program must contain at least one 16-bit instruction.")); - } + mp_arg_validate_length_range(bufinfo.len, 2, 64, MP_QSTR_program); if (bufinfo.len % 2 != 0) { mp_raise_ValueError(translate("Program size invalid")); } - if (bufinfo.len > 64) { - mp_raise_ValueError(translate("Program too large")); - } + mp_arg_validate_length_range(init_bufinfo.len, 2, 64, MP_QSTR_init); if (init_bufinfo.len % 2 != 0) { mp_raise_ValueError(translate("Init program size invalid")); } diff --git a/ports/raspberrypi/common-hal/analogio/AnalogIn.c b/ports/raspberrypi/common-hal/analogio/AnalogIn.c index 1d77630063..4b82ab687a 100644 --- a/ports/raspberrypi/common-hal/analogio/AnalogIn.c +++ b/ports/raspberrypi/common-hal/analogio/AnalogIn.c @@ -26,6 +26,7 @@ #include "common-hal/analogio/AnalogIn.h" #include "shared-bindings/analogio/AnalogIn.h" +#include "shared-bindings/microcontroller/Pin.h" #include "py/runtime.h" #include "supervisor/shared/translate.h" @@ -36,7 +37,7 @@ void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self, const mcu_pin_obj_t *pin) { if (pin->number < ADC_FIRST_PIN_NUMBER || pin->number > ADC_FIRST_PIN_NUMBER + ADC_PIN_COUNT) { - mp_raise_ValueError(translate("Pin does not have ADC capabilities")); + raise_ValueError_invalid_pin(); } adc_init(); diff --git a/ports/raspberrypi/common-hal/analogio/AnalogOut.c b/ports/raspberrypi/common-hal/analogio/AnalogOut.c index 7afa773d30..4efd56795a 100644 --- a/ports/raspberrypi/common-hal/analogio/AnalogOut.c +++ b/ports/raspberrypi/common-hal/analogio/AnalogOut.c @@ -34,7 +34,7 @@ #include "supervisor/shared/translate.h" void common_hal_analogio_analogout_construct(analogio_analogout_obj_t *self, const mcu_pin_obj_t *pin) { - mp_raise_RuntimeError(translate("AnalogOut functionality not supported")); + mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_AnalogOut); } bool common_hal_analogio_analogout_deinited(analogio_analogout_obj_t *self) { diff --git a/ports/raspberrypi/common-hal/busio/I2C.c b/ports/raspberrypi/common-hal/busio/I2C.c index 516cee2227..6b15bee512 100644 --- a/ports/raspberrypi/common-hal/busio/I2C.c +++ b/ports/raspberrypi/common-hal/busio/I2C.c @@ -30,6 +30,7 @@ #include "py/runtime.h" #include "shared-bindings/microcontroller/__init__.h" +#include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/bitbangio/I2C.h" #include "src/rp2_common/hardware_gpio/include/hardware/gpio.h" @@ -65,14 +66,14 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, self->peripheral = i2c[sda_instance]; } if (self->peripheral == NULL) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } if ((i2c_get_hw(self->peripheral)->enable & I2C_IC_ENABLE_ENABLE_BITS) != 0) { mp_raise_ValueError(translate("I2C peripheral in use")); } - if (frequency > 1000000) { - mp_raise_ValueError(translate("Unsupported baudrate")); - } + + mp_arg_validate_int_max(frequency, 1000000, MP_QSTR_frequency); + #if CIRCUITPY_REQUIRE_I2C_PULLUPS // Test that the pins are in a high state. (Hopefully indicating they are pulled up.) diff --git a/ports/raspberrypi/common-hal/busio/SPI.c b/ports/raspberrypi/common-hal/busio/SPI.c index 4a18d62584..a7b97823f9 100644 --- a/ports/raspberrypi/common-hal/busio/SPI.c +++ b/ports/raspberrypi/common-hal/busio/SPI.c @@ -82,7 +82,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, // TODO: Check to see if we're sharing the SPI with a native APA102. if (instance_index > 1) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } if (instance_index == 0) { diff --git a/ports/raspberrypi/common-hal/busio/UART.c b/ports/raspberrypi/common-hal/busio/UART.c index 97af41d495..d1ed3ea27a 100644 --- a/ports/raspberrypi/common-hal/busio/UART.c +++ b/ports/raspberrypi/common-hal/busio/UART.c @@ -32,6 +32,7 @@ #include "supervisor/shared/tick.h" #include "shared/runtime/interrupt_char.h" #include "common-hal/microcontroller/Pin.h" +#include "shared-bindings/microcontroller/Pin.h" #include "src/rp2_common/hardware_irq/include/hardware/irq.h" #include "src/rp2_common/hardware_gpio/include/hardware/gpio.h" @@ -66,7 +67,7 @@ static uint8_t pin_init(const uint8_t uart, const mcu_pin_obj_t *pin, const uint return NO_PIN; } if (!(((pin->number % 4) == pin_type) && ((((pin->number + 4) / 8) % NUM_UARTS) == uart))) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } claim_pin(pin); gpio_set_function(pin->number, GPIO_FUNC_UART); @@ -104,13 +105,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_float_t timeout, uint16_t receiver_buffer_size, byte *receiver_buffer, bool sigint_enabled) { - if (bits > 8) { - mp_raise_ValueError(translate("Invalid word/bit length")); - } - - if (receiver_buffer_size == 0) { - mp_raise_ValueError(translate("Invalid buffer size")); - } + mp_arg_validate_int_max(bits, 8, MP_QSTR_bits); + mp_arg_validate_int_min(receiver_buffer_size, 1, MP_QSTR_receiver_buffer_size); uint8_t uart_id = ((((tx != NULL) ? tx->number : rx->number) + 4) / 8) % NUM_UARTS; @@ -167,7 +163,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, // in the long-lived pool is not strictly necessary) // (This is a macro.) if (!ringbuf_alloc(&self->ringbuf, receiver_buffer_size, true)) { - mp_raise_msg(&mp_type_MemoryError, translate("Failed to allocate RX buffer")); + m_malloc_fail(receiver_buffer_size); } active_uarts[uart_id] = self; if (uart_id == 1) { diff --git a/ports/raspberrypi/common-hal/pulseio/PulseIn.c b/ports/raspberrypi/common-hal/pulseio/PulseIn.c index 45d31626ec..97c2b03f7b 100644 --- a/ports/raspberrypi/common-hal/pulseio/PulseIn.c +++ b/ports/raspberrypi/common-hal/pulseio/PulseIn.c @@ -49,7 +49,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self, 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)); + m_malloc_fail(maxlen * sizeof(uint16_t)); } self->pin = pin->number; self->maxlen = maxlen; @@ -237,7 +237,7 @@ uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t *self, index += self->len; } if (index < 0 || index >= self->len) { - mp_raise_IndexError_varg(translate("%q index out of range"), MP_QSTR_PulseIn); + mp_raise_IndexError_varg(translate("%q out of range"), MP_QSTR_index); } uint16_t value = self->buffer[(self->start + index) % self->maxlen]; return value; diff --git a/ports/raspberrypi/common-hal/pwmio/PWMOut.c b/ports/raspberrypi/common-hal/pwmio/PWMOut.c index 3ef4fb57f3..958e848b9f 100644 --- a/ports/raspberrypi/common-hal/pwmio/PWMOut.c +++ b/ports/raspberrypi/common-hal/pwmio/PWMOut.c @@ -259,7 +259,7 @@ void pwmio_pwmout_set_top(pwmio_pwmout_obj_t *self, uint16_t top) { void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t *self, uint32_t frequency) { if (frequency == 0 || frequency > (common_hal_mcu_processor_get_frequency() / 2)) { - mp_raise_ValueError(translate("Invalid PWM frequency")); + mp_arg_error_invalid(MP_QSTR_frequency); } target_slice_frequencies[self->slice] = frequency; diff --git a/ports/raspberrypi/common-hal/rtc/RTC.c b/ports/raspberrypi/common-hal/rtc/RTC.c index 9bd10abf70..9bfda0af31 100644 --- a/ports/raspberrypi/common-hal/rtc/RTC.c +++ b/ports/raspberrypi/common-hal/rtc/RTC.c @@ -92,5 +92,5 @@ int common_hal_rtc_get_calibration(void) { } void common_hal_rtc_set_calibration(int calibration) { - mp_raise_NotImplementedError(translate("RTC calibration is not supported on this board")); + mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_calibration); } diff --git a/ports/stm/common-hal/alarm/time/TimeAlarm.c b/ports/stm/common-hal/alarm/time/TimeAlarm.c index 6fb1fc629d..2eb8ee4a81 100644 --- a/ports/stm/common-hal/alarm/time/TimeAlarm.c +++ b/ports/stm/common-hal/alarm/time/TimeAlarm.c @@ -84,7 +84,7 @@ void alarm_time_timealarm_set_alarms(bool deep_sleep, size_t n_alarms, const mp_ continue; } if (timealarm_set) { - mp_raise_ValueError(translate("Only one alarm.time alarm can be set.")); + mp_raise_ValueError(translate("Only one alarm.time alarm can be set")); } timealarm = MP_OBJ_TO_PTR(alarms[i]); timealarm_set = true; diff --git a/ports/stm/common-hal/analogio/AnalogIn.c b/ports/stm/common-hal/analogio/AnalogIn.c index ed2575493e..c943ce0901 100644 --- a/ports/stm/common-hal/analogio/AnalogIn.c +++ b/ports/stm/common-hal/analogio/AnalogIn.c @@ -51,7 +51,7 @@ void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self, // No ADC function on pin if (pin->adc_unit == 0x00) { - mp_raise_ValueError(translate("Pin does not have ADC capabilities")); + raise_ValueError_invalid_pin(); } // TODO: add ADC traits to structure? diff --git a/ports/stm/common-hal/analogio/AnalogOut.c b/ports/stm/common-hal/analogio/AnalogOut.c index 0320b1f99b..b2cdd50153 100644 --- a/ports/stm/common-hal/analogio/AnalogOut.c +++ b/ports/stm/common-hal/analogio/AnalogOut.c @@ -65,7 +65,7 @@ void common_hal_analogio_analogout_construct(analogio_analogout_obj_t *self, self->channel = DAC_CHANNEL_2; self->dac_index = 1; } else { - mp_raise_ValueError(translate("Invalid DAC pin supplied")); + raise_ValueError_invalid_pin(); } // Only init if the shared DAC is empty or reset diff --git a/ports/stm/common-hal/busio/I2C.c b/ports/stm/common-hal/busio/I2C.c index 5ede538b12..3ca8249660 100644 --- a/ports/stm/common-hal/busio/I2C.c +++ b/ports/stm/common-hal/busio/I2C.c @@ -120,7 +120,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_varg(translate("Invalid %q pin selection"), MP_QSTR_I2C); + mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_I2C); } } @@ -155,7 +155,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("Unsupported baudrate")); + mp_raise_ValueError(translate("Unsupported frequency")); } #else self->handle.Init.ClockSpeed = frequency; @@ -171,7 +171,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, self->handle.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE; self->handle.State = HAL_I2C_STATE_RESET; if (HAL_I2C_Init(&(self->handle)) != HAL_OK) { - mp_raise_RuntimeError(translate("I2C Init Error")); + mp_raise_RuntimeError(translate("I2C init error")); } common_hal_mcu_pin_claim(sda); common_hal_mcu_pin_claim(scl); diff --git a/ports/stm/common-hal/busio/SPI.c b/ports/stm/common-hal/busio/SPI.c index f7961f8cef..fb782daad4 100644 --- a/ports/stm/common-hal/busio/SPI.c +++ b/ports/stm/common-hal/busio/SPI.c @@ -165,7 +165,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_varg(translate("Invalid %q pin selection"), MP_QSTR_SPI); + raise_ValueError_invalid_pin(); } } @@ -224,7 +224,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, self->handle.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; self->handle.Init.CRCPolynomial = 10; if (HAL_SPI_Init(&self->handle) != HAL_OK) { - mp_raise_ValueError(translate("SPI Init Error")); + mp_raise_ValueError(translate("SPI init error")); } self->baudrate = (get_busclock(SPIx) / 16); self->prescaler = 16; @@ -306,7 +306,7 @@ bool common_hal_busio_spi_configure(busio_spi_obj_t *self, get_busclock(self->handle.Instance)); if (HAL_SPI_Init(&self->handle) != HAL_OK) { - mp_raise_ValueError(translate("SPI Re-initialization error")); + mp_raise_ValueError(translate("SPI re-initialization error")); } self->baudrate = baudrate; @@ -346,7 +346,7 @@ 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 == NULL) { - mp_raise_ValueError(translate("No MOSI Pin")); + mp_raise_ValueError(translate("No MOSI pin")); } HAL_StatusTypeDef result = HAL_SPI_Transmit(&self->handle, (uint8_t *)data, (uint16_t)len, HAL_MAX_DELAY); return result == HAL_OK; @@ -355,9 +355,9 @@ bool common_hal_busio_spi_write(busio_spi_obj_t *self, bool common_hal_busio_spi_read(busio_spi_obj_t *self, uint8_t *data, size_t len, uint8_t write_value) { if (self->miso == NULL && !self->half_duplex) { - mp_raise_ValueError(translate("No MISO Pin")); + mp_raise_ValueError(translate("No MISO pin")); } else if (self->half_duplex && self->mosi == NULL) { - mp_raise_ValueError(translate("No MOSI Pin")); + mp_raise_ValueError(translate("No MOSI pin")); } HAL_StatusTypeDef result = HAL_OK; if ((!self->half_duplex && self->mosi == NULL) || (self->half_duplex && self->mosi != NULL && self->miso == NULL)) { @@ -372,7 +372,7 @@ bool common_hal_busio_spi_read(busio_spi_obj_t *self, bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, 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")); + mp_raise_ValueError(translate("Missing MISO or MOSI pin")); } HAL_StatusTypeDef result = HAL_SPI_TransmitReceive(&self->handle, (uint8_t *)data_out, data_in, (uint16_t)len,HAL_MAX_DELAY); diff --git a/ports/stm/common-hal/busio/UART.c b/ports/stm/common-hal/busio/UART.c index 7e35ad86dd..2347c079e8 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_eval if (uart_taken) { mp_raise_ValueError(translate("Hardware in use, try alternative pins")); } else { - mp_raise_ValueError_varg(translate("Invalid %q pin selection"), MP_QSTR_UART); + raise_ValueError_invalid_pin(); } } } @@ -164,12 +164,9 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } // Other errors - if (receiver_buffer_size == 0) { - mp_raise_ValueError(translate("Invalid buffer size")); - } - if (bits != 8 && bits != 9) { - mp_raise_ValueError(translate("Invalid word/bit length")); - } + mp_arg_validate_length_min(receiver_buffer_size, 1, MP_QSTR_receiver_buffer_size); + mp_arg_validate_int_range(bits, 8, 9, MP_QSTR_bits); + if (USARTx == NULL) { // this can only be hit if the periph file is wrong mp_raise_ValueError(translate("Internal define error")); } @@ -211,7 +208,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, self->handle.Init.HwFlowCtl = UART_HWCONTROL_NONE; self->handle.Init.OverSampling = UART_OVERSAMPLING_16; if (HAL_UART_Init(&self->handle) != HAL_OK) { - mp_raise_ValueError(translate("UART Init Error")); + mp_raise_ValueError(translate("UART init error")); } @@ -221,7 +218,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, self->ringbuf = (ringbuf_t) { receiver_buffer, receiver_buffer_size }; } else { if (!ringbuf_alloc(&self->ringbuf, receiver_buffer_size, true)) { - mp_raise_ValueError(translate("UART Buffer allocation error")); + m_malloc_fail(receiver_buffer_size); } } common_hal_mcu_pin_claim(rx); @@ -408,11 +405,11 @@ void common_hal_busio_uart_set_baudrate(busio_uart_obj_t *self, uint32_t baudrat // Otherwise de-init and set new rate if (HAL_UART_DeInit(&self->handle) != HAL_OK) { - mp_raise_ValueError(translate("UART De-init error")); + mp_raise_ValueError(translate("UART de-init error")); } self->handle.Init.BaudRate = baudrate; if (HAL_UART_Init(&self->handle) != HAL_OK) { - mp_raise_ValueError(translate("UART Re-init error")); + mp_raise_ValueError(translate("UART re-init error")); } self->baudrate = baudrate; diff --git a/ports/stm/common-hal/canio/CAN.c b/ports/stm/common-hal/canio/CAN.c index 74ff7f964b..08ac034bde 100644 --- a/ports/stm/common-hal/canio/CAN.c +++ b/ports/stm/common-hal/canio/CAN.c @@ -59,13 +59,13 @@ void common_hal_canio_can_construct(canio_can_obj_t *self, const mcu_pin_obj_t * 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); + mp_raise_ValueError_varg(translate("Invalid %q pin"), 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); + mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_rx); } if (reserved_can[periph_index]) { diff --git a/ports/stm/common-hal/pulseio/PulseIn.c b/ports/stm/common-hal/pulseio/PulseIn.c index b8fbd9a36b..1c323ad711 100644 --- a/ports/stm/common-hal/pulseio/PulseIn.c +++ b/ports/stm/common-hal/pulseio/PulseIn.c @@ -123,8 +123,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self, const mcu self->buffer = (uint16_t *)m_malloc(maxlen * sizeof(uint16_t), false); if (self->buffer == NULL) { // TODO: free the EXTI here? - mp_raise_msg_varg(&mp_type_MemoryError, translate("Failed to allocate RX buffer of %d bytes"), - maxlen * sizeof(uint16_t)); + m_malloc_fail(maxlen * sizeof(uint16_t)); } // Set internal variables @@ -257,7 +256,7 @@ uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t *self, int16_ } if (index < 0 || index >= self->len) { stm_peripherals_exti_enable(self->pin->number); - mp_raise_IndexError_varg(translate("%q index out of range"), MP_QSTR_PulseIn); + mp_raise_IndexError_varg(translate("%q out of range"), MP_QSTR_index); } uint16_t value = self->buffer[(self->start + index) % self->maxlen]; stm_peripherals_exti_enable(self->pin->number); diff --git a/ports/stm/common-hal/sdioio/SDCard.c b/ports/stm/common-hal/sdioio/SDCard.c index c7472a459f..40e6eddae1 100644 --- a/ports/stm/common-hal/sdioio/SDCard.c +++ b/ports/stm/common-hal/sdioio/SDCard.c @@ -115,7 +115,7 @@ STATIC int check_pins(sdioio_sdcard_obj_t *self, 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); + raise_ValueError_invalid_pin(); } } diff --git a/py/argcheck.c b/py/argcheck.c index c2066a7c39..5854c9d1d2 100644 --- a/py/argcheck.c +++ b/py/argcheck.c @@ -156,6 +156,13 @@ NORETURN void mp_arg_error_unimpl_kw(void) { #endif +mp_int_t mp_arg_validate_int(mp_int_t i, mp_int_t required_i, qstr arg_name) { + if (i != required_i) { + mp_raise_ValueError_varg(translate("%q must be %d"), arg_name, required_i); + } + return i; +} + mp_int_t mp_arg_validate_int_min(mp_int_t i, mp_int_t min, qstr arg_name) { if (i < min) { mp_raise_ValueError_varg(translate("%q must be >= %d"), arg_name, min); @@ -194,6 +201,27 @@ mp_uint_t mp_arg_validate_length_range(mp_uint_t length, mp_uint_t min, mp_uint_ return length; } +mp_uint_t mp_arg_validate_length_min(mp_uint_t length, mp_uint_t min, qstr arg_name) { + if (length < min) { + mp_raise_ValueError_varg(translate("%q length must be >= %d"), arg_name, min); + } + return length; +} + +mp_uint_t mp_arg_validate_length_max(mp_uint_t length, mp_uint_t max, qstr arg_name) { + if (length > max) { + mp_raise_ValueError_varg(translate("%q length must be <= %d"), arg_name, max); + } + return length; +} + +mp_uint_t mp_arg_validate_length(mp_uint_t length, mp_uint_t required_length, qstr arg_name) { + if (length != required_length) { + mp_raise_ValueError_varg(translate("%q length must be %d"), arg_name, required_length); + } + return length; +} + mp_obj_t mp_arg_validate_type(mp_obj_t obj, const mp_obj_type_t *type, qstr arg_name) { if (!mp_obj_is_type(obj, type)) { mp_raise_TypeError_varg(translate("%q must be of type %q"), arg_name, type->name); @@ -201,9 +229,21 @@ mp_obj_t mp_arg_validate_type(mp_obj_t obj, const mp_obj_type_t *type, qstr arg_ return obj; } -mp_obj_t mp_arg_validate_string(mp_obj_t obj, qstr arg_name) { +mp_obj_t mp_arg_validate_type_string(mp_obj_t obj, qstr arg_name) { if (!mp_obj_is_str(obj)) { mp_raise_TypeError_varg(translate("%q must be a string"), arg_name); } return obj; } + +mp_int_t mp_arg_validate_type_int(mp_obj_t obj, qstr arg_name) { + mp_int_t an_int; + if (!mp_obj_get_int_maybe(obj, &an_int)) { + mp_raise_TypeError_varg(translate("%q must be an int"), arg_name); + } + return an_int; +} + +NORETURN void mp_arg_error_invalid(qstr arg_name) { + mp_raise_ValueError_varg(translate("Invalid %q"), arg_name); +} diff --git a/py/builtinimport.c b/py/builtinimport.c index dbacc3d657..4e4b6f068a 100644 --- a/py/builtinimport.c +++ b/py/builtinimport.c @@ -282,7 +282,7 @@ STATIC void evaluate_relative_import(mp_int_t level, const char **module_name, s #endif // If we have a __path__ in the globals dict, then we're a package. - bool is_pkg = mp_map_lookup(&mp_globals_get()->map, MP_OBJ_NEW_QSTR(MP_QSTR___path__), MP_MAP_LOOKUP); + bool is_pkg = mp_map_lookup(&mp_globals_get()->map, MP_OBJ_NEW_QSTR(MP_QSTR___path__), MP_MAP_LOOKUP) != NULL; #if DEBUG_PRINT DEBUG_printf("Current module/package: "); diff --git a/py/runtime.h b/py/runtime.h index 4a309f3975..4fa30d9b2b 100644 --- a/py/runtime.h +++ b/py/runtime.h @@ -92,15 +92,21 @@ void mp_arg_parse_all_kw_array(size_t n_pos, size_t n_kw, const mp_obj_t *args, NORETURN void mp_arg_error_terse_mismatch(void); NORETURN void mp_arg_error_unimpl_kw(void); +NORETURN void mp_arg_error_invalid(qstr arg_name); +mp_int_t mp_arg_validate_int(mp_int_t i, mp_int_t required_i, qstr arg_name); mp_int_t mp_arg_validate_int_min(mp_int_t i, mp_int_t min, qstr arg_name); mp_int_t mp_arg_validate_int_max(mp_int_t i, mp_int_t j, qstr arg_name); mp_int_t mp_arg_validate_int_range(mp_int_t i, mp_int_t min, mp_int_t max, qstr arg_name); #if MICROPY_PY_BUILTINS_FLOAT mp_float_t mp_arg_validate_obj_float_non_negative(mp_obj_t float_in, mp_float_t default_for_null, qstr arg_name); #endif +mp_uint_t mp_arg_validate_length_min(mp_uint_t length, mp_uint_t min, qstr arg_name); +mp_uint_t mp_arg_validate_length_max(mp_uint_t length, mp_uint_t max, qstr arg_name); mp_uint_t mp_arg_validate_length_range(mp_uint_t length, mp_uint_t min, mp_uint_t max, qstr arg_name); +mp_uint_t mp_arg_validate_length(mp_uint_t length, mp_uint_t required_length, qstr arg_name); mp_obj_t mp_arg_validate_type(mp_obj_t obj, const mp_obj_type_t *type, qstr arg_name); -mp_obj_t mp_arg_validate_string(mp_obj_t obj, qstr arg_name); +mp_int_t mp_arg_validate_type_int(mp_obj_t obj, qstr arg_name); +mp_obj_t mp_arg_validate_type_string(mp_obj_t obj, qstr arg_name); static inline mp_obj_dict_t *PLACE_IN_ITCM(mp_locals_get)(void) { return MP_STATE_THREAD(dict_locals); diff --git a/shared-bindings/_bleio/Address.c b/shared-bindings/_bleio/Address.c index 9673642a5b..26aeec3036 100644 --- a/shared-bindings/_bleio/Address.c +++ b/shared-bindings/_bleio/Address.c @@ -69,7 +69,7 @@ STATIC mp_obj_t bleio_address_make_new(const mp_obj_type_t *type, size_t n_args, const mp_int_t address_type = args[ARG_address_type].u_int; if (address_type < BLEIO_ADDRESS_TYPE_MIN || address_type > BLEIO_ADDRESS_TYPE_MAX) { - mp_raise_ValueError(translate("Address type out of range")); + mp_arg_error_invalid(MP_QSTR_address_type); } common_hal_bleio_address_construct(self, buf_info.buf, address_type); diff --git a/shared-bindings/_bleio/Characteristic.c b/shared-bindings/_bleio/Characteristic.c index 4ff37f0623..6f72d96056 100644 --- a/shared-bindings/_bleio/Characteristic.c +++ b/shared-bindings/_bleio/Characteristic.c @@ -100,7 +100,7 @@ STATIC mp_obj_t bleio_characteristic_add_to_service(size_t n_args, const mp_obj_ const bleio_characteristic_properties_t properties = args[ARG_properties].u_int; if (properties & ~CHAR_PROP_ALL) { - mp_raise_ValueError(translate("Invalid properties")); + mp_arg_error_invalid(MP_QSTR_properties); } const bleio_attribute_security_mode_t read_perm = args[ARG_read_perm].u_int; @@ -109,10 +109,8 @@ 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_int = args[ARG_max_length].u_int; - if (max_length_int < 0) { - mp_raise_ValueError(translate("max_length must be >= 0")); - } + const mp_int_t max_length_int = mp_arg_validate_int_min(args[ARG_max_length].u_int, 0, MP_QSTR_max_length); + 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; diff --git a/shared-bindings/_bleio/CharacteristicBuffer.c b/shared-bindings/_bleio/CharacteristicBuffer.c index 78ff07fa77..aea77fb633 100644 --- a/shared-bindings/_bleio/CharacteristicBuffer.c +++ b/shared-bindings/_bleio/CharacteristicBuffer.c @@ -70,15 +70,9 @@ STATIC mp_obj_t bleio_characteristic_buffer_make_new(const mp_obj_type_t *type, bleio_characteristic_obj_t *characteristic = mp_arg_validate_type(args[ARG_characteristic].u_obj, &bleio_characteristic_type, MP_QSTR_characteristic); - mp_float_t timeout = mp_obj_get_float(args[ARG_timeout].u_obj); - if (timeout < 0.0f) { - mp_raise_ValueError(translate("timeout must be >= 0.0")); - } + mp_float_t timeout = mp_arg_validate_obj_float_non_negative(args[ARG_timeout].u_obj, 1.0f, MP_QSTR_timeout); - const int buffer_size = args[ARG_buffer_size].u_int; - if (buffer_size < 1) { - mp_raise_ValueError_varg(translate("%q must be >= 1"), MP_QSTR_buffer_size); - } + const mp_int_t buffer_size = mp_arg_validate_int_min(args[ARG_buffer_size].u_int, 1, MP_QSTR_buffer_size); bleio_characteristic_buffer_obj_t *self = m_new_obj(bleio_characteristic_buffer_obj_t); self->base.type = &bleio_characteristic_buffer_type; diff --git a/shared-bindings/_bleio/Descriptor.c b/shared-bindings/_bleio/Descriptor.c index f2ef6b433d..0e662655c4 100644 --- a/shared-bindings/_bleio/Descriptor.c +++ b/shared-bindings/_bleio/Descriptor.c @@ -94,10 +94,8 @@ 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_int = args[ARG_max_length].u_int; - if (max_length_int < 0) { - mp_raise_ValueError(translate("max_length must be >= 0")); - } + const mp_int_t max_length_int = mp_arg_validate_int_min(args[ARG_max_length].u_int, 0, MP_QSTR_max_length); + 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; diff --git a/shared-bindings/_bleio/PacketBuffer.c b/shared-bindings/_bleio/PacketBuffer.c index 9e64661fd3..30eb8dd8c7 100644 --- a/shared-bindings/_bleio/PacketBuffer.c +++ b/shared-bindings/_bleio/PacketBuffer.c @@ -73,10 +73,7 @@ STATIC mp_obj_t bleio_packet_buffer_make_new(const mp_obj_type_t *type, size_t n bleio_characteristic_obj_t *characteristic = mp_arg_validate_type(args[ARG_characteristic].u_obj, &bleio_characteristic_type, MP_QSTR_characteristic); - const mp_int_t buffer_size = args[ARG_buffer_size].u_int; - if (buffer_size < 1) { - mp_raise_ValueError_varg(translate("%q must be >= 1"), MP_QSTR_buffer_size); - } + const mp_int_t buffer_size = mp_arg_validate_int_min(args[ARG_buffer_size].u_int, 1, MP_QSTR_buffer_size); size_t max_packet_size = common_hal_bleio_characteristic_get_max_length(characteristic); if (args[ARG_max_packet_size].u_obj != mp_const_none) { diff --git a/shared-bindings/adafruit_pixelbuf/PixelBuf.c b/shared-bindings/adafruit_pixelbuf/PixelBuf.c index d9436ea45a..8f1ea4eac2 100644 --- a/shared-bindings/adafruit_pixelbuf/PixelBuf.c +++ b/shared-bindings/adafruit_pixelbuf/PixelBuf.c @@ -44,6 +44,10 @@ #include "extmod/ulab/code/ndarray.h" #endif +static NORETURN void invalid_byteorder(void) { + mp_arg_error_invalid(MP_QSTR_byteorder); +} + static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t *parsed); //| class PixelBuf: @@ -124,7 +128,7 @@ static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t size_t bo_len; const char *byteorder = mp_obj_str_get_data(byteorder_obj, &bo_len); if (bo_len < 3 || bo_len > 4) { - mp_raise_ValueError(translate("Invalid byteorder string")); + invalid_byteorder(); } parsed->order_string = byteorder_obj; @@ -136,7 +140,7 @@ static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t char *w = strchr(byteorder, 'W'); int num_chars = (dotstar ? 1 : 0) + (w ? 1 : 0) + (r ? 1 : 0) + (g ? 1 : 0) + (b ? 1 : 0); if ((num_chars < parsed->bpp) || !(r && b && g)) { - mp_raise_ValueError(translate("Invalid byteorder string")); + invalid_byteorder(); } parsed->is_dotstar = dotstar ? true : false; parsed->has_white = w ? true : false; @@ -146,10 +150,10 @@ static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t parsed->byteorder.w = w ? w - byteorder : 0; // The dotstar brightness byte is always first (as it goes with the pixel start bits) if (dotstar && byteorder[0] != 'P') { - mp_raise_ValueError(translate("Invalid byteorder string")); + invalid_byteorder(); } if (parsed->has_white && parsed->is_dotstar) { - mp_raise_ValueError(translate("Invalid byteorder string")); + invalid_byteorder(); } } diff --git a/shared-bindings/aesio/aes.c b/shared-bindings/aesio/aes.c index bb72b10e7e..27d52d8566 100644 --- a/shared-bindings/aesio/aes.c +++ b/shared-bindings/aesio/aes.c @@ -63,15 +63,12 @@ STATIC mp_obj_t aesio_aes_make_new(const mp_obj_type_t *type, size_t n_args, const uint8_t *key = NULL; uint32_t key_length = 0; - if (mp_get_buffer(args[ARG_key].u_obj, &bufinfo, MP_BUFFER_READ)) { - if ((bufinfo.len != 16) && (bufinfo.len != 24) && (bufinfo.len != 32)) { - mp_raise_TypeError(translate("Key must be 16, 24, or 32 bytes long")); - } - key = bufinfo.buf; - key_length = bufinfo.len; - } else { - mp_raise_TypeError(translate("No key was specified")); + mp_get_buffer_raise(args[ARG_key].u_obj, &bufinfo, MP_BUFFER_READ); + if ((bufinfo.len != 16) && (bufinfo.len != 24) && (bufinfo.len != 32)) { + mp_raise_TypeError(translate("Key must be 16, 24, or 32 bytes long")); } + key = bufinfo.buf; + key_length = bufinfo.len; int mode = args[ARG_mode].u_int; switch (args[ARG_mode].u_int) { diff --git a/shared-bindings/alarm/SleepMemory.c b/shared-bindings/alarm/SleepMemory.c index 7de36f0cec..37223f1f35 100644 --- a/shared-bindings/alarm/SleepMemory.c +++ b/shared-bindings/alarm/SleepMemory.c @@ -159,9 +159,8 @@ STATIC mp_obj_t alarm_sleep_memory_subscr(mp_obj_t self_in, mp_obj_t index_in, m } else { // store mp_int_t byte_value = mp_obj_get_int(value); - if (byte_value > 0xff || byte_value < 0) { - mp_raise_ValueError(translate("Bytes must be between 0 and 255.")); - } + mp_arg_validate_int_range(byte_value, 0, 255, MP_QSTR_bytes); + uint8_t short_value = byte_value; if (!common_hal_alarm_sleep_memory_set_bytes(self, index, &short_value, 1)) { mp_raise_RuntimeError(translate("Unable to write to sleep_memory.")); diff --git a/shared-bindings/analogio/AnalogOut.c b/shared-bindings/analogio/AnalogOut.c index 31173f8890..2f171c5a0f 100644 --- a/shared-bindings/analogio/AnalogOut.c +++ b/shared-bindings/analogio/AnalogOut.c @@ -108,10 +108,8 @@ STATIC mp_obj_t analogio_analogout_obj_set_value(mp_obj_t self_in, mp_obj_t valu if (common_hal_analogio_analogout_deinited(self)) { raise_deinited_error(); } - uint32_t v = mp_obj_get_int(value); - if (v >= (1 << 16)) { - mp_raise_ValueError(translate("AnalogOut is only 16 bits. Value must be less than 65536.")); - } + uint16_t v = mp_arg_validate_int_range(mp_obj_get_int(value), 0, 65535, MP_QSTR_value); + common_hal_analogio_analogout_set_value(self, v); return mp_const_none; } diff --git a/shared-bindings/audiomixer/Mixer.c b/shared-bindings/audiomixer/Mixer.c index a165435ff0..3ca6ccd5e3 100644 --- a/shared-bindings/audiomixer/Mixer.c +++ b/shared-bindings/audiomixer/Mixer.c @@ -91,19 +91,9 @@ STATIC mp_obj_t audiomixer_mixer_make_new(const mp_obj_type_t *type, size_t n_ar mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all_kw_array(n_args, n_kw, all_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - mp_int_t voice_count = args[ARG_voice_count].u_int; - if (voice_count < 1 || voice_count > 255) { - mp_raise_ValueError(translate("Invalid voice count")); - } - - mp_int_t channel_count = args[ARG_channel_count].u_int; - if (channel_count < 1 || channel_count > 2) { - mp_raise_ValueError(translate("Invalid channel count")); - } - mp_int_t sample_rate = args[ARG_sample_rate].u_int; - if (sample_rate < 1) { - mp_raise_ValueError(translate("Sample rate must be positive")); - } + mp_int_t voice_count = mp_arg_validate_int_range(args[ARG_voice_count].u_int, 1, 255, MP_QSTR_voice_count); + mp_int_t channel_count = mp_arg_validate_int_range(args[ARG_channel_count].u_int, 1, 2, MP_QSTR_channel_count); + mp_int_t sample_rate = mp_arg_validate_int_min(args[ARG_sample_rate].u_int, 1, MP_QSTR_sample_rate); mp_int_t bits_per_sample = args[ARG_bits_per_sample].u_int; if (bits_per_sample != 8 && bits_per_sample != 16) { mp_raise_ValueError(translate("bits_per_sample must be 8 or 16")); @@ -222,7 +212,7 @@ STATIC mp_obj_t audiomixer_mixer_obj_play(size_t n_args, const mp_obj_t *pos_arg uint8_t v = args[ARG_voice].u_int; if (v > (self->voice_count - 1)) { - mp_raise_ValueError(translate("Invalid voice")); + mp_arg_error_invalid(MP_QSTR_voice); } audiomixer_mixervoice_obj_t *voice = MP_OBJ_TO_PTR(self->voice[v]); mp_obj_t sample = args[ARG_sample].u_obj; @@ -248,7 +238,7 @@ STATIC mp_obj_t audiomixer_mixer_obj_stop_voice(size_t n_args, const mp_obj_t *p uint8_t v = args[ARG_voice].u_int; if (v > (self->voice_count - 1)) { - mp_raise_ValueError(translate("Invalid voice")); + mp_arg_error_invalid(MP_QSTR_voice); } audiomixer_mixervoice_obj_t *voice = MP_OBJ_TO_PTR(self->voice[v]); common_hal_audiomixer_mixervoice_stop(voice); diff --git a/shared-bindings/bitbangio/I2C.c b/shared-bindings/bitbangio/I2C.c index c65b184ca0..67c411120b 100644 --- a/shared-bindings/bitbangio/I2C.c +++ b/shared-bindings/bitbangio/I2C.c @@ -188,9 +188,7 @@ STATIC void readfrom(bitbangio_i2c_obj_t *self, mp_int_t address, mp_obj_t buffe size_t length = bufinfo.len; normalize_buffer_bounds(&start, end, &length); - if (length == 0) { - mp_raise_ValueError(translate("Buffer must be at least length 1")); - } + mp_arg_validate_length_min(length, 1, MP_QSTR_buffer); uint8_t status = shared_module_bitbangio_i2c_read(self, address, ((uint8_t *)bufinfo.buf) + start, length); if (status != 0) { diff --git a/shared-bindings/bitbangio/SPI.c b/shared-bindings/bitbangio/SPI.c index 2c29c09bf9..1f19f8c939 100644 --- a/shared-bindings/bitbangio/SPI.c +++ b/shared-bindings/bitbangio/SPI.c @@ -156,18 +156,10 @@ STATIC mp_obj_t bitbangio_spi_configure(size_t n_args, const mp_obj_t *pos_args, mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - uint8_t polarity = args[ARG_polarity].u_int; - if (polarity != 0 && polarity != 1) { - mp_raise_ValueError(translate("Invalid polarity")); - } - uint8_t phase = args[ARG_phase].u_int; - if (phase != 0 && phase != 1) { - mp_raise_ValueError(translate("Invalid phase")); - } - uint8_t bits = args[ARG_bits].u_int; - if (bits != 8 && bits != 9) { - mp_raise_ValueError(translate("Invalid number of bits")); - } + uint8_t polarity = (uint8_t)mp_arg_validate_int_range(args[ARG_polarity].u_int, 0, 1, MP_QSTR_polarity); + uint8_t phase = (uint8_t)mp_arg_validate_int_range(args[ARG_phase].u_int, 0, 1, MP_QSTR_phase); + uint8_t bits = (uint8_t)mp_arg_validate_int_range(args[ARG_bits].u_int, 8, 9, MP_QSTR_bits); + shared_module_bitbangio_spi_configure(self, args[ARG_baudrate].u_int, polarity, phase, bits); return mp_const_none; diff --git a/shared-bindings/bitops/__init__.c b/shared-bindings/bitops/__init__.c index 5b455dcb0f..0b6b98a8d1 100644 --- a/shared-bindings/bitops/__init__.c +++ b/shared-bindings/bitops/__init__.c @@ -64,10 +64,7 @@ STATIC mp_obj_t bit_transpose(size_t n_args, const mp_obj_t *pos_args, mp_map_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); - int width = args[ARG_width].u_int; - if (width < 2 || width > 8) { - mp_raise_ValueError_varg(translate("width must be from 2 to 8 (inclusive), not %d"), width); - } + mp_int_t width = mp_arg_validate_int_range(args[ARG_width].u_int, 2, 8, MP_QSTR_width); mp_buffer_info_t input_bufinfo; mp_get_buffer_raise(args[ARG_input].u_obj, &input_bufinfo, MP_BUFFER_READ); @@ -80,9 +77,9 @@ STATIC mp_obj_t bit_transpose(size_t n_args, const mp_obj_t *pos_args, mp_map_t mp_get_buffer_raise(args[ARG_output].u_obj, &output_bufinfo, MP_BUFFER_WRITE); int avail = output_bufinfo.len; int outlen = 8 * (inlen / width); - if (avail < outlen) { - mp_raise_ValueError_varg(translate("Output buffer must be at least %d bytes"), outlen); - } + + mp_arg_validate_length_min(avail, outlen, MP_QSTR_output); + common_hal_bitops_bit_transpose(output_bufinfo.buf, input_bufinfo.buf, inlen, width); return args[ARG_output].u_obj; } diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index 2d67281df0..e05e4e0546 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -210,9 +210,7 @@ STATIC mp_obj_t busio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_args, int32_t start = args[ARG_start].u_int; const int32_t end = args[ARG_end].u_int; normalize_buffer_bounds(&start, end, &length); - if (length == 0) { - mp_raise_ValueError_varg(translate("%q length must be >= 1"), MP_QSTR_buffer); - } + mp_arg_validate_length_min(length, 1, MP_QSTR_buffer); uint8_t status = common_hal_busio_i2c_read(self, args[ARG_address].u_int, ((uint8_t *)bufinfo.buf) + start, length); diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index 0a6c32f20b..af853b84ac 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -106,7 +106,7 @@ STATIC mp_obj_t busio_spi_make_new(const mp_obj_type_t *type, size_t n_args, siz common_hal_busio_spi_construct(self, clock, mosi, miso, args[ARG_half_duplex].u_bool); return MP_OBJ_FROM_PTR(self); #else - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); #endif // CIRCUITPY_BUSIO_SPI } @@ -191,18 +191,9 @@ STATIC mp_obj_t busio_spi_configure(size_t n_args, const mp_obj_t *pos_args, mp_ mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - uint8_t polarity = args[ARG_polarity].u_int; - if (polarity != 0 && polarity != 1) { - mp_raise_ValueError(translate("Invalid polarity")); - } - uint8_t phase = args[ARG_phase].u_int; - if (phase != 0 && phase != 1) { - mp_raise_ValueError(translate("Invalid phase")); - } - uint8_t bits = args[ARG_bits].u_int; - if (bits != 8 && bits != 9) { - mp_raise_ValueError(translate("Invalid number of bits")); - } + uint8_t polarity = (uint8_t)mp_arg_validate_int_range(args[ARG_polarity].u_int, 0, 1, MP_QSTR_polarity); + uint8_t phase = (uint8_t)mp_arg_validate_int_range(args[ARG_phase].u_int, 0, 1, MP_QSTR_phase); + uint8_t bits = (uint8_t)mp_arg_validate_int_range(args[ARG_bits].u_int, 8, 9, MP_QSTR_bits); if (!common_hal_busio_spi_configure(self, args[ARG_baudrate].u_int, polarity, phase, bits)) { diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index ae14e314af..7a27b04aec 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -113,10 +113,7 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, si mp_raise_ValueError(translate("tx and rx cannot both be None")); } - if (args[ARG_bits].u_int < 5 || args[ARG_bits].u_int > 9) { - mp_raise_ValueError(translate("bits must be in range 5 to 9")); - } - uint8_t bits = args[ARG_bits].u_int; + uint8_t bits = (uint8_t)mp_arg_validate_int_range(args[ARG_bits].u_int, 5, 9, MP_QSTR_bits); busio_uart_parity_t parity = BUSIO_UART_PARITY_NONE; if (args[ARG_parity].u_obj == MP_OBJ_FROM_PTR(&busio_uart_parity_even_obj)) { @@ -125,10 +122,7 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, si parity = BUSIO_UART_PARITY_ODD; } - uint8_t stop = args[ARG_stop].u_int; - if (stop != 1 && stop != 2) { - mp_raise_ValueError(translate("stop must be 1 or 2")); - } + uint8_t stop = (uint8_t)mp_arg_validate_int_range(args[ARG_stop].u_int, 1, 2, MP_QSTR_stop); mp_float_t timeout = mp_obj_get_float(args[ARG_timeout].u_obj); validate_timeout(timeout); diff --git a/shared-bindings/canio/Message.c b/shared-bindings/canio/Message.c index 64d4094b3f..28c445316a 100644 --- a/shared-bindings/canio/Message.c +++ b/shared-bindings/canio/Message.c @@ -57,9 +57,7 @@ STATIC mp_obj_t canio_message_make_new(const mp_obj_type_t *type, size_t n_args, mp_buffer_info_t data; 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")); - } + mp_arg_validate_length_range(data.len, 0, 8, MP_QSTR_data); canio_message_obj_t *self = m_new_obj(canio_message_obj_t); self->base.type = &canio_message_type; @@ -100,9 +98,9 @@ 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) { - mp_raise_ValueError(translate("Messages limited to 8 bytes")); - } + + mp_arg_validate_length_range(data.len, 0, 8, MP_QSTR_data); + common_hal_canio_message_set_data(self, data.buf, data.len); return mp_const_none; } diff --git a/shared-bindings/digitalio/DigitalInOut.c b/shared-bindings/digitalio/DigitalInOut.c index 37093add8f..a9026fbd59 100644 --- a/shared-bindings/digitalio/DigitalInOut.c +++ b/shared-bindings/digitalio/DigitalInOut.c @@ -207,7 +207,7 @@ STATIC mp_obj_t digitalio_digitalinout_obj_set_direction(mp_obj_t self_in, mp_ob mp_raise_NotImplementedError(translate("Pin is input only")); } } else { - mp_raise_ValueError(translate("Invalid direction.")); + mp_arg_error_invalid(MP_QSTR_direction); } return mp_const_none; } diff --git a/shared-bindings/displayio/FourWire.c b/shared-bindings/displayio/FourWire.c index 90aa5c6c17..2aa80df61d 100644 --- a/shared-bindings/displayio/FourWire.c +++ b/shared-bindings/displayio/FourWire.c @@ -89,14 +89,8 @@ STATIC mp_obj_t displayio_fourwire_make_new(const mp_obj_type_t *type, size_t n_ displayio_fourwire_obj_t *self = &allocate_display_bus_or_raise()->fourwire_bus; self->base.type = &displayio_fourwire_type; - uint8_t polarity = args[ARG_polarity].u_int; - if (polarity != 0 && polarity != 1) { - mp_raise_ValueError(translate("Invalid polarity")); - } - uint8_t phase = args[ARG_phase].u_int; - if (phase != 0 && phase != 1) { - mp_raise_ValueError(translate("Invalid phase")); - } + uint8_t polarity = (uint8_t)mp_arg_validate_int_range(args[ARG_polarity].u_int, 0, 1, MP_QSTR_polarity); + uint8_t phase = (uint8_t)mp_arg_validate_int_range(args[ARG_phase].u_int, 0, 1, MP_QSTR_phase); common_hal_displayio_fourwire_construct(self, MP_OBJ_TO_PTR(spi), command, chip_select, reset, args[ARG_baudrate].u_int, polarity, phase); @@ -133,10 +127,8 @@ STATIC mp_obj_t displayio_fourwire_obj_send(size_t n_args, const mp_obj_t *pos_a 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_int_t command_int = args[ARG_command].u_int; - if (command_int > 255 || command_int < 0) { - mp_raise_ValueError(translate("Command must be an int between 0 and 255")); - } + mp_int_t command_int = mp_arg_validate_int_range(args[ARG_command].u_int, 0, 255, MP_QSTR_command); + displayio_fourwire_obj_t *self = pos_args[0]; uint8_t command = command_int; mp_buffer_info_t bufinfo; diff --git a/shared-bindings/displayio/Group.c b/shared-bindings/displayio/Group.c index 188331f99d..75cc217af3 100644 --- a/shared-bindings/displayio/Group.c +++ b/shared-bindings/displayio/Group.c @@ -57,10 +57,7 @@ STATIC mp_obj_t displayio_group_make_new(const mp_obj_type_t *type, size_t n_arg mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all_kw_array(n_args, n_kw, all_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - mp_int_t scale = args[ARG_scale].u_int; - if (scale < 1) { - mp_raise_ValueError_varg(translate("%q must be >= 1"), MP_QSTR_scale); - } + mp_int_t scale = mp_arg_validate_int_min(args[ARG_scale].u_int, 1, MP_QSTR_scale); displayio_group_t *self = m_new_obj(displayio_group_t); self->base.type = &displayio_group_type; @@ -114,10 +111,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(displayio_group_get_scale_obj, displayio_group_obj_get STATIC mp_obj_t displayio_group_obj_set_scale(mp_obj_t self_in, mp_obj_t scale_obj) { displayio_group_t *self = native_group(self_in); - mp_int_t scale = mp_obj_get_int(scale_obj); - if (scale < 1) { - mp_raise_ValueError_varg(translate("%q must be >= 1"), MP_QSTR_scale); - } + mp_int_t scale = mp_arg_validate_int_min(mp_obj_get_int(scale_obj), 1, MP_QSTR_scale); + common_hal_displayio_group_set_scale(self, scale); return mp_const_none; } diff --git a/shared-bindings/displayio/I2CDisplay.c b/shared-bindings/displayio/I2CDisplay.c index fbfbd04c64..a637fc5071 100644 --- a/shared-bindings/displayio/I2CDisplay.c +++ b/shared-bindings/displayio/I2CDisplay.c @@ -98,10 +98,9 @@ MP_DEFINE_CONST_FUN_OBJ_1(displayio_i2cdisplay_reset_obj, displayio_i2cdisplay_o //| ... //| STATIC mp_obj_t displayio_i2cdisplay_obj_send(mp_obj_t self, mp_obj_t command_obj, mp_obj_t data_obj) { - mp_int_t command_int = MP_OBJ_SMALL_INT_VALUE(command_obj); - if (!mp_obj_is_small_int(command_obj) || command_int > 255 || command_int < 0) { - mp_raise_ValueError(translate("Command must be an int between 0 and 255")); - } + mp_int_t command_int = mp_obj_get_int(command_obj); + mp_arg_validate_int_range(command_int, 0, 255, MP_QSTR_command); + uint8_t command = command_int; mp_buffer_info_t bufinfo; mp_get_buffer_raise(data_obj, &bufinfo, MP_BUFFER_READ); diff --git a/shared-bindings/displayio/Shape.c b/shared-bindings/displayio/Shape.c index f39e7820a9..cbfe12d551 100644 --- a/shared-bindings/displayio/Shape.c +++ b/shared-bindings/displayio/Shape.c @@ -58,14 +58,8 @@ STATIC mp_obj_t displayio_shape_make_new(const mp_obj_type_t *type, size_t n_arg mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all_kw_array(n_args, n_kw, all_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - mp_int_t width = args[ARG_width].u_int; - if (width < 1) { - mp_raise_ValueError_varg(translate("%q must be >= 1"), MP_QSTR_width); - } - mp_int_t height = args[ARG_height].u_int; - if (height < 1) { - mp_raise_ValueError_varg(translate("%q must be >= 1"), MP_QSTR_height); - } + mp_int_t width = mp_arg_validate_int_min(args[ARG_width].u_int, 1, MP_QSTR_width); + mp_int_t height = mp_arg_validate_int_min(args[ARG_height].u_int, 1, MP_QSTR_height); displayio_shape_t *self = m_new_obj(displayio_shape_t); self->base.type = &displayio_shape_type; diff --git a/shared-bindings/displayio/TileGrid.c b/shared-bindings/displayio/TileGrid.c index 113721bcc6..b1557a1777 100644 --- a/shared-bindings/displayio/TileGrid.c +++ b/shared-bindings/displayio/TileGrid.c @@ -464,9 +464,8 @@ STATIC mp_obj_t tilegrid_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t v return MP_OBJ_NULL; // op not supported } else { mp_int_t value = mp_obj_get_int(value_obj); - if (value < 0 || value > 255) { - mp_raise_ValueError(translate("Tile value out of bounds")); - } + mp_arg_validate_int_range(value, 0, 255, MP_QSTR_tile); + common_hal_displayio_tilegrid_set_tile(self, x, y, value); } } diff --git a/shared-bindings/fontio/BuiltinFont.c b/shared-bindings/fontio/BuiltinFont.c index 9c97d9a9a3..5c1b976e81 100644 --- a/shared-bindings/fontio/BuiltinFont.c +++ b/shared-bindings/fontio/BuiltinFont.c @@ -98,10 +98,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(fontio_builtinfont_get_bounding_box_obj, fontio_builti STATIC mp_obj_t fontio_builtinfont_obj_get_glyph(mp_obj_t self_in, mp_obj_t codepoint_obj) { fontio_builtinfont_t *self = MP_OBJ_TO_PTR(self_in); - mp_int_t codepoint; - if (!mp_obj_get_int_maybe(codepoint_obj, &codepoint)) { - mp_raise_ValueError_varg(translate("%q should be an int"), MP_QSTR_codepoint); - } + mp_int_t codepoint = mp_arg_validate_type_int(codepoint_obj, MP_QSTR_codepoint); return common_hal_fontio_builtinfont_get_glyph(self, codepoint); } MP_DEFINE_CONST_FUN_OBJ_2(fontio_builtinfont_get_glyph_obj, fontio_builtinfont_obj_get_glyph); diff --git a/shared-bindings/memorymonitor/AllocationAlarm.c b/shared-bindings/memorymonitor/AllocationAlarm.c index b54645225a..fe25a1a230 100644 --- a/shared-bindings/memorymonitor/AllocationAlarm.c +++ b/shared-bindings/memorymonitor/AllocationAlarm.c @@ -63,10 +63,10 @@ STATIC mp_obj_t memorymonitor_allocationalarm_make_new(const mp_obj_type_t *type }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all_kw_array(n_args, n_kw, all_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - mp_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); - } + + mp_int_t minimum_block_count = + mp_arg_validate_int_min(args[ARG_minimum_block_count].u_int, 1, MP_QSTR_minimum_block_count); + memorymonitor_allocationalarm_obj_t *self = m_new_obj(memorymonitor_allocationalarm_obj_t); self->base.type = &memorymonitor_allocationalarm_type; @@ -90,9 +90,8 @@ STATIC mp_obj_t memorymonitor_allocationalarm_make_new(const mp_obj_type_t *type //| 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); - } + mp_arg_validate_int_min(count, 0, MP_QSTR_count); + common_hal_memorymonitor_allocationalarm_set_ignore(self_in, count); return self_in; } diff --git a/shared-bindings/microcontroller/Pin.c b/shared-bindings/microcontroller/Pin.c index e6809d6b72..27c2667d8e 100644 --- a/shared-bindings/microcontroller/Pin.c +++ b/shared-bindings/microcontroller/Pin.c @@ -194,3 +194,11 @@ void validate_pins(qstr what, uint8_t *pin_nos, mp_int_t max_pins, mp_obj_t seq, pin_nos[i] = common_hal_mcu_pin_number(pins[i]); } } + +NORETURN void raise_ValueError_invalid_pin(void) { + mp_arg_error_invalid(MP_QSTR_pin); +} + +NORETURN void raise_ValueError_invalid_pins(void) { + mp_arg_error_invalid(MP_QSTR_pins); +} diff --git a/shared-bindings/microcontroller/Pin.h b/shared-bindings/microcontroller/Pin.h index a7378ea98e..4ce20331d9 100644 --- a/shared-bindings/microcontroller/Pin.h +++ b/shared-bindings/microcontroller/Pin.h @@ -41,6 +41,8 @@ void validate_no_duplicate_pins(mp_obj_t seq, qstr arg_name); void validate_no_duplicate_pins_2(mp_obj_t seq1, mp_obj_t seq2, qstr arg_name1, qstr arg_name2); void validate_list_is_free_pins(qstr what, const mcu_pin_obj_t **pins_out, mp_int_t max_pins, mp_obj_t seq, uint8_t *count_out); void validate_pins(qstr what, uint8_t *pin_nos, mp_int_t max_pins, mp_obj_t seq, uint8_t *count_out); +NORETURN void raise_ValueError_invalid_pin(void); +NORETURN void raise_ValueError_invalid_pins(void); void assert_pin_free(const mcu_pin_obj_t *pin); diff --git a/shared-bindings/microcontroller/__init__.c b/shared-bindings/microcontroller/__init__.c index 707080cfbf..1b14b32934 100644 --- a/shared-bindings/microcontroller/__init__.c +++ b/shared-bindings/microcontroller/__init__.c @@ -119,7 +119,7 @@ STATIC mp_obj_t mcu_on_next_reset(mp_obj_t run_mode_obj) { } else if (run_mode_obj == MP_OBJ_FROM_PTR(&mcu_runmode_bootloader_obj)) { run_mode = RUNMODE_BOOTLOADER; } else { - mp_raise_ValueError(translate("Invalid run mode.")); + mp_arg_error_invalid(MP_QSTR_run_mode); } common_hal_mcu_on_next_reset(run_mode); return mp_const_none; diff --git a/shared-bindings/msgpack/ExtType.c b/shared-bindings/msgpack/ExtType.c index 1719e209b2..94c699d469 100644 --- a/shared-bindings/msgpack/ExtType.c +++ b/shared-bindings/msgpack/ExtType.c @@ -47,10 +47,8 @@ STATIC mp_obj_t mod_msgpack_exttype_make_new(const mp_obj_type_t *type, size_t n mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all_kw_array(n_args, n_kw, all_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - int code = args[ARG_code].u_int; - if (code < 0 || code > 127) { - mp_raise_AttributeError(translate("code outside range 0~127")); - } + int code = mp_arg_validate_int_range(args[ARG_code].u_int, 0, 127, MP_QSTR_code); + self->code = code; mp_obj_t data = args[ARG_data].u_obj; diff --git a/shared-bindings/nvm/ByteArray.c b/shared-bindings/nvm/ByteArray.c index 6e34b76bd9..b01430c078 100644 --- a/shared-bindings/nvm/ByteArray.c +++ b/shared-bindings/nvm/ByteArray.c @@ -153,9 +153,8 @@ STATIC mp_obj_t nvm_bytearray_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj } else { // store mp_int_t byte_value = mp_obj_get_int(value); - if (byte_value > 0xff || byte_value < 0) { - mp_raise_ValueError(translate("Bytes must be between 0 and 255.")); - } + mp_arg_validate_int_range(byte_value, 0, 255, MP_QSTR_bytes); + uint8_t short_value = byte_value; if (!common_hal_nvm_bytearray_set_bytes(self, index, &short_value, 1)) { mp_raise_RuntimeError(translate("Unable to write to nvm.")); diff --git a/shared-bindings/paralleldisplay/ParallelBus.c b/shared-bindings/paralleldisplay/ParallelBus.c index 6e6e778259..c93f363d1a 100644 --- a/shared-bindings/paralleldisplay/ParallelBus.c +++ b/shared-bindings/paralleldisplay/ParallelBus.c @@ -126,10 +126,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(paralleldisplay_parallelbus_reset_obj, paralleldisplay //| ... //| STATIC mp_obj_t paralleldisplay_parallelbus_obj_send(mp_obj_t self, mp_obj_t command_obj, mp_obj_t data_obj) { - mp_int_t command_int = MP_OBJ_SMALL_INT_VALUE(command_obj); - if (!mp_obj_is_small_int(command_obj) || command_int > 255 || command_int < 0) { - mp_raise_ValueError(translate("Command must be an int between 0 and 255")); - } + mp_int_t command_int = mp_arg_validate_int_range(mp_obj_get_int(command_obj), 0, 255, MP_QSTR_command); + uint8_t command = command_int; mp_buffer_info_t bufinfo; mp_get_buffer_raise(data_obj, &bufinfo, MP_BUFFER_READ); diff --git a/shared-bindings/ps2io/Ps2.c b/shared-bindings/ps2io/Ps2.c index a0fb6d607b..2ceca6b044 100644 --- a/shared-bindings/ps2io/Ps2.c +++ b/shared-bindings/ps2io/Ps2.c @@ -68,21 +68,21 @@ //| ... //| STATIC mp_obj_t ps2io_ps2_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { - enum { ARG_datapin, ARG_clkpin }; + enum { ARG_data_pin, ARG_clock_pin }; static const mp_arg_t allowed_args[] = { - { MP_QSTR_datapin, MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_clkpin, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_data_pin, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_clock_pin, MP_ARG_REQUIRED | MP_ARG_OBJ }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all_kw_array(n_args, n_kw, all_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - const mcu_pin_obj_t *clkpin = validate_obj_is_free_pin(args[ARG_clkpin].u_obj); - const mcu_pin_obj_t *datapin = validate_obj_is_free_pin(args[ARG_datapin].u_obj); + const mcu_pin_obj_t *clock_pin = validate_obj_is_free_pin(args[ARG_clock_pin].u_obj); + const mcu_pin_obj_t *data_pin = validate_obj_is_free_pin(args[ARG_data_pin].u_obj); ps2io_ps2_obj_t *self = m_new_obj(ps2io_ps2_obj_t); self->base.type = &ps2io_ps2_type; - common_hal_ps2io_ps2_construct(self, datapin, clkpin); + common_hal_ps2io_ps2_construct(self, data_pin, clock_pin); return MP_OBJ_FROM_PTR(self); } diff --git a/shared-bindings/ps2io/Ps2.h b/shared-bindings/ps2io/Ps2.h index da4c6ba2fe..861fd40232 100644 --- a/shared-bindings/ps2io/Ps2.h +++ b/shared-bindings/ps2io/Ps2.h @@ -34,7 +34,7 @@ extern const mp_obj_type_t ps2io_ps2_type; extern void common_hal_ps2io_ps2_construct(ps2io_ps2_obj_t *self, - const mcu_pin_obj_t *data_pin, const mcu_pin_obj_t *clk_pin); + const mcu_pin_obj_t *data_pin, const mcu_pin_obj_t *clock_pin); extern void common_hal_ps2io_ps2_deinit(ps2io_ps2_obj_t *self); extern bool common_hal_ps2io_ps2_deinited(ps2io_ps2_obj_t *self); extern uint16_t common_hal_ps2io_ps2_get_len(ps2io_ps2_obj_t *self); diff --git a/shared-bindings/pwmio/PWMOut.c b/shared-bindings/pwmio/PWMOut.c index 60a9dfb8b9..524a857e64 100644 --- a/shared-bindings/pwmio/PWMOut.c +++ b/shared-bindings/pwmio/PWMOut.c @@ -41,10 +41,10 @@ void common_hal_pwmio_pwmout_raise_error(pwmout_result_t result) { case PWMOUT_OK: break; case PWMOUT_INVALID_PIN: - mp_raise_ValueError(translate("Invalid pin")); + raise_ValueError_invalid_pin(); break; case PWMOUT_INVALID_FREQUENCY: - mp_raise_ValueError(translate("Invalid PWM frequency")); + mp_arg_error_invalid(MP_QSTR_frequency); break; case PWMOUT_INVALID_FREQUENCY_ON_PIN: mp_raise_ValueError(translate("Frequency must match existing PWMOut using this timer")); @@ -212,9 +212,9 @@ STATIC mp_obj_t pwmio_pwmout_obj_set_duty_cycle(mp_obj_t self_in, mp_obj_t duty_ 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)")); - } + + mp_arg_validate_int_range(duty, 0, 0xffff, MP_QSTR_duty_cycle); + common_hal_pwmio_pwmout_set_duty_cycle(self, duty); return mp_const_none; } @@ -251,7 +251,7 @@ STATIC mp_obj_t pwmio_pwmout_obj_set_frequency(mp_obj_t self_in, mp_obj_t freque } mp_int_t freq = mp_obj_get_int(frequency); if (freq == 0) { - mp_raise_ValueError(translate("Invalid PWM frequency")); + mp_arg_error_invalid(MP_QSTR_frequency); } common_hal_pwmio_pwmout_set_frequency(self, freq); return mp_const_none; diff --git a/shared-bindings/rgbmatrix/RGBMatrix.c b/shared-bindings/rgbmatrix/RGBMatrix.c index 4739807bd0..fc9f438766 100644 --- a/shared-bindings/rgbmatrix/RGBMatrix.c +++ b/shared-bindings/rgbmatrix/RGBMatrix.c @@ -207,11 +207,7 @@ STATIC mp_obj_t rgbmatrix_rgbmatrix_make_new(const mp_obj_type_t *type, size_t n uint8_t clock_pin = validate_pin(args[ARG_clock_pin].u_obj); uint8_t latch_pin = validate_pin(args[ARG_latch_pin].u_obj); uint8_t output_enable_pin = validate_pin(args[ARG_output_enable_pin].u_obj); - int bit_depth = args[ARG_bit_depth].u_int; - - if (bit_depth <= 0 || bit_depth > 6) { - mp_raise_ValueError_varg(translate("Bit depth must be from 1 to 6 inclusive, not %d"), bit_depth); - } + mp_int_t bit_depth = mp_arg_validate_int_range(args[ARG_bit_depth].u_int, 1, 6, MP_QSTR_bit_depth); validate_pins(MP_QSTR_rgb_pins, rgb_pins, MP_ARRAY_SIZE(self->rgb_pins), args[ARG_rgb_list].u_obj, &rgb_count); validate_pins(MP_QSTR_addr_pins, addr_pins, MP_ARRAY_SIZE(self->addr_pins), args[ARG_addr_list].u_obj, &addr_count); @@ -220,12 +216,7 @@ STATIC mp_obj_t rgbmatrix_rgbmatrix_make_new(const mp_obj_type_t *type, size_t n mp_raise_ValueError_varg(translate("Must use a multiple of 6 rgb pins, not %d"), rgb_count); } - int tile = args[ARG_tile].u_int; - - if (tile <= 0) { - mp_raise_ValueError_varg( - translate("tile must be greater than zero")); - } + int tile = mp_arg_validate_int_min(args[ARG_tile].u_int, 1, MP_QSTR_tile); int computed_height = (rgb_count / 3) * (1 << (addr_count)) * tile; if (args[ARG_height].u_int != 0) { @@ -235,21 +226,18 @@ STATIC mp_obj_t rgbmatrix_rgbmatrix_make_new(const mp_obj_type_t *type, size_t n } } - if (args[ARG_width].u_int <= 0) { - mp_raise_ValueError(translate("width must be greater than zero")); - } + mp_int_t width = mp_arg_validate_int_min(args[ARG_width].u_int, 1, MP_QSTR_width); preflight_pins_or_throw(clock_pin, rgb_pins, rgb_count, true); mp_obj_t framebuffer = args[ARG_framebuffer].u_obj; if (framebuffer == mp_const_none) { - int width = args[ARG_width].u_int; int bufsize = 2 * width * computed_height; framebuffer = mp_obj_new_bytearray_of_zeros(bufsize); } common_hal_rgbmatrix_rgbmatrix_construct(self, - args[ARG_width].u_int, + width, bit_depth, rgb_count, rgb_pins, addr_count, addr_pins, diff --git a/shared-bindings/sdioio/SDCard.c b/shared-bindings/sdioio/SDCard.c index f6407ff2a8..891ecfe092 100644 --- a/shared-bindings/sdioio/SDCard.c +++ b/shared-bindings/sdioio/SDCard.c @@ -129,14 +129,10 @@ STATIC mp_obj_t sdioio_sdcard_configure(size_t n_args, const mp_obj_t *pos_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); - } - + mp_int_t frequency = mp_arg_validate_int_min(args[ARG_frequency].u_int, 0, MP_QSTR_frequency); 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); + mp_arg_error_invalid(MP_QSTR_width); } if (!common_hal_sdioio_sdcard_configure(self, frequency, width)) { diff --git a/shared-bindings/supervisor/__init__.c b/shared-bindings/supervisor/__init__.c index 0b86b7b2a6..6fcff963a6 100644 --- a/shared-bindings/supervisor/__init__.c +++ b/shared-bindings/supervisor/__init__.c @@ -106,9 +106,8 @@ MP_DEFINE_CONST_FUN_OBJ_0(supervisor_reload_obj, supervisor_reload); STATIC mp_obj_t supervisor_set_next_stack_limit(mp_obj_t size_obj) { mp_int_t size = mp_obj_get_int(size_obj); - if (size < 256) { - mp_raise_ValueError(translate("Stack size must be at least 256")); - } + mp_arg_validate_int_min(size, 256, MP_QSTR_size); + set_next_stack_size(size); return mp_const_none; diff --git a/shared-bindings/synthio/__init__.c b/shared-bindings/synthio/__init__.c index 72fe2eb31f..106a073535 100644 --- a/shared-bindings/synthio/__init__.c +++ b/shared-bindings/synthio/__init__.c @@ -82,7 +82,7 @@ STATIC mp_obj_t synthio_from_file(size_t n_args, const mp_obj_t *pos_args, mp_ma } if (bytes_read != sizeof(chunk_header) || memcmp(chunk_header, "MThd\0\0\0\6\0\0\0\1", 12)) { - mp_raise_ValueError(translate("Invalid MIDI file")); + mp_arg_error_invalid(MP_QSTR_file); // TODO: for a multi-track MIDI (type 1), return an AudioMixer } @@ -97,7 +97,7 @@ STATIC mp_obj_t synthio_from_file(size_t n_args, const mp_obj_t *pos_args, mp_ma mp_raise_OSError(MP_EIO); } if (bytes_read != 8 || memcmp(chunk_header, "MTrk", 4)) { - mp_raise_ValueError(translate("Invalid MIDI file")); + mp_arg_error_invalid(MP_QSTR_file); } uint32_t track_size = (chunk_header[4] << 24) | (chunk_header[5] << 16) | (chunk_header[6] << 8) | chunk_header[7]; @@ -106,7 +106,7 @@ STATIC mp_obj_t synthio_from_file(size_t n_args, const mp_obj_t *pos_args, mp_ma mp_raise_OSError(MP_EIO); } if (bytes_read != track_size) { - mp_raise_ValueError(translate("Invalid MIDI file")); + mp_arg_error_invalid(MP_QSTR_file); } synthio_miditrack_obj_t *result = m_new_obj(synthio_miditrack_obj_t); diff --git a/shared-bindings/usb_hid/Device.c b/shared-bindings/usb_hid/Device.c index 2741013d03..3f30a6264c 100644 --- a/shared-bindings/usb_hid/Device.c +++ b/shared-bindings/usb_hid/Device.c @@ -114,10 +114,8 @@ STATIC mp_obj_t usb_hid_device_make_new(const mp_obj_type_t *type, size_t n_args mp_obj_t in_report_lengths = args[ARG_in_report_lengths].u_obj; mp_obj_t out_report_lengths = args[ARG_out_report_lengths].u_obj; - size_t report_ids_count = (size_t)MP_OBJ_SMALL_INT_VALUE(mp_obj_len(report_ids)); - if (report_ids_count < 1) { - mp_raise_ValueError_varg(translate("%q length must be >= 1"), MP_QSTR_report_ids); - } + size_t report_ids_count = + mp_arg_validate_length_min((size_t)MP_OBJ_SMALL_INT_VALUE(mp_obj_len(report_ids)), 1, MP_QSTR_report_ids); if ((size_t)MP_OBJ_SMALL_INT_VALUE(mp_obj_len(in_report_lengths)) != report_ids_count || (size_t)MP_OBJ_SMALL_INT_VALUE(mp_obj_len(out_report_lengths)) != report_ids_count) { @@ -158,7 +156,7 @@ STATIC mp_obj_t usb_hid_device_make_new(const mp_obj_type_t *type, size_t n_args } -//| def send_report(self, buf: ReadableBuffer, report_id: Optional[int] = None) -> None: +//| def send_report(self, report: ReadableBuffer, report_id: Optional[int] = None) -> None: //| """Send an HID report. If the device descriptor specifies zero or one report id's, //| you can supply `None` (the default) as the value of ``report_id``. //| Otherwise you must specify which report id to use when sending the report. @@ -168,9 +166,9 @@ STATIC mp_obj_t usb_hid_device_make_new(const mp_obj_type_t *type, size_t n_args STATIC mp_obj_t usb_hid_device_send_report(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { usb_hid_device_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); - enum { ARG_buf, ARG_report_id }; + enum { ARG_report, ARG_report_id }; static const mp_arg_t allowed_args[] = { - { MP_QSTR_buf, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_report, MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_report_id, MP_ARG_OBJ, {.u_obj = mp_const_none} }, }; @@ -178,7 +176,7 @@ STATIC mp_obj_t usb_hid_device_send_report(size_t n_args, const mp_obj_t *pos_ar 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_buf].u_obj, &bufinfo, MP_BUFFER_READ); + mp_get_buffer_raise(args[ARG_report].u_obj, &bufinfo, MP_BUFFER_READ); // -1 asks common_hal to determine the report id if possible. mp_int_t report_id_arg = -1; diff --git a/shared-bindings/wifi/Monitor.c b/shared-bindings/wifi/Monitor.c index a63c0a8023..235ec534aa 100644 --- a/shared-bindings/wifi/Monitor.c +++ b/shared-bindings/wifi/Monitor.c @@ -55,19 +55,14 @@ STATIC mp_obj_t wifi_monitor_make_new(const mp_obj_type_t *type, size_t n_args, mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all_kw_array(n_args, n_kw, all_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - if (args[ARG_channel].u_int < 1 || args[ARG_channel].u_int > 13) { - mp_raise_ValueError_varg(translate("%q out of bounds"), MP_QSTR_channel); - } - - if (args[ARG_queue].u_int < 0) { - mp_raise_ValueError_varg(translate("%q out of bounds"), MP_QSTR_channel); - } + mp_int_t channel = mp_arg_validate_int_range(args[ARG_channel].u_int, 1, 13, MP_QSTR_channel); + mp_int_t queue = mp_arg_validate_int_min(args[ARG_queue].u_int, 0, MP_QSTR_queue); wifi_monitor_obj_t *self = MP_STATE_VM(wifi_monitor_singleton); if (common_hal_wifi_monitor_deinited()) { self = m_new_obj(wifi_monitor_obj_t); self->base.type = &wifi_monitor_type; - common_hal_wifi_monitor_construct(self, args[ARG_channel].u_int, args[ARG_queue].u_int); + common_hal_wifi_monitor_construct(self, channel, queue); MP_STATE_VM(wifi_monitor_singleton) = self; } diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index cf1e9dfc4e..e79d7047b3 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -87,9 +87,7 @@ 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 > 253) { - mp_raise_ValueError(translate("Hostname must be between 1 and 253 characters")); - } + mp_arg_validate_length_range(hostname.len, 1, 253, MP_QSTR_hostname); #ifndef CONFIG_IDF_TARGET_ESP32C3 regex_t regex; // validate hostname according to RFC 1123 @@ -269,9 +267,7 @@ STATIC mp_obj_t wifi_radio_start_ap(size_t n_args, const mp_obj_t *pos_args, mp_ authmode = (1 << AUTHMODE_WPA) | (1 << AUTHMODE_WPA2) | (1 << AUTHMODE_PSK); } 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_arg_validate_length_range(password.len, 8, 63, MP_QSTR_password); } else { authmode = 1; } @@ -342,9 +338,7 @@ 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")); - } + mp_arg_validate_length_range(password.len, 8, 63, MP_QSTR_password); } #define MAC_ADDRESS_LENGTH 6 diff --git a/shared-module/_bleio/Attribute.c b/shared-module/_bleio/Attribute.c index 3acfcf1f53..9c75a69fd1 100644 --- a/shared-module/_bleio/Attribute.c +++ b/shared-module/_bleio/Attribute.c @@ -40,7 +40,7 @@ void common_hal_bleio_attribute_security_mode_check_valid(bleio_attribute_securi case SECURITY_MODE_SIGNED_WITH_MITM: break; default: - mp_raise_ValueError(translate("Invalid security_mode")); + mp_arg_error_invalid(MP_QSTR_security_mode); break; } } diff --git a/shared-module/adafruit_pixelbuf/PixelBuf.c b/shared-module/adafruit_pixelbuf/PixelBuf.c index 99980c705e..cab97feace 100644 --- a/shared-module/adafruit_pixelbuf/PixelBuf.c +++ b/shared-module/adafruit_pixelbuf/PixelBuf.c @@ -171,9 +171,7 @@ STATIC void _pixelbuf_parse_color(pixelbuf_pixelbuf_obj_t *self, mp_obj_t color, mp_obj_t *items; size_t len; mp_obj_get_array(color, &len, &items); - if (len < 3 || len > 4) { - mp_raise_ValueError_varg(translate("Expected tuple of length %d, got %d"), byteorder->bpp, len); - } + mp_arg_validate_length_range(len, 3, 4, MP_QSTR_color); *r = _pixelbuf_get_as_uint8(items[PIXEL_R]); *g = _pixelbuf_get_as_uint8(items[PIXEL_G]); diff --git a/shared-module/audiocore/WaveFile.c b/shared-module/audiocore/WaveFile.c index 0cceb979a6..b4056e3f29 100644 --- a/shared-module/audiocore/WaveFile.c +++ b/shared-module/audiocore/WaveFile.c @@ -60,7 +60,7 @@ void common_hal_audioio_wavefile_construct(audioio_wavefile_obj_t *self, if (bytes_read != 16 || memcmp(chunk_header, "RIFF", 4) != 0 || memcmp(chunk_header + 8, "WAVEfmt ", 8) != 0) { - mp_raise_ValueError(translate("Invalid wave file")); + mp_arg_error_invalid(MP_QSTR_file); } uint32_t format_size; if (f_read(&self->file->fp, &format_size, 4, &bytes_read) != FR_OK) { @@ -105,7 +105,7 @@ void common_hal_audioio_wavefile_construct(audioio_wavefile_obj_t *self, mp_raise_OSError(MP_EIO); } if (bytes_read != 4) { - mp_raise_ValueError(translate("Invalid file")); + mp_arg_error_invalid(MP_QSTR_file); } self->file_length = data_length; self->data_start = self->file->fp.fptr; @@ -121,15 +121,13 @@ void common_hal_audioio_wavefile_construct(audioio_wavefile_obj_t *self, self->buffer = m_malloc(self->len, false); if (self->buffer == NULL) { common_hal_audioio_wavefile_deinit(self); - mp_raise_msg(&mp_type_MemoryError, - translate("Couldn't allocate first buffer")); + m_malloc_fail(self->len); } self->second_buffer = m_malloc(self->len, false); if (self->second_buffer == NULL) { common_hal_audioio_wavefile_deinit(self); - mp_raise_msg(&mp_type_MemoryError, - translate("Couldn't allocate second buffer")); + m_malloc_fail(self->len); } } } diff --git a/shared-module/audiomixer/Mixer.c b/shared-module/audiomixer/Mixer.c index d6569c66f0..1c5de4d934 100644 --- a/shared-module/audiomixer/Mixer.c +++ b/shared-module/audiomixer/Mixer.c @@ -47,13 +47,13 @@ void common_hal_audiomixer_mixer_construct(audiomixer_mixer_obj_t *self, self->first_buffer = m_malloc(self->len, false); if (self->first_buffer == NULL) { common_hal_audiomixer_mixer_deinit(self); - mp_raise_msg(&mp_type_MemoryError, translate("Couldn't allocate first buffer")); + m_malloc_fail(self->len); } self->second_buffer = m_malloc(self->len, false); if (self->second_buffer == NULL) { common_hal_audiomixer_mixer_deinit(self); - mp_raise_msg(&mp_type_MemoryError, translate("Couldn't allocate second buffer")); + m_malloc_fail(self->len); } self->bits_per_sample = bits_per_sample; diff --git a/shared-module/audiomp3/MP3Decoder.c b/shared-module/audiomp3/MP3Decoder.c index bbc7e1c79e..d0b5428a11 100644 --- a/shared-module/audiomp3/MP3Decoder.c +++ b/shared-module/audiomp3/MP3Decoder.c @@ -193,8 +193,7 @@ void common_hal_audiomp3_mp3file_construct(audiomp3_mp3file_obj_t *self, self->inbuf = m_malloc(self->inbuf_length, false); if (self->inbuf == NULL) { common_hal_audiomp3_mp3file_deinit(self); - mp_raise_msg(&mp_type_MemoryError, - translate("Couldn't allocate input buffer")); + m_malloc_fail(self->inbuf_length); } self->decoder = MP3InitDecoder(); if (self->decoder == NULL) { @@ -214,15 +213,13 @@ void common_hal_audiomp3_mp3file_construct(audiomp3_mp3file_obj_t *self, self->buffers[0] = m_malloc(MAX_BUFFER_LEN, false); if (self->buffers[0] == NULL) { common_hal_audiomp3_mp3file_deinit(self); - mp_raise_msg(&mp_type_MemoryError, - translate("Couldn't allocate first buffer")); + m_malloc_fail(MAX_BUFFER_LEN); } self->buffers[1] = m_malloc(MAX_BUFFER_LEN, false); if (self->buffers[1] == NULL) { common_hal_audiomp3_mp3file_deinit(self); - mp_raise_msg(&mp_type_MemoryError, - translate("Couldn't allocate second buffer")); + m_malloc_fail(MAX_BUFFER_LEN); } } diff --git a/shared-module/bitbangio/SPI.c b/shared-module/bitbangio/SPI.c index 65511964a6..dc91c6e0d5 100644 --- a/shared-module/bitbangio/SPI.c +++ b/shared-module/bitbangio/SPI.c @@ -41,7 +41,7 @@ void shared_module_bitbangio_spi_construct(bitbangio_spi_obj_t *self, const mcu_pin_obj_t *miso) { digitalinout_result_t result = common_hal_digitalio_digitalinout_construct(&self->clock, clock); if (result != DIGITALINOUT_OK) { - mp_raise_ValueError(translate("Clock pin init failed.")); + mp_raise_ValueError_varg(translate("%q init failed"), MP_QSTR_clock); } common_hal_digitalio_digitalinout_switch_to_output(&self->clock, self->polarity == 1, DRIVE_MODE_PUSH_PULL); @@ -49,7 +49,7 @@ void shared_module_bitbangio_spi_construct(bitbangio_spi_obj_t *self, result = common_hal_digitalio_digitalinout_construct(&self->mosi, mosi); if (result != DIGITALINOUT_OK) { common_hal_digitalio_digitalinout_deinit(&self->clock); - mp_raise_ValueError(translate("MOSI pin init failed.")); + mp_raise_ValueError_varg(translate("%q init failed"), MP_QSTR_mosi); } self->has_mosi = true; common_hal_digitalio_digitalinout_switch_to_output(&self->mosi, false, DRIVE_MODE_PUSH_PULL); @@ -63,7 +63,7 @@ void shared_module_bitbangio_spi_construct(bitbangio_spi_obj_t *self, if (mosi != NULL) { common_hal_digitalio_digitalinout_deinit(&self->mosi); } - mp_raise_ValueError(translate("MISO pin init failed.")); + mp_raise_ValueError_varg(translate("%q init failed"), MP_QSTR_miso); } self->has_miso = true; } @@ -123,7 +123,7 @@ void shared_module_bitbangio_spi_unlock(bitbangio_spi_obj_t *self) { // Writes out the given data. bool shared_module_bitbangio_spi_write(bitbangio_spi_obj_t *self, const uint8_t *data, size_t len) { if (len > 0 && !self->has_mosi) { - mp_raise_ValueError(translate("Cannot write without MOSI pin.")); + mp_raise_ValueError(translate("Cannot write without MOSI pin")); } uint32_t delay_half = self->delay_half; @@ -178,7 +178,7 @@ bool shared_module_bitbangio_spi_write(bitbangio_spi_obj_t *self, const uint8_t // Reads in len bytes while outputting zeroes. bool shared_module_bitbangio_spi_read(bitbangio_spi_obj_t *self, uint8_t *data, size_t len, uint8_t write_data) { if (len > 0 && !self->has_miso) { - mp_raise_ValueError(translate("Cannot read without MISO pin.")); + mp_raise_ValueError(translate("Cannot read without MISO pin")); } uint32_t delay_half = self->delay_half; @@ -246,7 +246,7 @@ bool shared_module_bitbangio_spi_read(bitbangio_spi_obj_t *self, uint8_t *data, // transfer bool shared_module_bitbangio_spi_transfer(bitbangio_spi_obj_t *self, const uint8_t *dout, uint8_t *din, size_t len) { if (len > 0 && (!self->has_mosi || !self->has_miso)) { - mp_raise_ValueError(translate("Cannot transfer without MOSI and MISO pins.")); + mp_raise_ValueError(translate("Cannot transfer without MOSI and MISO pins")); } uint32_t delay_half = self->delay_half; diff --git a/shared-module/displayio/Group.c b/shared-module/displayio/Group.c index 1a4e4eafb5..ad45852379 100644 --- a/shared-module/displayio/Group.c +++ b/shared-module/displayio/Group.c @@ -268,7 +268,7 @@ static void _add_layer(displayio_group_t *self, mp_obj_t layer) { if (native_layer != MP_OBJ_NULL) { displayio_tilegrid_t *tilegrid = native_layer; if (tilegrid->in_group) { - mp_raise_ValueError(translate("Layer already in a group.")); + mp_raise_ValueError(translate("Layer already in a group")); } else { tilegrid->in_group = true; } @@ -281,7 +281,7 @@ static void _add_layer(displayio_group_t *self, mp_obj_t layer) { if (native_layer != MP_OBJ_NULL) { displayio_group_t *group = native_layer; if (group->in_group) { - mp_raise_ValueError(translate("Layer already in a group.")); + mp_raise_ValueError(translate("Layer already in a group")); } else { group->in_group = true; } @@ -290,7 +290,7 @@ static void _add_layer(displayio_group_t *self, mp_obj_t layer) { group, self->hidden || self->hidden_by_parent); return; } - mp_raise_ValueError(translate("Layer must be a Group or TileGrid subclass.")); + mp_raise_ValueError(translate("Layer must be a Group or TileGrid subclass")); } static void _remove_layer(displayio_group_t *self, size_t index) { diff --git a/shared-module/displayio/OnDiskBitmap.c b/shared-module/displayio/OnDiskBitmap.c index dd2731a814..2863dffb19 100644 --- a/shared-module/displayio/OnDiskBitmap.c +++ b/shared-module/displayio/OnDiskBitmap.c @@ -50,7 +50,7 @@ void common_hal_displayio_ondiskbitmap_construct(displayio_ondiskbitmap_t *self, } if (bytes_read != 138 || memcmp(bmp_header, "BM", 2) != 0) { - mp_raise_ValueError(translate("Invalid BMP file")); + mp_arg_error_invalid(MP_QSTR_file); } // We can't cast because we're not aligned. diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index 48353b7dba..d184d3b8c2 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -83,9 +83,8 @@ void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebu 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); - } + + mp_arg_validate_length_min(self->bufinfo.len, framebuffer_size, MP_QSTR_framebuffer); self->first_manual_refresh = !auto_refresh; diff --git a/shared-module/rgbmatrix/RGBMatrix.c b/shared-module/rgbmatrix/RGBMatrix.c index 0bfed0aa6c..a0a9e1390c 100644 --- a/shared-module/rgbmatrix/RGBMatrix.c +++ b/shared-module/rgbmatrix/RGBMatrix.c @@ -117,10 +117,10 @@ void common_hal_rgbmatrix_rgbmatrix_reconstruct(rgbmatrix_rgbmatrix_obj_t *self, common_hal_rgbmatrix_rgbmatrix_deinit(self); switch (stat) { case PROTOMATTER_ERR_PINS: - mp_raise_ValueError(translate("Invalid pin")); + raise_ValueError_invalid_pin(); break; case PROTOMATTER_ERR_ARG: - mp_raise_ValueError(translate("Invalid argument")); + mp_arg_error_invalid(MP_QSTR_args); break; case PROTOMATTER_ERR_MALLOC: mp_raise_msg(&mp_type_MemoryError, NULL); diff --git a/shared-module/synthio/MidiTrack.c b/shared-module/synthio/MidiTrack.c index b2693a0c59..f02747d734 100644 --- a/shared-module/synthio/MidiTrack.c +++ b/shared-module/synthio/MidiTrack.c @@ -32,13 +32,17 @@ #define BYTES_PER_SAMPLE (BITS_PER_SAMPLE / 8) #define SILENCE 0x80 +STATIC NORETURN void raise_midi_stream_error(uint32_t pos) { + mp_raise_ValueError_varg(translate("Error in MIDI stream at position %d"), pos); +} + STATIC uint8_t parse_note(const uint8_t *buffer, uint32_t len, uint32_t *pos) { if (*pos + 1 >= len) { - mp_raise_ValueError_varg(translate("Error in MIDI stream at position %d"), *pos); + raise_midi_stream_error(*pos); } uint8_t note = buffer[(*pos)++]; if (note > 127 || buffer[(*pos)++] > 127) { - mp_raise_ValueError_varg(translate("Error in MIDI stream at position %d"), *pos); + raise_midi_stream_error(*pos); } return note; } @@ -84,7 +88,7 @@ void common_hal_synthio_miditrack_construct(synthio_miditrack_obj_t *self, } while ((c & 0x80) && (pos < len)); if (c & 0x80) { - mp_raise_ValueError_varg(translate("Error in MIDI stream at position %d"), pos); + raise_midi_stream_error(pos); } dur += delta * sample_rate / tempo; @@ -128,14 +132,14 @@ void common_hal_synthio_miditrack_construct(synthio_miditrack_obj_t *self, case 12: case 13: // one data byte to ignore if (pos >= len || buffer[pos++] > 127) { - mp_raise_ValueError_varg(translate("Error in MIDI stream at position %d"), pos); + raise_midi_stream_error(pos); } break; case 15: // the full syntax is too complicated, just assume it's "End of Track" event pos = len; break; default: // invalid event - mp_raise_ValueError_varg(translate("Error in MIDI stream at position %d"), pos); + raise_midi_stream_error(pos); } } terminate_span(self, &dur, &max_dur); diff --git a/shared-module/usb_hid/Device.c b/shared-module/usb_hid/Device.c index 8a0c429f84..13e66058c2 100644 --- a/shared-module/usb_hid/Device.c +++ b/shared-module/usb_hid/Device.c @@ -181,16 +181,14 @@ uint8_t common_hal_usb_hid_device_validate_report_id(usb_hid_device_obj_t *self, } if (!(report_id_arg >= 0 && get_report_id_idx(self, (size_t)report_id_arg) < CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR)) { - mp_raise_ValueError_varg(translate("Invalid %q"), MP_QSTR_report_id); + mp_arg_error_invalid(MP_QSTR_report_id); } return (uint8_t)report_id_arg; } void common_hal_usb_hid_device_construct(usb_hid_device_obj_t *self, mp_obj_t report_descriptor, uint16_t usage_page, uint16_t usage, size_t num_report_ids, uint8_t *report_ids, uint8_t *in_report_lengths, uint8_t *out_report_lengths) { - if (num_report_ids > CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR) { - mp_raise_ValueError_varg(translate("More than %d report ids not supported"), - CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR); - } + mp_arg_validate_length_max( + num_report_ids, CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR, MP_QSTR_report_ids); // report buffer pointers are NULL at start, and are created when USB is initialized. mp_buffer_info_t bufinfo; @@ -223,10 +221,7 @@ void common_hal_usb_hid_device_send_report(usb_hid_device_obj_t *self, uint8_t * // report_id and len have already been validated for this device. size_t id_idx = get_report_id_idx(self, report_id); - if (len != self->in_report_lengths[id_idx]) { - mp_raise_ValueError_varg(translate("Buffer incorrect size. Should be %d bytes."), - self->in_report_lengths[id_idx]); - } + mp_arg_validate_length(len, self->in_report_lengths[id_idx], MP_QSTR_report); // Wait until interface is ready, timeout = 2 seconds uint64_t end_ticks = supervisor_ticks_ms64() + 2000; @@ -235,7 +230,7 @@ void common_hal_usb_hid_device_send_report(usb_hid_device_obj_t *self, uint8_t * } if (!tud_hid_ready()) { - mp_raise_msg(&mp_type_OSError, translate("USB busy")); + mp_raise_msg(&mp_type_OSError, translate("USB busy")); } if (!tud_hid_report(report_id, report, len)) { diff --git a/shared-module/vectorio/Circle.c b/shared-module/vectorio/Circle.c index 2ec11fe1bb..ee83ad18b9 100644 --- a/shared-module/vectorio/Circle.c +++ b/shared-module/vectorio/Circle.c @@ -15,7 +15,7 @@ void common_hal_vectorio_circle_construct(vectorio_circle_t *self, uint16_t radi void common_hal_vectorio_circle_set_on_dirty(vectorio_circle_t *self, vectorio_event_t on_dirty) { if (self->on_dirty.obj != NULL) { - mp_raise_TypeError(translate("circle can only be registered in one parent")); + mp_raise_TypeError(translate("can only have one parent")); } self->on_dirty = on_dirty; } diff --git a/shared-module/vectorio/Polygon.c b/shared-module/vectorio/Polygon.c index 10ebdf1edd..24eb1c501d 100644 --- a/shared-module/vectorio/Polygon.c +++ b/shared-module/vectorio/Polygon.c @@ -40,9 +40,8 @@ static void _clobber_points_list(vectorio_polygon_t *self, mp_obj_t points_tuple mp_obj_t *tuple_items; mp_obj_tuple_get(items[i], &tuple_len, &tuple_items); - if (tuple_len != 2) { - mp_raise_ValueError_varg(translate("%q must be a tuple of length 2"), MP_QSTR_point); - } + mp_arg_validate_length(tuple_len, 2, MP_QSTR_point); + mp_int_t x; mp_int_t y; if (!mp_obj_get_int_maybe(tuple_items[ 0 ], &x) @@ -103,7 +102,7 @@ void common_hal_vectorio_polygon_set_points(vectorio_polygon_t *self, mp_obj_t p void common_hal_vectorio_polygon_set_on_dirty(vectorio_polygon_t *self, vectorio_event_t notification) { if (self->on_dirty.obj != NULL) { - mp_raise_TypeError(translate("polygon can only be registered in one parent")); + mp_raise_TypeError(translate("can only have one parent")); } self->on_dirty = notification; } diff --git a/shared-module/vectorio/Rectangle.c b/shared-module/vectorio/Rectangle.c index fbd3d6bdf5..4c2bdc66cb 100644 --- a/shared-module/vectorio/Rectangle.c +++ b/shared-module/vectorio/Rectangle.c @@ -14,7 +14,7 @@ void common_hal_vectorio_rectangle_construct(vectorio_rectangle_t *self, uint32_ void common_hal_vectorio_rectangle_set_on_dirty(vectorio_rectangle_t *self, vectorio_event_t on_dirty) { if (self->on_dirty.obj != NULL) { - mp_raise_TypeError(translate("can only be registered in one parent")); + mp_raise_TypeError(translate("can only have one parent")); } self->on_dirty = on_dirty; } diff --git a/shared-module/vectorio/VectorShape.c b/shared-module/vectorio/VectorShape.c index 04213d36e7..f72cd5cc97 100644 --- a/shared-module/vectorio/VectorShape.c +++ b/shared-module/vectorio/VectorShape.c @@ -63,9 +63,7 @@ (u32 & 0x1 ? '1' : '0') static void short_bound_check(mp_int_t i, qstr name) { - if (i < SHRT_MIN || i > SHRT_MAX) { - mp_raise_ValueError_varg(translate("%q must be between %d and %d"), name, SHRT_MIN, SHRT_MAX); - } + mp_arg_validate_int_range(i, SHRT_MIN, SHRT_MAX, name); } inline __attribute__((always_inline)) @@ -277,9 +275,7 @@ void common_hal_vectorio_vector_shape_set_location(vectorio_vector_shape_t *self size_t tuple_len = 0; mp_obj_t *tuple_items; mp_obj_tuple_get(xy, &tuple_len, &tuple_items); - if (tuple_len != 2) { - mp_raise_TypeError(translate("(x,y) integers required")); - } + mp_arg_validate_length(tuple_len, 2, MP_QSTR_location); mp_int_t x; mp_int_t y; From f1f9ba237150d2ef7e6bc8497d8804eb39f8c910 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 19 May 2022 23:51:25 +0200 Subject: [PATCH 104/246] Add support for WeAct Studio Pico --- .../boards/weact_studio_pico/board.c | 40 ++++++++++++++ .../boards/weact_studio_pico/mpconfigboard.h | 2 + .../boards/weact_studio_pico/mpconfigboard.mk | 11 ++++ .../weact_studio_pico/pico-sdk-configboard.h | 1 + .../boards/weact_studio_pico/pins.c | 53 +++++++++++++++++++ 5 files changed, 107 insertions(+) create mode 100644 ports/raspberrypi/boards/weact_studio_pico/board.c create mode 100644 ports/raspberrypi/boards/weact_studio_pico/mpconfigboard.h create mode 100644 ports/raspberrypi/boards/weact_studio_pico/mpconfigboard.mk create mode 100644 ports/raspberrypi/boards/weact_studio_pico/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/weact_studio_pico/pins.c diff --git a/ports/raspberrypi/boards/weact_studio_pico/board.c b/ports/raspberrypi/boards/weact_studio_pico/board.c new file mode 100644 index 0000000000..e992ec063c --- /dev/null +++ b/ports/raspberrypi/boards/weact_studio_pico/board.c @@ -0,0 +1,40 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Fabian Affolter + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} + +void board_deinit(void) { +} diff --git a/ports/raspberrypi/boards/weact_studio_pico/mpconfigboard.h b/ports/raspberrypi/boards/weact_studio_pico/mpconfigboard.h new file mode 100644 index 0000000000..e3276bbd74 --- /dev/null +++ b/ports/raspberrypi/boards/weact_studio_pico/mpconfigboard.h @@ -0,0 +1,2 @@ +#define MICROPY_HW_BOARD_NAME "WeAct Studio Pico" +#define MICROPY_HW_MCU_NAME "rp2040" diff --git a/ports/raspberrypi/boards/weact_studio_pico/mpconfigboard.mk b/ports/raspberrypi/boards/weact_studio_pico/mpconfigboard.mk new file mode 100644 index 0000000000..358928a9ac --- /dev/null +++ b/ports/raspberrypi/boards/weact_studio_pico/mpconfigboard.mk @@ -0,0 +1,11 @@ +USB_VID = 0x239A +USB_PID = 0x000B +USB_PRODUCT = "Pico" +USB_MANUFACTURER = "WeAct Studio" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ" + +CIRCUITPY__EVE = 1 diff --git a/ports/raspberrypi/boards/weact_studio_pico/pico-sdk-configboard.h b/ports/raspberrypi/boards/weact_studio_pico/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/weact_studio_pico/pico-sdk-configboard.h @@ -0,0 +1 @@ +// Put board-specific pico-sdk definitions here. This file must exist. diff --git a/ports/raspberrypi/boards/weact_studio_pico/pins.c b/ports/raspberrypi/boards/weact_studio_pico/pins.c new file mode 100644 index 0000000000..8632d9c322 --- /dev/null +++ b/ports/raspberrypi/boards/weact_studio_pico/pins.c @@ -0,0 +1,53 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_GP0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_GP1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_GP2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_GP3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_GP4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_GP5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_GP6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_GP7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_GP8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_GP9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_GP10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_GP11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_GP12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_GP13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_GP14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_GP15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_GP16), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_GP17), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_GP18), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_GP19), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_GP20), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_GP21), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_GP22), MP_ROM_PTR(&pin_GPIO22) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_GP23), MP_ROM_PTR(&pin_GPIO23) }, + + { MP_ROM_QSTR(MP_QSTR_GP24), MP_ROM_PTR(&pin_GPIO24) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_GP25), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_GP26_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_GP26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_GP27_A1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_GP27), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, + + { MP_ROM_QSTR(MP_QSTR_GP28_A2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_GP28), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO29) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From e3896be3455f4949fff9b11bd7e60ad3e915e022 Mon Sep 17 00:00:00 2001 From: dahanzimin <353767514@qq.com> Date: Fri, 20 May 2022 09:46:55 +0800 Subject: [PATCH 105/246] Modify mixgoce_ Lib is a submodule --- .gitmodules | 3 + ports/espressif/boards/mixgo_ce_udisk/cp_lib | 1 + .../mixgo_ce_udisk/mixgoce_lib/Image.py | 58 - .../mixgoce_lib/adafruit_framebuf.py | 549 --------- .../mixgoce_lib/adafruit_irremote.py | 283 ----- .../mixgoce_lib/adafruit_minimqtt.py | 1000 ----------------- .../mixgoce_lib/adafruit_rtttl.py | 204 ---- .../mixgo_ce_udisk/mixgoce_lib/blynklib.py | 390 ------- .../mixgo_ce_udisk/mixgoce_lib/blynktimer.py | 134 --- .../mixgo_ce_udisk/mixgoce_lib/button.py | 49 - .../mixgo_ce_udisk/mixgoce_lib/infrared.py | 41 - .../mixgo_ce_udisk/mixgoce_lib/irremote.py | 111 -- .../boards/mixgo_ce_udisk/mixgoce_lib/led.py | 34 - .../mixgo_ce_udisk/mixgoce_lib/matcher.py | 97 -- .../mixgo_ce_udisk/mixgoce_lib/matrix.py | 277 ----- .../mixgo_ce_udisk/mixgoce_lib/mixgoce.py | 85 -- .../mixgo_ce_udisk/mixgoce_lib/mixpy.py | 84 -- .../mixgo_ce_udisk/mixgoce_lib/mmatrix.py | 139 --- .../mixgo_ce_udisk/mixgoce_lib/msa301.py | 70 -- .../mixgo_ce_udisk/mixgoce_lib/music.py | 102 -- .../mixgo_ce_udisk/mixgoce_lib/mxc6655xa.py | 80 -- .../mixgo_ce_udisk/mixgoce_lib/pixels.py | 71 -- .../mixgo_ce_udisk/mixgoce_lib/sensor.py | 55 - .../mixgo_ce_udisk/mixgoce_lib/touchpad.py | 25 - .../boards/mixgo_ce_udisk/mpconfigboard.mk | 2 +- 25 files changed, 5 insertions(+), 3939 deletions(-) create mode 160000 ports/espressif/boards/mixgo_ce_udisk/cp_lib delete mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/Image.py delete mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_framebuf.py delete mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_irremote.py delete mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_minimqtt.py delete mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_rtttl.py delete mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/blynklib.py delete mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/blynktimer.py delete mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/button.py delete mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/infrared.py delete mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/irremote.py delete mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/led.py delete mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/matcher.py delete mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/matrix.py delete mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mixgoce.py delete mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mixpy.py delete mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mmatrix.py delete mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/msa301.py delete mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/music.py delete mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mxc6655xa.py delete mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/pixels.py delete mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/sensor.py delete mode 100644 ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/touchpad.py diff --git a/.gitmodules b/.gitmodules index 9a10cc21e2..089162d33e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -286,3 +286,6 @@ [submodule "frozen/Adafruit_CircuitPython_FakeRequests"] path = frozen/Adafruit_CircuitPython_FakeRequests url = https://github.com/adafruit/Adafruit_CircuitPython_FakeRequests.git +[submodule "ports/espressif/boards/mixgo_ce_udisk/cp_lib"] + path = ports/espressif/boards/mixgo_ce_udisk/cp_lib + url = https://github.com/dahanzimin/circuitpython_lib.git diff --git a/ports/espressif/boards/mixgo_ce_udisk/cp_lib b/ports/espressif/boards/mixgo_ce_udisk/cp_lib new file mode 160000 index 0000000000..d6bb0f58f6 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/cp_lib @@ -0,0 +1 @@ +Subproject commit d6bb0f58f62983f11e771c5ec91c934eb6ff2b82 diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/Image.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/Image.py deleted file mode 100644 index c799b4aadd..0000000000 --- a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/Image.py +++ /dev/null @@ -1,58 +0,0 @@ -""" -Image - -CircuitPython library for Image - MixGoCE -======================================================= - -Small Cabbage -20210721 -""" - -HEART=bytearray(b'\x00\x00\x00\x0c\x1e\x3f\x7e\xfc\x7e\x3f\x1e\x0c\x00\x00\x00\x00') -HEART_SMALL=bytearray(b'\x00\x00\x00\x00\x0c\x1e\x3c\x78\x3c\x1e\x0c\x00\x00\x00\x00\x00') -HAPPY=bytearray(b'\x00\x00\x00\x0c\x0c\x20\x40\x80\x80\x40\x20\x0c\x0c\x00\x00\x00') -SAD=bytearray(b'\x00\x00\x08\x04\x04\x84\x40\x20\x20\x40\x84\x04\x04\x08\x00\x00') -SMILE=bytearray(b'\x00\x00\x04\x02\x02\x24\x40\x80\x80\x40\x24\x02\x02\x04\x00\x00') -SILLY=bytearray(b'\x00\x00\x04\x0a\x0a\x04\x60\xa0\xa0\x60\x04\x0a\x0a\x04\x00\x00') -FABULOUS=bytearray(b'\x00\x00\x06\x05\x05\x65\xa6\xa0\xa0\xa6\x65\x05\x05\x06\x00\x00') -SURPRISED=bytearray(b'\x00\x00\x00\x00\x00\x00\x00\xbe\x00\x00\x00\x00\x00\x00\x00\x00') -ASLEEP=bytearray(b'\x00\x00\x04\x04\x04\x44\xa0\xa0\xa0\xa0\x44\x04\x04\x04\x00\x00') -ANGRY=bytearray(b'\x00\x00\x01\x02\x84\x42\x21\x10\x10\x21\x42\x84\x02\x01\x00\x00') -CONFUSED=bytearray(b'\x00\x00\x00\x00\x00\x04\x02\xa2\x12\x0c\x00\x00\x00\x00\x00\x00') -NO=bytearray(b'\x00\x00\x00\x00\x42\x24\x18\x18\x24\x42\x00\x00\x00\x00\x00\x00') -YES=bytearray(b'\x00\x00\x00\x00\x10\x20\x40\x40\x20\x10\x08\x04\x02\x00\x00\x00') -LEFT_ARROW=bytearray(b'\x00\x00\x10\x28\x54\x92\x10\x10\x10\x10\x10\x10\x10\x10\x00\x00') -RIGHT_ARROW=bytearray(b'\x00\x00\x10\x10\x10\x10\x10\x10\x10\x10\x92\x54\x28\x10\x00\x00') -DRESS=bytearray(b'\x00\x00\x00\x40\xa2\xd7\xae\xda\xae\xd7\xa2\x40\x00\x00\x00\x00') -TRANSFORMERS=bytearray(b'\x00\x00\x00\x00\x00\x9c\x64\x1a\x64\x9c\x00\x00\x00\x00\x00\x00') -SCISSORS=bytearray(b'\x00\x00\x00\x00\x00\x43\xa6\x6c\x18\x6c\xa6\x43\x00\x00\x00\x00') -EXIT=bytearray(b'\x00\x00\x00\x00\x00\x00\x28\x04\x72\x0e\x17\x25\x48\x88\x00\x00') -TREE=bytearray(b'\x00\x00\x00\x10\x18\x1c\x1e\xff\x1e\x1c\x18\x10\x00\x00\x00\x00') -PACMAN=bytearray(b'\x00\x00\x1c\x36\x63\x41\x45\x41\x49\x55\x22\x00\x00\x00\x00\x00') -TARGET=bytearray(b'\x00\x00\x00\x00\x00\x00\x38\x44\x54\x44\x38\x00\x00\x00\x00\x00') -TSHIRT=bytearray(b'\x00\x00\x00\x04\x0a\xf9\x82\x82\x82\x82\xf9\x0a\x04\x00\x00\x00') -ROLLERSKATE=bytearray(b'\x00\x00\x00\x60\x5f\x71\x11\x17\x14\x14\x74\x58\x60\x00\x00\x00') -DUCK=bytearray(b'\x00\x00\x08\x0c\x0a\xf9\x81\x83\x9e\x90\x90\x90\x50\x30\x10\x00') -HOUSE=bytearray(b'\x04\x06\xfb\x01\x01\xf9\x09\x29\x09\x09\xf9\x01\x01\xfb\x06\x04') -TORTOISE=bytearray(b'\x00\x00\x00\x00\x00\x5e\x3c\x3f\x3f\x3c\x5e\x00\x00\x00\x00\x00') -BUTTERFLY=bytearray(b'\x00\x00\x00\x00\x04\xca\xaa\x5c\x38\x5c\xaa\xca\x04\x00\x00\x00') -STICKFIGURE=bytearray(b'\x00\x00\x00\x00\x00\x90\x4a\x3d\x4a\x90\x00\x00\x00\x00\x00\x00') -GHOST=bytearray(b'\x00\x00\x00\x00\xfe\xdf\xe9\xdf\xe9\xdf\xfe\xc0\x80\x00\x00\x00') -PITCHFORK=bytearray(b'\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x3e\x49\x49\x49\x49\x49') -MUSIC_QUAVERS=bytearray(b'\x20\x10\x08\x0c\x1c\x38\x30\x10\x08\x0c\x1c\x38\x30\x10\x08\x04') -MUSIC_QUAVER=bytearray(b'\x06\x05\x05\x05\x05\x05\x05\x05\x36\x7c\xfc\xfc\xf8\x70\x00\x00') -MUSIC_CROTCHET=bytearray(b'\x02\x02\x02\x02\x02\x02\x02\x02\x1a\x3e\x7e\x7e\x7c\x38\x00\x00') -COW=bytearray(b'\x00\x1e\x1a\x1f\xfe\xfc\x1c\x1c\x1c\xfc\xfc\x08\x10\x10\x20\x00') -RABBIT=bytearray(b'\x14\x2a\x2a\x2a\x2a\x2a\x63\x41\x55\x41\x49\x49\x5d\x41\x3e\x00') -SQUARE_SMALL=bytearray(b'\x00\x00\x00\x00\x00\x00\x3c\x24\x24\x3c\x00\x00\x00\x00\x00\x00') -SQUARE=bytearray(b'\x00\x00\x00\x00\xff\x81\x81\x81\x81\x81\x81\xff\x00\x00\x00\x00') -DIAMOND_SMALL=bytearray(b'\x00\x00\x00\x00\x00\x08\x14\x2c\x14\x08\x00\x00\x00\x00\x00\x00') -DIAMOND=bytearray(b'\x00\x00\x04\x0e\x1b\x35\x6f\xdd\x6f\x35\x1b\x0e\x04\x00\x00\x00') -CHESSBOARD=bytearray(b'\x00\x00\x00\xfe\xaa\xfe\xaa\xfe\xaa\xfe\xaa\xfe\xaa\xfe\x00\x00') -TRIANGLE_LEFT=bytearray(b'\x00\x00\x00\x00\x00\x10\x38\x7c\xfe\x00\x00\x00\x00\x00\x00\x00') -TRIANGLE=bytearray(b'\x00\x00\x40\x60\x70\x78\x7c\x7e\x7e\x7c\x78\x70\x60\x40\x00\x00') -SNAKE=bytearray(b'\x00\x40\x60\x70\x38\x18\x18\x18\x18\x1f\x05\x07\x00\x00\x00\x00') -UMBRELLA=bytearray(b'\x00\x00\x00\x08\x0c\x0e\x0e\xff\x8e\xce\x0c\x08\x00\x00\x00\x00') -SKULL=bytearray(b'\x00\x00\x00\x0c\x1a\x79\x99\xd7\x99\x79\x1a\x0c\x00\x00\x00\x00') -GIRAFFE=bytearray(b'\x00\x00\x00\x00\xe0\x20\x20\xff\x03\x02\x00\x00\x00\x00\x00\x00') -SWORD=bytearray(b'\x00\x00\x18\x18\x7e\x3c\x18\x18\x18\x18\x18\x18\x18\x00\x00\x00') \ No newline at end of file diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_framebuf.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_framebuf.py deleted file mode 100644 index 458dcc5410..0000000000 --- a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_framebuf.py +++ /dev/null @@ -1,549 +0,0 @@ -# The MIT License (MIT) -# -# Copyright (c) 2018 Kattni Rembor for Adafruit Industries -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION 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_framebuf` -==================================================== - -CircuitPython pure-python framebuf module, based on the micropython framebuf module. - -* Author(s): Melissa LeBlanc-Williams, Kattni Rembor, Tony DiCola, original file - created by Damien P. George - -Implementation Notes --------------------- - -**Hardware:** - -* `Adafruit SSD1306 OLED displays `_ - -**Software and Dependencies:** - -* Adafruit CircuitPython firmware for the supported boards: - https://github.com/adafruit/circuitpython/releases - -""" - -__version__ = "0.0.0-auto.0" -__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_framebuf.git" - -import os -import struct - -# Framebuf format constants: -MVLSB = 0 # Single bit displays (like SSD1306 OLED) -RGB565 = 1 # 16-bit color displays -GS4_HMSB = 2 # Unimplemented! -MHMSB = 3 # Single bit displays like the Sharp Memory -RGB888 = 4 # Neopixels and Dotstars - - -class MHMSBFormat: - """MHMSBFormat""" - - @staticmethod - def set_pixel(framebuf, x, y, color): - """Set a given pixel to a color.""" - index = (y * framebuf.stride + x) // 8 - offset = 7 - x & 0x07 - framebuf.buf[index] = (framebuf.buf[index] & ~(0x01 << offset)) | ( - (color != 0) << offset - ) - - @staticmethod - def get_pixel(framebuf, x, y): - """Get the color of a given pixel""" - index = (y * framebuf.stride + x) // 8 - offset = 7 - x & 0x07 - return (framebuf.buf[index] >> offset) & 0x01 - - @staticmethod - def fill(framebuf, color): - """completely fill/clear the buffer with a color""" - if color: - fill = 0xFF - else: - fill = 0x00 - for i in range(len(framebuf.buf)): - framebuf.buf[i] = fill - - @staticmethod - def fill_rect(framebuf, x, y, width, height, color): - """Draw a rectangle at the given location, size and color. The ``fill_rect`` method draws - both the outline and interior.""" - # pylint: disable=too-many-arguments - for _x in range(x, x + width): - offset = 7 - _x & 0x07 - for _y in range(y, y + height): - index = (_y * framebuf.stride + _x) // 8 - framebuf.buf[index] = (framebuf.buf[index] & ~(0x01 << offset)) | ( - (color != 0) << offset - ) - - -class MVLSBFormat: - """MVLSBFormat""" - - @staticmethod - def set_pixel(framebuf, x, y, color): - """Set a given pixel to a color.""" - index = (y >> 3) * framebuf.stride + x - offset = y & 0x07 - framebuf.buf[index] = (framebuf.buf[index] & ~(0x01 << offset)) | ( - (color != 0) << offset - ) - - @staticmethod - def get_pixel(framebuf, x, y): - """Get the color of a given pixel""" - index = (y >> 3) * framebuf.stride + x - offset = y & 0x07 - return (framebuf.buf[index] >> offset) & 0x01 - - @staticmethod - def fill(framebuf, color): - """completely fill/clear the buffer with a color""" - if color: - fill = 0xFF - else: - fill = 0x00 - for i in range(len(framebuf.buf)): - framebuf.buf[i] = fill - - @staticmethod - def fill_rect(framebuf, x, y, width, height, color): - """Draw a rectangle at the given location, size and color. The ``fill_rect`` method draws - both the outline and interior.""" - # pylint: disable=too-many-arguments - while height > 0: - index = (y >> 3) * framebuf.stride + x - offset = y & 0x07 - for w_w in range(width): - framebuf.buf[index + w_w] = ( - framebuf.buf[index + w_w] & ~(0x01 << offset) - ) | ((color != 0) << offset) - y += 1 - height -= 1 - - -class RGB888Format: - """RGB888Format""" - - @staticmethod - def set_pixel(framebuf, x, y, color): - """Set a given pixel to a color.""" - index = (y * framebuf.stride + x) * 3 - if isinstance(color, tuple): - framebuf.buf[index : index + 3] = bytes(color) - else: - framebuf.buf[index : index + 3] = bytes( - ((color >> 16) & 255, (color >> 8) & 255, color & 255) - ) - - @staticmethod - def get_pixel(framebuf, x, y): - """Get the color of a given pixel""" - index = (y * framebuf.stride + x) * 3 - return ( - (framebuf.buf[index] << 16) - | (framebuf.buf[index + 1] << 8) - | framebuf.buf[index + 2] - ) - - @staticmethod - def fill(framebuf, color): - """completely fill/clear the buffer with a color""" - fill = (color >> 16) & 255, (color >> 8) & 255, color & 255 - for i in range(0, len(framebuf.buf), 3): - framebuf.buf[i : i + 3] = bytes(fill) - - @staticmethod - def fill_rect(framebuf, x, y, width, height, color): - """Draw a rectangle at the given location, size and color. The ``fill_rect`` method draws - both the outline and interior.""" - # pylint: disable=too-many-arguments - fill = (color >> 16) & 255, (color >> 8) & 255, color & 255 - for _x in range(x, x + width): - for _y in range(y, y + height): - index = (_y * framebuf.stride + _x) * 3 - framebuf.buf[index : index + 3] = bytes(fill) - - -class FrameBuffer: - """FrameBuffer object. - - :param buf: An object with a buffer protocol which must be large enough to contain every - pixel defined by the width, height and format of the FrameBuffer. - :param width: The width of the FrameBuffer in pixel - :param height: The height of the FrameBuffer in pixel - :param buf_format: Specifies the type of pixel used in the FrameBuffer; permissible values - are listed under Constants below. These set the number of bits used to - encode a color value and the layout of these bits in ``buf``. Where a - color value c is passed to a method, c is a small integer with an encoding - that is dependent on the format of the FrameBuffer. - :param stride: The number of pixels between each horizontal line of pixels in the - FrameBuffer. This defaults to ``width`` but may need adjustments when - implementing a FrameBuffer within another larger FrameBuffer or screen. The - ``buf`` size must accommodate an increased step size. - - """ - - def __init__(self, buf, width, height, buf_format=MVLSB, stride=None): - # pylint: disable=too-many-arguments - self.buf = buf - self.width = width - self.height = height - self.stride = stride - self._font = None - if self.stride is None: - self.stride = width - if buf_format == MVLSB: - self.format = MVLSBFormat() - elif buf_format == MHMSB: - self.format = MHMSBFormat() - elif buf_format == RGB888: - self.format = RGB888Format() - else: - raise ValueError("invalid format") - self._rotation = 0 - - @property - def rotation(self): - """The rotation setting of the display, can be one of (0, 1, 2, 3)""" - return self._rotation - - @rotation.setter - def rotation(self, val): - if not val in (0, 1, 2, 3): - raise RuntimeError("Bad rotation setting") - self._rotation = val - - def fill(self, color): - """Fill the entire FrameBuffer with the specified color.""" - self.format.fill(self, color) - - def fill_rect(self, x, y, width, height, color): - """Draw a rectangle at the given location, size and color. The ``fill_rect`` method draws - both the outline and interior.""" - # pylint: disable=too-many-arguments, too-many-boolean-expressions - self.rect(x, y, width, height, color, fill=True) - - def pixel(self, x, y, color=None): - """If ``color`` is not given, get the color value of the specified pixel. If ``color`` is - given, set the specified pixel to the given color.""" - if self.rotation == 1: - x, y = y, x - x = self.width - x - 1 - if self.rotation == 2: - x = self.width - x - 1 - y = self.height - y - 1 - if self.rotation == 3: - x, y = y, x - y = self.height - y - 1 - - if x < 0 or x >= self.width or y < 0 or y >= self.height: - return None - if color is None: - return self.format.get_pixel(self, x, y) - self.format.set_pixel(self, x, y, color) - return None - - def hline(self, x, y, width, color): - """Draw a horizontal line up to a given length.""" - self.rect(x, y, width, 1, color, fill=True) - - def vline(self, x, y, height, color): - """Draw a vertical line up to a given length.""" - self.rect(x, y, 1, height, color, fill=True) - - def circle(self, center_x, center_y, radius, color): - """Draw a circle at the given midpoint location, radius and color. - The ```circle``` method draws only a 1 pixel outline.""" - x = radius - 1 - y = 0 - d_x = 1 - d_y = 1 - err = d_x - (radius << 1) - while x >= y: - self.pixel(center_x + x, center_y + y, color) - self.pixel(center_x + y, center_y + x, color) - self.pixel(center_x - y, center_y + x, color) - self.pixel(center_x - x, center_y + y, color) - self.pixel(center_x - x, center_y - y, color) - self.pixel(center_x - y, center_y - x, color) - self.pixel(center_x + y, center_y - x, color) - self.pixel(center_x + x, center_y - y, color) - if err <= 0: - y += 1 - err += d_y - d_y += 2 - if err > 0: - x -= 1 - d_x += 2 - err += d_x - (radius << 1) - - def rect(self, x, y, width, height, color, *, fill=False): - """Draw a rectangle at the given location, size and color. The ```rect``` method draws only - a 1 pixel outline.""" - # pylint: disable=too-many-arguments - if self.rotation == 1: - x, y = y, x - width, height = height, width - x = self.width - x - width - if self.rotation == 2: - x = self.width - x - width - y = self.height - y - height - if self.rotation == 3: - x, y = y, x - width, height = height, width - y = self.height - y - height - - # pylint: disable=too-many-boolean-expressions - if ( - width < 1 - or height < 1 - or (x + width) <= 0 - or (y + height) <= 0 - or y >= self.height - or x >= self.width - ): - return - x_end = min(self.width - 1, x + width - 1) - y_end = min(self.height - 1, y + height - 1) - x = max(x, 0) - y = max(y, 0) - if fill: - self.format.fill_rect(self, x, y, x_end - x + 1, y_end - y + 1, color) - else: - self.format.fill_rect(self, x, y, x_end - x + 1, 1, color) - self.format.fill_rect(self, x, y, 1, y_end - y + 1, color) - self.format.fill_rect(self, x, y_end, x_end - x + 1, 1, color) - self.format.fill_rect(self, x_end, y, 1, y_end - y + 1, color) - - def line(self, x_0, y_0, x_1, y_1, color): - # pylint: disable=too-many-arguments - """Bresenham's line algorithm""" - d_x = abs(x_1 - x_0) - d_y = abs(y_1 - y_0) - x, y = x_0, y_0 - s_x = -1 if x_0 > x_1 else 1 - s_y = -1 if y_0 > y_1 else 1 - if d_x > d_y: - err = d_x / 2.0 - while x != x_1: - self.pixel(x, y, color) - err -= d_y - if err < 0: - y += s_y - err += d_x - x += s_x - else: - err = d_y / 2.0 - while y != y_1: - self.pixel(x, y, color) - err -= d_x - if err < 0: - x += s_x - err += d_y - y += s_y - self.pixel(x, y, color) - - def blit(self): - """blit is not yet implemented""" - raise NotImplementedError() - - def scroll(self, delta_x, delta_y): - """shifts framebuf in x and y direction""" - if delta_x < 0: - shift_x = 0 - xend = self.width + delta_x - dt_x = 1 - else: - shift_x = self.width - 1 - xend = delta_x - 1 - dt_x = -1 - if delta_y < 0: - y = 0 - yend = self.height + delta_y - dt_y = 1 - else: - y = self.height - 1 - yend = delta_y - 1 - dt_y = -1 - while y != yend: - x = shift_x - while x != xend: - self.format.set_pixel( - self, x, y, self.format.get_pixel(self, x - delta_x, y - delta_y) - ) - x += dt_x - y += dt_y - - # pylint: disable=too-many-arguments - def text(self, string, x, y, color, *, font_name="font5x8.bin", size=1): - """Place text on the screen in variables sizes. Breaks on \n to next line. - - Does not break on line going off screen. - """ - # determine our effective width/height, taking rotation into account - frame_width = self.width - frame_height = self.height - if self.rotation == 1 or self.rotation == 3: - frame_width, frame_height = frame_height, frame_width - - for chunk in string.split("\n"): - if not self._font or self._font.font_name != font_name: - # load the font! - self._font = BitmapFont(font_name) - width = self._font.font_width - height = self._font.font_height - for i, char in enumerate(chunk): - char_x = x + (i * (width + 1)) * size - if ( - char_x + (width * size) > 0 - and char_x < frame_width - and y + (height * size) > 0 - and y < frame_height - ): - self._font.draw_char(char, char_x, y, self, color, size=size) - y += height * size - - # pylint: enable=too-many-arguments - - def image(self, img): - """Set buffer to value of Python Imaging Library image. The image should - be in 1 bit mode and a size equal to the display size.""" - # determine our effective width/height, taking rotation into account - width = self.width - height = self.height - if self.rotation == 1 or self.rotation == 3: - width, height = height, width - - if isinstance(self.format, RGB888Format) and img.mode != "RGB": - raise ValueError("Image must be in mode RGB.") - if isinstance(self.format, (MHMSBFormat, MVLSBFormat)) and img.mode != "1": - raise ValueError("Image must be in mode 1.") - - imwidth, imheight = img.size - if imwidth != width or imheight != height: - raise ValueError( - "Image must be same dimensions as display ({0}x{1}).".format( - width, height - ) - ) - # Grab all the pixels from the image, faster than getpixel. - pixels = img.load() - # Clear buffer - for i in range(len(self.buf)): - self.buf[i] = 0 - # Iterate through the pixels - for x in range(width): # yes this double loop is slow, - for y in range(height): # but these displays are small! - if img.mode == "RGB": - self.pixel(x, y, pixels[(x, y)]) - elif pixels[(x, y)]: - self.pixel(x, y, 1) # only write if pixel is true - - -# MicroPython basic bitmap font renderer. -# Author: Tony DiCola -# License: MIT License (https://opensource.org/licenses/MIT) -class BitmapFont: - """A helper class to read binary font tiles and 'seek' through them as a - file to display in a framebuffer. We use file access so we dont waste 1KB - of RAM on a font!""" - - def __init__(self, font_name="font5x8.bin"): - # Specify the drawing area width and height, and the pixel function to - # call when drawing pixels (should take an x and y param at least). - # Optionally specify font_name to override the font file to use (default - # is font5x8.bin). The font format is a binary file with the following - # format: - # - 1 unsigned byte: font character width in pixels - # - 1 unsigned byte: font character height in pixels - # - x bytes: font data, in ASCII order covering all 255 characters. - # Each character should have a byte for each pixel column of - # data (i.e. a 5x8 font has 5 bytes per character). - self.font_name = font_name - - # Open the font file and grab the character width and height values. - # Note that only fonts up to 8 pixels tall are currently supported. - try: - self._font_code=b'\x05\x08\x00\x00\x00\x00\x00>[O[>>kOk>\x1c>|>\x1c\x18<~<\x18\x1cW}W\x1c\x1c^\x7f^\x1c\x00\x18<\x18\x00\xff\xe7\xc3\xe7\xff\x00\x18$\x18\x00\xff\xe7\xdb\xe7\xff0H:\x06\x0e&)y)&@\x7f\x05\x05\x07@\x7f\x05%?Z<\xe7\x1c\x1c\x08\x08\x1c\x1c>\x7f\x14"\x7f"\x14__\x00__\x06\t\x7f\x01\x7f\x00f\x89\x95j`````\x94\xa2\xff\xa2\x94\x08\x04~\x04\x08\x10 ~ \x10\x08\x08*\x1c\x08\x08\x1c*\x08\x08\x1e\x10\x10\x10\x10\x0c\x1e\x0c\x1e\x0c08>80\x06\x0e>\x0e\x06\x00\x00\x00\x00\x00\x00\x00_\x00\x00\x00\x07\x00\x07\x00\x14\x7f\x14\x7f\x14$*\x7f*\x12#\x13\x08db6IV P\x00\x08\x07\x03\x00\x00\x1c"A\x00\x00A"\x1c\x00*\x1c\x7f\x1c*\x08\x08>\x08\x08\x00\x80p0\x00\x08\x08\x08\x08\x08\x00\x00``\x00 \x10\x08\x04\x02>QIE>\x00B\x7f@\x00rIIIF!AIM3\x18\x14\x12\x7f\x10\'EEE9A]YN|\x12\x11\x12|\x7fIII6>AAA"\x7fAAA>\x7fIIIA\x7f\t\t\t\x01>AAQs\x7f\x08\x08\x08\x7f\x00A\x7fA\x00 @A?\x01\x7f\x08\x14"A\x7f@@@@\x7f\x02\x1c\x02\x7f\x7f\x04\x08\x10\x7f>AAA>\x7f\t\t\t\x06>AQ!^\x7f\t\x19)F&III2\x03\x01\x7f\x01\x03?@@@?\x1f @ \x1f?@8@?c\x14\x08\x14c\x03\x04x\x04\x03aYIMC\x00\x7fAAA\x02\x04\x08\x10 \x00AAA\x7f\x04\x02\x01\x02\x04@@@@@\x00\x03\x07\x08\x00 TTx@\x7f(DD88DDD(8DD(\x7f8TTT\x18\x00\x08~\t\x02\x18\xa4\xa4\x9cx\x7f\x08\x04\x04x\x00D}@\x00 @@=\x00\x7f\x10(D\x00\x00A\x7f@\x00|\x04x\x04x|\x08\x04\x04x8DDD8\xfc\x18$$\x18\x18$$\x18\xfc|\x08\x04\x04\x08HTTT$\x04\x04?D$<@@ |\x1c @ \x1c<@0@III\x00~\x01\x01\x01~*****DD_DD@QJD@@DJQ@\x00\x00\xff\x01\x03\xe0\x80\xff\x00\x00\x08\x08kk\x086\x126$6\x06\x0f\t\x0f\x06\x00\x00\x18\x18\x00\x00\x00\x10\x10\x000@\xff\x01\x01\x00\x1f\x01\x01\x1e\x00\x19\x1d\x17\x12\x00<<<<\x00\x00\x00\x00\x00' - self.font_width, self.font_height = struct.unpack("BB", b'\x05\x08') - # simple font file validation check based on expected file size - #if 2 + 256 * self.font_width != os.stat(font_name)[6]: - # raise RuntimeError("Invalid font file: " + font_name) - except OSError: - print("Could not find font file", font_name) - raise - except OverflowError: - # os.stat can throw this on boards without long int support - # just hope the font file is valid and press on - pass - - def deinit(self): - """Close the font file as cleanup.""" - #self._font.close() - - def __enter__(self): - """Initialize/open the font file""" - self.__init__() - return self - - def __exit__(self, exception_type, exception_value, traceback): - """cleanup on exit""" - #self.deinit() - pass - - def draw_char( - self, char, x, y, framebuffer, color, size=1 - ): # pylint: disable=too-many-arguments - """Draw one character at position (x,y) to a framebuffer in a given color""" - size = max(size, 1) - # Don't draw the character if it will be clipped off the visible area. - # if x < -self.font_width or x >= framebuffer.width or \ - # y < -self.font_height or y >= framebuffer.height: - # return - # Go through each column of the character. - for char_x in range(self.font_width): - # Grab the byte for the current column of font data. - #self._font.seek(2 + (ord(char) * self.font_width) + char_x) - chcode=bytes([self._font_code[(2 + (ord(char) * self.font_width) + char_x)]]) - try: - line = struct.unpack("B", chcode)[0] - except RuntimeError: - continue # maybe character isnt there? go to next - # Go through each row in the column byte. - for char_y in range(self.font_height): - # Draw a pixel for each bit that's flipped on. - if (line >> char_y) & 0x1: - framebuffer.fill_rect( - x + char_x * size, y + char_y * size, size, size, color - ) - - def width(self, text): - """Return the pixel width of the specified text message.""" - return len(text) * (self.font_width + 1) - - -class FrameBuffer1(FrameBuffer): # pylint: disable=abstract-method - """FrameBuffer1 object. Inherits from FrameBuffer.""" diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_irremote.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_irremote.py deleted file mode 100644 index e7f1476cfc..0000000000 --- a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_irremote.py +++ /dev/null @@ -1,283 +0,0 @@ -# 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. -""" -`adafruit_irremote` -==================================================== - -Demo code for Circuit Playground Express: - -.. code-block:: python - - # Circuit Playground Express Demo Code - # Adjust the pulseio 'board.PIN' if using something else - import pulseio - import board - import adafruit_irremote - - pulsein = pulseio.PulseIn(board.REMOTEIN, maxlen=120, idle_state=True) - decoder = adafruit_irremote.GenericDecode() - - - while True: - pulses = decoder.read_pulses(pulsein) - print("Heard", len(pulses), "Pulses:", pulses) - try: - code = decoder.decode_bits(pulses) - print("Decoded:", code) - except adafruit_irremote.IRNECRepeatException: # unusual short code! - print("NEC repeat!") - except adafruit_irremote.IRDecodeException as e: # failed to decode - print("Failed to decode: ", e.args) - - print("----------------------------") - -* Author(s): Scott Shawcroft - -Implementation Notes --------------------- - -**Hardware:** - -* `CircuitPlayground Express `_ - -* `IR Receiver Sensor `_ - -**Software and Dependencies:** - -* Adafruit CircuitPython firmware for the ESP8622 and M0-based boards: - https://github.com/adafruit/circuitpython/releases - -""" - -# Pretend self matter because we may add object level config later. -# pylint: disable=no-self-use - -import array -import time - -__version__ = "0.0.0-auto.0" -__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_IRRemote.git" - - -class IRDecodeException(Exception): - """Generic decode exception""" - - -class IRNECRepeatException(Exception): - """Exception when a NEC repeat is decoded""" - - -class GenericDecode: - """Generic decoding of infrared signals""" - - def bin_data(self, pulses): - """Compute bins of pulse lengths where pulses are +-25% of the average. - - :param list pulses: Input pulse lengths - """ - bins = [[pulses[0], 0]] - - for _, pulse in enumerate(pulses): - matchedbin = False - # print(pulse, end=": ") - for b, pulse_bin in enumerate(bins): - if pulse_bin[0] * 0.75 <= pulse <= pulse_bin[0] * 1.25: - # print("matches bin") - bins[b][0] = (pulse_bin[0] + pulse) // 2 # avg em - bins[b][1] += 1 # track it - matchedbin = True - break - if not matchedbin: - bins.append([pulse, 1]) - # print(bins) - return bins - - def decode_bits(self, pulses): - """Decode the pulses into bits.""" - # pylint: disable=too-many-branches,too-many-statements - - # special exception for NEC repeat code! - if ( - (len(pulses) == 3) - and (8000 <= pulses[0] <= 10000) - and (2000 <= pulses[1] <= 3000) - and (450 <= pulses[2] <= 700) - ): - raise IRNECRepeatException() - - if len(pulses) < 10: - raise IRDecodeException("10 pulses minimum") - - # Ignore any header (evens start at 1), and any trailer. - if len(pulses) % 2 == 0: - pulses_end = -1 - else: - pulses_end = None - - evens = pulses[1:pulses_end:2] - odds = pulses[2:pulses_end:2] - - # bin both halves - even_bins = self.bin_data(evens) - odd_bins = self.bin_data(odds) - - outliers = [b[0] for b in (even_bins + odd_bins) if b[1] == 1] - even_bins = [b for b in even_bins if b[1] > 1] - odd_bins = [b for b in odd_bins if b[1] > 1] - - if not even_bins or not odd_bins: - raise IRDecodeException("Not enough data") - - if len(even_bins) == 1: - pulses = odds - pulse_bins = odd_bins - elif len(odd_bins) == 1: - pulses = evens - pulse_bins = even_bins - else: - raise IRDecodeException("Both even/odd pulses differ") - - if len(pulse_bins) == 1: - raise IRDecodeException("Pulses do not differ") - if len(pulse_bins) > 2: - raise IRDecodeException("Only mark & space handled") - - mark = min(pulse_bins[0][0], pulse_bins[1][0]) - space = max(pulse_bins[0][0], pulse_bins[1][0]) - - if outliers: - # skip outliers - pulses = [ - p - for p in pulses - if not (outliers[0] * 0.75) <= p <= (outliers[0] * 1.25) - ] - # convert marks/spaces to 0 and 1 - for i, pulse_length in enumerate(pulses): - if (space * 0.75) <= pulse_length <= (space * 1.25): - pulses[i] = False - elif (mark * 0.75) <= pulse_length <= (mark * 1.25): - pulses[i] = True - else: - raise IRDecodeException("Pulses outside mark/space") - - # convert bits to bytes! - output = [0] * ((len(pulses) + 7) // 8) - for i, pulse_length in enumerate(pulses): - output[i // 8] = output[i // 8] << 1 - if pulse_length: - output[i // 8] |= 1 - return output - - def _read_pulses_non_blocking( - self, input_pulses, max_pulse=10000, pulse_window=0.10 - ): - """Read out a burst of pulses without blocking until pulses stop for a specified - period (pulse_window), pruning pulses after a pulse longer than ``max_pulse``. - - :param ~pulseio.PulseIn input_pulses: Object to read pulses from - :param int max_pulse: Pulse duration to end a burst - :param float pulse_window: pulses are collected for this period of time - """ - received = None - recent_count = 0 - pruning = False - while True: - while input_pulses: - pulse = input_pulses.popleft() - recent_count += 1 - if pulse > max_pulse: - if received is None: - continue - pruning = True - if not pruning: - if received is None: - received = [] - received.append(pulse) - - if recent_count == 0: - return received - recent_count = 0 - time.sleep(pulse_window) - - def read_pulses( - self, - input_pulses, - *, - max_pulse=10000, - blocking=True, - pulse_window=0.10, - blocking_delay=0.10 - ): - """Read out a burst of pulses until pulses stop for a specified - period (pulse_window), pruning pulses after a pulse longer than ``max_pulse``. - - :param ~pulseio.PulseIn input_pulses: Object to read pulses from - :param int max_pulse: Pulse duration to end a burst - :param bool blocking: If True, will block until pulses found. - If False, will return None if no pulses. - Defaults to True for backwards compatibility - :param float pulse_window: pulses are collected for this period of time - :param float blocking_delay: delay between pulse checks when blocking - """ - while True: - pulses = self._read_pulses_non_blocking( - input_pulses, max_pulse, pulse_window - ) - if blocking and pulses is None: - time.sleep(blocking_delay) - continue - return pulses - - -class GenericTransmit: - """Generic infrared transmit class that handles encoding.""" - - def __init__(self, header, one, zero, trail): - self.header = header - self.one = one - self.zero = zero - self.trail = trail - - def transmit(self, pulseout, data): - """Transmit the ``data`` using the ``pulseout``. - - :param pulseio.PulseOut pulseout: PulseOut to transmit on - :param bytearray data: Data to transmit - """ - durations = array.array("H", [0] * (2 + len(data) * 8 * 2 + 1)) - durations[0] = self.header[0] - durations[1] = self.header[1] - durations[-1] = self.trail - out = 2 - for byte_index, _ in enumerate(data): - for i in range(7, -1, -1): - if (data[byte_index] & 1 << i) > 0: - durations[out] = self.one[0] - durations[out + 1] = self.one[1] - else: - durations[out] = self.zero[0] - durations[out + 1] = self.zero[1] - out += 2 - - # print(durations) - pulseout.send(durations) diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_minimqtt.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_minimqtt.py deleted file mode 100644 index 4dde03eb5d..0000000000 --- a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_minimqtt.py +++ /dev/null @@ -1,1000 +0,0 @@ -# SPDX-FileCopyrightText: 2019-2021 Brent Rubell for Adafruit Industries -# -# SPDX-License-Identifier: MIT - -# Original Work Copyright (c) 2016 Paul Sokolovsky, uMQTT -# Modified Work Copyright (c) 2019 Bradley Beach, esp32spi_mqtt -# Modified Work Copyright (c) 2012-2019 Roger Light and others, Paho MQTT Python - -""" -`adafruit_minimqtt` -================================================================================ - -A minimal MQTT Library for CircuitPython. - -* Author(s): Brent Rubell - -Implementation Notes --------------------- - -Adapted from https://github.com/micropython/micropython-lib/tree/master/umqtt.simple/umqtt - -**Software and Dependencies:** - -* Adafruit CircuitPython firmware for the supported boards: - https://github.com/adafruit/circuitpython/releases - -""" -import errno -import struct -import time -from random import randint -from micropython import const -from matcher import MQTTMatcher - -__version__ = "0.0.0-auto.0" -__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT.git" - -# Client-specific variables -MQTT_MSG_MAX_SZ = const(268435455) -MQTT_MSG_SZ_LIM = const(10000000) -MQTT_TOPIC_LENGTH_LIMIT = const(65535) -MQTT_TCP_PORT = const(1883) -MQTT_TLS_PORT = const(8883) - -# MQTT Commands -MQTT_PINGREQ = b"\xc0\0" -MQTT_PINGRESP = const(0xD0) -MQTT_SUB = b"\x82" -MQTT_UNSUB = b"\xA2" -MQTT_DISCONNECT = b"\xe0\0" - -# Variable CONNECT header [MQTT 3.1.2] -MQTT_HDR_CONNECT = bytearray(b"\x04MQTT\x04\x02\0\0") - - -CONNACK_ERRORS = { - const(0x01): "Connection Refused - Incorrect Protocol Version", - const(0x02): "Connection Refused - ID Rejected", - const(0x03): "Connection Refused - Server unavailable", - const(0x04): "Connection Refused - Incorrect username/password", - const(0x05): "Connection Refused - Unauthorized", -} - -_default_sock = None # pylint: disable=invalid-name -_fake_context = None # pylint: disable=invalid-name - - -class MMQTTException(Exception): - """MiniMQTT Exception class.""" - - # pylint: disable=unnecessary-pass - # pass - - -# Legacy ESP32SPI Socket API -def set_socket(sock, iface=None): - """Legacy API for setting the socket and network interface. - - :param sock: socket object. - :param iface: internet interface object - - """ - global _default_sock # pylint: disable=invalid-name, global-statement - global _fake_context # pylint: disable=invalid-name, global-statement - _default_sock = sock - if iface: - _default_sock.set_interface(iface) - _fake_context = _FakeSSLContext(iface) - - -class _FakeSSLSocket: - def __init__(self, socket, tls_mode): - self._socket = socket - self._mode = tls_mode - self.settimeout = socket.settimeout - self.send = socket.send - self.recv = socket.recv - self.close = socket.close - - def connect(self, address): - """connect wrapper to add non-standard mode parameter""" - try: - return self._socket.connect(address, self._mode) - except RuntimeError as error: - raise OSError(errno.ENOMEM) from error - - -class _FakeSSLContext: - def __init__(self, iface): - self._iface = iface - - def wrap_socket(self, socket, server_hostname=None): - """Return the same socket""" - # pylint: disable=unused-argument - return _FakeSSLSocket(socket, self._iface.TLS_MODE) - - -class MQTT: - """MQTT Client for CircuitPython. - - :param str broker: MQTT Broker URL or IP Address. - :param int port: Optional port definition, defaults to 8883. - :param str username: Username for broker authentication. - :param str password: Password for broker authentication. - :param network_manager: NetworkManager object, such as WiFiManager from ESPSPI_WiFiManager. - :param str client_id: Optional client identifier, defaults to a unique, generated string. - :param bool is_ssl: Sets a secure or insecure connection with the broker. - :param int keep_alive: KeepAlive interval between the broker and the MiniMQTT client. - :param socket socket_pool: A pool of socket resources available for the given radio. - :param ssl_context: SSL context for long-lived SSL connections. - :param bool use_binary_mode: Messages are passed as bytearray instead of string to callbacks. - - """ - - # pylint: disable=too-many-arguments,too-many-instance-attributes, not-callable, invalid-name, no-member - def __init__( - self, - broker, - port=None, - username=None, - password=None, - client_id=None, - is_ssl=True, - keep_alive=60, - socket_pool=None, - ssl_context=None, - use_binary_mode=False, - ): - - self._socket_pool = socket_pool - self._ssl_context = ssl_context - self._sock = None - self._backwards_compatible_sock = False - self._use_binary_mode = use_binary_mode - - self.keep_alive = keep_alive - self._user_data = None - self._is_connected = False - self._msg_size_lim = MQTT_MSG_SZ_LIM - self._pid = 0 - self._timestamp = 0 - self.logger = None - - self.broker = broker - self._username = username - self._password = password - if ( - self._password and len(password.encode("utf-8")) > MQTT_TOPIC_LENGTH_LIMIT - ): # [MQTT-3.1.3.5] - raise MMQTTException("Password length is too large.") - - self.port = MQTT_TCP_PORT - if is_ssl: - self.port = MQTT_TLS_PORT - if port: - self.port = port - - # define client identifer - if client_id: - # user-defined client_id MAY allow client_id's > 23 bytes or - # non-alpha-numeric characters - self.client_id = client_id - else: - # assign a unique client_id - self.client_id = "cpy{0}{1}".format( - randint(0, int(time.monotonic() * 100) % 1000), randint(0, 99) - ) - # generated client_id's enforce spec.'s length rules - if len(self.client_id.encode("utf-8")) > 23 or not self.client_id: - raise ValueError("MQTT Client ID must be between 1 and 23 bytes") - - # LWT - self._lw_topic = None - self._lw_qos = 0 - self._lw_topic = None - self._lw_msg = None - self._lw_retain = False - - # List of subscribed topics, used for tracking - self._subscribed_topics = [] - self._on_message_filtered = MQTTMatcher() - - # Default topic callback methods - self._on_message = None - self.on_connect = None - self.on_disconnect = None - self.on_publish = None - self.on_subscribe = None - self.on_unsubscribe = None - - # pylint: disable=too-many-branches - def _get_connect_socket(self, host, port, *, timeout=1): - """Obtains a new socket and connects to a broker. - - :param str host: Desired broker hostname - :param int port: Desired broker port - :param int timeout: Desired socket timeout - """ - # For reconnections - check if we're using a socket already and close it - if self._sock: - self._sock.close() - self._sock = None - - # Legacy API - use the interface's socket instead of a passed socket pool - if self._socket_pool is None: - self._socket_pool = _default_sock - - # Legacy API - fake the ssl context - if self._ssl_context is None: - self._ssl_context = _fake_context - - if not isinstance(port, int): - raise RuntimeError("Port must be an integer") - - if port == 8883 and not self._ssl_context: - raise RuntimeError( - "ssl_context must be set before using adafruit_mqtt for secure MQTT." - ) - - if self.logger is not None and port == MQTT_TLS_PORT: - self.logger.info( - "Establishing a SECURE SSL connection to {0}:{1}".format(host, port) - ) - elif self.logger is not None: - self.logger.info( - "Establishing an INSECURE connection to {0}:{1}".format(host, port) - ) - - addr_info = self._socket_pool.getaddrinfo( - host, port, 0, self._socket_pool.SOCK_STREAM - )[0] - - sock = None - retry_count = 0 - while retry_count < 5 and sock is None: - retry_count += 1 - - try: - sock = self._socket_pool.socket(addr_info[0], addr_info[1]) - except OSError: - continue - - connect_host = addr_info[-1][0] - if port == 8883: - sock = self._ssl_context.wrap_socket(sock, server_hostname=host) - connect_host = host - sock.settimeout(timeout) - - try: - sock.connect((connect_host, port)) - except MemoryError: - sock.close() - sock = None - except OSError: - sock.close() - sock = None - - if sock is None: - raise RuntimeError("Repeated socket failures") - - self._backwards_compatible_sock = not hasattr(sock, "recv_into") - return sock - - def __enter__(self): - return self - - def __exit__(self, exception_type, exception_value, traceback): - self.deinit() - - def _sock_exact_recv(self, bufsize): - """Reads _exact_ number of bytes from the connected socket. Will only return - string with the exact number of bytes requested. - - The semantics of native socket receive is that it returns no more than the - specified number of bytes (i.e. max size). However, it makes no guarantees in - terms of the minimum size of the buffer, which could be 1 byte. This is a - wrapper for socket recv() to ensure that no less than the expected number of - bytes is returned or trigger a timeout exception. - - :param int bufsize: number of bytes to receive - """ - stamp = time.monotonic() - rc = self._sock.recv(bufsize) - to_read = bufsize - len(rc) - assert to_read >= 0 - read_timeout = self.keep_alive - while to_read > 0: - recv = self._sock.recv(to_read) - to_read -= len(recv) - rc += recv - if time.monotonic() - stamp > read_timeout: - raise MMQTTException( - "Unable to receive {} bytes within {} seconds.".format( - to_read, read_timeout - ) - ) - return rc - - def deinit(self): - """De-initializes the MQTT client and disconnects from the mqtt broker.""" - self.disconnect() - - @property - def mqtt_msg(self): - """Returns maximum MQTT payload and topic size.""" - return self._msg_size_lim, MQTT_TOPIC_LENGTH_LIMIT - - @mqtt_msg.setter - def mqtt_msg(self, msg_size): - """Sets the maximum MQTT message payload size. - - :param int msg_size: Maximum MQTT payload size. - """ - if msg_size < MQTT_MSG_MAX_SZ: - self._msg_size_lim = msg_size - - def will_set(self, topic=None, payload=None, qos=0, retain=False): - """Sets the last will and testament properties. MUST be called before `connect()`. - - :param str topic: MQTT Broker topic. - :param int|float|str payload: Last will disconnection payload. - payloads of type int & float are converted to a string. - :param int qos: Quality of Service level, defaults to - zero. Conventional options are ``0`` (send at most once), ``1`` - (send at least once), or ``2`` (send exactly once). - - .. note:: Only options ``1`` or ``0`` are QoS levels supported by this library. - :param bool retain: Specifies if the payload is to be retained when - it is published. - """ - if self.logger is not None: - self.logger.debug("Setting last will properties") - self._valid_qos(qos) - if self._is_connected: - raise MMQTTException("Last Will should only be called before connect().") - if payload is None: - payload = "" - if isinstance(payload, (int, float, str)): - payload = str(payload).encode() - else: - raise MMQTTException("Invalid message data type.") - self._lw_qos = qos - self._lw_topic = topic - self._lw_msg = payload - self._lw_retain = retain - - def add_topic_callback(self, mqtt_topic, callback_method): - """Registers a callback_method for a specific MQTT topic. - - :param str mqtt_topic: MQTT topic identifier. - :param function callback_method: The callback method. - """ - if mqtt_topic is None or callback_method is None: - raise ValueError("MQTT topic and callback method must both be defined.") - self._on_message_filtered[mqtt_topic] = callback_method - - def remove_topic_callback(self, mqtt_topic): - """Removes a registered callback method. - - :param str mqtt_topic: MQTT topic identifier string. - """ - if mqtt_topic is None: - raise ValueError("MQTT Topic must be defined.") - try: - del self._on_message_filtered[mqtt_topic] - except KeyError: - raise KeyError( - "MQTT topic callback not added with add_topic_callback." - ) from None - - @property - def on_message(self): - """Called when a new message has been received on a subscribed topic. - - Expected method signature is ``on_message(client, topic, message)`` - """ - return self._on_message - - @on_message.setter - def on_message(self, method): - self._on_message = method - - def _handle_on_message(self, client, topic, message): - matched = False - if topic is not None: - for callback in self._on_message_filtered.iter_match(topic): - callback(client, topic, message) # on_msg with callback - matched = True - - if not matched and self.on_message: # regular on_message - self.on_message(client, topic, message) - - def username_pw_set(self, username, password=None): - """Set client's username and an optional password. - - :param str username: Username to use with your MQTT broker. - :param str password: Password to use with your MQTT broker. - - """ - if self._is_connected: - raise MMQTTException("This method must be called before connect().") - self._username = username - if password is not None: - self._password = password - - # pylint: disable=too-many-branches, too-many-statements, too-many-locals - def connect(self, clean_session=True, host=None, port=None, keep_alive=None): - """Initiates connection with the MQTT Broker. - - :param bool clean_session: Establishes a persistent session. - :param str host: Hostname or IP address of the remote broker. - :param int port: Network port of the remote broker. - :param int keep_alive: Maximum period allowed for communication, in seconds. - - """ - if host: - self.broker = host - if port: - self.port = port - if keep_alive: - self.keep_alive = keep_alive - - if self.logger is not None: - self.logger.debug("Attempting to establish MQTT connection...") - - # Get a new socket - self._sock = self._get_connect_socket(self.broker, self.port) - - # Fixed Header - fixed_header = bytearray([0x10]) - - # NOTE: Variable header is - # MQTT_HDR_CONNECT = bytearray(b"\x04MQTT\x04\x02\0\0") - # because final 4 bytes are 4, 2, 0, 0 - var_header = MQTT_HDR_CONNECT - var_header[6] = clean_session << 1 - - # Set up variable header and remaining_length - remaining_length = 12 + len(self.client_id.encode("utf-8")) - if self._username: - remaining_length += ( - 2 - + len(self._username.encode("utf-8")) - + 2 - + len(self._password.encode("utf-8")) - ) - var_header[6] |= 0xC0 - if self.keep_alive: - assert self.keep_alive < MQTT_TOPIC_LENGTH_LIMIT - var_header[7] |= self.keep_alive >> 8 - var_header[8] |= self.keep_alive & 0x00FF - if self._lw_topic: - remaining_length += ( - 2 + len(self._lw_topic.encode("utf-8")) + 2 + len(self._lw_msg) - ) - var_header[6] |= 0x4 | (self._lw_qos & 0x1) << 3 | (self._lw_qos & 0x2) << 3 - var_header[6] |= self._lw_retain << 5 - - # Remaining length calculation - large_rel_length = False - if remaining_length > 0x7F: - large_rel_length = True - # Calculate Remaining Length [2.2.3] - while remaining_length > 0: - encoded_byte = remaining_length % 0x80 - remaining_length = remaining_length // 0x80 - # if there is more data to encode, set the top bit of the byte - if remaining_length > 0: - encoded_byte |= 0x80 - fixed_header.append(encoded_byte) - if large_rel_length: - fixed_header.append(0x00) - else: - fixed_header.append(remaining_length) - fixed_header.append(0x00) - - if self.logger is not None: - self.logger.debug("Sending CONNECT to broker...") - self.logger.debug( - "Fixed Header: %s\nVariable Header: %s", fixed_header, var_header - ) - self._sock.send(fixed_header) - self._sock.send(var_header) - # [MQTT-3.1.3-4] - self._send_str(self.client_id) - if self._lw_topic: - # [MQTT-3.1.3-11] - self._send_str(self._lw_topic) - self._send_str(self._lw_msg) - if self._username is None: - self._username = None - else: - self._send_str(self._username) - self._send_str(self._password) - if self.logger is not None: - self.logger.debug("Receiving CONNACK packet from broker") - while True: - op = self._wait_for_msg() - if op == 32: - rc = self._sock_exact_recv(3) - assert rc[0] == 0x02 - if rc[2] != 0x00: - raise MMQTTException(CONNACK_ERRORS[rc[2]]) - self._is_connected = True - result = rc[0] & 1 - if self.on_connect is not None: - self.on_connect(self, self._user_data, result, rc[2]) - return result - - def disconnect(self): - """Disconnects the MiniMQTT client from the MQTT broker.""" - self.is_connected() - if self.logger is not None: - self.logger.debug("Sending DISCONNECT packet to broker") - try: - self._sock.send(MQTT_DISCONNECT) - except RuntimeError as e: - if self.logger is not None: - self.logger.warning("Unable to send DISCONNECT packet: {}".format(e)) - if self.logger is not None: - self.logger.debug("Closing socket") - self._sock.close() - self._is_connected = False - self._subscribed_topics = [] - if self.on_disconnect is not None: - self.on_disconnect(self, self._user_data, 0) - - def ping(self): - """Pings the MQTT Broker to confirm if the broker is alive or if - there is an active network connection. - Returns response codes of any messages received while waiting for PINGRESP. - """ - self.is_connected() - if self.logger is not None: - self.logger.debug("Sending PINGREQ") - self._sock.send(MQTT_PINGREQ) - ping_timeout = self.keep_alive - stamp = time.monotonic() - rc, rcs = None, [] - while rc != MQTT_PINGRESP: - rc = self._wait_for_msg() - if rc: - rcs.append(rc) - if time.monotonic() - stamp > ping_timeout: - raise MMQTTException("PINGRESP not returned from broker.") - return rcs - - # pylint: disable=too-many-branches, too-many-statements - def publish(self, topic, msg, retain=False, qos=0): - """Publishes a message to a topic provided. - - :param str topic: Unique topic identifier. - :param str|int|float|bytes msg: Data to send to the broker. - :param bool retain: Whether the message is saved by the broker. - :param int qos: Quality of Service level for the message, defaults to zero. - - """ - self.is_connected() - self._valid_topic(topic) - if "+" in topic or "#" in topic: - raise MMQTTException("Publish topic can not contain wildcards.") - # check msg/qos kwargs - if msg is None: - raise MMQTTException("Message can not be None.") - if isinstance(msg, (int, float)): - msg = str(msg).encode("ascii") - elif isinstance(msg, str): - msg = str(msg).encode("utf-8") - elif isinstance(msg, bytes): - pass - else: - raise MMQTTException("Invalid message data type.") - if len(msg) > MQTT_MSG_MAX_SZ: - raise MMQTTException("Message size larger than %d bytes." % MQTT_MSG_MAX_SZ) - assert ( - 0 <= qos <= 1 - ), "Quality of Service Level 2 is unsupported by this library." - - # fixed header. [3.3.1.2], [3.3.1.3] - pub_hdr_fixed = bytearray([0x30 | retain | qos << 1]) - - # variable header = 2-byte Topic length (big endian) - pub_hdr_var = bytearray(struct.pack(">H", len(topic.encode("utf-8")))) - pub_hdr_var.extend(topic.encode("utf-8")) # Topic name - - remaining_length = 2 + len(msg) + len(topic.encode("utf-8")) - if qos > 0: - # packet identifier where QoS level is 1 or 2. [3.3.2.2] - remaining_length += 2 - self._pid = self._pid + 1 if self._pid < 0xFFFF else 1 - pub_hdr_var.append(self._pid >> 8) - pub_hdr_var.append(self._pid & 0xFF) - - # Calculate remaining length [2.2.3] - if remaining_length > 0x7F: - while remaining_length > 0: - encoded_byte = remaining_length % 0x80 - remaining_length = remaining_length // 0x80 - if remaining_length > 0: - encoded_byte |= 0x80 - pub_hdr_fixed.append(encoded_byte) - else: - pub_hdr_fixed.append(remaining_length) - - if self.logger is not None: - self.logger.debug( - "Sending PUBLISH\nTopic: %s\nMsg: %s\ - \nQoS: %d\nRetain? %r", - topic, - msg, - qos, - retain, - ) - self._sock.send(pub_hdr_fixed) - self._sock.send(pub_hdr_var) - self._sock.send(msg) - if qos == 0 and self.on_publish is not None: - self.on_publish(self, self._user_data, topic, self._pid) - if qos == 1: - while True: - op = self._wait_for_msg() - if op == 0x40: - sz = self._sock_exact_recv(1) - assert sz == b"\x02" - rcv_pid = self._sock_exact_recv(2) - rcv_pid = rcv_pid[0] << 0x08 | rcv_pid[1] - if self._pid == rcv_pid: - if self.on_publish is not None: - self.on_publish(self, self._user_data, topic, rcv_pid) - return - - def subscribe(self, topic, qos=0): - """Subscribes to a topic on the MQTT Broker. - This method can subscribe to one topics or multiple topics. - - :param str|tuple|list topic: Unique MQTT topic identifier string. If - this is a `tuple`, then the tuple should - contain topic identifier string and qos - level integer. If this is a `list`, then - each list element should be a tuple containing - a topic identifier string and qos level integer. - :param int qos: Quality of Service level for the topic, defaults to - zero. Conventional options are ``0`` (send at most once), ``1`` - (send at least once), or ``2`` (send exactly once). - - """ - self.is_connected() - topics = None - if isinstance(topic, tuple): - topic, qos = topic - self._valid_topic(topic) - self._valid_qos(qos) - if isinstance(topic, str): - self._valid_topic(topic) - self._valid_qos(qos) - topics = [(topic, qos)] - if isinstance(topic, list): - topics = [] - for t, q in topic: - self._valid_qos(q) - self._valid_topic(t) - topics.append((t, q)) - # Assemble packet - packet_length = 2 + (2 * len(topics)) + (1 * len(topics)) - packet_length += sum(len(topic.encode("utf-8")) for topic, qos in topics) - packet_length_byte = packet_length.to_bytes(1, "big") - self._pid = self._pid + 1 if self._pid < 0xFFFF else 1 - packet_id_bytes = self._pid.to_bytes(2, "big") - # Packet with variable and fixed headers - packet = MQTT_SUB + packet_length_byte + packet_id_bytes - # attaching topic and QOS level to the packet - for t, q in topics: - topic_size = len(t.encode("utf-8")).to_bytes(2, "big") - qos_byte = q.to_bytes(1, "big") - packet += topic_size + t.encode() + qos_byte - if self.logger is not None: - for t, q in topics: - self.logger.debug("SUBSCRIBING to topic %s with QoS %d", t, q) - self._sock.send(packet) - while True: - op = self._wait_for_msg() - if op == 0x90: - rc = self._sock_exact_recv(4) - assert rc[1] == packet[2] and rc[2] == packet[3] - if rc[3] == 0x80: - raise MMQTTException("SUBACK Failure!") - for t, q in topics: - if self.on_subscribe is not None: - self.on_subscribe(self, self._user_data, t, q) - self._subscribed_topics.append(t) - return - - def unsubscribe(self, topic): - """Unsubscribes from a MQTT topic. - - :param str|list topic: Unique MQTT topic identifier string or list. - - """ - topics = None - if isinstance(topic, str): - self._valid_topic(topic) - topics = [(topic)] - if isinstance(topic, list): - topics = [] - for t in topic: - self._valid_topic(t) - topics.append((t)) - for t in topics: - if t not in self._subscribed_topics: - raise MMQTTException( - "Topic must be subscribed to before attempting unsubscribe." - ) - # Assemble packet - packet_length = 2 + (2 * len(topics)) - packet_length += sum(len(topic.encode("utf-8")) for topic in topics) - packet_length_byte = packet_length.to_bytes(1, "big") - self._pid = self._pid + 1 if self._pid < 0xFFFF else 1 - packet_id_bytes = self._pid.to_bytes(2, "big") - packet = MQTT_UNSUB + packet_length_byte + packet_id_bytes - for t in topics: - topic_size = len(t.encode("utf-8")).to_bytes(2, "big") - packet += topic_size + t.encode() - if self.logger is not None: - for t in topics: - self.logger.debug("UNSUBSCRIBING from topic %s", t) - self._sock.send(packet) - if self.logger is not None: - self.logger.debug("Waiting for UNSUBACK...") - while True: - op = self._wait_for_msg() - if op == 176: - rc = self._sock_exact_recv(3) - assert rc[0] == 0x02 - # [MQTT-3.32] - assert rc[1] == packet_id_bytes[0] and rc[2] == packet_id_bytes[1] - for t in topics: - if self.on_unsubscribe is not None: - self.on_unsubscribe(self, self._user_data, t, self._pid) - self._subscribed_topics.remove(t) - return - - def reconnect(self, resub_topics=True): - """Attempts to reconnect to the MQTT broker. - - :param bool resub_topics: Resubscribe to previously subscribed topics. - - """ - if self.logger is not None: - self.logger.debug("Attempting to reconnect with MQTT broker") - self.connect() - if self.logger is not None: - self.logger.debug("Reconnected with broker") - if resub_topics: - if self.logger is not None: - self.logger.debug( - "Attempting to resubscribe to previously subscribed topics." - ) - subscribed_topics = self._subscribed_topics.copy() - self._subscribed_topics = [] - while subscribed_topics: - feed = subscribed_topics.pop() - self.subscribe(feed) - - def loop(self, timeout=1): - """Non-blocking message loop. Use this method to - check incoming subscription messages. - Returns response codes of any messages received. - - :param int timeout: Socket timeout, in seconds. - - """ - if self._timestamp == 0: - self._timestamp = time.monotonic() - current_time = time.monotonic() - if current_time - self._timestamp >= self.keep_alive: - self._timestamp = 0 - # Handle KeepAlive by expecting a PINGREQ/PINGRESP from the server - if self.logger is not None: - self.logger.debug( - "KeepAlive period elapsed - requesting a PINGRESP from the server..." - ) - rcs = self.ping() - return rcs - self._sock.settimeout(timeout) - rc = self._wait_for_msg() - return [rc] if rc else None - - def _wait_for_msg(self, timeout=0.1): - """Reads and processes network events.""" - # CPython socket module contains a timeout attribute - if hasattr(self._socket_pool, "timeout"): - try: - res = self._sock_exact_recv(1) - except self._socket_pool.timeout: - return None - else: # socketpool, esp32spi - try: - res = self._sock_exact_recv(1) - except OSError as error: - if error.errno == errno.ETIMEDOUT: - # raised by a socket timeout if 0 bytes were present - return None - raise MMQTTException from error - - # Block while we parse the rest of the response - self._sock.settimeout(timeout) - if res in [None, b""]: - # If we get here, it means that there is nothing to be received - return None - if res[0] == MQTT_PINGRESP: - if self.logger is not None: - self.logger.debug("Got PINGRESP") - sz = self._sock_exact_recv(1)[0] - if sz != 0x00: - raise MMQTTException( - "Unexpected PINGRESP returned from broker: {}.".format(sz) - ) - return MQTT_PINGRESP - if res[0] & 0xF0 != 0x30: - return res[0] - sz = self._recv_len() - # topic length MSB & LSB - topic_len = self._sock_exact_recv(2) - topic_len = (topic_len[0] << 8) | topic_len[1] - topic = self._sock_exact_recv(topic_len) - topic = str(topic, "utf-8") - sz -= topic_len + 2 - pid = 0 - if res[0] & 0x06: - pid = self._sock_exact_recv(2) - pid = pid[0] << 0x08 | pid[1] - sz -= 0x02 - # read message contents - raw_msg = self._sock_exact_recv(sz) - msg = raw_msg if self._use_binary_mode else str(raw_msg, "utf-8") - if self.logger is not None: - self.logger.debug( - "Receiving SUBSCRIBE \nTopic: %s\nMsg: %s\n", topic, raw_msg - ) - self._handle_on_message(self, topic, msg) - if res[0] & 0x06 == 0x02: - pkt = bytearray(b"\x40\x02\0\0") - struct.pack_into("!H", pkt, 2, pid) - self._sock.send(pkt) - elif res[0] & 6 == 4: - assert 0 - return res[0] - - def _recv_len(self): - """Unpack MQTT message length.""" - n = 0 - sh = 0 - b = bytearray(1) - while True: - b = self._sock_exact_recv(1)[0] - n |= (b & 0x7F) << sh - if not b & 0x80: - return n - sh += 7 - - def _recv_into(self, buf, size=0): - """Backwards-compatible _recv_into implementation.""" - if self._backwards_compatible_sock: - size = len(buf) if size == 0 else size - b = self._sock.recv(size) - read_size = len(b) - buf[:read_size] = b - return read_size - return self._sock.recv_into(buf, size) - - def _sock_exact_recv(self, bufsize): - """Reads _exact_ number of bytes from the connected socket. Will only return - string with the exact number of bytes requested. - - The semantics of native socket receive is that it returns no more than the - specified number of bytes (i.e. max size). However, it makes no guarantees in - terms of the minimum size of the buffer, which could be 1 byte. This is a - wrapper for socket recv() to ensure that no less than the expected number of - bytes is returned or trigger a timeout exception. - - :param int bufsize: number of bytes to receive - - """ - if not self._backwards_compatible_sock: - # CPython/Socketpool Impl. - rc = bytearray(bufsize) - self._sock.recv_into(rc, bufsize) - else: # ESP32SPI Impl. - stamp = time.monotonic() - read_timeout = self.keep_alive - # This will timeout with socket timeout (not keepalive timeout) - rc = self._sock.recv(bufsize) - if not rc: - if self.logger is not None: - self.logger.debug("_sock_exact_recv timeout") - # If no bytes waiting, raise same exception as socketpool - raise OSError(errno.ETIMEDOUT) - # If any bytes waiting, try to read them all, - # or raise exception if wait longer than read_timeout - to_read = bufsize - len(rc) - assert to_read >= 0 - read_timeout = self.keep_alive - while to_read > 0: - recv = self._sock.recv(to_read) - to_read -= len(recv) - rc += recv - if time.monotonic() - stamp > read_timeout: - raise MMQTTException( - "Unable to receive {} bytes within {} seconds.".format( - to_read, read_timeout - ) - ) - return rc - - def _send_str(self, string): - """Encodes a string and sends it to a socket. - - :param str string: String to write to the socket. - - """ - if isinstance(string, str): - self._sock.send(struct.pack("!H", len(string.encode("utf-8")))) - self._sock.send(str.encode(string, "utf-8")) - else: - self._sock.send(struct.pack("!H", len(string))) - self._sock.send(string) - - @staticmethod - def _valid_topic(topic): - """Validates if topic provided is proper MQTT topic format. - - :param str topic: Topic identifier - - """ - if topic is None: - raise MMQTTException("Topic may not be NoneType") - # [MQTT-4.7.3-1] - if not topic: - raise MMQTTException("Topic may not be empty.") - # [MQTT-4.7.3-3] - if len(topic.encode("utf-8")) > MQTT_TOPIC_LENGTH_LIMIT: - raise MMQTTException("Topic length is too large.") - - @staticmethod - def _valid_qos(qos_level): - """Validates if the QoS level is supported by this library - - :param int qos_level: Desired QoS level. - - """ - if isinstance(qos_level, int): - if qos_level < 0 or qos_level > 2: - raise MMQTTException("QoS must be between 1 and 2.") - else: - raise MMQTTException("QoS must be an integer.") - - def is_connected(self): - """Returns MQTT client session status as True if connected, raises - a `MMQTTException` if `False`. - """ - if self._sock is None or self._is_connected is False: - raise MMQTTException("MiniMQTT is not connected.") - return self._is_connected - - # Logging - def enable_logger(self, logger, log_level=20): - """Enables library logging provided a logger object. - - :param logger: A python logger pacakge. - :param log_level: Numeric value of a logging level, defaults to INFO. - - """ - self.logger = logger.getLogger("log") - self.logger.setLevel(log_level) - - def disable_logger(self): - """Disables logging.""" - if not self.logger: - raise MMQTTException("Can not disable logger, no logger found.") - self.logger = None diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_rtttl.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_rtttl.py deleted file mode 100644 index 75665f1bb5..0000000000 --- a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/adafruit_rtttl.py +++ /dev/null @@ -1,204 +0,0 @@ -# The MIT License (MIT) -# -# Copyright (c) 2017, 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. -""" -`adafruit_rtttl` -==================================================== - -Play notes to a digialio pin using ring tone text transfer language (rtttl). - -* Author(s): Scott Shawcroft -""" - -__version__ = "2.4.2" -__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_RTTTL" - -import sys -import time -import pwmio - -AUDIOIO_AVAILABLE = False -try: - import audioio - from adafruit_waveform import sine - - AUDIOIO_AVAILABLE = True - try: - import audiocore - except ImportError: - audiocore = audioio -except ImportError: - pass - -PIANO = { - "4c": 261.626, - "4c#": 277.183, - "4d": 293.665, - "4d#": 311.127, - "4e": 329.628, - "4f": 349.228, - "4f#": 369.994, - "4g": 391.995, - "4g#": 415.305, - "4a": 440, - "4a#": 466.164, - "4b": 493.883, - "5c": 523.251, - "5c#": 554.365, - "5d": 587.330, - "5d#": 622.254, - "5e": 659.255, - "5f": 698.456, - "5f#": 739.989, - "5g": 783.991, - "5g#": 830.609, - "5a": 880, - "5a#": 932.328, - "5b": 987.767, - "6c": 1046.50, - "6c#": 1108.73, - "6d": 1174.66, - "6d#": 1244.51, - "6e": 1318.51, - "6f": 1396.91, - "6f#": 1479.98, - "6g": 1567.98, - "6g#": 1661.22, - "6a": 1760, - "6a#": 1864.66, - "6b": 1975.53, - "7c": 2093, - "7c#": 2217.46, -} - - -def _parse_note(note, duration=2, octave="6"): - note = note.strip() - piano_note = None - note_duration = duration - if note[0].isdigit() and note[1].isdigit(): - note_duration = int(note[:2]) - piano_note = note[2] - elif note[0].isdigit(): - note_duration = int(note[0]) - piano_note = note[1] - else: - piano_note = note[0] - if "." in note: - note_duration *= 1.5 - if "#" in note: - piano_note += "#" - note_octave = octave - if note[-1].isdigit(): - note_octave = note[-1] - piano_note = note_octave + piano_note - return piano_note, note_duration - - -def _get_wave(tune, octave): - """Returns the proper waveform to play the song along with the minimum - frequency in the song. - """ - min_freq = 13000 - - for note in tune.split(","): - piano_note, _ = _parse_note(note, octave=octave) - if piano_note[-1] != "p" and PIANO[piano_note] < min_freq: - min_freq = PIANO[piano_note] - return sine.sine_wave(16000, min_freq), min_freq - - -# pylint: disable-msg=too-many-arguments -def _play_to_pin(tune, base_tone, min_freq, duration, octave, tempo): - """Using the prepared input send the notes to the pin - """ - pwm = isinstance(base_tone, pwmio.PWMOut) - for note in tune.split(","): - piano_note, note_duration = _parse_note(note, duration, octave) - if piano_note in PIANO: - if pwm: - base_tone.frequency = int(PIANO[piano_note]) - base_tone.duty_cycle = 2 ** 15 - else: - # AudioOut interface changed in CP 3.x - if sys.implementation.version[0] >= 3: - pitch = int(PIANO[piano_note]) - sine_wave = sine.sine_wave(16000, pitch) - sine_wave_sample = audiocore.RawSample(sine_wave) - base_tone.play(sine_wave_sample, loop=True) - else: - base_tone.frequency = int(16000 * (PIANO[piano_note] / min_freq)) - base_tone.play(loop=True) - - time.sleep(4 / note_duration * 60 / tempo) - if pwm: - base_tone.duty_cycle = 0 - else: - base_tone.stop() - time.sleep(0.02) - - -# pylint: disable-msg=too-many-arguments -def play(pin, rtttl, octave=None, duration=None, tempo=None): - """Play notes to a digialio pin using ring tone text transfer language (rtttl). - :param ~digitalio.DigitalInOut pin: the speaker pin - :param rtttl: string containing rtttl - :param int octave: represents octave number (default 6 starts at middle c) - :param int duration: length of notes (default 4 quarter note) - :param int tempo: how fast (default 63 beats per minute) - """ - _, defaults, tune = rtttl.lower().split(":") - for default in defaults.split(","): - if default[0] == "d" and not duration: - duration = int(default[2:]) - elif default[0] == "o" and not octave: - octave = default[2:] - elif default[0] == "b" and not tempo: - tempo = int(default[2:]) - if not octave: - octave = 6 - if not duration: - duration = 4 - if not tempo: - tempo = 63 - - base_tone = None - min_freq = 440 - if AUDIOIO_AVAILABLE: - wave, min_freq = _get_wave(tune, octave) - try: - # AudioOut interface changed in CP 3.x; a waveform if now pass - # directly to .play(), generated for each note in _play_to_pin() - if sys.implementation.version[0] >= 3: - base_tone = audioio.AudioOut(pin) - else: - base_tone = audioio.AudioOut(pin, wave) - except ValueError: - # No DAC on the pin so use PWM. - pass - - # Fall back to PWM - if not base_tone: - base_tone = pwmio.PWMOut(pin, duty_cycle=0, variable_frequency=True) - - _play_to_pin(tune, base_tone, min_freq, duration, octave, tempo) - - base_tone.deinit() diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/blynklib.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/blynklib.py deleted file mode 100644 index c174d91c7f..0000000000 --- a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/blynklib.py +++ /dev/null @@ -1,390 +0,0 @@ -# Copyright (c) 2019-2020 Anton Morozenko -# Copyright (c) 2015-2019 Volodymyr Shymanskyy. -# See the file LICENSE for copying permission. -# 宋义深 2021/4/25 Modified -__version__ = '0.2.6' - -import socketpool as socket -import ssl -import struct -import time -import wifi - -LOGO = """ - ___ __ __ - / _ )/ /_ _____ / /__ - / _ / / // / _ \\/ '_/ - /____/_/\\_, /_//_/_/\\_\\ - /___/ for Python v{}\n""".format(__version__) - - -def stub_log(*args): - pass - - -def ticks_ms(): - return int(time.time() * 1000) - - -def sleep_ms(ms): - time.sleep(ms // 1000) - - -class BlynkError(Exception): - pass - - -class RedirectError(Exception): - def __init__(self, server, port): - self.server = server - self.port = port - - -class Protocol(object): - MSG_RSP = 0 - MSG_LOGIN = 2 - MSG_PING = 6 - MSG_TWEET = 12 - MSG_EMAIL = 13 - MSG_NOTIFY = 14 - MSG_BRIDGE = 15 - MSG_HW_SYNC = 16 - MSG_INTERNAL = 17 - MSG_PROPERTY = 19 - MSG_HW = 20 - MSG_REDIRECT = 41 - MSG_HEAD_LEN = 5 - - STATUS_INVALID_TOKEN = 9 - STATUS_NO_DATA = 17 - STATUS_OK = 200 - VPIN_MAX_NUM = 32 - - _msg_id = 0 - - def _get_msg_id(self, **kwargs): - if 'msg_id' in kwargs: - return kwargs['msg_id'] - self._msg_id += 1 - return self._msg_id if self._msg_id <= 0xFFFF else 1 - - def _pack_msg(self, msg_type, *args, **kwargs): - data = ('\0'.join([str(curr_arg) for curr_arg in args])).encode('utf-8') - return struct.pack('!BHH', msg_type, self._get_msg_id(**kwargs), len(data)) + data - - def parse_response(self, rsp_data, msg_buffer): - msg_args = [] - try: - msg_type, msg_id, h_data = struct.unpack('!BHH', rsp_data[:self.MSG_HEAD_LEN]) - except Exception as p_err: - print(p_err) - raise BlynkError('Message parse error: {}'.format(p_err)) - if msg_id == 0: - raise BlynkError('invalid msg_id == 0') - elif h_data >= msg_buffer: - raise BlynkError('Command too long. Length = {}'.format(h_data)) - elif msg_type in (self.MSG_RSP, self.MSG_PING): - pass - elif msg_type in (self.MSG_HW, self.MSG_BRIDGE, self.MSG_INTERNAL, self.MSG_REDIRECT): - msg_body = rsp_data[self.MSG_HEAD_LEN: self.MSG_HEAD_LEN + h_data] - msg_args = [itm.decode('utf-8') for itm in msg_body.split(b'\0')] - else: - print('unknown') - raise BlynkError("Unknown message type: '{}'".format(msg_type)) - return msg_type, msg_id, h_data, msg_args - - def heartbeat_msg(self, heartbeat, rcv_buffer): - return self._pack_msg(self.MSG_INTERNAL, 'ver', __version__, 'buff-in', rcv_buffer, 'h-beat', heartbeat, - 'dev', 'python') - - def login_msg(self, token): - return self._pack_msg(self.MSG_LOGIN, token) - - def ping_msg(self): - return self._pack_msg(self.MSG_PING) - - def response_msg(self, *args, **kwargs): - return self._pack_msg(self.MSG_RSP, *args, **kwargs) - - def virtual_write_msg(self, v_pin, *val): - return self._pack_msg(self.MSG_HW, 'vw', v_pin, *val) - - def virtual_sync_msg(self, *pins): - return self._pack_msg(self.MSG_HW_SYNC, 'vr', *pins) - - def email_msg(self, to, subject, body): - return self._pack_msg(self.MSG_EMAIL, to, subject, body) - - def tweet_msg(self, msg): - return self._pack_msg(self.MSG_TWEET, msg) - - def notify_msg(self, msg): - return self._pack_msg(self.MSG_NOTIFY, msg) - - def set_property_msg(self, pin, prop, *val): - return self._pack_msg(self.MSG_PROPERTY, pin, prop, *val) - - def internal_msg(self, *args): - return self._pack_msg(self.MSG_INTERNAL, *args) - - -class Connection(Protocol): - SOCK_MAX_TIMEOUT = 5 - SOCK_TIMEOUT = 0 - SOCK_SSL_TIMEOUT = 1 - EAGAIN = 11 - ETIMEDOUT = 60 - RETRIES_TX_DELAY = 2 - RETRIES_TX_MAX_NUM = 3 - RECONNECT_SLEEP = 1 - TASK_PERIOD_RES = 50 - DISCONNECTED = 0 - CONNECTING = 1 - AUTHENTICATING = 2 - AUTHENTICATED = 3 - - _state = None - _socket = None - _socketPool = None - _last_rcv_time = 0 - _last_ping_time = 0 - _last_send_time = 0 - - def __init__(self, token, server='blynk-cloud.com', port=80, ssl_cert=None, heartbeat=10, rcv_buffer=1024, - log=stub_log): - self.token = token - self.server = server - self.port = port - self.heartbeat = heartbeat - self.rcv_buffer = rcv_buffer - self.log = log - self.ssl_cert = ssl_cert - - def send(self, data): - retries = self.RETRIES_TX_MAX_NUM - while retries > 0: - try: - retries -= 1 - self._last_send_time = ticks_ms() - return self._socket.send(data) - except (Exception): - sleep_ms(self.RETRIES_TX_DELAY) - - def receive(self, length, timeout): - d_buff = bytearray(length) - try: - self._socket.settimeout(timeout) - recv_length = self._socket.recv_into(d_buff) - d_buff = d_buff[:recv_length] - #print(self.parse_response(bytes(d_buff), self.rcv_buffer)) - return bytes(d_buff) - except (Exception) as err: - if 'timed out' in str(err): - return b'' - if str(self.EAGAIN) in str(err) or str(self.ETIMEDOUT) in str(err): - return b'' - raise - - def is_server_alive(self): - now = ticks_ms() - h_beat_ms = self.heartbeat * 1000 - rcv_delta = now - self._last_rcv_time - ping_delta = now - self._last_ping_time - send_delta = now - self._last_send_time - if rcv_delta > h_beat_ms + (h_beat_ms // 2): - return False - if (ping_delta > h_beat_ms // 10) and (send_delta > h_beat_ms or rcv_delta > h_beat_ms): - self.send(self.ping_msg()) - self.log('Heartbeat time: {}'.format(now)) - self._last_ping_time = now - return True - - def _get_socket(self): - try: - self._state = self.CONNECTING - self._socket = socket.SocketPool(wifi.radio).socket() - self._socketPool = socket.SocketPool(wifi.radio) - self._socket.connect(self._socketPool.getaddrinfo(self.server, self.port)[0][4]) - self._socket.settimeout(self.SOCK_TIMEOUT) - if self.ssl_cert: - # system default CA certificates case - if self.ssl_cert == "default": - self.ssl_cert = None - self.log('Using SSL socket...') - ssl_context = ssl.create_default_context(cafile=self.ssl_cert) - ssl_context.verify_mode = ssl.CERT_REQUIRED - self._socket.settimeout(self.SOCK_SSL_TIMEOUT) - self._socket = ssl_context.wrap_socket(sock=self._socket, server_hostname=self.server) - self.log('Connected to blynk server') - except Exception as g_exc: - print(g_exc) - raise BlynkError('Connection with the Blynk server failed: {}'.format(g_exc)) - - def _authenticate(self): - self._state = self.AUTHENTICATING - self.send(self.login_msg(self.token)) - rsp_data = self.receive(self.rcv_buffer, self.SOCK_MAX_TIMEOUT) - if not rsp_data: - raise BlynkError('Auth stage timeout') - msg_type, _, status, args = self.parse_response(rsp_data, self.rcv_buffer) - if status != self.STATUS_OK: - if status == self.STATUS_INVALID_TOKEN: - raise BlynkError('Invalid Auth Token') - if msg_type == self.MSG_REDIRECT: - raise RedirectError(*args) - raise BlynkError('Auth stage failed. Status={}'.format(status)) - self._state = self.AUTHENTICATED - - def _set_heartbeat(self): - self.send(self.heartbeat_msg(self.heartbeat, self.rcv_buffer)) - rcv_data = self.receive(self.rcv_buffer, self.SOCK_MAX_TIMEOUT) - if not rcv_data: - raise BlynkError('Heartbeat stage timeout') - _, _, status, _ = self.parse_response(rcv_data, self.rcv_buffer) - if status != self.STATUS_OK: - raise BlynkError('Set heartbeat returned code={}'.format(status)) - self.log('Heartbeat = {} sec. MaxCmdBuffer = {} bytes'.format(self.heartbeat, self.rcv_buffer)) - - def connected(self): - return True if self._state == self.AUTHENTICATED else False - - -class Blynk(Connection): - _CONNECT_TIMEOUT = 30 # 30sec - _VPIN_WILDCARD = '*' - _VPIN_READ = 'read v' - _VPIN_WRITE = 'write v' - _INTERNAL = 'internal_' - _CONNECT = 'connect' - _DISCONNECT = 'disconnect' - _VPIN_READ_ALL = '{}{}'.format(_VPIN_READ, _VPIN_WILDCARD) - _VPIN_WRITE_ALL = '{}{}'.format(_VPIN_WRITE, _VPIN_WILDCARD) - _events = {} - - def __init__(self, token, **kwargs): - Connection.__init__(self, token, **kwargs) - self._start_time = ticks_ms() - self._last_rcv_time = ticks_ms() - self._last_send_time = ticks_ms() - self._last_ping_time = ticks_ms() - self._state = self.DISCONNECTED - print(LOGO) - - def connect(self, timeout=_CONNECT_TIMEOUT): - end_time = time.time() + timeout - while not self.connected(): - if self._state == self.DISCONNECTED: - try: - self._get_socket() - print('[Connecting 1/5] Socket got.') - self._authenticate() - print('[Connecting 2/5] Authenticated.') - self._set_heartbeat() - print('[Connecting 3/5] Heartbeat sent.') - self._last_rcv_time = ticks_ms() - print('[Connecting 4/5] Last receive time set.') - self.log('Registered events: {}\n'.format(list(self._events.keys()))) - print('[Connecting 5/5] Events registered.') - self.call_handler(self._CONNECT) - return True - except BlynkError as b_err: - self.disconnect(b_err) - sleep_ms(self.TASK_PERIOD_RES) - except RedirectError as r_err: - self.disconnect() - self.server = r_err.server - self.port = r_err.port - sleep_ms(self.TASK_PERIOD_RES) - if time.time() >= end_time: - return False - - def disconnect(self, err_msg=None): - self.call_handler(self._DISCONNECT) - if self._socket: - self._socket.close() - self._state = self.DISCONNECTED - if err_msg: - self.log('[ERROR]: {}\nConnection closed'.format(err_msg)) - self._msg_id = 0 - time.sleep(self.RECONNECT_SLEEP) - - def virtual_write(self, v_pin, *val): - return self.send(self.virtual_write_msg(v_pin, *val)) - - def virtual_sync(self, *v_pin): - return self.send(self.virtual_sync_msg(*v_pin)) - - def email(self, to, subject, body): - return self.send(self.email_msg(to, subject, body)) - - def tweet(self, msg): - return self.send(self.tweet_msg(msg)) - - def notify(self, msg): - return self.send(self.notify_msg(msg)) - - def set_property(self, v_pin, property_name, *val): - return self.send(self.set_property_msg(v_pin, property_name, *val)) - - def internal(self, *args): - return self.send(self.internal_msg(*args)) - - def handle_event(blynk, event_name): - class Deco(object): - def __init__(self, func): - self.func = func - # wildcard 'read V*' and 'write V*' events handling - if str(event_name).lower() in (blynk._VPIN_READ_ALL, blynk._VPIN_WRITE_ALL): - event_base_name = str(event_name).split(blynk._VPIN_WILDCARD)[0] - for i in range(blynk.VPIN_MAX_NUM + 1): - blynk._events['{}{}'.format(event_base_name.lower(), i)] = func - else: - blynk._events[str(event_name).lower()] = func - - def __call__(self): - return self.func() - - return Deco - - def call_handler(self, event, *args, **kwargs): - if event in self._events.keys(): - self.log("Event: ['{}'] -> {}".format(event, args)) - self._events[event](*args, **kwargs) - - def process(self, msg_type, msg_id, msg_len, msg_args): - if msg_type == self.MSG_RSP: - self.log('Response status: {}'.format(msg_len)) - elif msg_type == self.MSG_PING: - self.send(self.response_msg(self.STATUS_OK, msg_id=msg_id)) - elif msg_type in (self.MSG_HW, self.MSG_BRIDGE, self.MSG_INTERNAL): - if msg_type == self.MSG_INTERNAL: - self.call_handler("{}{}".format(self._INTERNAL, msg_args[0]), msg_args[1:]) - elif len(msg_args) >= 3 and msg_args[0] == 'vw': - self.call_handler("{}{}".format(self._VPIN_WRITE, msg_args[1]), int(msg_args[1]), msg_args[2:]) - elif len(msg_args) == 2 and msg_args[0] == 'vr': - self.call_handler("{}{}".format(self._VPIN_READ, msg_args[1]), int(msg_args[1])) - - def read_response(self, timeout=0.5): - end_time = time.time() + timeout - while time.time() <= end_time: - rsp_data = self.receive(self.rcv_buffer, self.SOCK_TIMEOUT) - if rsp_data: - self._last_rcv_time = ticks_ms() - msg_type, msg_id, h_data, msg_args = self.parse_response(rsp_data, self.rcv_buffer) - self.process(msg_type, msg_id, h_data, msg_args) - - def run(self): - if not self.connected(): - self.connect() - else: - try: - self.read_response(timeout=self.SOCK_TIMEOUT) - if not self.is_server_alive(): - self.disconnect('Blynk server is offline') - except KeyboardInterrupt: - raise - except BlynkError as b_err: - self.log(b_err) - self.disconnect() - except Exception as g_exc: - self.log(g_exc) diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/blynktimer.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/blynktimer.py deleted file mode 100644 index 8fe26ad3f6..0000000000 --- a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/blynktimer.py +++ /dev/null @@ -1,134 +0,0 @@ -# Copyright (c) 2019-2020 Anton Morozenko -# 宋义深 2021/4/25 Modified -""" -Polling timers for functions. -Registers timers and performs run once or periodical function execution after defined time intervals. -""" -# select.select call used as polling waiter where it is possible -# cause time.sleep sometimes may load CPU up to 100% with small polling wait interval -try: - # cpython - import time - import select - - polling_wait = lambda x: select.select([], [], [], x) - polling_wait(0.01) -except OSError: - # windows case where select.select call fails - polling_wait = lambda x: time.sleep(x) - -except ImportError: - # micropython - import time - - try: - from uselect import select as s_select - - polling_wait = lambda x: s_select([], [], [], x) - except ImportError: - # case when micropython port does not support select.select - polling_wait = lambda x: time.sleep(x) - -WAIT_SEC = 0.05 -MAX_TIMERS = 16 -DEFAULT_INTERVAL = 10 - - -class TimerError(Exception): - pass - - -class Timer(object): - timers = {} - - def __init__(self, no_timers_err=True): - self.no_timers_err = no_timers_err - - def _get_func_name(self, obj): - """retrieves a suitable name for a function""" - if hasattr(obj, 'func'): - # handles nested decorators - return self._get_func_name(obj.func) - # simply returns 'timer' if on port without function attrs - return getattr(obj, '__name__', 'timer') - - def register(blynk, *args, **kwargs): - # kwargs with defaults are used cause PEP 3102 no supported by Python2 - interval = kwargs.pop('interval', DEFAULT_INTERVAL) - run_once = kwargs.pop('run_once', False) - stopped = kwargs.pop('stopped', False) - - class Deco(object): - def __init__(self, func): - self.func = func - if len(list(Timer.timers.keys())) >= MAX_TIMERS: - raise TimerError('Max allowed timers num={}'.format(MAX_TIMERS)) - _timer = _Timer(interval, func, run_once, stopped, *args, **kwargs) - Timer.timers['{}_{}'.format(len(list(Timer.timers.keys())), blynk._get_func_name(func))] = _timer - - def __call__(self, *f_args, **f_kwargs): - return self.func(*f_args, **f_kwargs) - - return Deco - - @staticmethod - def stop(t_id): - timer = Timer.timers.get(t_id, None) - if timer is None: - raise TimerError('Timer id={} not found'.format(t_id)) - Timer.timers[t_id].stopped = True - - @staticmethod - def start(t_id): - timer = Timer.timers.get(t_id, None) - if timer is None: - raise TimerError('Timer id={} not found'.format(t_id)) - Timer.timers[t_id].stopped = False - Timer.timers[t_id].fire_time = None - Timer.timers[t_id].fire_time_prev = None - - @staticmethod - def is_stopped(t_id): - timer = Timer.timers.get(t_id, None) - if timer is None: - raise TimerError('Timer id={} not found'.format(t_id)) - return timer.stopped - - def get_timers(self): - states = {True: 'Stopped', False: 'Running'} - return {k: states[v.stopped] for k, v in self.timers.items()} - - def run(self): - polling_wait(WAIT_SEC) - timers_intervals = [curr_timer.run() for curr_timer in Timer.timers.values() if not curr_timer.stopped] - if not timers_intervals and self.no_timers_err: - raise TimerError('Running timers not found') - return timers_intervals - - -class _Timer(object): - def __init__(self, interval, deco, run_once, stopped, *args, **kwargs): - self.interval = interval - self.deco = deco - self.args = args - self.run_once = run_once - self.kwargs = kwargs - self.fire_time = None - self.fire_time_prev = None - self.stopped = stopped - - def run(self): - timer_real_interval = 0 - if self.fire_time is None: - self.fire_time = time.time() + self.interval - if self.fire_time_prev is None: - self.fire_time_prev = time.time() - curr_time = time.time() - if curr_time >= self.fire_time: - self.deco(*self.args, **self.kwargs) - if self.run_once: - self.stopped = True - timer_real_interval = curr_time - self.fire_time_prev - self.fire_time_prev = self.fire_time - self.fire_time = curr_time + self.interval - return timer_real_interval diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/button.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/button.py deleted file mode 100644 index e7b3087802..0000000000 --- a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/button.py +++ /dev/null @@ -1,49 +0,0 @@ -""" -Button - -CircuitPython library for Button - MixGoCE -======================================================= -Small Cabbage -20210721 -dahanzimin -20210423 -""" - -import time -import board -from digitalio import DigitalInOut, Direction, Pull - -class Button(): - - def __init__(self, pin): - self.pin = DigitalInOut(pin) - self.pin.direction = Direction.INPUT - self.pin.pull = Pull.UP - self.flag = True - - def is_pressed(self): - return self.pin.value == False - - def get_presses(self, delay=1): - last_time, presses = time.monotonic(), 0 - while time.monotonic()< last_time + delay: - time.sleep(0.05) - if self.was_pressed(): - presses += 1 - return presses - - def was_pressed(self): - if self.pin.value != self.flag: - self.flag = self.pin.value - time.sleep(0.01) - if self.flag == False: - return True - else: - return False - -button_A1 = Button(board.IO14) -button_A2 = Button(board.IO21) -button_A3 = Button(board.IO36) -button_A4 = Button(board.IO37) -button_B1 = Button(board.IO0) -button_B2 = Button(board.IO35) \ No newline at end of file diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/infrared.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/infrared.py deleted file mode 100644 index 508b9dd7f8..0000000000 --- a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/infrared.py +++ /dev/null @@ -1,41 +0,0 @@ -""" -Infrared Sensor - -CircuitPython library for Infrared Sensor - MixGoCE -======================================================= - -Small Cabbage -20210721 -dahanzimin -20210423 -""" - -from mixgoce import version -import board -from pwmio import PWMOut - -if version:#new - def near(x, val=10000): - from analogio import AnalogIn - - pwm = PWMOut(board.IO39, frequency=50000, duty_cycle=65535) - if x == 'left': - IR=AnalogIn(board.IO3) - reaction = IR.value-10000 #fix - if x == 'right': - IR=AnalogIn(board.IO16) - reaction = IR.value - IR.deinit() - pwm.deinit() - return reaction > val -else:#old - def near(x, val=10000): - from digitalio import DigitalInOut, Direction - - IR = DigitalInOut(board.IO38) - IR.direction = Direction.INPUT - pwm = PWMOut(board.IO39, frequency=53000, duty_cycle=100) - reaction = IR.value - IR.deinit() - pwm.deinit() - return reaction \ No newline at end of file diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/irremote.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/irremote.py deleted file mode 100644 index 30445e3503..0000000000 --- a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/irremote.py +++ /dev/null @@ -1,111 +0,0 @@ -""" -IR Remote - -CircuitPython library for IR Remote - MixGoCE -======================================================= - -Small Cabbage -20210811 -""" - -import pulseio -import board -import adafruit_irremote - -first_init =True - -def encode2hex(code): - res = "0X" - for c in code: - c = hex(c)[2:] - if len(c) == 1: - c = "0" + c - res = res + c.upper() - return res - -def decode2list(string): - res = [0, 0, 0, 0] - prefix = "0" * (8 - len(string[2:])) - string = prefix + string[2:] - for i in range(4): - res[i] = int(string[2*i:2*(i+1)], 16) - return res - -def ir_receive_hex(pin=board.IO38, flag=False): - global first_init - global decoder - global pulsein - - if first_init : - pulsein = pulseio.PulseIn(pin, maxlen=120, idle_state=True) - decoder = adafruit_irremote.GenericDecode() - first_init=False - - pulses = decoder.read_pulses(pulsein, blocking=False) - if pulses: - try: - # print("Heard", len(pulses), "Pulses:", pulses) - code = decoder.decode_bits(pulses) - res = encode2hex(code) - if flag: - print("Decoded:", res) - # pulsein.deinit() - return res - except adafruit_irremote.IRNECRepeatException: # unusual short code! - print("NEC repeat!") - except adafruit_irremote.IRDecodeException as e: # failed to decode - if flag: - print("Failed to decode: ", e.args) - # except TypeError as e: - # pass - # finally: - # pulsein.deinit() - -def ir_receive(pin=board.IO38,flag=False): - global first_init - global decoder - global pulsein - - if first_init : - pulsein = pulseio.PulseIn(pin, maxlen=120, idle_state=True) - decoder = adafruit_irremote.GenericDecode() - first_init=False - - pulses = decoder.read_pulses(pulsein, blocking=False) - if pulses: - try: - code = decoder.decode_bits(pulses) - if flag: - print("Decoded:", code) - return code - except adafruit_irremote.IRNECRepeatException: # unusual short code! - print("NEC repeat!") - except adafruit_irremote.IRDecodeException as e: # failed to decode - if flag: - print("Failed to decode: ", e.args) - -def ir_send(content=[255, 0, 0, 0], pin=board.IO39): - pulseout = pulseio.PulseOut(pin, frequency=38000, duty_cycle=2 ** 15) - # Create an encoder that will take numbers and turn them into NEC IR pulses - encoder = adafruit_irremote.GenericTransmit( - header=[9500, 4500], one=[550, 550], zero=[550, 1700], trail=550 - ) - encoder.transmit(pulseout, content) - print("IR signal sent!") - pulseout.deinit() - -def ir_send_hex(content="0XFF000000", pin=board.IO39): # [255, 0, 0, 0] - pulseout = pulseio.PulseOut(pin, frequency=38000, duty_cycle=2 ** 15) - # Create an encoder that will take numbers and turn them into NEC IR pulses - encoder = adafruit_irremote.GenericTransmit( - header=[9500, 4500], one=[550, 550], zero=[550, 1700], trail=550 - ) - encoder.transmit(pulseout, decode2list(content)) - print("IR signal sent!") - pulseout.deinit() - - - - - - \ No newline at end of file diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/led.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/led.py deleted file mode 100644 index 33d556a90c..0000000000 --- a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/led.py +++ /dev/null @@ -1,34 +0,0 @@ -""" -Led - -CircuitPython library for Led - MixGoCE -======================================================= - -Small Cabbage -20210721 -dahanzimin -20210423 -""" -import board -from pwmio import PWMOut - -class Led(object): #fix - def __init__(self, pin): - self.pin = PWMOut(pin, frequency=5000, duty_cycle=65535) - - def setbrightness(self, val): - self.pin.duty_cycle = 65535 - val - - def setonoff(self, val): - if val == 1: - self.pin.duty_cycle = 0 - elif val == 0: - self.pin.duty_cycle = 65535 - else: - self.pin.duty_cycle = 65535 - self.pin.duty_cycle - - def getonoff(self): - return (65535 - self.pin.duty_cycle) // 65535 - -led_L1 = Led(board.IO33) -led_L2 = Led(board.IO34) \ No newline at end of file diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/matcher.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/matcher.py deleted file mode 100644 index 5d641ccbf3..0000000000 --- a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/matcher.py +++ /dev/null @@ -1,97 +0,0 @@ -# SPDX-FileCopyrightText: 2017 Yoch -# -# SPDX-License-Identifier: EPL-1.0 - -""" -`matcher` -==================================================================================== - -MQTT topic filter matcher from the Eclipse Project's Paho.MQTT.Python -https://github.com/eclipse/paho.mqtt.python/blob/master/src/paho/mqtt/matcher.py -* Author(s): Yoch (https://github.com/yoch) -""" - - -class MQTTMatcher: - """Intended to manage topic filters including wildcards. - - Internally, MQTTMatcher use a prefix tree (trie) to store - values associated with filters, and has an iter_match() - method to iterate efficiently over all filters that match - some topic name. - """ - - # pylint: disable=too-few-public-methods - class Node: - """Individual node on the MQTT prefix tree.""" - - __slots__ = "children", "content" - - def __init__(self): - self.children = {} - self.content = None - - def __init__(self): - self._root = self.Node() - - def __setitem__(self, key, value): - """Add a topic filter :key to the prefix tree - and associate it to :value""" - node = self._root - for sym in key.split("/"): - node = node.children.setdefault(sym, self.Node()) - node.content = value - - def __getitem__(self, key): - """Retrieve the value associated with some topic filter :key""" - try: - node = self._root - for sym in key.split("/"): - node = node.children[sym] - if node.content is None: - raise KeyError(key) - return node.content - except KeyError: - raise KeyError(key) from None - - def __delitem__(self, key): - """Delete the value associated with some topic filter :key""" - lst = [] - try: - parent, node = None, self._root - for k in key.split("/"): - parent, node = node, node.children[k] - lst.append((parent, k, node)) - node.content = None - except KeyError: - raise KeyError(key) from None - else: # cleanup - for parent, k, node in reversed(lst): - if node.children or node.content is not None: - break - del parent.children[k] - - def iter_match(self, topic): - """Return an iterator on all values associated with filters - that match the :topic""" - lst = topic.split("/") - normal = not topic.startswith("$") - - def rec(node, i=0): - if i == len(lst): - if node.content is not None: - yield node.content - else: - part = lst[i] - if part in node.children: - for content in rec(node.children[part], i + 1): - yield content - if "+" in node.children and (normal or i > 0): - for content in rec(node.children["+"], i + 1): - yield content - if "#" in node.children and (normal or i > 0): - content = node.children["#"].content - if content is not None: - yield content - - return rec(self._root) diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/matrix.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/matrix.py deleted file mode 100644 index 5ff56ccb3b..0000000000 --- a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/matrix.py +++ /dev/null @@ -1,277 +0,0 @@ -# The MIT License (MIT) -# -# Copyright (c) 2016 Radomir Dopieralski & Tony DiCola for Adafruit Industries -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION 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_ht16k33.ht16k33` -=========================== - -* Authors: Radomir Dopieralski & Tony DiCola for Adafruit Industries - -""" -from adafruit_bus_device import i2c_device -from micropython import const - -__version__ = "0.0.0-auto.0" -__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_HT16K33.git" - -_HT16K33_BLINK_CMD = const(0x80) -_HT16K33_BLINK_DISPLAYON = const(0x01) -_HT16K33_CMD_BRIGHTNESS = const(0xE0) -_HT16K33_OSCILATOR_ON = const(0x21) - - -class HT16K33: - """ - The base class for all displays. Contains common methods. - - :param int address: The I2C addess of the HT16K33. - :param bool auto_write: True if the display should immediately change when - set. If False, `show` must be called explicitly. - :param float brightness: 0.0 - 1.0 default brightness level. - """ - - def __init__(self, i2c, address=0x70, auto_write=True, brightness=1.0): - self.i2c_device = i2c_device.I2CDevice(i2c, address) - self._temp = bytearray(1) - self._buffer = bytearray(17) - self._auto_write = auto_write - self.fill(0) - self._write_cmd(_HT16K33_OSCILATOR_ON) - self._blink_rate = None - self._brightness = None - self.blink_rate = 0 - self.brightness = brightness - - def _write_cmd(self, byte): - self._temp[0] = byte - with self.i2c_device: - self.i2c_device.write(self._temp) - - @property - def blink_rate(self): - """The blink rate. Range 0-3.""" - return self._blink_rate - - @blink_rate.setter - def blink_rate(self, rate=None): - if not 0 <= rate <= 3: - raise ValueError("Blink rate must be an integer in the range: 0-3") - rate = rate & 0x03 - self._blink_rate = rate - self._write_cmd(_HT16K33_BLINK_CMD | _HT16K33_BLINK_DISPLAYON | rate << 1) - - @property - def brightness(self): - """The brightness. Range 0.0-1.0""" - return self._brightness - - @brightness.setter - def brightness(self, brightness): - if not 0.0 <= brightness <= 1.0: - raise ValueError( - "Brightness must be a decimal number in the range: 0.0-1.0" - ) - - self._brightness = brightness - xbright = round(15 * brightness) - xbright = xbright & 0x0F - self._write_cmd(_HT16K33_CMD_BRIGHTNESS | xbright) - - @property - def auto_write(self): - """Auto write updates to the display.""" - return self._auto_write - - @auto_write.setter - def auto_write(self, auto_write): - if isinstance(auto_write, bool): - self._auto_write = auto_write - else: - raise ValueError("Must set to either True or False.") - - def show(self): - """Refresh the display and show the changes.""" - with self.i2c_device: - # Byte 0 is 0x00, address of LED data register. The remaining 16 - # bytes are the display register data to set. - self.i2c_device.write(self._buffer) - - def fill(self, color): - """Fill the whole display with the given color.""" - fill = 0xFF if color else 0x00 - for i in range(16): - self._buffer[i + 1] = fill - if self._auto_write: - self.show() - - def _pixel(self, x, y, color=None): - addr = 2 * y + x // 8 - mask = 1 << x % 8 - if color is None: - return bool(self._buffer[addr + 1] & mask) - if color: - # set the bit - self._buffer[addr + 1] |= mask - else: - # clear the bit - self._buffer[addr + 1] &= ~mask - if self._auto_write: - self.show() - return None - - def _set_buffer(self, i, value): - self._buffer[i + 1] = value # Offset by 1 to move past register address. - - def _get_buffer(self, i): - return self._buffer[i + 1] # Offset by 1 to move past register address. - -class MatrixBackpack16x8(HT16K33): - """A single matrix.""" - - _columns = 16 - _rows = 8 - - def pixel(self, x, y, color=None): - """Get or set the color of a given pixel.""" - if not 0 <= x <= 15: - return None - if not 0 <= y <= 7: - return None - return super()._pixel(x, y, color) - - def __getitem__(self, key): - x, y = key - return self.pixel(x, y) - - def __setitem__(self, key, value): - x, y = key - self.pixel(x, y, value) - - # pylint: disable=too-many-branches - def shift(self, x, y, rotate=False): - """ - Shift pixels by x and y - - :param rotate: (Optional) Rotate the shifted pixels to the left side (default=False) - """ - auto_write = self.auto_write - self._auto_write = False - if x > 0: # Shift Right - for _ in range(x): - for row in range(0, self.rows): - last_pixel = self[self.columns - 1, row] if rotate else 0 - for col in range(self.columns - 1, 0, -1): - self[col, row] = self[col - 1, row] - self[0, row] = last_pixel - elif x < 0: # Shift Left - for _ in range(-x): - for row in range(0, self.rows): - last_pixel = self[0, row] if rotate else 0 - for col in range(0, self.columns - 1): - self[col, row] = self[col + 1, row] - self[self.columns - 1, row] = last_pixel - if y > 0: # Shift Up - for _ in range(y): - for col in range(0, self.columns): - last_pixel = self[col, self.rows - 1] if rotate else 0 - for row in range(self.rows - 1, 0, -1): - self[col, row] = self[col, row - 1] - self[col, 0] = last_pixel - elif y < 0: # Shift Down - for _ in range(-y): - for col in range(0, self.columns): - last_pixel = self[col, 0] if rotate else 0 - for row in range(0, self.rows - 1): - self[col, row] = self[col, row + 1] - self[col, self.rows - 1] = last_pixel - self._auto_write = auto_write - if auto_write: - self.show() - - # pylint: enable=too-many-branches - - def shift_right(self, rotate=False): - """ - Shift all pixels right - - :param rotate: (Optional) Rotate the shifted pixels to the left side (default=False) - """ - self.shift(1, 0, rotate) - - def shift_left(self, rotate=False): - """ - Shift all pixels left - - :param rotate: (Optional) Rotate the shifted pixels to the right side (default=False) - """ - self.shift(-1, 0, rotate) - - def shift_up(self, rotate=False): - """ - Shift all pixels up - - :param rotate: (Optional) Rotate the shifted pixels to bottom (default=False) - """ - self.shift(0, 1, rotate) - - def shift_down(self, rotate=False): - """ - Shift all pixels down - - :param rotate: (Optional) Rotate the shifted pixels to top (default=False) - """ - self.shift(0, -1, rotate) - - def image(self, img): - """Set buffer to value of Python Imaging Library image. The image should - be in 1 bit mode and a size equal to the display size.""" - imwidth, imheight = img.size - if imwidth != self.columns or imheight != self.rows: - raise ValueError( - "Image must be same dimensions as display ({0}x{1}).".format( - self.columns, self.rows - ) - ) - # Grab all the pixels from the image, faster than getpixel. - pixels = img.convert("1").load() - # Iterate through the pixels - for x in range(self.columns): # yes this double loop is slow, - for y in range(self.rows): # but these displays are small! - self.pixel(x, y, pixels[(x, y)]) - if self._auto_write: - self.show() - - @property - def columns(self): - """Read-only property for number of columns""" - return self._columns - - @property - def rows(self): - """Read-only property for number of rows""" - return self._rows - - - - - - diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mixgoce.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mixgoce.py deleted file mode 100644 index 9042c5c814..0000000000 --- a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mixgoce.py +++ /dev/null @@ -1,85 +0,0 @@ -# Paste mixgoce.py - -import board -from rtc import RTC -from busio import I2C - -def do_connect(username, password): - import wifi - from time import sleep - - wifi.radio.connect(ssid=username.encode(), password=password.encode()) - while not wifi.radio.ipv4_address: - sleep(0.1) - print("Wi-Fi connected!") - return wifi.radio - -rtc_clock = RTC() - -try: - i2c = I2C(board.IO41, board.IO42,frequency=400000) - while not i2c.try_lock(): - pass - if 0x6a in i2c.scan(): - version = 99 - elif 0x15 in i2c.scan(): - version = 1 - else: - version = 0 - - i2c.unlock() - - if version == 99: - i2c.deinit() - elif version:#new - import mxc6655xa - acc = mxc6655xa.MXC6655XA(i2c) - - def get_temperature(): - return acc.get_temperature() - else:#old - import msa301 - acc = msa301.MSA301(i2c) - -except Exception as e: - print(e) - -ADDITIONAL_TOPIC = 'b640a0ce465fa2a4150c36b305c1c11b' -WILL_TOPIC = '9d634e1a156dc0c1611eb4c3cff57276' - -def ntp(url='http://mixio.mixly.org/time.php'): - import ssl - import wifi - import socketpool - import adafruit_requests - #TEXT_URL = 'http://mixio.mixly.org/time.php' - #TEXT_URL = url - pool = socketpool.SocketPool(wifi.radio) - requests = adafruit_requests.Session(pool, ssl.create_default_context()) - # print("Fetching text from", TEXT_URL) - response = requests.get(url) - # print("-" * 40) - # print(tuple(response.text.split(","))) - # print("-" * 40) - return tuple(response.text.split(",")) - -def analyse_sharekey(url): - import ssl - import wifi - import socketpool - import adafruit_requests - import json - #TEXT_URL = 'http://mixio.mixly.org/time.php' - #TEXT_URL = url - pool = socketpool.SocketPool(wifi.radio) - requests = adafruit_requests.Session(pool, ssl.create_default_context()) - # print("Fetching text from", TEXT_URL) - response = requests.get(url) - # print("-" * 40) - # print(tuple(response.text.split(","))) - # print("-" * 40) - if response.text == '-1': - print('Invalid share key') - else: - result = json.loads(response.text) - return (result['0'], result['1'], result['2']) \ No newline at end of file diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mixpy.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mixpy.py deleted file mode 100644 index 7aa9b9bc38..0000000000 --- a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mixpy.py +++ /dev/null @@ -1,84 +0,0 @@ -#coding=utf-8 -import math - -def math_map(v, al, ah, bl, bh): - if al==ah: - return bl - if al > ah: - al, ah = ah, al - if v > ah: - v = ah - if v < al: - v = al - return bl + (bh - bl) * (v - al) / (ah - al) - -def math_mean(myList): - localList = [e for e in myList if type(e) == int or type(e) == float] - if not localList: return - return float(sum(localList)) / len(localList) - -def math_median(myList): - localList = sorted([e for e in myList if type(e) == int or type(e) == float]) - if not localList: return - if len(localList) % 2 == 0: - return (localList[len(localList) // 2 - 1] + localList[len(localList) // 2]) / 2.0 - else: - return localList[(len(localList) - 1) // 2] - -def math_modes(some_list): - modes = [] - # Using a lists of [item, count] to keep count rather than dict - # to avoid "unhashable" errors when the counted item is itself a list or dict. - counts = [] - maxCount = 1 - for item in some_list: - found = False - for count in counts: - if count[0] == item: - count[1] += 1 - maxCount = max(maxCount, count[1]) - found = True - if not found: - counts.append([item, 1]) - for counted_item, item_count in counts: - if item_count == maxCount: - modes.append(counted_item) - return modes - -def math_standard_deviation(numbers): - n = len(numbers) - if n == 0: return - mean = float(sum(numbers)) / n - variance = sum((x - mean) ** 2 for x in numbers) / n - return math.sqrt(variance) - -def lists_sort(my_list, type, reverse): - def try_float(s): - try: - return float(s) - except: - return 0 - key_funcs = { - "NUMERIC": try_float, - "TEXT": str, - "IGNORE_CASE": lambda s: str(s).lower() - } - key_func = key_funcs[type] - list_cpy = list(my_list) - return sorted(list_cpy, key=key_func, reverse=reverse) - -def format_content(mydict, cid): - if 'lat' in mydict and 'long' in mydict: - res = '{'+'"lat": "{}", "long": "{}", "clientid": "{}"'.format(mydict.pop('lat'),mydict.pop('long'),cid) - if len(mydict)>0: - res += ', "message": [' - for d in mydict: - res += '{{"label": "{}", "value": "{}"}},'.format(d,mydict[d]) - res = res[:-1] + "]" - res += '}' - return res - else: - print('Invalid Input') - -def format_str(d): - return str(d).replace("'",'"') \ No newline at end of file diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mmatrix.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mmatrix.py deleted file mode 100644 index eb46f4862a..0000000000 --- a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mmatrix.py +++ /dev/null @@ -1,139 +0,0 @@ -""" -Matrix - -CircuitPython library for Matrix - MixGoCE -======================================================= - -Small Cabbage -20210721 -""" -import time -from mixgoce import i2c -from matrix import MatrixBackpack16x8 -from adafruit_framebuf import FrameBuffer,MVLSB - -buf = bytearray(16) -fb = FrameBuffer(buf, 16, 8, MVLSB) - -class MixGoMatrix(MatrixBackpack16x8): - - def show_dynamic(self, to_show, delay=200): - # self.fill(0) - if type(to_show)==str or type(to_show)==int: - for i in to_show: - fb.fill(0) - fb.text(i, 5, 0, color=1) - # turn all LEDs off - self.fill(0) - for x in range(16): - # using the FrameBuffer text result - bite = buf[x] - for y in range(8): - bit = 1 << y & bite - # if bit > 0 then set the pixel brightness - if bit: - self[x, y] = 1 - self.show() - if len(to_show)>1: - time.sleep(delay/1000) - elif type(to_show)==list or type(to_show)==tuple: - for i in to_show: - #if type(i)!=str and type(i)!=type(Image.HEART): - if type(i)!=str and type(i)!=type(bytearray(16)): - pass - for i in to_show: - self.show_dynamic(i) - time.sleep(delay/1000) - elif type(to_show)==type(bytearray(16)): - buf = to_show - # turn all LEDs off - self.fill(0) - # print(buf) - for x in range(16): - # using the FrameBuffer text result - bite = buf[x] - # print(bite,end=" ") - for y in range(8): - bit = 1 << y & bite - # if bit > 0 then set the pixel brightness - if bit: - self[x, y] = 1 - self.show() - - def scroll(self, text_to_show, delay=0): - for i in range(len(text_to_show) * 6 + 26): - fb.fill(0) - fb.text(text_to_show, -i + 16, 0, color=1) - # turn all LEDs off - self.fill(0) - for x in range(16): - # using the FrameBuffer text result - bite = buf[x] - for y in range(8): - bit = 1 << y & bite - # if bit > 0 then set the pixel brightness - if bit: - self[x, y] = 1 - self.show() - time.sleep(delay/1000) - - def show_static(self, text_to_show): - fb.fill(0) - if len(text_to_show)==2: - l = 3 - elif len(text_to_show)==1: - l = 5 - else: - l = 0 - fb.text(text_to_show, l, 0, color=1) - # turn all LEDs off - self.fill(0) - for x in range(16): - # using the FrameBuffer text result - bite = buf[x] - for y in range(8): - bit = 1 << y & bite - # if bit > 0 then set the pixel brightness - if bit: - self[x, y] = 1 - self.show() - - def set_brightness(self, val): - self.brightness = max(min(val, 1), 0) - - def get_brightness(self): - return self.brightness - - def set_pixel(self, x, y, val): - self[x, y] = val - self.show() - - def get_pixel(self, x, y): - return int(self[x, y]) - - def clear(self): - self.fill(0) - self.show() - - def up(self, times, rotate=False): - for i in range(times): - self.shift_down(rotate) - self.show() - - def down(self, times, rotate=False): - for i in range(times): - self.shift_up(rotate) - self.show() - - def left(self, times, rotate=False): - for i in range(times): - self.shift_left(rotate) - self.show() - - def right(self, times, rotate=False): - for i in range(times): - self.shift_right(rotate) - self.show() - -display = MixGoMatrix(i2c, auto_write=False, brightness=0.1) -display.clear() \ No newline at end of file diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/msa301.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/msa301.py deleted file mode 100644 index 141f5e15b0..0000000000 --- a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/msa301.py +++ /dev/null @@ -1,70 +0,0 @@ -""" -MSA301 - -CircuitPython library for the MSA301 Accelerometer -======================================================= - -dahanzimin -20210411 -mixly -""" -import time -import adafruit_bus_device.i2c_device as i2c_device -from micropython import const - -MSA301_ADDRESS = const(0x26) - -MSA301_REG_DEVICE_ID = const(0x01) -MSA301_REG_DATA = const(0x02) -MSA301_REG_ODR = const(0x10) -MSA301_REG_POWERMODE = const(0x11) -MSA301_REG_RESRANGE = const(0x0F) - - -_STANDARD_GRAVITY = 9.806 - -class MSA301: - - _BUFFER = bytearray(2) - data_reg = bytearray(6) - - def __init__(self, i2c_bus): - self._device = i2c_device.I2CDevice(i2c_bus, MSA301_ADDRESS) - if self._chip_id() != 0x13: - raise AttributeError("Cannot find a MSA301") - - self._write_u8(MSA301_REG_ODR,0X09) #RATE_500_HZ - self._write_u8(MSA301_REG_POWERMODE,0X12) #NORMAL & WIDTH_250_HZ - self._write_u8(MSA301_REG_RESRANGE,0X02) #RESOLUTION_14_BIT & RANGE_8_G - - def _read_u8(self, address): - # Read an 8-bit unsigned value from the specified 8-bit address. - with self._device: - self._BUFFER[0] = address & 0xFF - self._device.write(self._BUFFER, end=1) - self._device.readinto(self._BUFFER, end=1) - return self._BUFFER[0] - - def _write_u8(self, address, val): - # Write an 8-bit unsigned value to the specified 8-bit address. - with self._device: - self._BUFFER[0] = address & 0xFF - self._BUFFER[1] = val & 0xFF - self._device.write(self._BUFFER, end=2) - - def _chip_id(self): - return self._read_u8(MSA301_REG_DEVICE_ID) - - def u2s(self,n): - return n if n < (1 << 7) else n - (1 << 8) - - @property - def acceleration(self): - for i in range(0,6): - self.data_reg[i]=self._read_u8(MSA301_REG_DATA+i) - x_acc=((self.u2s(self.data_reg[1])<<8|self.data_reg[0])>>2)/1024.0 - y_acc=((self.u2s(self.data_reg[3])<<8|self.data_reg[2])>>2)/1024.0 - z_acc=((self.u2s(self.data_reg[5])<<8|self.data_reg[4])>>2)/1024.0 - return (-y_acc,-x_acc,z_acc) - - diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/music.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/music.py deleted file mode 100644 index fbf7f1a4ea..0000000000 --- a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/music.py +++ /dev/null @@ -1,102 +0,0 @@ -""" -Music - -CircuitPython library for Music - MixGoCE -======================================================= - -Small Cabbage -20210721 -""" - - -import time -from mixgoce import version - -class Music: - def __init__(self, pin, duration='4', octave='6', tempo='63'): - import pwmio - self.pin = pin - self.pwm = pwmio.PWMOut(pin, duty_cycle=0, variable_frequency=True) - self.duration = duration - self.octave = octave - self.tempo = tempo - - def set_duration(self, duration='4'): - self.duration = duration - - def set_octave(self, octave='6'): - self.octave = octave - - def sef_tempo(self, tempo='63'): - self.tempo = tempo - - def set_duration_tempo(self, duration, tempo):#这项等于原来的set_tempo - self.duration = duration - self.tempo = tempo - - def reset(self): - self.set_duration() - self.set_octave() - self.set_tempo() - - def get_duration(self): - return self.duration - - def get_octave(self): - return self.octave - - def get_tempo(self): - return (self.tempo) - - def play_demo(self, demo): - import adafruit_rtttl - if self.pwm: - self.pwm.deinit() - adafruit_rtttl.play(self.pin, demo) - - def play_demo_print(self, demo): - import adafruit_rtttl - if self.pwm: - self.pwm.deinit() - adafruit_rtttl.play(self.pin, demo) - _, defaults, tune = demo.lower().split(":") - print(tune) - - def play(self, note, duration=None): - import pwmio - if self.pwm: - self.pwm.deinit() - self.pwm = pwmio.PWMOut(self.pin, duty_cycle=0, variable_frequency=True) - self.pwm.frequency = int(note) - self.pwm.duty_cycle = 2 ** 15 - if duration: - # print(1) - time.sleep(duration/1000) - self.pwm.duty_cycle = 0 - - def stop(self): - self.pwm.duty_cycle = 0 - self.pwm.deinit() - -BA_DING = "itchy:d=4,o=4,b=300:4b5,2g5" -JUMP_UP = "itchy:d=4,o=5,b=300:c,d,e,f,g" -JUMP_DOWN = "itchy:d=4,o=5,b=300:g,f,e,d,c" -POWER_UP = "itchy:d=4,o=4,b=300:4g4,4c5,4e5,2g5,4e5,1g5" -POWER_DOWN = "itchy:d=4,o=4,b=300:4g5,4d#5,4c5,2g4,4b4,1c5" -DADADADUM = "itchy:d=4,o=4,b=200:2p,g,g,g,1d#,p,f,f,f,1d" -#ENTERTAINER = "itchy:d=4,o=4,b=300:4d4,d#4,e4,2c5,4e4,2c5,4e4,1c5,c5,d5,d#5,e5,c5,d5,2e5,b4,2d5,1c5" -BIRTHDAY = "itchy:d=4,o=4,b=180:6c,12c,4d,4c,4f,2e,6c,12c,4d,4c,4g,2f,6c,12c,4c5,4a,4f,4e,4d,6a#,12a#,4a,4f,4g,2f" -#BLUES = "itchy:d=4,o=4,b=400:2c,4e,4g,4a,4a#,4a,4g,4e,2c,4e,4g,4a,4a#,4a,4g,4e,4f,4a,2c,4d,4d#,4d,4c,4a,2c,4e,4g,4a,4a#,4a,4g,4e,4g,4b,4d,4f,4f,4a,4c,4d#,2c,e,g,e,g,f,e,d" -#PYTHON = "itchy:d=4,o=4,b=380:d5,4b4,p,b4,b4,a#4,b4,g5,p,d5,d5,r,b4,c5,p,c5,c5,p,d5,1e5,p,c5,a4,p,a4,a4,g#4,a4,f#5,p,e5,e5,p,c5,b4,p,b4,b4,p,c5,1d5,p,d5,4b4,p,b4,b4,a#4,b4,b5,p,g5,g5,p,d5,c#5,p,a5,a5,p,a5,1a5,p,g5,f#5,p,a5,a5,g#5,a5,e5,p,a5,a5,g#5,a5,d5,p,c#5,d5,p,c#5,2d5,3p" - -import board - -if version:#new - buzzer = Music(board.IO40) -else:#old - from digitalio import DigitalInOut, Direction - - buzzer = Music(board.IO17) - spk_en = DigitalInOut(board.IO40) - spk_en.direction = Direction.OUTPUT - spk_en.value = True \ No newline at end of file diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mxc6655xa.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mxc6655xa.py deleted file mode 100644 index 0a5c83dbe0..0000000000 --- a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/mxc6655xa.py +++ /dev/null @@ -1,80 +0,0 @@ -""" -MXC6655XA - -CircuitPython library for the MXC6655XA Accelerometer -======================================================= - -dahanzimin -20210411 -mixly -""" -import time -import adafruit_bus_device.i2c_device as i2c_device -from micropython import const - -MXC6655XA_ADDRESS = const(0x15) - -MXC6655XA_REG_DATA = const(0x03) -MXC6655XA_REG_CTRL = const(0x0D) -MXC6655XA_REG_DEVICE_ID = const(0x0E) - -MXC6655XA_CMD_8G_POWER_ON = const(0x40) -MXC6655XA_CMD_4G_POWER_ON = const(0x20) -MXC6655XA_CMD_2G_POWER_ON = const(0x00) - -MXC6655XA_2G_SENSITIVITY =1024 -MXC6655XA_4G_SENSITIVITY =512 -MXC6655XA_8G_SENSITIVITY =256 -MXC6655XA_T_ZERO =25 -MXC6655XA_T_SENSITIVITY =0.586 - -class MXC6655XA: - - _BUFFER = bytearray(2) - data_reg = bytearray(7) - - def __init__(self, i2c_bus): - self._device = i2c_device.I2CDevice(i2c_bus, MXC6655XA_ADDRESS) - if self._chip_id() != 0x02: - raise AttributeError("Cannot find a MXC6655XA") - self._Enable() #star - time.sleep(0.3) - self.range = MXC6655XA_8G_SENSITIVITY #SET 8g range - - def _read_u8(self, address): - # Read an 8-bit unsigned value from the specified 8-bit address. - with self._device: - self._BUFFER[0] = address & 0xFF - self._device.write(self._BUFFER, end=1) - self._device.readinto(self._BUFFER, end=1) - return self._BUFFER[0] - - def _write_u8(self, address, val): - # Write an 8-bit unsigned value to the specified 8-bit address. - with self._device: - self._BUFFER[0] = address & 0xFF - self._BUFFER[1] = val & 0xFF - self._device.write(self._BUFFER, end=2) - - def _chip_id(self): - return self._read_u8(MXC6655XA_REG_DEVICE_ID) - - def _Enable(self): - self._write_u8(MXC6655XA_REG_CTRL,MXC6655XA_CMD_8G_POWER_ON) - - def u2s(self,n): - return n if n < (1 << 7) else n - (1 << 8) - - @property - def acceleration(self): - for i in range(0,6): - self.data_reg[i]=self._read_u8(MXC6655XA_REG_DATA+i) - x_acc=float((self.u2s(self.data_reg[0])<<8|self.data_reg[1])>>4)/self.range - y_acc=float((self.u2s(self.data_reg[2])<<8|self.data_reg[3])>>4)/self.range - z_acc=float((self.u2s(self.data_reg[4])<<8|self.data_reg[5])>>4)/self.range - #t_acc=float(self.u2s(self.data_reg[6]))*MXC6655XA_T_SENSITIVITY + MXC6655XA_T_ZERO - return (-y_acc,-x_acc,z_acc) - - def get_temperature(self): - t_acc=float(self.u2s(self._read_u8(MXC6655XA_REG_DATA+6)))*MXC6655XA_T_SENSITIVITY + MXC6655XA_T_ZERO - return round(t_acc,1) diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/pixels.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/pixels.py deleted file mode 100644 index f51055e510..0000000000 --- a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/pixels.py +++ /dev/null @@ -1,71 +0,0 @@ -""" -RGB - -CircuitPython library for RGB - MixGoCE -======================================================= - -Small Cabbage -20210721 -""" - - -import time -import board -import neopixel - -def wheel(pos): - # 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) - - -class RGB(object): - def __init__(self,pin=board.IO8,num=4,flag="RGB"): - self.pin = pin - self.num = num - self.pixels = neopixel.NeoPixel(pin, num, brightness=0.3, auto_write=False, pixel_order = flag) - - def show_all(self, R, G, B): - color = (R, G, B) - self.pixels.fill(color) - - def show_one(self, index, R, G, B): - color = (R, G, B) - self.pixels[index - 1] = color - - def write(self): - self.pixels.show() - - def color_chase(self, R, G, B, wait): - color = (R, G, B) - for i in range(self.num): - self.pixels[i] = color - time.sleep(wait/1000) - self.pixels.show() - - def rainbow_cycle(self, wait): - for j in range(255): - for i in range(self.num): - rc_index = (i * 256 // self.num) + j - self.pixels[i] = wheel(rc_index & 255) - self.pixels.show() - time.sleep(wait/1000/256) - - def change_mod(self,flag): - import time - if flag in ("RGB","GRB"): - self.pixels.deinit() - time.sleep(0.1) - self.pixels = neopixel.NeoPixel(self.pin, self.num, brightness=0.3, auto_write=False, pixel_order = flag) - -rgb = RGB() -rgb.show_all(0,0,0) -rgb.write() \ No newline at end of file diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/sensor.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/sensor.py deleted file mode 100644 index 56d6465201..0000000000 --- a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/sensor.py +++ /dev/null @@ -1,55 +0,0 @@ -""" -Analog Sensor - -CircuitPython library for Analog Sensor - MixGoCE -======================================================= - -Small Cabbage -20210721 -dahanzimin -20210423 -""" -from mixgoce import version - -class ADCSensor: - import board - __pins=[board.IO13,board.IO15,board.IO16] - __species = {} - __first_init = True - def __new__(cls, pin, *args, **kwargs): - if pin not in cls.__species.keys(): - cls.__first_init = True - cls.__species[pin]=object.__new__(cls) - return cls.__species[pin] - - def __init__(self,pin): - from analogio import AnalogIn - if self.__first_init: - self.__first_init = False - self.pin = AnalogIn(self.__pins[pin]) - - def read(self): - return self.pin.value - -def get_brightness(): - return ADCSensor(1).read() - -def get_soundlevel(): #fix - value_d= [] - for _ in range(5): - values = [] - for _ in range(5): - val = ADCSensor(0).read() - values.append(val) - value_d.append(max(values) - min(values)) - return max(value_d) - - -if version:#new - from mixgoce import acc - def get_temperature(): - return acc.get_temperature() -else:#old - def get_temperature(): - adc_val = ADCSensor(2).read() - return adc_val * 3.9 / 5900 \ No newline at end of file diff --git a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/touchpad.py b/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/touchpad.py deleted file mode 100644 index 1aa9b78c6b..0000000000 --- a/ports/espressif/boards/mixgo_ce_udisk/mixgoce_lib/touchpad.py +++ /dev/null @@ -1,25 +0,0 @@ -""" -TouchPad - -CircuitPython library for TouchPad - MixGoCE -======================================================= - -Small Cabbage -20210721 -dahanzimin -20210423 -""" -import board -from touchio import TouchIn -class TouchPad(): - def __init__(self,pin,v=18000): - self.pin = TouchIn(pin) - self.v = v - - def is_touched(self): - return self.pin.raw_value > self.v - -touch_T1 = TouchPad(board.IO4) -touch_T2 = TouchPad(board.IO5) -touch_T3 = TouchPad(board.IO6) -touch_T4 = TouchPad(board.IO7) \ No newline at end of file diff --git a/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk b/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk index dbd55bc52a..99c623985e 100644 --- a/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk +++ b/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk @@ -20,5 +20,5 @@ CIRCUITPY_MODULE=wroom FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel -FROZEN_MPY_DIRS += boards/$(BOARD)/mixgoce_lib +FROZEN_MPY_DIRS += boards/$(BOARD)/cp_lib/mixgoce_lib From 71f65317c498c5df5ba4314aa84ed30d8b74b485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E6=B1=89=E5=AD=90=E6=B0=91?= <48112196+dahanzimin@users.noreply.github.com> Date: Fri, 20 May 2022 10:37:55 +0800 Subject: [PATCH 106/246] Repair No newline at end of file --- .gitmodules | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index c91fdc2811..6293345f1e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -291,4 +291,5 @@ url = https://github.com/pypewpew/pew-pewpew-lcd.git [submodule "ports/espressif/boards/mixgo_ce_udisk/cp_lib"] path = ports/espressif/boards/mixgo_ce_udisk/cp_lib - url = https://github.com/dahanzimin/circuitpython_lib.git \ No newline at end of file + url = https://github.com/dahanzimin/circuitpython_lib.git + From 73f2621cda29e56545bc979727ecc83d8a271592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E6=B1=89=E5=AD=90=E6=B0=91?= <48112196+dahanzimin@users.noreply.github.com> Date: Fri, 20 May 2022 10:38:14 +0800 Subject: [PATCH 107/246] Repair No newline at end of file --- ports/espressif/boards/mixgo_ce_udisk/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/boards/mixgo_ce_udisk/board.c b/ports/espressif/boards/mixgo_ce_udisk/board.c index bf5980e627..0432485111 100644 --- a/ports/espressif/boards/mixgo_ce_udisk/board.c +++ b/ports/espressif/boards/mixgo_ce_udisk/board.c @@ -45,4 +45,4 @@ void reset_board(void) { } void board_deinit(void) { -} \ No newline at end of file +} From 4356a125048dccbd93d195210faecabd019e169c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E6=B1=89=E5=AD=90=E6=B0=91?= <48112196+dahanzimin@users.noreply.github.com> Date: Fri, 20 May 2022 10:55:23 +0800 Subject: [PATCH 108/246] Update mpconfigboard.mk --- ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk b/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk index 99c623985e..5d201ba73d 100644 --- a/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk +++ b/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk @@ -21,4 +21,3 @@ CIRCUITPY_MODULE=wroom FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel FROZEN_MPY_DIRS += boards/$(BOARD)/cp_lib/mixgoce_lib - From d744939c6c2ab6d8a63afdb97f746c0aa18e3b0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E6=B1=89=E5=AD=90=E6=B0=91?= <48112196+dahanzimin@users.noreply.github.com> Date: Fri, 20 May 2022 11:06:48 +0800 Subject: [PATCH 110/246] Fix End of Files --- .gitmodules | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 6293345f1e..542f15d327 100644 --- a/.gitmodules +++ b/.gitmodules @@ -292,4 +292,3 @@ [submodule "ports/espressif/boards/mixgo_ce_udisk/cp_lib"] path = ports/espressif/boards/mixgo_ce_udisk/cp_lib url = https://github.com/dahanzimin/circuitpython_lib.git - From 3c20b5f95f4fd7e656193072ba97378360a6655f Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 20 May 2022 00:04:49 -0400 Subject: [PATCH 111/246] use validator in mimx UART constructor --- ports/mimxrt10xx/common-hal/busio/UART.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ports/mimxrt10xx/common-hal/busio/UART.c b/ports/mimxrt10xx/common-hal/busio/UART.c index 8615002811..9f801a2f65 100644 --- a/ports/mimxrt10xx/common-hal/busio/UART.c +++ b/ports/mimxrt10xx/common-hal/busio/UART.c @@ -113,12 +113,9 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, bool sigint_enabled) { self->baudrate = baudrate; - self->character_bits = bits; + self->character_bits = (uint8_t)mp_arg_validate_int_range(self->character_bits, 7, 8, MP_QSTR_bits); self->timeout_ms = timeout * 1000; - if (self->character_bits != 7 && self->character_bits != 8) { - mp_arg_validate_int_range(self->character_bits, 7, 8, MP_QSTR_bits); - } DBGPrintf(&mp_plat_print, "uart_construct: tx:%p rx:%p rts:%p cts:%p rs485:%p\n", tx, rx, rts, cts, rs485_dir); From f63b26c534c83216de01d3363343b9fad17beafa Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 20 May 2022 10:10:55 -0400 Subject: [PATCH 112/246] address jepler's comments and further squeezes --- locale/circuitpython.pot | 131 +++++++----------- .../common-hal/alarm/pin/PinAlarm.c | 2 +- .../atmel-samd/common-hal/audiobusio/I2SOut.c | 6 +- .../atmel-samd/common-hal/audiobusio/PDMIn.c | 4 +- .../atmel-samd/common-hal/audioio/AudioOut.c | 7 +- ports/atmel-samd/common-hal/busio/I2C.c | 2 +- ports/atmel-samd/common-hal/busio/UART.c | 4 +- .../imagecapture/ParallelImageCapture.c | 6 +- ports/atmel-samd/common-hal/pulseio/PulseIn.c | 1 + ports/cxd56/common-hal/busio/I2C.c | 2 +- ports/cxd56/common-hal/busio/UART.c | 4 +- ports/cxd56/common-hal/camera/Camera.c | 4 +- ports/cxd56/common-hal/gnss/GNSS.c | 2 +- ports/cxd56/common-hal/sdioio/SDCard.c | 2 +- ports/espressif/common-hal/busio/I2C.c | 2 +- ports/espressif/common-hal/busio/UART.c | 7 +- ports/mimxrt10xx/common-hal/busio/UART.c | 8 +- .../raspberrypi/common-hal/pulseio/PulseIn.c | 2 +- ports/stm/common-hal/analogio/AnalogIn.c | 4 +- ports/stm/common-hal/busio/I2C.c | 4 +- ports/stm/common-hal/busio/SPI.c | 2 +- ports/stm/common-hal/busio/UART.c | 14 +- ports/stm/common-hal/canio/CAN.c | 4 +- ports/stm/common-hal/pwmio/PWMOut.c | 6 +- py/argcheck.c | 8 ++ py/runtime.h | 1 + shared-bindings/microcontroller/Pin.c | 4 + shared-bindings/microcontroller/Pin.h | 1 + shared-bindings/sdioio/SDCard.c | 2 +- shared-module/bitbangio/SPI.c | 4 +- 30 files changed, 118 insertions(+), 132 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index fdd4d09887..1737dba2b7 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -80,6 +80,10 @@ msgstr "" msgid "%q and %q contain duplicate pins" msgstr "" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "" @@ -179,9 +183,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/raspberrypi/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#: ports/stm/common-hal/pulseio/PulseIn.c shared-bindings/canio/Match.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c +#: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "" @@ -646,6 +650,10 @@ msgstr "" msgid "Call super().__init__() before accessing native object." msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" @@ -693,18 +701,10 @@ msgstr "" 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 "" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only 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 "" @@ -752,10 +752,6 @@ msgstr "" msgid "Cannot wake on pin edge. Only level." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin" -msgstr "" - #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" msgstr "" @@ -786,28 +782,6 @@ msgstr "" msgid "Corrupt .mpy file" msgstr "" -#: ports/cxd56/common-hal/camera/Camera.c ports/cxd56/common-hal/gnss/GNSS.c -#: ports/cxd56/common-hal/sdioio/SDCard.c -msgid "Could not initialize %q" -msgstr "" - -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -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 "" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "" @@ -1038,6 +1012,10 @@ msgstr "" msgid "Function requires lock" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1182,12 +1160,7 @@ msgstr "" msgid "Invalid %q" msgstr "" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c 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 ports/stm/common-hal/sdioio/SDCard.c +#: shared-bindings/microcontroller/Pin.c msgid "Invalid %q pin" msgstr "" @@ -1208,8 +1181,7 @@ msgstr "" msgid "Invalid MAC address" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c ports/espressif/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #: py/moduerrno.c msgid "Invalid argument" msgstr "" @@ -1235,15 +1207,7 @@ msgstr "" msgid "Invalid multicast MAC address" 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/espressif/common-hal/busio/UART.c shared-bindings/busio/UART.c +#: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "" @@ -1412,7 +1376,7 @@ msgstr "" msgid "No MISO Pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c msgid "No MISO pin" msgstr "" @@ -1421,7 +1385,7 @@ msgstr "" msgid "No MOSI Pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c msgid "No MOSI pin" msgstr "" @@ -1658,6 +1622,10 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" +msgstr "" + #: ports/raspberrypi/common-hal/countio/Counter.c msgid "PWM slice already in use" msgstr "" @@ -1678,10 +1646,6 @@ msgstr "" msgid "Pin cannot wake from Deep Sleep" msgstr "" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -msgid "Pin cannot wake from deep sleep" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "" @@ -1777,7 +1741,8 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c +#: 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 "RS485" msgstr "" @@ -1790,11 +1755,6 @@ msgstr "" 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/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 "" @@ -1844,6 +1804,10 @@ msgstr "" msgid "SD card CSD format not supported" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -1867,7 +1831,7 @@ msgid "SPI peripheral in use" msgstr "" #: ports/stm/common-hal/busio/SPI.c -msgid "SPI re-initialization error" +msgid "SPI re-init" msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c @@ -2062,19 +2026,20 @@ msgid "Tuple or struct_time argument required" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART de-init error" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART init error" +msgid "UART re-init" 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" +msgid "UART write" msgstr "" #: shared-module/usb_hid/Device.c @@ -2211,10 +2176,6 @@ msgid "" "declined or ignored." msgstr "" -#: ports/cxd56/common-hal/busio/I2C.c ports/espressif/common-hal/busio/UART.c -msgid "Unsupported baudrate" -msgstr "" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "" @@ -2227,10 +2188,6 @@ msgstr "" msgid "Unsupported format" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported frequency" -msgstr "" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" @@ -2671,6 +2628,10 @@ msgstr "" msgid "casting" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "" @@ -3107,6 +3068,10 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "" @@ -4025,6 +3990,10 @@ msgstr "" msgid "timeout waiting for v2 card" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "" diff --git a/ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c b/ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c index b771c5b998..9289a66a87 100644 --- a/ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c +++ b/ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c @@ -261,7 +261,7 @@ static void pinalarm_set_alarms_deep(size_t n_alarms, const mp_obj_t *alarms) { } } if (t->n < 0) { - mp_raise_ValueError(translate("Pin cannot wake from deep sleep")); + raise_ValueError_invalid_pin(); } // It is strange, but to my experiment, interrupt during sleep diff --git a/ports/atmel-samd/common-hal/audiobusio/I2SOut.c b/ports/atmel-samd/common-hal/audiobusio/I2SOut.c index f5531f2bab..eb98cc8d27 100644 --- a/ports/atmel-samd/common-hal/audiobusio/I2SOut.c +++ b/ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -151,16 +151,16 @@ void common_hal_audiobusio_i2sout_construct(audiobusio_i2sout_obj_t *self, } #endif if (bc_clock_unit == 0xff) { - mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_bit_clock); + raise_ValueError_invalid_pin_name(MP_QSTR_clock); } if (ws_clock_unit == 0xff) { - mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_word_select); + raise_ValueError_invalid_pin_name(MP_QSTR_word_select); } if (bc_clock_unit != ws_clock_unit) { mp_raise_ValueError(translate("Bit clock and word select must share a clock unit")); } if (serializer == 0xff) { - mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_data); + raise_ValueError_invalid_pin_name(MP_QSTR_data); } self->clock_unit = ws_clock_unit; self->serializer = serializer; diff --git a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c index e7c00901bf..c3bdd95793 100644 --- a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c +++ b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -121,7 +121,7 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self, self->clock_unit = 1; #endif } else { - mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_clock); + raise_ValueError_invalid_pin_name(MP_QSTR_clock); } self->data_pin = data_pin; // PA07, PA19 -> SD0, PA08, PB16 -> SD1 @@ -152,7 +152,7 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self, self->serializer = 1; #endif } else { - mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_data); + raise_ValueError_invalid_pin_name(MP_QSTR_data); } if (!(bit_depth == 16 || bit_depth == 8) || !mono || oversample != OVERSAMPLING) { diff --git a/ports/atmel-samd/common-hal/audioio/AudioOut.c b/ports/atmel-samd/common-hal/audioio/AudioOut.c index 87a6ee62ad..1e1eb80e9c 100644 --- a/ports/atmel-samd/common-hal/audioio/AudioOut.c +++ b/ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -143,13 +143,14 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t *self, #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")); + raise_ValueError_invalid_pin_name(MP_QSTR_left_channel); } if (right_channel != NULL && right_channel != &pin_PA02 && right_channel != &pin_PA05) { - mp_raise_ValueError(translate("Invalid pin for right channel")); + raise_ValueError_invalid_pin_name(MP_QSTR_right_channel); } if (right_channel == left_channel) { - mp_raise_ValueError(translate("Cannot output both channels on the same pin")); + mp_raise_ValueError_varg(translate("%q and %q must be different"), + MP_QSTR_left_channel, MP_QSTR_right_channel); } claim_pin(left_channel); if (right_channel != NULL) { diff --git a/ports/atmel-samd/common-hal/busio/I2C.c b/ports/atmel-samd/common-hal/busio/I2C.c index 4124faff4a..c539cc3abc 100644 --- a/ports/atmel-samd/common-hal/busio/I2C.c +++ b/ports/atmel-samd/common-hal/busio/I2C.c @@ -128,7 +128,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, reset_pin_number(sda->number); reset_pin_number(scl->number); common_hal_busio_i2c_deinit(self); - mp_raise_ValueError(translate("Unsupported frequency")); + mp_arg_error_invalid(MP_QSTR_frequency); } self->sda_pin = sda->number; diff --git a/ports/atmel-samd/common-hal/busio/UART.c b/ports/atmel-samd/common-hal/busio/UART.c index 0af363ae44..510ce087df 100644 --- a/ports/atmel-samd/common-hal/busio/UART.c +++ b/ports/atmel-samd/common-hal/busio/UART.c @@ -77,7 +77,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, self->tx_pin = NO_PIN; if ((rts != NULL) || (cts != NULL) || (rs485_dir != NULL) || (rs485_invert)) { - mp_raise_ValueError(translate("RTS/CTS/RS485 Not yet supported on this device")); + mp_raise_NotImplementedError(translate("RS485")); } mp_arg_validate_int_max(bits, 8, MP_QSTR_bits); @@ -183,7 +183,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } if (usart_async_init(usart_desc_p, sercom, self->buffer, self->buffer_length, NULL) != ERR_NONE) { - mp_raise_ValueError(translate("Could not initialize UART")); + mp_raise_RuntimeError(translate("UART init")); } // usart_async_init() sets a number of defaults based on a prototypical SERCOM diff --git a/ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c b/ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c index 1f23b27590..c86ffb8d65 100644 --- a/ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c +++ b/ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c @@ -66,13 +66,13 @@ void common_hal_imagecapture_parallelimagecapture_construct(imagecapture_paralle mp_arg_error_invalid(MP_QSTR_datacount); } if (vertical_sync && vertical_sync->number != PIN_PCC_DEN1) { - mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_vsync); + raise_ValueError_invalid_pin_name(MP_QSTR_vsync); } if (horizontal_reference && horizontal_reference->number != PIN_PCC_DEN2) { - mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_href); + raise_ValueError_invalid_pin_name(MP_QSTR_href); } if (data_clock->number != PIN_PCC_CLK) { - mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_data_clock); + raise_ValueError_invalid_pin_name(MP_QSTR_data_clock); } // technically, 0 was validated as free already but check again for (int i = 0; i < data_count; i++) { diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.c b/ports/atmel-samd/common-hal/pulseio/PulseIn.c index 4f00fac027..8cc455c958 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -352,6 +352,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(); + // Can't use mp_arg_validate_index_range() here due to the critical section. mp_raise_IndexError_varg(translate("%q out of range"), MP_QSTR_index); } uint16_t value = self->buffer[(self->start + index) % self->maxlen]; diff --git a/ports/cxd56/common-hal/busio/I2C.c b/ports/cxd56/common-hal/busio/I2C.c index ad85860a9d..07d9024a51 100644 --- a/ports/cxd56/common-hal/busio/I2C.c +++ b/ports/cxd56/common-hal/busio/I2C.c @@ -37,7 +37,7 @@ 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) { if (frequency != I2C_SPEED_STANDARD && frequency != I2C_SPEED_FAST) { - mp_raise_ValueError(translate("Unsupported baudrate")); + mp_arg_error_invalid(MP_QSTR_frequency); } if (scl->number != PIN_I2C0_BCK || sda->number != PIN_I2C0_BDT) { diff --git a/ports/cxd56/common-hal/busio/UART.c b/ports/cxd56/common-hal/busio/UART.c index 735d0a3e40..aafc0b790e 100644 --- a/ports/cxd56/common-hal/busio/UART.c +++ b/ports/cxd56/common-hal/busio/UART.c @@ -66,7 +66,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, struct termios tio; if ((rts != NULL) || (cts != NULL) || (rs485_dir != NULL) || (rs485_invert)) { - mp_raise_ValueError(translate("RTS/CTS/RS485 Not yet supported on this device")); + mp_raise_NotImplementedError(translate("RS485")); } mp_arg_validate_int(bits, 8, MP_QSTR_bits); @@ -90,7 +90,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, if (busio_uart_dev[self->number].fd < 0) { busio_uart_dev[self->number].fd = open(busio_uart_dev[self->number].devpath, O_RDWR); if (busio_uart_dev[self->number].fd < 0) { - mp_raise_ValueError(translate("Could not initialize UART")); + mp_raise_RuntimeError(translate("UART init")); } // Wait to make sure the UART is ready diff --git a/ports/cxd56/common-hal/camera/Camera.c b/ports/cxd56/common-hal/camera/Camera.c index 7471b12af7..f304ed8f74 100644 --- a/ports/cxd56/common-hal/camera/Camera.c +++ b/ports/cxd56/common-hal/camera/Camera.c @@ -121,11 +121,11 @@ static void camera_start_preview() { void common_hal_camera_construct(camera_obj_t *self) { if (camera_dev.fd < 0) { if (video_initialize(camera_dev.devpath) < 0) { - mp_raise_ValueError_varg(translate("Could not initialize %q"), MP_QSTR_Camera); + mp_raise_RuntimeError(translate("Camera init")); } camera_dev.fd = open(camera_dev.devpath, 0); if (camera_dev.fd < 0) { - mp_raise_ValueError_varg(translate("Could not initialize %q"), MP_QSTR_Camera); + mp_raise_RuntimeError(translate("Camera init")); } } diff --git a/ports/cxd56/common-hal/gnss/GNSS.c b/ports/cxd56/common-hal/gnss/GNSS.c index 11b83d07b1..977d2e9b4b 100644 --- a/ports/cxd56/common-hal/gnss/GNSS.c +++ b/ports/cxd56/common-hal/gnss/GNSS.c @@ -56,7 +56,7 @@ 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) { - mp_raise_ValueError_varg(translate("Could not initialize %q"), MP_QSTR_GNSS); + mp_raise_RuntimeError(translate("GNSS init")); } } diff --git a/ports/cxd56/common-hal/sdioio/SDCard.c b/ports/cxd56/common-hal/sdioio/SDCard.c index c86e052ea5..e8e5df4687 100644 --- a/ports/cxd56/common-hal/sdioio/SDCard.c +++ b/ports/cxd56/common-hal/sdioio/SDCard.c @@ -59,7 +59,7 @@ void common_hal_sdioio_sdcard_construct(sdioio_sdcard_obj_t *self, } if (open_blockdriver("/dev/mmcsd0", 0, &self->inode) < 0) { - mp_raise_ValueError_varg(translate("Could not initialize %q"), MP_QSTR_SDCard); + mp_raise_RuntimeError(translate("SDCard init")); } self->inode->u.i_bops->geometry(self->inode, &geo); diff --git a/ports/espressif/common-hal/busio/I2C.c b/ports/espressif/common-hal/busio/I2C.c index 5af9e8a4dc..23906fe2d2 100644 --- a/ports/espressif/common-hal/busio/I2C.c +++ b/ports/espressif/common-hal/busio/I2C.c @@ -113,7 +113,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, if (err == ESP_FAIL) { mp_raise_OSError(MP_EIO); } else { - mp_raise_ValueError(translate("Invalid argument")); + mp_raise_RuntimeError(translate("init I2C")); } } diff --git a/ports/espressif/common-hal/busio/UART.c b/ports/espressif/common-hal/busio/UART.c index 9d0fd1dbf7..27323fecf4 100644 --- a/ports/espressif/common-hal/busio/UART.c +++ b/ports/espressif/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 "components/driver/include/driver/uart.h" @@ -156,7 +157,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, // Install the driver before we change the settings. if (uart_driver_install(self->uart_num, receiver_buffer_size, 0, 20, &self->event_queue, 0) != ESP_OK || uart_set_mode(self->uart_num, mode) != ESP_OK) { - mp_raise_ValueError(translate("Could not initialize UART")); + mp_raise_RuntimeError(translate("UART init")); } // On the debug uart, enable pattern detection to look for CTRL+C #ifdef CIRCUITPY_DEBUG_UART_RX @@ -263,7 +264,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, 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")); + raise_ValueError_invalid_pins(); } } @@ -374,7 +375,7 @@ uint32_t common_hal_busio_uart_get_baudrate(busio_uart_obj_t *self) { void common_hal_busio_uart_set_baudrate(busio_uart_obj_t *self, uint32_t baudrate) { if (baudrate > UART_BITRATE_MAX || uart_set_baudrate(self->uart_num, baudrate) != ESP_OK) { - mp_raise_ValueError(translate("Unsupported baudrate")); + mp_arg_error_invalid(MP_QSTR_baudrate); } } diff --git a/ports/mimxrt10xx/common-hal/busio/UART.c b/ports/mimxrt10xx/common-hal/busio/UART.c index 9f801a2f65..20430c91c8 100644 --- a/ports/mimxrt10xx/common-hal/busio/UART.c +++ b/ports/mimxrt10xx/common-hal/busio/UART.c @@ -183,10 +183,10 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } if (rx && !rx_config) { - mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_RX); + raise_ValueError_invalid_pin_name(MP_QSTR_rx); } if (tx && !tx_config) { - mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_TX); + raise_ValueError_invalid_pin_name(MP_QSTR_tx); } if (uart_taken) { @@ -233,7 +233,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } } if ((rts != NULL) && (rts_config == NULL)) { - mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_RTS); + raise_ValueError_invalid_pin_name(MP_QSTR_rts); } } @@ -247,7 +247,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } } if (cts_config == NULL) { - mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_CTS); + raise_ValueError_invalid_pin_name(MP_QSTR_cts); } } diff --git a/ports/raspberrypi/common-hal/pulseio/PulseIn.c b/ports/raspberrypi/common-hal/pulseio/PulseIn.c index 97c2b03f7b..71633fcef7 100644 --- a/ports/raspberrypi/common-hal/pulseio/PulseIn.c +++ b/ports/raspberrypi/common-hal/pulseio/PulseIn.c @@ -237,7 +237,7 @@ uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t *self, index += self->len; } if (index < 0 || index >= self->len) { - mp_raise_IndexError_varg(translate("%q out of range"), MP_QSTR_index); + mp_arg_validate_index_range(index, 0, self->len, MP_QSTR_index); } uint16_t value = self->buffer[(self->start + index) % self->maxlen]; return value; diff --git a/ports/stm/common-hal/analogio/AnalogIn.c b/ports/stm/common-hal/analogio/AnalogIn.c index c943ce0901..3079816e01 100644 --- a/ports/stm/common-hal/analogio/AnalogIn.c +++ b/ports/stm/common-hal/analogio/AnalogIn.c @@ -65,7 +65,7 @@ void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self, LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_ADC3); #endif } else { - mp_raise_ValueError(translate("Invalid ADC Unit value")); + mp_raise_RuntimeError(translate("Invalid ADC Unit value")); } common_hal_mcu_pin_claim(pin); self->pin = pin; @@ -147,7 +147,7 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { ADCx = ADC3; #endif } else { - mp_raise_ValueError(translate("Invalid ADC Unit value")); + mp_raise_RuntimeError(translate("Invalid ADC Unit value")); } LL_GPIO_SetPinMode(pin_port(self->pin->port), (uint32_t)pin_mask(self->pin->number), LL_GPIO_MODE_ANALOG); diff --git a/ports/stm/common-hal/busio/I2C.c b/ports/stm/common-hal/busio/I2C.c index 3ca8249660..3ff437c803 100644 --- a/ports/stm/common-hal/busio/I2C.c +++ b/ports/stm/common-hal/busio/I2C.c @@ -120,7 +120,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_varg(translate("Invalid %q pin"), MP_QSTR_I2C); + raise_ValueError_invalid_pins(); } } @@ -155,7 +155,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("Unsupported frequency")); + mp_arg_error_invalid(MP_QSTR_frequency); } #else self->handle.Init.ClockSpeed = frequency; diff --git a/ports/stm/common-hal/busio/SPI.c b/ports/stm/common-hal/busio/SPI.c index fb782daad4..f772cdeec0 100644 --- a/ports/stm/common-hal/busio/SPI.c +++ b/ports/stm/common-hal/busio/SPI.c @@ -306,7 +306,7 @@ bool common_hal_busio_spi_configure(busio_spi_obj_t *self, get_busclock(self->handle.Instance)); if (HAL_SPI_Init(&self->handle) != HAL_OK) { - mp_raise_ValueError(translate("SPI re-initialization error")); + mp_raise_RuntimeError(translate("SPI re-init")); } self->baudrate = baudrate; diff --git a/ports/stm/common-hal/busio/UART.c b/ports/stm/common-hal/busio/UART.c index 2347c079e8..d3fdb83c88 100644 --- a/ports/stm/common-hal/busio/UART.c +++ b/ports/stm/common-hal/busio/UART.c @@ -93,7 +93,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, uint8_t periph_index = 0; // origin 0 corrected if ((rts != NULL) || (cts != NULL) || (rs485_dir != NULL) || (rs485_invert == true)) { - mp_raise_ValueError(translate("RTS/CTS/RS485 Not yet supported on this device")); + mp_raise_NotImplementedError(translate("RS485")); } // Can have both pins, or either @@ -168,7 +168,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_arg_validate_int_range(bits, 8, 9, MP_QSTR_bits); if (USARTx == NULL) { // this can only be hit if the periph file is wrong - mp_raise_ValueError(translate("Internal define error")); + mp_raise_RuntimeError(translate("Internal define error")); } // GPIO Init @@ -208,7 +208,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, self->handle.Init.HwFlowCtl = UART_HWCONTROL_NONE; self->handle.Init.OverSampling = UART_OVERSAMPLING_16; if (HAL_UART_Init(&self->handle) != HAL_OK) { - mp_raise_ValueError(translate("UART init error")); + mp_raise_RuntimeError(translate("UART init")); } @@ -232,7 +232,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, // start the interrupt series if ((HAL_UART_GetState(&self->handle) & HAL_UART_STATE_BUSY_RX) == HAL_UART_STATE_BUSY_RX) { - mp_raise_ValueError(translate("Could not start interrupt, RX busy")); + mp_raise_RuntimeError(translate("Could not start interrupt, RX busy")); } // start the receive interrupt chain @@ -335,7 +335,7 @@ size_t common_hal_busio_uart_write(busio_uart_obj_t *self, const uint8_t *data, Status = HAL_UART_GetState(&self->handle); } } else { - mp_raise_ValueError(translate("UART write error")); + mp_raise_RuntimeError(translate("UART write")); } return len; @@ -405,11 +405,11 @@ void common_hal_busio_uart_set_baudrate(busio_uart_obj_t *self, uint32_t baudrat // Otherwise de-init and set new rate if (HAL_UART_DeInit(&self->handle) != HAL_OK) { - mp_raise_ValueError(translate("UART de-init error")); + mp_raise_RuntimeError(translate("UART de-init")); } self->handle.Init.BaudRate = baudrate; if (HAL_UART_Init(&self->handle) != HAL_OK) { - mp_raise_ValueError(translate("UART re-init error")); + mp_raise_RuntimeError(translate("UART re-init")); } self->baudrate = baudrate; diff --git a/ports/stm/common-hal/canio/CAN.c b/ports/stm/common-hal/canio/CAN.c index 08ac034bde..992745b80a 100644 --- a/ports/stm/common-hal/canio/CAN.c +++ b/ports/stm/common-hal/canio/CAN.c @@ -59,13 +59,13 @@ void common_hal_canio_can_construct(canio_can_obj_t *self, const mcu_pin_obj_t * 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"), MP_QSTR_tx); + raise_ValueError_invalid_pin_name(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"), MP_QSTR_rx); + raise_ValueError_invalid_pin_name(MP_QSTR_rx); } if (reserved_can[periph_index]) { diff --git a/ports/stm/common-hal/pwmio/PWMOut.c b/ports/stm/common-hal/pwmio/PWMOut.c index e5dc18cd79..6710f43f7d 100644 --- a/ports/stm/common-hal/pwmio/PWMOut.c +++ b/ports/stm/common-hal/pwmio/PWMOut.c @@ -279,16 +279,16 @@ void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t *self, uint32_t fr // restart everything, adjusting for new speed if (HAL_TIM_PWM_Init(&self->handle) != HAL_OK) { - mp_raise_ValueError(translate("Could not re-init timer")); + mp_raise_RuntimeError(translate("timer re-init")); } self->chan_handle.Pulse = timer_get_internal_duty(self->duty_cycle, period); if (HAL_TIM_PWM_ConfigChannel(&self->handle, &self->chan_handle, self->channel) != HAL_OK) { - mp_raise_ValueError(translate("Could not re-init channel")); + mp_raise_RuntimeError(translate("channel re-init")); } if (HAL_TIM_PWM_Start(&self->handle, self->channel) != HAL_OK) { - mp_raise_ValueError(translate("Could not restart PWM")); + mp_raise_RuntimeError(translate("PWM restart")); } tim_frequencies[self->tim->tim_index] = frequency; diff --git a/py/argcheck.c b/py/argcheck.c index 5854c9d1d2..592b35940e 100644 --- a/py/argcheck.c +++ b/py/argcheck.c @@ -222,6 +222,14 @@ mp_uint_t mp_arg_validate_length(mp_uint_t length, mp_uint_t required_length, qs return length; } +// int instead of uint because an index can be negative in some cases. +mp_int_t mp_arg_validate_index_range(mp_int_t index, mp_int_t min, mp_int_t max, qstr arg_name) { + if (index < min || index > max) { + mp_raise_IndexError_varg(translate("%q out of range"), arg_name, min, max); + } + return index; +} + mp_obj_t mp_arg_validate_type(mp_obj_t obj, const mp_obj_type_t *type, qstr arg_name) { if (!mp_obj_is_type(obj, type)) { mp_raise_TypeError_varg(translate("%q must be of type %q"), arg_name, type->name); diff --git a/py/runtime.h b/py/runtime.h index 4fa30d9b2b..dccdc2feed 100644 --- a/py/runtime.h +++ b/py/runtime.h @@ -104,6 +104,7 @@ mp_uint_t mp_arg_validate_length_min(mp_uint_t length, mp_uint_t min, qstr arg_n mp_uint_t mp_arg_validate_length_max(mp_uint_t length, mp_uint_t max, qstr arg_name); mp_uint_t mp_arg_validate_length_range(mp_uint_t length, mp_uint_t min, mp_uint_t max, qstr arg_name); mp_uint_t mp_arg_validate_length(mp_uint_t length, mp_uint_t required_length, qstr arg_name); +mp_int_t mp_arg_validate_index_range(mp_int_t index, mp_int_t min, mp_int_t max, qstr arg_name); mp_obj_t mp_arg_validate_type(mp_obj_t obj, const mp_obj_type_t *type, qstr arg_name); mp_int_t mp_arg_validate_type_int(mp_obj_t obj, qstr arg_name); mp_obj_t mp_arg_validate_type_string(mp_obj_t obj, qstr arg_name); diff --git a/shared-bindings/microcontroller/Pin.c b/shared-bindings/microcontroller/Pin.c index 27c2667d8e..db96519dc7 100644 --- a/shared-bindings/microcontroller/Pin.c +++ b/shared-bindings/microcontroller/Pin.c @@ -202,3 +202,7 @@ NORETURN void raise_ValueError_invalid_pin(void) { NORETURN void raise_ValueError_invalid_pins(void) { mp_arg_error_invalid(MP_QSTR_pins); } + +NORETURN void raise_ValueError_invalid_pin_name(qstr pin_name) { + mp_raise_ValueError_varg(translate("Invalid %q pin"), pin_name); +} diff --git a/shared-bindings/microcontroller/Pin.h b/shared-bindings/microcontroller/Pin.h index 4ce20331d9..12ff422a4a 100644 --- a/shared-bindings/microcontroller/Pin.h +++ b/shared-bindings/microcontroller/Pin.h @@ -43,6 +43,7 @@ void validate_list_is_free_pins(qstr what, const mcu_pin_obj_t **pins_out, mp_in void validate_pins(qstr what, uint8_t *pin_nos, mp_int_t max_pins, mp_obj_t seq, uint8_t *count_out); NORETURN void raise_ValueError_invalid_pin(void); NORETURN void raise_ValueError_invalid_pins(void); +NORETURN void raise_ValueError_invalid_pin_name(qstr pin_name); void assert_pin_free(const mcu_pin_obj_t *pin); diff --git a/shared-bindings/sdioio/SDCard.c b/shared-bindings/sdioio/SDCard.c index 891ecfe092..c06ce18826 100644 --- a/shared-bindings/sdioio/SDCard.c +++ b/shared-bindings/sdioio/SDCard.c @@ -129,7 +129,7 @@ STATIC mp_obj_t sdioio_sdcard_configure(size_t n_args, const mp_obj_t *pos_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 = mp_arg_validate_int_min(args[ARG_frequency].u_int, 0, MP_QSTR_frequency); + mp_int_t frequency = mp_arg_validate_int_min(args[ARG_frequency].u_int, 1, MP_QSTR_frequency); uint8_t width = args[ARG_width].u_int; if (width != 0 && width != 1 && width != 4) { mp_arg_error_invalid(MP_QSTR_width); diff --git a/shared-module/bitbangio/SPI.c b/shared-module/bitbangio/SPI.c index dc91c6e0d5..972b085978 100644 --- a/shared-module/bitbangio/SPI.c +++ b/shared-module/bitbangio/SPI.c @@ -123,7 +123,7 @@ void shared_module_bitbangio_spi_unlock(bitbangio_spi_obj_t *self) { // Writes out the given data. bool shared_module_bitbangio_spi_write(bitbangio_spi_obj_t *self, const uint8_t *data, size_t len) { if (len > 0 && !self->has_mosi) { - mp_raise_ValueError(translate("Cannot write without MOSI pin")); + mp_raise_ValueError(translate("No MOSI pin")); } uint32_t delay_half = self->delay_half; @@ -178,7 +178,7 @@ bool shared_module_bitbangio_spi_write(bitbangio_spi_obj_t *self, const uint8_t // Reads in len bytes while outputting zeroes. bool shared_module_bitbangio_spi_read(bitbangio_spi_obj_t *self, uint8_t *data, size_t len, uint8_t write_data) { if (len > 0 && !self->has_miso) { - mp_raise_ValueError(translate("Cannot read without MISO pin")); + mp_raise_ValueError(translate("No MISO pin")); } uint32_t delay_half = self->delay_half; From ea430d678fd4a9c419ac31ea4a896eebb5c1cc0e Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 20 May 2022 08:27:43 +0000 Subject: [PATCH 113/246] Translated using Weblate (German) Currently translated at 100.0% (1059 of 1059 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/de/ --- locale/de_DE.po | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/locale/de_DE.po b/locale/de_DE.po index 498b1fdaf4..9051a04d57 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -6,14 +6,14 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-03-24 15:57+0000\n" +"PO-Revision-Date: 2022-05-20 19:25+0000\n" "Last-Translator: Fabian Affolter \n" "Language: de_DE\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.12-dev\n" +"X-Generator: Weblate 4.13-dev\n" #: main.c msgid "" @@ -117,7 +117,7 @@ msgstr "%q muss %d-%d sein" #: shared-bindings/displayio/Display.c msgid "%q must be 1 when %q is True" -msgstr "" +msgstr "%q muss 1 sein, wenn %q wahr ist" #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" @@ -895,7 +895,7 @@ msgstr "Konnte first buffer nicht zuteilen" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate input buffer" -msgstr "Eingabepuffer konnte nicht reserviert werden" +msgstr "Eingabepuffer konnte nicht zugewiesen werden" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c @@ -908,7 +908,7 @@ msgstr "Absturz in den HardFault_Handler." #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Channel Init Error" -msgstr "DAC Kanal Initialisierungsfehler" +msgstr "DAC-Kanal-Initialisierungsfehler" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Device Init Error" @@ -1133,6 +1133,8 @@ msgstr "Framepuffer benötigt %d bytes" msgid "" "Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" msgstr "" +"Die Frequenz muss 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 oder 1008 " +"MHz betragen" #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" @@ -1569,11 +1571,11 @@ msgstr "" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Mismatched data size" -msgstr "" +msgstr "Nicht übereinstimmende Datengröße" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Mismatched swap flag" -msgstr "" +msgstr "Nicht übereinstimmendes Swap-Flag" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" @@ -1646,7 +1648,7 @@ msgstr "Name zu lang" #: shared-bindings/displayio/TileGrid.c msgid "New bitmap must be same size as old bitmap" -msgstr "" +msgstr "Neue Bitmap muss die gleiche Größe wie alte Bitmap haben" #: ports/espressif/common-hal/_bleio/__init__.c msgid "Nimble out of memory" @@ -1782,7 +1784,7 @@ msgstr "Kein Speicherplatz mehr verfügbar auf dem Gerät" #: py/moduerrno.c msgid "No such device" -msgstr "" +msgstr "Kein solches Gerät" #: py/moduerrno.c msgid "No such file/directory" @@ -1899,7 +1901,7 @@ msgstr "Nur eine Farbe kann transparent sein zu einer Zeit" #: py/moduerrno.c msgid "Operation not permitted" -msgstr "" +msgstr "Operation nicht erlaubt" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" @@ -3381,7 +3383,7 @@ msgstr "Format erfordert ein Wörterbuch (dict)" #: shared-bindings/microcontroller/Processor.c msgid "frequency is read-only for this board" -msgstr "" +msgstr "Frequenz ist für dieses Board schreibgeschützt" #: py/objdeque.c msgid "full" From d98c6ecde2914813d98e1b507edbebc442584f2b Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Fri, 20 May 2022 21:25:25 +0200 Subject: [PATCH 114/246] 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 | 907 ++++++++++++++------------------- locale/cs.po | 652 +++++------------------- locale/de_DE.po | 1013 ++++++++++++++++++------------------- locale/el.po | 641 +++++------------------- locale/en_GB.po | 1004 ++++++++++++++++++------------------- locale/es.po | 997 +++++++++++++++++-------------------- locale/fil.po | 805 +++++++++++------------------- locale/fr.po | 1010 ++++++++++++++++++------------------- locale/hi.po | 641 +++++------------------- locale/it_IT.po | 831 +++++++++++-------------------- locale/ja.po | 906 ++++++++++++++------------------- locale/ko.po | 678 ++++++------------------- locale/nl.po | 945 ++++++++++++++++------------------- locale/pl.po | 873 +++++++++++++------------------- locale/pt_BR.po | 1021 ++++++++++++++++++-------------------- locale/ru.po | 887 ++++++++++++++------------------- locale/sv.po | 1014 ++++++++++++++++++------------------- locale/tr.po | 684 +++++++------------------ locale/zh_Latn_pinyin.po | 1016 ++++++++++++++++++------------------- 19 files changed, 6539 insertions(+), 9986 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index c16258bf52..be10475e61 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -72,10 +72,24 @@ msgid "" msgstr "" "%d pin alamat, %d rgb pin dan %d ubin menunjukkan ketinggian %d, bukan %d" +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "%q dan %q berisi pin duplikat" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "%q berisi pin duplikat" @@ -88,12 +102,7 @@ msgstr "%q gagal: %d" msgid "%q in use" msgstr "%q sedang digunakan" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "%q indeks di luar batas" @@ -101,14 +110,34 @@ msgstr "%q indeks di luar batas" msgid "%q indices must be integers, not %s" msgstr "indeks %q harus bilangan bulat, bukan %s" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "%q panjang harus %d-%d" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "%q panjang harus >= 1" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "%q harus %d-%d" @@ -125,14 +154,10 @@ msgstr "%q harus <= %d" msgid "%q must be >= %d" msgstr "%q harus >= %d" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "%q harus >= 0" -#: 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 "%q harus >= 1" @@ -141,14 +166,9 @@ msgstr "%q harus >= 1" msgid "%q must be a string" msgstr "%q harus berupa string" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "%q harus berupa tuple dengan panjang 2" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" -msgstr "%q harus antara %d dan %d" +#: py/argcheck.c +msgid "%q must be an int" +msgstr "" #: py/argcheck.c msgid "%q must be of type %q" @@ -166,7 +186,11 @@ msgstr "%q harus pangkat 2" msgid "%q 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/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q di luar jangkauan" @@ -175,10 +199,6 @@ msgstr "%q di luar jangkauan" msgid "%q pin invalid" msgstr "pin %q tidak valid" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%q harus berupa int" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "" @@ -341,10 +361,6 @@ msgstr "'yield from' di dalam fungsi async" msgid "'yield' outside function" msgstr "'yield' diluar fungsi" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "" - #: py/compile.c msgid "*x must be assignment target" msgstr "*x harus menjadi target assignment" @@ -380,10 +396,6 @@ msgstr "ADC2 sedang digunakan oleh WiFi" msgid "Address must be %d bytes long" msgstr "Alamat harus sepanjang %d byte" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "Jenis alamat di luar batas" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "" @@ -474,25 +486,6 @@ msgstr "" 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" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "fungsionalitas AnalogOut tidak didukung" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -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" -msgstr "pin yang dipakai tidak mendukung AnalogOut" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "" @@ -564,11 +557,6 @@ msgstr "" msgid "Bit clock and word select must share a clock unit" msgstr "Bit clock dan word harus memiliki kesamaan pada clock unit" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "Kedalaman bit harus kelipatan 8." @@ -610,11 +598,6 @@ msgstr "Buffer + offset terlalu kecil %d %d %d" msgid "Buffer elements must be 4 bytes long or less" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "Ukuran buffer salah. Seharusnya %d byte." - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "Buffer bukan bytearray." @@ -624,7 +607,6 @@ msgstr "Buffer bukan bytearray." msgid "Buffer is too small" msgstr "Buffer terlalu kecil" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -639,10 +621,6 @@ msgstr "Panjang buffer harus kelipatan 512" msgid "Buffer must be a multiple of 512 bytes" msgstr "" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "Penyangga harus memiliki panjang setidaknya 1" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -664,10 +642,6 @@ msgstr "Pin bus %d sudah digunakan" msgid "Byte buffer must be 16 bytes." msgstr "Byte buffer harus 16 byte." -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "Bytes harus di antara 0 dan 255." - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "Blok CBC harus merupakan kelipatan 16 byte" @@ -684,6 +658,10 @@ msgstr "" msgid "Call super().__init__() before accessing native object." msgstr "Panggil super().__init__() sebelum mengakses objek asli." +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" @@ -733,20 +711,10 @@ 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" -msgstr "" -"Tidak dapat menggunakan output di kedua channel dengan menggunakan pin yang " -"sama" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "Tidak dapat membaca tanpa pin MISO." - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "Tidak dapat merekam ke file" @@ -758,10 +726,8 @@ 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." +msgid "Cannot reset into bootloader because no bootloader is present" msgstr "" -"Tidak dapat melakukan reset ke bootloader karena tidak ada bootloader yang " -"terisi" #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -781,8 +747,8 @@ msgid "Cannot subclass slice" msgstr "Tidak dapat membuat subkelas dari irisan" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." -msgstr "Tidak dapat transfer tanpa pin MOSI dan MISO." +msgid "Cannot transfer without MOSI and MISO pins" +msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" @@ -790,14 +756,13 @@ msgstr "" "Tidak dapat membuat variasi frekuensi pada penghitung waktu yang sudah " "digunakan" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c -msgid "Cannot wake on pin edge. Only level." +msgid "Cannot wake on pin edge, only level" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." -msgstr "Tidak dapat menulis tanpa pin MOSI." +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge. Only level." +msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" @@ -811,10 +776,6 @@ msgstr "Kode inti CircuitPython mengalami crash. Aduh!\n" msgid "CircuitPython was unable to allocate the heap." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "Init pin clock gagal." - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "Peregangan clock terlalu panjang" @@ -823,11 +784,6 @@ msgstr "Peregangan clock terlalu panjang" msgid "Clock unit in use" msgstr "Clock unit sedang digunakan" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -msgid "Command must be an int between 0 and 255" -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 " @@ -839,35 +795,6 @@ msgstr "" msgid "Corrupt .mpy file" msgstr "File .mpy 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 "" - -#: 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 -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "Tidak dapat menginisialisasi UART" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init channel" -msgstr "Tidak dapat menginisialisasi ulang kanal" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init timer" -msgstr "Tidak dapat menginisialisasi ulang timer" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not restart PWM" -msgstr "Tidak dapat memulai ulang PWM" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "" @@ -888,20 +815,6 @@ msgstr "Tidak dapat memulai interupsi, RX sibuk" msgid "Couldn't allocate decoder" 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 "Tidak dapat mengalokasikan penyangga pertama" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate input buffer" -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 "Tidak dapat mengalokasikan penyangga kedua" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "Gagal ke HardFault_Handler." @@ -949,10 +862,6 @@ msgstr "Kapasitas tujuan lebih kecil dari destination_length." msgid "Device in use" msgstr "Perangkat sedang digunakan" -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -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." @@ -1008,11 +917,6 @@ msgstr "Diharapkan %q" msgid "Expected an alarm" msgstr "" -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "Diharapkan tuple dengan panjang %d, didapatkan %d" - #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." @@ -1039,22 +943,6 @@ msgstr "Gagal mengirim perintah." msgid "Failed to acquire mutex, err 0x%04x" msgstr "Gagal memperoleh mutex, err 0x%04x" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -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/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/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/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "" @@ -1123,11 +1011,6 @@ msgstr "" msgid "Format not supported" msgstr "" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" -msgstr "" - #: ports/mimxrt10xx/common-hal/microcontroller/Processor.c msgid "" "Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" @@ -1142,6 +1025,10 @@ msgstr "Frekuensi harus cocok dengan PWMOut yang ada menggunakan timer ini" msgid "Function requires lock" msgstr "Fungsinya membutuhkan kunci" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1169,17 +1056,13 @@ 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" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "Gagal Inisialisasi I2C" +msgid "I2C init error" +msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c msgid "I2C peripheral in use" @@ -1288,75 +1171,33 @@ msgstr "" msgid "Internal error #%d" msgstr "Kesalahan internal #%d" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: py/argcheck.c msgid "Invalid %q" msgstr "" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c 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/canio/CAN.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" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "File BMP tidak valid" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "Pin DAC yang diberikan tidak valid" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "Frekuensi PWM tidak valid" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "Argumen tidak valid" @@ -1364,42 +1205,11 @@ msgstr "Argumen tidak valid" msgid "Invalid bits per value" msgstr "Bit per nilai tidak valid" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "Ukuran buffer tidak valid" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "String byteorder tidak valid" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "Periode penangkapan tidak valid. Kisaran yang valid: 1 - 500" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "Jumlah kanal tidak valid" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "Arah tidak valid." - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "File tidak valid" - #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Ukuran potongan format tidak valid" @@ -1408,78 +1218,14 @@ msgstr "Ukuran potongan format tidak valid" msgid "Invalid memory access." msgstr "Akses memori tidak valid." -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "Jumlah bit tidak valid" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "Fase tidak valid" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "Pin tidak valid" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "Pin untuk channel kiri tidak valid" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -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/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/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "Pin-pin tidak valid" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "Polaritas tidak valid" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "Properti tidak valid" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "Mode operasi tidak valid." - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "security_mode tidak valid" - #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" @@ -1492,23 +1238,6 @@ msgstr "" msgid "Invalid state" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "Suara tidak valid" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "Hitungan suara tidak valid" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "File wave tidak valid" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "Panjang kata/bit tidak valid" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "Panjang kunci harus 16, 24, atau 32 byte" @@ -1522,25 +1251,17 @@ msgid "LHS of keyword arg must be an id" msgstr "LHS dari keyword arg harus menjadi sebuah id" #: shared-module/displayio/Group.c -msgid "Layer already in a group." -msgstr "Layer sudah ada dalam grup." +msgid "Layer already in a group" +msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." -msgstr "Layer harus sebuah Grup atau subklas dari TileGrid." +msgid "Layer must be a Group or TileGrid subclass" +msgstr "" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "Pin MISO gagal inisialisasi." - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "Pin MOSI gagal inisialisasi." - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "" @@ -1550,10 +1271,6 @@ msgstr "" 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 "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Penundaan mulai mikrofon harus dalam kisaran 0,0 hingga 1,0" @@ -1567,10 +1284,14 @@ msgstr "" msgid "Mismatched swap flag" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "Tidak menemukan Pin MISO atau MOSI" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1606,11 +1327,6 @@ msgstr "" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "Harus berupa subclass %q." @@ -1671,15 +1387,23 @@ msgid "No I2C device at address: 0x%x" msgstr "" #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "Tidak ada Pin MISO" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Tidak ada Pin MOSI" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1718,16 +1442,6 @@ msgstr "Tidak ada GCLK yang kosong" msgid "No hardware random available" msgstr "Tidak ada perangkat keras acak yang tersedia" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "Tidak ada dukungan perangkat keras pada pin clk" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "Tidak ada dukungan hardware untuk pin" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "" @@ -1877,10 +1591,13 @@ msgid "Only one address is allowed" msgstr "" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "" @@ -1912,11 +1629,6 @@ msgstr "Kehabisan socket" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Sampel berlebihan harus kelipatan 8." @@ -1925,11 +1637,6 @@ msgstr "Sampel berlebihan harus kelipatan 8." msgid "PDMIn not available" msgstr "" -#: shared-bindings/pwmio/PWMOut.c -msgid "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" -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." @@ -1937,6 +1644,10 @@ msgstr "" "Frekuensi PWM tidak dapat ditulis ketika variabel_frequency Salah pada " "konstruksi." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" +msgstr "" + #: ports/raspberrypi/common-hal/countio/Counter.c msgid "PWM slice already in use" msgstr "" @@ -1953,29 +1664,14 @@ msgstr "Periferal sedang digunakan" msgid "Permission denied" msgstr "Izin ditolak" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "Jumlah pin terlalu besar" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "Pin tidak mempunya kemampuan untuk ADC (Analog Digital Converter)" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2047,18 +1743,10 @@ msgstr "" msgid "Program does OUT without loading OSR" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "" - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Pull tidak digunakan saat arah output." @@ -2080,8 +1768,9 @@ msgstr "Kesalahan DeInit RNG" msgid "RNG Init Error" msgstr "Kesalahan Init RNG" -#: ports/nrf/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" +#: 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 "RS485" msgstr "" #: ports/espressif/common-hal/busio/UART.c @@ -2089,21 +1778,10 @@ msgstr "" msgid "RS485 inversion specified when not in RS485 mode" msgstr "Pembalikan RS485 ditentukan saat tidak dalam mode RS485" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "Kalibrasi RTC tidak didukung pada board ini" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "RTC tidak didukung di board ini" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/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 Belum didukung pada perangkat ini" - #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" msgstr "Kesalahan pembuatan nomor acak" @@ -2155,6 +1833,10 @@ msgstr "" msgid "SD card CSD format not supported" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2165,30 +1847,21 @@ msgstr "" msgid "SDIO Init Error %d" msgstr "" -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "Kesalahan Init SPI" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "Kesalahan Inisialisasi ulang SPI" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -msgid "Sample rate must be positive" -msgstr "Tingkat sampel harus positif" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" -msgstr "Nilai sampel terlalu tinggi. Nilai harus kurang dari %d" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" +msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c msgid "Scale dimensions must divide by 3" @@ -2208,14 +1881,6 @@ msgstr "Serializer sedang digunakan" msgid "Server side context cannot have hostname" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "" @@ -2251,10 +1916,6 @@ msgstr "" msgid "Splitting with sub-captures" msgstr "Memisahkan dengan menggunakan sub-captures" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "Ukuran stack minimal harus 256" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "" @@ -2340,10 +2001,6 @@ msgstr "Tinggi tile harus persis membagi tinggi bitmap" msgid "Tile index out of bounds" msgstr "Indeks ubin di luar batas" -#: shared-bindings/displayio/TileGrid.c -msgid "Tile value out of bounds" -msgstr "Nilai ubin di luar batas" - #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" msgstr "Lebar ubin harus persis membagi lebar bitmap" @@ -2363,6 +2020,9 @@ 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 "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Terlalu banyak channel dalam sampel" @@ -2395,24 +2055,21 @@ msgid "Tuple or struct_time argument required" msgstr "Diperlukan argumen Tuple atau struct_time" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "Kesalahan alokasi Buffer UART" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" +msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "Kesalahan UART De-init" +msgid "UART re-init" +msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "Kesalahan Init UART" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "Kesalahan Re-init UART" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" -msgstr "Kesalahan penulisan UART" +msgid "UART write" +msgstr "" #: shared-module/usb_hid/Device.c msgid "USB busy" @@ -2550,12 +2207,6 @@ msgstr "" "Masalah yang tidak ditentukan. Bisa jadi permintaan pemasangan pada " "perangkat lain ditolak atau diabaikan." -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "Baudrate tidak didukung" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "" @@ -2630,10 +2281,6 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" -msgstr "" - #: main.c msgid "Woken up by alarm.\n" msgstr "" @@ -2786,10 +2433,6 @@ msgstr "" msgid "bits must be 32 or less" msgstr "" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -2827,11 +2470,6 @@ msgstr "" msgid "byteorder is not a string" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -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 "" @@ -2840,7 +2478,7 @@ msgstr "" msgid "bytes value out of range" msgstr "" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "kalibrasi keluar dari jangkauan" @@ -2848,12 +2486,9 @@ msgstr "kalibrasi keluar dari jangkauan" msgid "calibration is read only" msgstr "kalibrasi adalah read only" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "nilai kalibrasi keluar dari jangkauan +/-127" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" +msgid "can only have one parent" msgstr "" #: py/emitinlinethumb.c @@ -3024,6 +2659,10 @@ msgstr "" msgid "casting" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "" @@ -3036,10 +2675,6 @@ msgstr "" 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/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "" @@ -3464,6 +3099,10 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "" @@ -3714,10 +3353,6 @@ msgstr "" msgid "matrix is not positive definite" msgstr "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3725,10 +3360,6 @@ 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 "" - #: extmod/ulab/code/ndarray.c msgid "maximum number of dimensions is 4" msgstr "" @@ -4100,10 +3731,6 @@ msgstr "" msgid "poll on file not available on win32" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "Muncul dari PulseIn yang kosong" @@ -4150,14 +3777,6 @@ msgstr "" msgid "pull masks conflict with direction masks" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "antrian meluap (overflow)" @@ -4328,10 +3947,6 @@ msgstr "" 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 "" @@ -4380,10 +3995,6 @@ msgstr "sintaksis error pada pendeskripsi uctypes" msgid "threshold must be in the range 0-65536" msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "" @@ -4403,10 +4014,6 @@ msgstr "" msgid "timeout must be < 655.35 secs" msgstr "" -#: shared-bindings/_bleio/CharacteristicBuffer.c -msgid "timeout must be >= 0.0" -msgstr "waktu habis harus >= 0,0" - #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" msgstr "" @@ -4415,6 +4022,10 @@ msgstr "" msgid "timeout waiting for v2 card" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "" @@ -4606,13 +4217,7 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" @@ -4684,6 +4289,246 @@ msgstr "zi harus berjenis float" msgid "zi must be of shape (n_section, 2)" msgstr "Zi harus berbentuk (n_section, 2)" +#~ msgid "%q must be a tuple of length 2" +#~ msgstr "%q harus berupa tuple dengan panjang 2" + +#~ msgid "%q must be between %d and %d" +#~ msgstr "%q harus antara %d dan %d" + +#~ msgid "%q should be an int" +#~ msgstr "%q harus berupa int" + +#~ msgid "Address type out of range" +#~ msgstr "Jenis alamat di luar batas" + +#~ msgid "AnalogIn not supported on given pin" +#~ msgstr "AnalogIn tidak didukung pada pin yang diberikan" + +#~ msgid "AnalogOut functionality not supported" +#~ msgstr "fungsionalitas AnalogOut tidak didukung" + +#~ msgid "AnalogOut is only 16 bits. Value must be less than 65536." +#~ msgstr "AnalogOut hanya 16 bit. Nilai harus kurang dari 65536." + +#~ msgid "AnalogOut not supported on given pin" +#~ msgstr "pin yang dipakai tidak mendukung AnalogOut" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "Ukuran buffer salah. Seharusnya %d byte." + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "Penyangga harus memiliki panjang setidaknya 1" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "Bytes harus di antara 0 dan 255." + +#~ msgid "Cannot output both channels on the same pin" +#~ msgstr "" +#~ "Tidak dapat menggunakan output di kedua channel dengan menggunakan pin " +#~ "yang sama" + +#~ msgid "Cannot read without MISO pin." +#~ msgstr "Tidak dapat membaca tanpa pin MISO." + +#~ msgid "Cannot reset into bootloader because no bootloader is present." +#~ msgstr "" +#~ "Tidak dapat melakukan reset ke bootloader karena tidak ada bootloader " +#~ "yang terisi" + +#~ msgid "Cannot transfer without MOSI and MISO pins." +#~ msgstr "Tidak dapat transfer tanpa pin MOSI dan MISO." + +#~ msgid "Cannot write without MOSI pin." +#~ msgstr "Tidak dapat menulis tanpa pin MOSI." + +#~ msgid "Clock pin init failed." +#~ msgstr "Init pin clock gagal." + +#~ msgid "Command must be an int between 0 and 255" +#~ msgstr "Perintah harus berupa int di antara 0 dan 255" + +#~ msgid "Could not initialize UART" +#~ msgstr "Tidak dapat menginisialisasi UART" + +#~ msgid "Could not re-init channel" +#~ msgstr "Tidak dapat menginisialisasi ulang kanal" + +#~ msgid "Could not re-init timer" +#~ msgstr "Tidak dapat menginisialisasi ulang timer" + +#~ msgid "Could not restart PWM" +#~ msgstr "Tidak dapat memulai ulang PWM" + +#~ msgid "Couldn't allocate first buffer" +#~ msgstr "Tidak dapat mengalokasikan penyangga pertama" + +#~ msgid "Couldn't allocate input buffer" +#~ msgstr "Tidak dapat mengalokasikan penyangga masukan" + +#~ msgid "Couldn't allocate second buffer" +#~ msgstr "Tidak dapat mengalokasikan penyangga kedua" + +#~ msgid "DigitalInOut not supported on given pin" +#~ msgstr "DigitalInOut tidak didukung pada pin yang diberikan" + +#, c-format +#~ msgid "Expected tuple of length %d, got %d" +#~ msgstr "Diharapkan tuple dengan panjang %d, didapatkan %d" + +#~ msgid "Failed to allocate RX buffer" +#~ msgstr "Gagal untuk mengalokasikan buffer RX" + +#, c-format +#~ msgid "Failed to allocate RX buffer of %d bytes" +#~ msgstr "Gagal untuk megalokasikan buffer RX dari %d byte" + +#~ msgid "I2C Init Error" +#~ msgstr "Gagal Inisialisasi I2C" + +#~ msgid "Invalid BMP file" +#~ msgstr "File BMP tidak valid" + +#~ msgid "Invalid DAC pin supplied" +#~ msgstr "Pin DAC yang diberikan tidak valid" + +#~ msgid "Invalid PWM frequency" +#~ msgstr "Frekuensi PWM tidak valid" + +#~ msgid "Invalid buffer size" +#~ msgstr "Ukuran buffer tidak valid" + +#~ msgid "Invalid byteorder string" +#~ msgstr "String byteorder tidak valid" + +#~ msgid "Invalid capture period. Valid range: 1 - 500" +#~ msgstr "Periode penangkapan tidak valid. Kisaran yang valid: 1 - 500" + +#~ msgid "Invalid channel count" +#~ msgstr "Jumlah kanal tidak valid" + +#~ msgid "Invalid direction." +#~ msgstr "Arah tidak valid." + +#~ msgid "Invalid file" +#~ msgstr "File tidak valid" + +#~ msgid "Invalid number of bits" +#~ msgstr "Jumlah bit tidak valid" + +#~ msgid "Invalid phase" +#~ msgstr "Fase tidak valid" + +#~ msgid "Invalid pin" +#~ msgstr "Pin tidak valid" + +#~ msgid "Invalid pin for left channel" +#~ msgstr "Pin untuk channel kiri tidak valid" + +#~ msgid "Invalid pin for right channel" +#~ msgstr "Pin untuk channel kanan tidak valid" + +#~ msgid "Invalid polarity" +#~ msgstr "Polaritas tidak valid" + +#~ msgid "Invalid properties" +#~ msgstr "Properti tidak valid" + +#~ msgid "Invalid run mode." +#~ msgstr "Mode operasi tidak valid." + +#~ msgid "Invalid security_mode" +#~ msgstr "security_mode tidak valid" + +#~ msgid "Invalid voice" +#~ msgstr "Suara tidak valid" + +#~ msgid "Invalid voice count" +#~ msgstr "Hitungan suara tidak valid" + +#~ msgid "Invalid wave file" +#~ msgstr "File wave tidak valid" + +#~ msgid "Invalid word/bit length" +#~ msgstr "Panjang kata/bit tidak valid" + +#~ msgid "Layer already in a group." +#~ msgstr "Layer sudah ada dalam grup." + +#~ msgid "Layer must be a Group or TileGrid subclass." +#~ msgstr "Layer harus sebuah Grup atau subklas dari TileGrid." + +#~ msgid "MISO pin init failed." +#~ msgstr "Pin MISO gagal inisialisasi." + +#~ msgid "MOSI pin init failed." +#~ msgstr "Pin MOSI gagal inisialisasi." + +#~ msgid "No hardware support on clk pin" +#~ msgstr "Tidak ada dukungan perangkat keras pada pin clk" + +#~ msgid "No hardware support on pin" +#~ msgstr "Tidak ada dukungan hardware untuk pin" + +#~ msgid "" +#~ "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +#~ msgstr "PWM duty_cycle harus antara 0 dan 65535 inklusif (resolusi 16 bit)" + +#~ msgid "Pin does not have ADC capabilities" +#~ msgstr "Pin tidak mempunya kemampuan untuk ADC (Analog Digital Converter)" + +#~ msgid "RTC calibration is not supported on this board" +#~ msgstr "Kalibrasi RTC tidak didukung pada board ini" + +#~ msgid "RTS/CTS/RS485 Not yet supported on this device" +#~ msgstr "RTS/CTS/RS485 Belum didukung pada perangkat ini" + +#~ msgid "SPI Init Error" +#~ msgstr "Kesalahan Init SPI" + +#~ msgid "SPI Re-initialization error" +#~ msgstr "Kesalahan Inisialisasi ulang SPI" + +#~ msgid "Sample rate must be positive" +#~ msgstr "Tingkat sampel harus positif" + +#, c-format +#~ msgid "Sample rate too high. It must be less than %d" +#~ msgstr "Nilai sampel terlalu tinggi. Nilai harus kurang dari %d" + +#~ msgid "Stack size must be at least 256" +#~ msgstr "Ukuran stack minimal harus 256" + +#~ msgid "Tile value out of bounds" +#~ msgstr "Nilai ubin di luar batas" + +#~ msgid "UART Buffer allocation error" +#~ msgstr "Kesalahan alokasi Buffer UART" + +#~ msgid "UART De-init error" +#~ msgstr "Kesalahan UART De-init" + +#~ msgid "UART Init Error" +#~ msgstr "Kesalahan Init UART" + +#~ msgid "UART Re-init error" +#~ msgstr "Kesalahan Re-init UART" + +#~ msgid "UART write error" +#~ msgstr "Kesalahan penulisan UART" + +#~ msgid "Unsupported baudrate" +#~ msgstr "Baudrate tidak didukung" + +#~ msgid "bytes > 8 bits not supported" +#~ msgstr "byte > 8 bit tidak didukung" + +#~ msgid "calibration value out of range +/-127" +#~ msgstr "nilai kalibrasi keluar dari jangkauan +/-127" + +#~ msgid "timeout must be >= 0.0" +#~ msgstr "waktu habis harus >= 0,0" + #~ msgid "Unsupported operation" #~ msgstr "Operasi yang tidak didukung" diff --git a/locale/cs.po b/locale/cs.po index 5a87f5bc06..ce3fc2a7bc 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -71,10 +71,24 @@ msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "%d adresní pin, %d rgb pin a %d dlaždice indikuje výšku %d, ne %d" +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "%q a %q obsahují duplicitní piny" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "%q obsahuje duplicitní piny" @@ -87,12 +101,7 @@ msgstr "%q: selhání %d" msgid "%q in use" msgstr "%q se právě používá" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "Index %q je mimo rozsah" @@ -100,14 +109,34 @@ msgstr "Index %q je mimo rozsah" msgid "%q indices must be integers, not %s" msgstr "Indexy %q musí být celá čísla, nikoli %s" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "%q délka musí být %d-%d" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "%q délka musí být >= 1" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "%q musí být %d-%d" @@ -124,14 +153,10 @@ msgstr "%q musí být <= %d" msgid "%q must be >= %d" msgstr "%q musí být >= %d" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "%q musí být >= 0" -#: 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 "%q musí být > = 1" @@ -140,14 +165,9 @@ msgstr "%q musí být > = 1" msgid "%q must be a string" msgstr "%q musí být string" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "%q musí být n-tice délky 2" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" -msgstr "%q musí být mezi %d a %d" +#: py/argcheck.c +msgid "%q must be an int" +msgstr "" #: py/argcheck.c msgid "%q must be of type %q" @@ -165,7 +185,11 @@ msgstr "%q musí být mocnina 2" msgid "%q out of bounds" msgstr "%q je mimo hranice" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q je mimo rozsah" @@ -174,10 +198,6 @@ msgstr "%q je mimo rozsah" msgid "%q pin invalid" msgstr "pin %q není platný" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%q by měl být int" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "%q s ID 0 musím být délky 1" @@ -340,10 +360,6 @@ msgstr "" msgid "'yield' outside function" msgstr "" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "" - #: py/compile.c msgid "*x must be assignment target" msgstr "" @@ -379,10 +395,6 @@ msgstr "" msgid "Address must be %d bytes long" msgstr "" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "" @@ -473,25 +485,6 @@ msgstr "" msgid "Already scanning for wifi networks" 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 -#: ports/raspberrypi/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/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "" @@ -563,11 +556,6 @@ msgstr "" msgid "Bit clock and word select must share a clock unit" msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "" @@ -609,11 +597,6 @@ msgstr "" msgid "Buffer elements must be 4 bytes long or less" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "" - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "" @@ -623,7 +606,6 @@ msgstr "" msgid "Buffer is too small" msgstr "" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -638,10 +620,6 @@ msgstr "" msgid "Buffer must be a multiple of 512 bytes" msgstr "" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -663,10 +641,6 @@ msgstr "" msgid "Byte buffer must be 16 bytes." msgstr "" -#: shared-bindings/alarm/SleepMemory.c 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 "" @@ -683,6 +657,10 @@ msgstr "" msgid "Call super().__init__() before accessing native object." msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" @@ -730,18 +708,10 @@ msgstr "" 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 "" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only 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 "" @@ -753,7 +723,7 @@ 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." +msgid "Cannot reset into bootloader because no bootloader is present" msgstr "" #: ports/espressif/common-hal/socketpool/Socket.c @@ -774,20 +744,19 @@ msgid "Cannot subclass slice" msgstr "" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." +msgid "Cannot transfer without MOSI and MISO pins" msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c -msgid "Cannot wake on pin edge. Only level." +msgid "Cannot wake on pin edge, only level" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge. Only level." msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -802,10 +771,6 @@ msgstr "" msgid "CircuitPython was unable to allocate the heap." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "" - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "" @@ -814,11 +779,6 @@ msgstr "" msgid "Clock unit in use" msgstr "" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/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 " @@ -829,35 +789,6 @@ msgstr "" msgid "Corrupt .mpy file" 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 "" - -#: 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 -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -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 "" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "" @@ -878,20 +809,6 @@ msgstr "" 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 "" @@ -939,10 +856,6 @@ msgstr "" 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." @@ -998,11 +911,6 @@ msgstr "" msgid "Expected an alarm" msgstr "" -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "" - #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." @@ -1029,22 +937,6 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/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/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/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/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "" @@ -1113,11 +1005,6 @@ msgstr "" msgid "Format not supported" msgstr "" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" -msgstr "" - #: ports/mimxrt10xx/common-hal/microcontroller/Processor.c msgid "" "Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" @@ -1132,6 +1019,10 @@ msgstr "" msgid "Function requires lock" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1159,16 +1050,12 @@ 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 "" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" +msgid "I2C init error" msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c @@ -1276,75 +1163,33 @@ msgstr "" msgid "Internal error #%d" msgstr "" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: py/argcheck.c msgid "Invalid %q" msgstr "" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.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/canio/CAN.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 "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "" @@ -1352,42 +1197,11 @@ msgstr "" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" 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 "" @@ -1396,78 +1210,14 @@ msgstr "" msgid "Invalid memory access." msgstr "" -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" 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 -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.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/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" 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 "" - #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" @@ -1480,23 +1230,6 @@ msgstr "" msgid "Invalid state" 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/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "" @@ -1510,25 +1243,17 @@ msgid "LHS of keyword arg must be an id" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer already in a group." +msgid "Layer already in a group" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." +msgid "Layer must be a Group or TileGrid subclass" msgstr "" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "" - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "" - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "" @@ -1538,10 +1263,6 @@ msgstr "" msgid "Maximum x value when mirrored is %d" msgstr "" -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" @@ -1555,10 +1276,14 @@ msgstr "" msgid "Mismatched swap flag" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1594,11 +1319,6 @@ msgstr "" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" @@ -1659,15 +1379,23 @@ msgid "No I2C device at address: 0x%x" msgstr "" #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1706,16 +1434,6 @@ msgstr "" 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/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "" @@ -1860,10 +1578,13 @@ msgid "Only one address is allowed" msgstr "" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "" @@ -1895,11 +1616,6 @@ msgstr "" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "" @@ -1910,12 +1626,11 @@ msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +"PWM frequency not writable when variable_frequency is False on construction." msgstr "" -#: shared-bindings/pwmio/PWMOut.c -msgid "" -"PWM frequency not writable when variable_frequency is False on construction." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" msgstr "" #: ports/raspberrypi/common-hal/countio/Counter.c @@ -1934,29 +1649,14 @@ msgstr "" msgid "Permission denied" msgstr "" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2025,18 +1725,10 @@ msgstr "" msgid "Program does OUT without loading OSR" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "" - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -2058,8 +1750,9 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" +#: 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 "RS485" msgstr "" #: ports/espressif/common-hal/busio/UART.c @@ -2067,21 +1760,10 @@ msgstr "" msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "" - #: shared-bindings/alarm/time/TimeAlarm.c 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/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 "" @@ -2131,6 +1813,10 @@ msgstr "" msgid "SD card CSD format not supported" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2141,29 +1827,20 @@ msgstr "" 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 "" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" 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" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c @@ -2184,14 +1861,6 @@ msgstr "" msgid "Server side context cannot have hostname" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "" @@ -2227,10 +1896,6 @@ msgstr "" msgid "Splitting with sub-captures" msgstr "" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "" @@ -2316,10 +1981,6 @@ msgstr "" 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 "" @@ -2339,6 +2000,9 @@ msgid "To exit, please reset the board without " msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample" +msgstr "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -2371,23 +2035,20 @@ msgid "Tuple or struct_time argument required" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" +msgid "UART re-init" 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" +msgid "UART write" msgstr "" #: shared-module/usb_hid/Device.c @@ -2524,12 +2185,6 @@ msgid "" "declined or ignored." msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "" @@ -2604,10 +2259,6 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" -msgstr "" - #: main.c msgid "Woken up by alarm.\n" msgstr "" @@ -2760,10 +2411,6 @@ msgstr "" msgid "bits must be 32 or less" msgstr "" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -2801,11 +2448,6 @@ msgstr "" msgid "byteorder is not a string" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/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 "" @@ -2814,7 +2456,7 @@ msgstr "" msgid "bytes value out of range" msgstr "" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "" @@ -2822,12 +2464,9 @@ msgstr "" msgid "calibration is read only" msgstr "" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" +msgid "can only have one parent" msgstr "" #: py/emitinlinethumb.c @@ -2998,6 +2637,10 @@ msgstr "" msgid "casting" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "" @@ -3010,10 +2653,6 @@ msgstr "" 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/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "" @@ -3438,6 +3077,10 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "" @@ -3688,10 +3331,6 @@ msgstr "" msgid "matrix is not positive definite" msgstr "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3699,10 +3338,6 @@ 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 "" - #: extmod/ulab/code/ndarray.c msgid "maximum number of dimensions is 4" msgstr "" @@ -4073,10 +3708,6 @@ msgstr "" msgid "poll on file not available on win32" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" @@ -4123,14 +3754,6 @@ msgstr "" msgid "pull masks conflict with direction masks" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "" @@ -4301,10 +3924,6 @@ msgstr "" 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 "" @@ -4353,10 +3972,6 @@ msgstr "" msgid "threshold must be in the range 0-65536" msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "" @@ -4376,10 +3991,6 @@ msgstr "" msgid "timeout must be < 655.35 secs" 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 "" @@ -4388,6 +3999,10 @@ msgstr "" msgid "timeout waiting for v2 card" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "" @@ -4579,13 +4194,7 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" @@ -4657,6 +4266,15 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "%q must be a tuple of length 2" +#~ msgstr "%q musí být n-tice délky 2" + +#~ msgid "%q must be between %d and %d" +#~ msgstr "%q musí být mezi %d a %d" + +#~ msgid "%q should be an int" +#~ msgstr "%q by měl být int" + #~ msgid "" #~ "\n" #~ "Code stopped by auto-reload.\n" diff --git a/locale/de_DE.po b/locale/de_DE.po index 9051a04d57..73e28062e5 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -74,10 +74,24 @@ msgstr "" "%d Adress-Pins, %d RGB-Pins und %d Kacheln indizieren eine Höhe von %d, " "nicht %d" +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "%q und %q enthalten doppelte Pins" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "%q enthält doppelte Pins" @@ -90,12 +104,7 @@ msgstr "%q Fehler: %d" msgid "%q in use" msgstr "%q in Benutzung" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.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" @@ -103,14 +112,34 @@ msgstr "Der Index %q befindet sich außerhalb des Bereiches" msgid "%q indices must be integers, not %s" msgstr "%q Indizes müssen Integer sein, nicht %s" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "%q Länge muss %d-%d sein" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "%q Länge muss >= 1 sein" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "%q muss %d-%d sein" @@ -127,14 +156,10 @@ msgstr "%q muss <= %d sein" msgid "%q must be >= %d" msgstr "%q muss >= %d sein" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "%q muss >= 0 sein" -#: 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 "%q muss >= 1 sein" @@ -143,14 +168,9 @@ msgstr "%q muss >= 1 sein" msgid "%q must be a string" msgstr "%q muss ein String sein" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "%q muss ein Tupel der Länge 2 sein" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" -msgstr "%q muss zwischen %d und %d sein" +#: py/argcheck.c +msgid "%q must be an int" +msgstr "" #: py/argcheck.c msgid "%q must be of type %q" @@ -168,7 +188,11 @@ msgstr "%q muss eine Potenz von 2 sein" msgid "%q out of bounds" msgstr "%q 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/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q außerhalb des Bereichs" @@ -177,10 +201,6 @@ msgstr "%q außerhalb des Bereichs" msgid "%q pin invalid" msgstr "%q Pin ungültig" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%q sollte ein integer sein" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "%q mit Berichts-ID von 0 muss von Länge 1 sein" @@ -344,10 +364,6 @@ msgstr "'yield from' innerhalb einer async Funktion" msgid "'yield' outside function" msgstr "'yield' außerhalb einer Funktion" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "(x,y) Integer benötigt" - #: py/compile.c msgid "*x must be assignment target" msgstr "*x muss Zuordnungsziel sein" @@ -383,10 +399,6 @@ msgstr "ADC2 wird vom WiFi benutzt" msgid "Address must be %d bytes long" msgstr "Die Adresse muss %d Bytes lang sein" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "Adresstyp außerhalb des zulässigen Bereichs" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "Alle CAN-Schnittstellen sind in Benutzung" @@ -477,25 +489,6 @@ msgstr "Läuft bereits" msgid "Already scanning for wifi networks" msgstr "Sucht bereits nach Wifi-Netzwerken" -#: ports/cxd56/common-hal/analogio/AnalogIn.c -msgid "AnalogIn not supported on given pin" -msgstr "AnalogIn ist an diesem Pin nicht unterstützt" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "AnalogOut-Funktion wird nicht unterstützt" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "AnalogOut kann nur 16 Bit. Der Wert muss unter 65536 liegen." - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "AnalogOut ist an diesem Pin nicht unterstützt" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "Ein anderer PWMAudioOut ist bereits aktiv" @@ -567,11 +560,6 @@ msgstr "Bit clock und word select müssen geordnete Pins sein" msgid "Bit clock and word select must share a clock unit" msgstr "Bit clock und word select müssen eine clock unit teilen" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "Bittiefe muss zwischen 1 und 6 liegen, nicht %d" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "Bit depth muss ein Vielfaches von 8 sein." @@ -613,11 +601,6 @@ msgstr "Buffer + Offset zu klein %d %d %d" msgid "Buffer elements must be 4 bytes long or less" msgstr "Puffer-Elemente müssen 4 Bytes lang oder kürzer sein" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "Der Puffergröße ist inkorrekt. Sie sollte %d bytes haben." - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "Der Buffer ist kein Byte-Array." @@ -627,7 +610,6 @@ msgstr "Der Buffer ist kein Byte-Array." msgid "Buffer is too small" msgstr "Der Puffer ist zu klein" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -642,10 +624,6 @@ msgstr "Die Pufferlänge muss ein vielfaches von 512 sein" msgid "Buffer must be a multiple of 512 bytes" msgstr "Der Puffer muss ein vielfaches von 512 bytes sein" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "Der Puffer muss eine Mindestenslänge von 1 haben" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -667,10 +645,6 @@ msgstr "Bus-Pin %d wird schon benutzt" msgid "Byte buffer must be 16 bytes." msgstr "Der Puffer muss 16 Bytes lang sein." -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "Ein Bytes kann nur Werte zwischen 0 und 255 annehmen." - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "CBC-Blöcke müssen ein Vielfaches von 16 Bytes sein" @@ -687,6 +661,10 @@ msgstr "CRC oder Checksumme ungültig" msgid "Call super().__init__() before accessing native object." msgstr "Rufe super().__init__() vor dem Zugriff auf ein natives Objekt auf." +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "Alarm der RTC IO kann nur im deep sleep ausgeführt werden." @@ -737,18 +715,10 @@ msgid "Cannot have scan responses for extended, connectable advertisements." msgstr "" "Es können keine Scanantworten für erweiterte, verbindbare Anzeigen vorliegen." -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Cannot output both channels on the same pin" -msgstr "Kann nicht beite Kanäle auf dem gleichen Pin ausgeben" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "Kann nicht 'pull' an einem 'input-only' pin." -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "Kann ohne MISO-Pin nicht lesen." - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "Aufnahme in eine Datei nicht möglich" @@ -760,8 +730,8 @@ msgstr "'/' kann nicht wiedereingehängt werden, wenn per USB sichtbar." #: 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 "Reset zum Bootloader nicht möglich, da Bootloader nicht vorhanden." +msgid "Cannot reset into bootloader because no bootloader is present" +msgstr "" #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -781,23 +751,22 @@ msgid "Cannot subclass slice" msgstr "Slice kann keine sub-klasse sein" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." -msgstr "Übertragung ohne MOSI- und MISO-Pins nicht möglich." +msgid "Cannot transfer without MOSI and MISO pins" +msgstr "" #: shared-bindings/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" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge, only level" +msgstr "" + +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge. Only level." msgstr "Kann nicht auf Flanke wecken, nur auf Level." -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." -msgstr "Kann nicht ohne MOSI-Pin schreiben." - #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" msgstr "Schreiben von CharacteristicBuffer ist nicht vorgesehen" @@ -810,10 +779,6 @@ msgstr "Der CircuitPython-Kerncode ist hart abgestürzt. Hoppla!\n" msgid "CircuitPython was unable to allocate the heap." msgstr "CircuitPython war es nicht möglich heap-Speicher zu allozieren." -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "Clock pin init fehlgeschlagen." - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "Clock stretch zu lang" @@ -822,11 +787,6 @@ msgstr "Clock stretch zu lang" msgid "Clock unit in use" msgstr "Clock unit wird benutzt" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -msgid "Command must be an int between 0 and 255" -msgstr "Der Befehl muss ein int zwischen 0 und 255 sein" - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -839,35 +799,6 @@ msgstr "" msgid "Corrupt .mpy file" msgstr "Beschädigte .mpy Datei" -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Could not initialize Camera" -msgstr "Konnte Kamera nicht initialisieren" - -#: ports/cxd56/common-hal/gnss/GNSS.c -msgid "Could not initialize GNSS" -msgstr "GNSS konnte nicht initialisiert werden" - -#: ports/cxd56/common-hal/sdioio/SDCard.c -msgid "Could not initialize SDCard" -msgstr "Konnte SDKarte nicht initialisieren" - -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "Konnte UART nicht initialisieren" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init channel" -msgstr "Kanal konnte nicht neu initiiert werden" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init timer" -msgstr "Timer konnte nicht neu gestartet werden" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not restart PWM" -msgstr "PWM konnte nicht neu gestartet werden" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "Clock konnte nicht ermittelt werden" @@ -888,20 +819,6 @@ msgstr "Interrupt konnte nicht gestartet werden, RX beschäftigt" msgid "Couldn't allocate decoder" msgstr "Decoder konnte nicht zugeordnet werden" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate first buffer" -msgstr "Konnte first buffer nicht zuteilen" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate input buffer" -msgstr "Eingabepuffer konnte nicht zugewiesen werden" - -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate second buffer" -msgstr "Konnte second buffer nicht zuteilen" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "Absturz in den HardFault_Handler." @@ -949,10 +866,6 @@ msgstr "Die Zielkapazität ist kleiner als destination_length." msgid "Device in use" msgstr "Gerät in Benutzung" -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -msgstr "DigitalInOut wird auf dem angegebenen Pin nicht unterstützt" - #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." @@ -1008,11 +921,6 @@ msgstr "Erwartet ein(e) %q" msgid "Expected an alarm" msgstr "Alarm erwartet" -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "Habe ein Tupel der Länge %d erwartet aber %d erhalten" - #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." @@ -1040,22 +948,6 @@ msgstr "Kommando nicht gesendet." msgid "Failed to acquire mutex, err 0x%04x" msgstr "Mutex konnte nicht akquiriert werden. Status: 0x%04x" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -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/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/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/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "Zuweisung des Wifi Speichers ist fehlgeschlagen" @@ -1124,11 +1016,6 @@ msgstr "Für RGB-Farbräume muss die Eingabe-Bitmap 16 Bit pro Pixel haben" msgid "Format not supported" msgstr "Format nicht unterstützt" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" -msgstr "Framepuffer benötigt %d bytes" - #: ports/mimxrt10xx/common-hal/microcontroller/Processor.c msgid "" "Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" @@ -1147,6 +1034,10 @@ msgstr "" msgid "Function requires lock" msgstr "Die Funktion erwartet, dass der 'lock'-Befehl zuvor ausgeführt wurde" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "Generischer Fehler" @@ -1174,17 +1065,13 @@ 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 "Der Hostname muss zwischen 1 und 253 Zeichen haben" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "Lese/Schreibe-operation an geschlossener Datei" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "I2C-Init-Fehler" +msgid "I2C init error" +msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c msgid "I2C peripheral in use" @@ -1297,75 +1184,33 @@ msgstr "Interner Fehler" msgid "Internal error #%d" msgstr "Interner Fehler #%d" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: py/argcheck.c msgid "Invalid %q" msgstr "Ungültiger %q" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c 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/canio/CAN.c -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Invalid %q pin selection" -msgstr "Ungültige %q Pin-Auswahl" - #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "Ungültiger ADC-Einheitenwert" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "Ungültiges AuthMode" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "Ungültiges BLE Parameter" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "Ungültige BMP-Datei" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "Ungültige BSSID" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "Ungültiger DAC-Pin angegeben" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "Ungültige MAC-Adresse" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "Ungültige MIDI Datei" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "Ungültige PWM Frequenz" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "Ungültiger Pin" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "Ungültiges Argument" @@ -1373,42 +1218,11 @@ msgstr "Ungültiges Argument" msgid "Invalid bits per value" msgstr "Ungültige Bits pro Wert" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "Ungültige Puffergröße" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "Ungültige Byteorder-String" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "Ungültiger Aufnahmezeitraum. Gültiger Bereich: 1 - 500" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "Ungültige Anzahl von Kanälen" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "Ungültiger data_count %d" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "Ungültige data_pins[%d]" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "Ungültige Richtung." - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "Ungültige Datei" - #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Ungültige format chunk size" @@ -1417,78 +1231,14 @@ msgstr "Ungültige format chunk size" msgid "Invalid memory access." msgstr "Ungültiger Speicherzugriff." -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "Ungültiger Modus" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "Ungültige Multicast-MAC-Adresse" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "Ungültige Anzahl von Bits" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "Ungültige Phase" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "Ungültiger Pin" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "Ungültiger Pin für linken Kanal" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -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/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/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "Ungültige Pins" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "Ungültige Polarität" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "Ungültige Eigenschaften" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "Ungültiger Ausführungsmodus." - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "Ungültiger security_mode" - #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "Ungültige Größe" @@ -1501,23 +1251,6 @@ msgstr "Ungültiges Socket für TLS" msgid "Invalid state" msgstr "Ungültiger Zustand" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "Ungültige Stimme" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "Ungültige Anzahl von Stimmen" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "Ungültige wave Datei" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "Ungültige Wort- / Bitlänge" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "Der Schlüssel muss 16, 24 oder 32 Byte lang sein" @@ -1531,25 +1264,17 @@ msgid "LHS of keyword arg must be an id" msgstr "LHS des Schlüsselwortarguments muss eine id sein" #: shared-module/displayio/Group.c -msgid "Layer already in a group." -msgstr "Layer ist bereits in einer Gruppe." +msgid "Layer already in a group" +msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." -msgstr "Layer muss eine Group- oder TileGrid-Unterklasse sein." +msgid "Layer must be a Group or TileGrid subclass" +msgstr "" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "MAC Adresse war ungültig" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "MISO pin Initialisierung fehlgeschlagen." - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "MOSI pin Initialisierung fehlgeschlagen." - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "Zuordnung muss ein Tupel sein" @@ -1559,10 +1284,6 @@ msgstr "Zuordnung muss ein Tupel sein" 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 "Meldungen auf 8 Bytes limitiert" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" @@ -1577,10 +1298,14 @@ msgstr "Nicht übereinstimmende Datengröße" msgid "Mismatched swap flag" msgstr "Nicht übereinstimmendes Swap-Flag" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "Fehlender MISO- oder MOSI-Pin" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1616,11 +1341,6 @@ msgstr "Fehlender first_set_pin. Instruktion %d setzt Pin(s)" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "jmp_pin fehlt. Befehl %d springt auf Pin" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "Mehr als %d Berichts-IDs werden nicht unterstützt" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "Muss eine %q Unterklasse sein." @@ -1681,15 +1401,23 @@ msgid "No I2C device at address: 0x%x" msgstr "Kein I2C-Gerät an Adresse: 0x%x" #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "Kein MISO-Pin" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Kein MOSI-Pin" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1728,16 +1456,6 @@ msgstr "Keine freien GCLKs" msgid "No hardware random available" msgstr "Kein hardware random verfügbar" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "Keine Hardwareunterstützung am clk Pin" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "Keine Hardwareunterstützung an diesem Pin" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "Nicht in Programm" @@ -1888,10 +1606,13 @@ msgid "Only one address is allowed" msgstr "Nur eine Adresse ist erlaubt" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "Nur eine alarm-time kann gesetzt werden." @@ -1923,11 +1644,6 @@ msgstr "Keine Sockets mehr verfügbar" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "Out-Buffer-Elemente müssen <= 4 bytes lang sein" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "Ausgabe-Buffer muss mindestens %d Bytes sein" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Oversample muss ein Vielfaches von 8 sein." @@ -1936,16 +1652,15 @@ msgstr "Oversample muss ein Vielfaches von 8 sein." msgid "PDMIn not available" msgstr "PDMIn nicht verfügbar" -#: 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/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." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" +msgstr "" + #: ports/raspberrypi/common-hal/countio/Counter.c msgid "PWM slice already in use" msgstr "PWM-Stück wird bereits verwendet" @@ -1962,29 +1677,14 @@ msgstr "Peripheriegerät wird bereits verwendet" msgid "Permission denied" msgstr "Zugriff verweigert" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "Pin kann nicht aus Deep Sleep aufwachen" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "Pin-Anzahl muss mindestens 1 sein" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "Pin-Anzahl zu gross" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "Pin hat keine ADC-Funktionalität" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2057,18 +1757,10 @@ msgstr "Programm macht IN ohne Laden von ISR" msgid "Program does OUT without loading OSR" msgstr "Programm macht OUT ohne Laden von OSR" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "Programm muss mindestens eine 16-Bit-Instruktion enthalten." - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "Programm-Größe ist ungültig" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "Das Programm ist zu groß" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Pull wird nicht verwendet, wenn die Richtung output ist." @@ -2090,30 +1782,20 @@ msgstr "RNG DeInit-Fehler" msgid "RNG Init Error" msgstr "RNG Init-Fehler" -#: ports/nrf/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" -msgstr "RS485 wird von diesem Gerät nicht unterstützt" +#: 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 "RS485" +msgstr "" #: ports/espressif/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/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/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" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "Eine RTC wird auf diesem Board nicht unterstützt" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/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 Wird von diesem Gerät noch nicht unterstützt" - #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" msgstr "Fehler bei der Erzeugung von Zufallszahlen" @@ -2163,6 +1845,10 @@ msgstr "Sicherheitsmodus aktiv! Gespeicherter Code wird nicht ausgeführt\n" msgid "SD card CSD format not supported" msgstr "SD-Card CSD-Format nicht unterstützt" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2173,30 +1859,21 @@ msgstr "SDIO GetCardInfo-Fehler %d" msgid "SDIO Init Error %d" msgstr "SDIO-Init-Fehler %d" -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "SPI-Init-Fehler" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "SPI-Neuinitialisierungsfehler" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "SPI-Konfiguration fehlgeschlagen" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "SPI-Peripheriegeräte wird bereits verwendet" -#: shared-bindings/audiomixer/Mixer.c -msgid "Sample rate must be positive" -msgstr "Abtastrate muss positiv sein" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" -msgstr "Abtastrate zu hoch. Wert muss unter %d liegen" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" +msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c msgid "Scale dimensions must divide by 3" @@ -2216,14 +1893,6 @@ msgstr "Serializer wird benutzt" msgid "Server side context cannot have hostname" msgstr "Serverseitiger Kontext kann keinen Hostnamen haben" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "Die Anzahl der Pins muss zwischen 1 und 5 liegen" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "Die Anzahl der Pins für Side set muss zwischen 1 und 5 liegen" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "Größe nicht unterstützt" @@ -2259,10 +1928,6 @@ msgstr "Geben Sie genau einen von data0 oder data_pins an" msgid "Splitting with sub-captures" msgstr "Splitting mit sub-captures" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "Die Stackgröße sollte mindestens 256 sein" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "Stereo links muss sich auf PWM-Kanal A befinden" @@ -2360,10 +2025,6 @@ msgstr "Die Kachelhöhe muss die Bitmaphöhe genau teilen" msgid "Tile index out of bounds" msgstr "Kachel index außerhalb der Grenzen" -#: shared-bindings/displayio/TileGrid.c -msgid "Tile value out of bounds" -msgstr "Kachelwert außerhalb der Grenzen" - #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" msgstr "Die Kachelbreite muss die Bitmap-Breite genau teilen" @@ -2384,6 +2045,9 @@ 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 "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Zu viele Kanäle im sample." @@ -2416,24 +2080,21 @@ msgid "Tuple or struct_time argument required" msgstr "Tuple- oder struct_time-Argument erforderlich" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "UART Buffer reservierungs Fehler" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" +msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "UART De-Init-Fehler" +msgid "UART re-init" +msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "UART Init Fehler" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "UART Re-Init-Fehler" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" -msgstr "UART-Schreibfehler" +msgid "UART write" +msgstr "" #: shared-module/usb_hid/Device.c msgid "USB busy" @@ -2573,12 +2234,6 @@ msgstr "" "Nicht näher bezeichnetes Problem. Möglicherweise wurde die Pairing-" "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/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "Baudrate wird nicht unterstützt" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "Nicht unterstützter Farbraum" @@ -2663,10 +2318,6 @@ msgstr "" "\n" "Um die vorhandenen Module anzuzeigen, gebe `help(\"modules\")` ein.\n" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" -msgstr "WiFi Passwort muss zwischen 8 und 63 Zeichen lang sein" - #: main.c msgid "Woken up by alarm.\n" msgstr "Aufgeweckt durch Alarm.\n" @@ -2821,10 +2472,6 @@ msgstr "Bitmap-Größen müssen übereinstimmen" msgid "bits must be 32 or less" msgstr "bits müssen 32 oder kleiner sein" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "bits müssen zwischen 5 und 9 liegen" - #: 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" @@ -2862,11 +2509,6 @@ msgstr "Der Puffer ist zu klein für die angefragten Bytes" msgid "byteorder is not a string" msgstr "Byteorder ist kein String" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -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 "Byte-Länge ist kein vielfaches der Item-Größe" @@ -2875,7 +2517,7 @@ msgstr "Byte-Länge ist kein vielfaches der Item-Größe" msgid "bytes value out of range" msgstr "Byte-Wert außerhalb des Bereichs" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "Kalibrierung ist außerhalb der Reichweite" @@ -2883,13 +2525,10 @@ msgstr "Kalibrierung ist außerhalb der Reichweite" msgid "calibration is read only" msgstr "Kalibrierung ist Schreibgeschützt" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "Kalibrierwert nicht im Bereich von +/-127" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" -msgstr "kann nur bei einem Elternteil registriert werden" +msgid "can only have one parent" +msgstr "" #: py/emitinlinethumb.c msgid "can only have up to 4 parameters to Thumb assembly" @@ -3067,6 +2706,10 @@ msgstr "Kann nicht eindeutig die Größe (sizeof) des Skalars ermitteln" msgid "casting" msgstr "Umwandlung (cast)" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "(char) Zeichenpuffer zu klein" @@ -3079,10 +2722,6 @@ msgstr "chr() arg ist nicht in range(0x110000)" msgid "chr() arg not in range(256)" msgstr "chr() arg ist nicht in range(256)" -#: shared-module/vectorio/Circle.c -msgid "circle can only be registered in one parent" -msgstr "Kreis kann nur in einem Elternteil registriert werden" - #: shared-bindings/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "clip Punkt muss ein (x,y) Tupel sein" @@ -3513,6 +3152,10 @@ 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" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "Ausgangswerte müssen iterierbar sein" @@ -3769,10 +3412,6 @@ msgstr "Mathe-Domain-Fehler" msgid "matrix is not positive definite" msgstr "Matrix ist nicht positiv definitiv" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "max_connections muss zwischen 0 und 10 liegen" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3780,10 +3419,6 @@ msgstr "max_connections muss zwischen 0 und 10 liegen" 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 "max_length muss >= 0 sein" - #: extmod/ulab/code/ndarray.c msgid "maximum number of dimensions is 4" msgstr "die maximale Anzahl der Dimensionen beträgt 4" @@ -4159,10 +3794,6 @@ msgstr "pixel_shader muss displayio.Palette oder displayio.ColorConverter sein" msgid "poll on file not available on win32" msgstr "Abfrage der Datei unter Win32 nicht verfügbar" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "Polygon kann nur in einem übergeordneten Element registriert werden" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop von einem leeren PulseIn" @@ -4209,14 +3840,6 @@ msgstr "Drücken der linken Taste beim Einschalten\n" msgid "pull masks conflict with direction masks" msgstr "Pull-Masken kollidieren mit Richtungsmasken" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "pull_threshold muss zwischen 1 und 32 liegen" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "push_threshold muss zwischen 1 und 32 liegen" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "Warteschlangenüberlauf" @@ -4389,10 +4012,6 @@ msgstr "start_x sollte ein int sein" msgid "step must be non-zero" msgstr "Schritt (step) darf nicht Null sein" -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "stop muss 1 oder 2 sein" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "stop ist von start aus nicht erreichbar" @@ -4442,10 +4061,6 @@ msgstr "Syntaxfehler in uctypes Deskriptor" msgid "threshold must be in the range 0-65536" msgstr "threshold muss im Intervall 0-65536 liegen" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "Kachel muss größer als Null sein" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() nimmt eine 9-Sequenz an" @@ -4465,10 +4080,6 @@ msgstr "Das Zeitlimit muss 0,0-100,0 Sekunden betragen" msgid "timeout must be < 655.35 secs" msgstr "timeout muss kleiner als 655.35 Sekunden sein" -#: shared-bindings/_bleio/CharacteristicBuffer.c -msgid "timeout must be >= 0.0" -msgstr "timeout muss >= 0.0 sein" - #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" msgstr "Zeitlimit beim warten auf v1 Karte" @@ -4477,6 +4088,10 @@ msgstr "Zeitlimit beim warten auf v1 Karte" msgid "timeout waiting for v2 card" msgstr "Zeitlimit beim warten auf v2 Karte" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +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" @@ -4670,13 +4285,7 @@ msgstr "watchdog nicht initialisiert" msgid "watchdog timeout must be greater than 0" msgstr "watchdog Zeitlimit muss größer als 0 sein" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "breite muss zwischen (inklusive) 2 und 8 liegen, nicht %d" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "Breite muss größer als 0 sein" @@ -4748,6 +4357,350 @@ msgstr "zi muss eine Gleitkommazahl sein" msgid "zi must be of shape (n_section, 2)" msgstr "zi muss die Form (n_section, 2) haben" +#~ msgid "%q must be a tuple of length 2" +#~ msgstr "%q muss ein Tupel der Länge 2 sein" + +#~ msgid "%q must be between %d and %d" +#~ msgstr "%q muss zwischen %d und %d sein" + +#~ msgid "%q should be an int" +#~ msgstr "%q sollte ein integer sein" + +#~ msgid "(x,y) integers required" +#~ msgstr "(x,y) Integer benötigt" + +#~ msgid "Address type out of range" +#~ msgstr "Adresstyp außerhalb des zulässigen Bereichs" + +#~ msgid "AnalogIn not supported on given pin" +#~ msgstr "AnalogIn ist an diesem Pin nicht unterstützt" + +#~ msgid "AnalogOut functionality not supported" +#~ msgstr "AnalogOut-Funktion wird nicht unterstützt" + +#~ msgid "AnalogOut is only 16 bits. Value must be less than 65536." +#~ msgstr "AnalogOut kann nur 16 Bit. Der Wert muss unter 65536 liegen." + +#~ msgid "AnalogOut not supported on given pin" +#~ msgstr "AnalogOut ist an diesem Pin nicht unterstützt" + +#, c-format +#~ msgid "Bit depth must be from 1 to 6 inclusive, not %d" +#~ msgstr "Bittiefe muss zwischen 1 und 6 liegen, nicht %d" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "Der Puffergröße ist inkorrekt. Sie sollte %d bytes haben." + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "Der Puffer muss eine Mindestenslänge von 1 haben" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "Ein Bytes kann nur Werte zwischen 0 und 255 annehmen." + +#~ msgid "Cannot output both channels on the same pin" +#~ msgstr "Kann nicht beite Kanäle auf dem gleichen Pin ausgeben" + +#~ msgid "Cannot read without MISO pin." +#~ msgstr "Kann ohne MISO-Pin nicht lesen." + +#~ msgid "Cannot reset into bootloader because no bootloader is present." +#~ msgstr "Reset zum Bootloader nicht möglich, da Bootloader nicht vorhanden." + +#~ msgid "Cannot transfer without MOSI and MISO pins." +#~ msgstr "Übertragung ohne MOSI- und MISO-Pins nicht möglich." + +#~ msgid "Cannot write without MOSI pin." +#~ msgstr "Kann nicht ohne MOSI-Pin schreiben." + +#~ msgid "Clock pin init failed." +#~ msgstr "Clock pin init fehlgeschlagen." + +#~ msgid "Command must be an int between 0 and 255" +#~ msgstr "Der Befehl muss ein int zwischen 0 und 255 sein" + +#~ msgid "Could not initialize Camera" +#~ msgstr "Konnte Kamera nicht initialisieren" + +#~ msgid "Could not initialize GNSS" +#~ msgstr "GNSS konnte nicht initialisiert werden" + +#~ msgid "Could not initialize SDCard" +#~ msgstr "Konnte SDKarte nicht initialisieren" + +#~ msgid "Could not initialize UART" +#~ msgstr "Konnte UART nicht initialisieren" + +#~ msgid "Could not re-init channel" +#~ msgstr "Kanal konnte nicht neu initiiert werden" + +#~ msgid "Could not re-init timer" +#~ msgstr "Timer konnte nicht neu gestartet werden" + +#~ msgid "Could not restart PWM" +#~ msgstr "PWM konnte nicht neu gestartet werden" + +#~ msgid "Couldn't allocate first buffer" +#~ msgstr "Konnte first buffer nicht zuteilen" + +#~ msgid "Couldn't allocate input buffer" +#~ msgstr "Eingabepuffer konnte nicht zugewiesen werden" + +#~ msgid "Couldn't allocate second buffer" +#~ msgstr "Konnte second buffer nicht zuteilen" + +#~ msgid "DigitalInOut not supported on given pin" +#~ msgstr "DigitalInOut wird auf dem angegebenen Pin nicht unterstützt" + +#, c-format +#~ msgid "Expected tuple of length %d, got %d" +#~ msgstr "Habe ein Tupel der Länge %d erwartet aber %d erhalten" + +#~ msgid "Failed to allocate RX buffer" +#~ msgstr "Konnte keinen RX Buffer allozieren" + +#, c-format +#~ msgid "Failed to allocate RX buffer of %d bytes" +#~ msgstr "Konnte keine RX Buffer mit %d allozieren" + +#, c-format +#~ msgid "Framebuffer requires %d bytes" +#~ msgstr "Framepuffer benötigt %d bytes" + +#~ msgid "Hostname must be between 1 and 253 characters" +#~ msgstr "Der Hostname muss zwischen 1 und 253 Zeichen haben" + +#~ msgid "I2C Init Error" +#~ msgstr "I2C-Init-Fehler" + +#~ msgid "Invalid %q pin selection" +#~ msgstr "Ungültige %q Pin-Auswahl" + +#~ msgid "Invalid AuthMode" +#~ msgstr "Ungültiges AuthMode" + +#~ msgid "Invalid BMP file" +#~ msgstr "Ungültige BMP-Datei" + +#~ msgid "Invalid DAC pin supplied" +#~ msgstr "Ungültiger DAC-Pin angegeben" + +#~ msgid "Invalid MIDI file" +#~ msgstr "Ungültige MIDI Datei" + +#~ msgid "Invalid PWM frequency" +#~ msgstr "Ungültige PWM Frequenz" + +#~ msgid "Invalid Pin" +#~ msgstr "Ungültiger Pin" + +#~ msgid "Invalid buffer size" +#~ msgstr "Ungültige Puffergröße" + +#~ msgid "Invalid byteorder string" +#~ msgstr "Ungültige Byteorder-String" + +#~ msgid "Invalid capture period. Valid range: 1 - 500" +#~ msgstr "Ungültiger Aufnahmezeitraum. Gültiger Bereich: 1 - 500" + +#~ msgid "Invalid channel count" +#~ msgstr "Ungültige Anzahl von Kanälen" + +#, c-format +#~ msgid "Invalid data_count %d" +#~ msgstr "Ungültiger data_count %d" + +#~ msgid "Invalid direction." +#~ msgstr "Ungültige Richtung." + +#~ msgid "Invalid file" +#~ msgstr "Ungültige Datei" + +#~ msgid "Invalid mode" +#~ msgstr "Ungültiger Modus" + +#~ msgid "Invalid number of bits" +#~ msgstr "Ungültige Anzahl von Bits" + +#~ msgid "Invalid phase" +#~ msgstr "Ungültige Phase" + +#~ msgid "Invalid pin" +#~ msgstr "Ungültiger Pin" + +#~ msgid "Invalid pin for left channel" +#~ msgstr "Ungültiger Pin für linken Kanal" + +#~ msgid "Invalid pin for right channel" +#~ msgstr "Ungültiger Pin für rechten Kanal" + +#~ msgid "Invalid polarity" +#~ msgstr "Ungültige Polarität" + +#~ msgid "Invalid properties" +#~ msgstr "Ungültige Eigenschaften" + +#~ msgid "Invalid run mode." +#~ msgstr "Ungültiger Ausführungsmodus." + +#~ msgid "Invalid security_mode" +#~ msgstr "Ungültiger security_mode" + +#~ msgid "Invalid voice" +#~ msgstr "Ungültige Stimme" + +#~ msgid "Invalid voice count" +#~ msgstr "Ungültige Anzahl von Stimmen" + +#~ msgid "Invalid wave file" +#~ msgstr "Ungültige wave Datei" + +#~ msgid "Invalid word/bit length" +#~ msgstr "Ungültige Wort- / Bitlänge" + +#~ msgid "Layer already in a group." +#~ msgstr "Layer ist bereits in einer Gruppe." + +#~ msgid "Layer must be a Group or TileGrid subclass." +#~ msgstr "Layer muss eine Group- oder TileGrid-Unterklasse sein." + +#~ msgid "MISO pin init failed." +#~ msgstr "MISO pin Initialisierung fehlgeschlagen." + +#~ msgid "MOSI pin init failed." +#~ msgstr "MOSI pin Initialisierung fehlgeschlagen." + +#~ msgid "Messages limited to 8 bytes" +#~ msgstr "Meldungen auf 8 Bytes limitiert" + +#, c-format +#~ msgid "More than %d report ids not supported" +#~ msgstr "Mehr als %d Berichts-IDs werden nicht unterstützt" + +#~ msgid "No hardware support on clk pin" +#~ msgstr "Keine Hardwareunterstützung am clk Pin" + +#~ msgid "No hardware support on pin" +#~ msgstr "Keine Hardwareunterstützung an diesem Pin" + +#, c-format +#~ msgid "Output buffer must be at least %d bytes" +#~ msgstr "Ausgabe-Buffer muss mindestens %d Bytes sein" + +#~ 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" + +#~ msgid "Pin count must be at least 1" +#~ msgstr "Pin-Anzahl muss mindestens 1 sein" + +#~ msgid "Pin does not have ADC capabilities" +#~ msgstr "Pin hat keine ADC-Funktionalität" + +#~ msgid "Program must contain at least one 16-bit instruction." +#~ msgstr "Programm muss mindestens eine 16-Bit-Instruktion enthalten." + +#~ msgid "Program too large" +#~ msgstr "Das Programm ist zu groß" + +#~ msgid "RS485 Not yet supported on this device" +#~ msgstr "RS485 wird von diesem Gerät nicht unterstützt" + +#~ msgid "RTC calibration is not supported on this board" +#~ msgstr "Die RTC-Kalibrierung wird auf diesem Board nicht unterstützt" + +#~ msgid "RTS/CTS/RS485 Not yet supported on this device" +#~ msgstr "RTS / CTS / RS485 Wird von diesem Gerät noch nicht unterstützt" + +#~ msgid "SPI Init Error" +#~ msgstr "SPI-Init-Fehler" + +#~ msgid "SPI Re-initialization error" +#~ msgstr "SPI-Neuinitialisierungsfehler" + +#~ msgid "Sample rate must be positive" +#~ msgstr "Abtastrate muss positiv sein" + +#, c-format +#~ msgid "Sample rate too high. It must be less than %d" +#~ msgstr "Abtastrate zu hoch. Wert muss unter %d liegen" + +#~ msgid "Set pin count must be between 1 and 5" +#~ msgstr "Die Anzahl der Pins muss zwischen 1 und 5 liegen" + +#~ msgid "Side set pin count must be between 1 and 5" +#~ msgstr "Die Anzahl der Pins für Side set muss zwischen 1 und 5 liegen" + +#~ msgid "Stack size must be at least 256" +#~ msgstr "Die Stackgröße sollte mindestens 256 sein" + +#~ msgid "Tile value out of bounds" +#~ msgstr "Kachelwert außerhalb der Grenzen" + +#~ msgid "UART Buffer allocation error" +#~ msgstr "UART Buffer reservierungs Fehler" + +#~ msgid "UART De-init error" +#~ msgstr "UART De-Init-Fehler" + +#~ msgid "UART Init Error" +#~ msgstr "UART Init Fehler" + +#~ msgid "UART Re-init error" +#~ msgstr "UART Re-Init-Fehler" + +#~ msgid "UART write error" +#~ msgstr "UART-Schreibfehler" + +#~ msgid "Unsupported baudrate" +#~ msgstr "Baudrate wird nicht unterstützt" + +#~ msgid "WiFi password must be between 8 and 63 characters" +#~ msgstr "WiFi Passwort muss zwischen 8 und 63 Zeichen lang sein" + +#~ msgid "bits must be in range 5 to 9" +#~ msgstr "bits müssen zwischen 5 und 9 liegen" + +#~ msgid "bytes > 8 bits not supported" +#~ msgstr "bytes mit mehr als 8 bits werden nicht unterstützt" + +#~ msgid "calibration value out of range +/-127" +#~ msgstr "Kalibrierwert nicht im Bereich von +/-127" + +#~ msgid "can only be registered in one parent" +#~ msgstr "kann nur bei einem Elternteil registriert werden" + +#~ msgid "circle can only be registered in one parent" +#~ msgstr "Kreis kann nur in einem Elternteil registriert werden" + +#~ msgid "max_connections must be between 0 and 10" +#~ msgstr "max_connections muss zwischen 0 und 10 liegen" + +#~ msgid "max_length must be >= 0" +#~ msgstr "max_length muss >= 0 sein" + +#~ msgid "polygon can only be registered in one parent" +#~ msgstr "Polygon kann nur in einem übergeordneten Element registriert werden" + +#~ msgid "pull_threshold must be between 1 and 32" +#~ msgstr "pull_threshold muss zwischen 1 und 32 liegen" + +#~ msgid "push_threshold must be between 1 and 32" +#~ msgstr "push_threshold muss zwischen 1 und 32 liegen" + +#~ msgid "stop must be 1 or 2" +#~ msgstr "stop muss 1 oder 2 sein" + +#~ msgid "tile must be greater than zero" +#~ msgstr "Kachel muss größer als Null sein" + +#~ msgid "timeout must be >= 0.0" +#~ msgstr "timeout muss >= 0.0 sein" + +#, c-format +#~ msgid "width must be from 2 to 8 (inclusive), not %d" +#~ msgstr "breite muss zwischen (inklusive) 2 und 8 liegen, nicht %d" + #~ msgid "Unsupported operation" #~ msgstr "Nicht unterstützte Operation" diff --git a/locale/el.po b/locale/el.po index 2c21d3b972..d4229b5592 100644 --- a/locale/el.po +++ b/locale/el.po @@ -66,10 +66,24 @@ msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "" +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "" @@ -82,12 +96,7 @@ msgstr "" msgid "%q in use" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "" @@ -95,14 +104,34 @@ msgstr "" msgid "%q indices must be integers, not %s" msgstr "" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "" @@ -119,14 +148,10 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.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 "" @@ -135,13 +160,8 @@ msgstr "" msgid "%q must be a string" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" +#: py/argcheck.c +msgid "%q must be an int" msgstr "" #: py/argcheck.c @@ -160,7 +180,11 @@ msgstr "" msgid "%q 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/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "" @@ -169,10 +193,6 @@ msgstr "" msgid "%q pin invalid" msgstr "" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "" @@ -335,10 +355,6 @@ msgstr "" msgid "'yield' outside function" msgstr "" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "" - #: py/compile.c msgid "*x must be assignment target" msgstr "" @@ -374,10 +390,6 @@ msgstr "" msgid "Address must be %d bytes long" msgstr "" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "" @@ -468,25 +480,6 @@ msgstr "" msgid "Already scanning for wifi networks" 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 -#: ports/raspberrypi/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/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "" @@ -556,11 +549,6 @@ msgstr "" msgid "Bit clock and word select must share a clock unit" msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "" @@ -602,11 +590,6 @@ msgstr "" msgid "Buffer elements must be 4 bytes long or less" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "" - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "" @@ -616,7 +599,6 @@ msgstr "" msgid "Buffer is too small" msgstr "" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -631,10 +613,6 @@ msgstr "" msgid "Buffer must be a multiple of 512 bytes" msgstr "" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -656,10 +634,6 @@ msgstr "" msgid "Byte buffer must be 16 bytes." msgstr "" -#: shared-bindings/alarm/SleepMemory.c 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 "" @@ -676,6 +650,10 @@ msgstr "" msgid "Call super().__init__() before accessing native object." msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" @@ -723,18 +701,10 @@ msgstr "" 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 "" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only 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 "" @@ -746,7 +716,7 @@ 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." +msgid "Cannot reset into bootloader because no bootloader is present" msgstr "" #: ports/espressif/common-hal/socketpool/Socket.c @@ -767,20 +737,19 @@ msgid "Cannot subclass slice" msgstr "" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." +msgid "Cannot transfer without MOSI and MISO pins" msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c -msgid "Cannot wake on pin edge. Only level." +msgid "Cannot wake on pin edge, only level" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge. Only level." msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -795,10 +764,6 @@ msgstr "" msgid "CircuitPython was unable to allocate the heap." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "" - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "" @@ -807,11 +772,6 @@ msgstr "" msgid "Clock unit in use" msgstr "" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/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 " @@ -822,35 +782,6 @@ msgstr "" msgid "Corrupt .mpy file" 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 "" - -#: 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 -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -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 "" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "" @@ -871,20 +802,6 @@ msgstr "" 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 "" @@ -932,10 +849,6 @@ msgstr "" 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." @@ -991,11 +904,6 @@ msgstr "" msgid "Expected an alarm" msgstr "" -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "" - #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." @@ -1022,22 +930,6 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/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/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/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/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "" @@ -1106,11 +998,6 @@ msgstr "" msgid "Format not supported" msgstr "" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" -msgstr "" - #: ports/mimxrt10xx/common-hal/microcontroller/Processor.c msgid "" "Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" @@ -1125,6 +1012,10 @@ msgstr "" msgid "Function requires lock" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1152,16 +1043,12 @@ 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 "" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" +msgid "I2C init error" msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c @@ -1269,75 +1156,33 @@ msgstr "" msgid "Internal error #%d" msgstr "" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: py/argcheck.c msgid "Invalid %q" msgstr "" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.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/canio/CAN.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 "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "" @@ -1345,42 +1190,11 @@ msgstr "" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" 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 "" @@ -1389,78 +1203,14 @@ msgstr "" msgid "Invalid memory access." msgstr "" -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" 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 -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.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/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" 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 "" - #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" @@ -1473,23 +1223,6 @@ msgstr "" msgid "Invalid state" 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/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "" @@ -1503,25 +1236,17 @@ msgid "LHS of keyword arg must be an id" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer already in a group." +msgid "Layer already in a group" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." +msgid "Layer must be a Group or TileGrid subclass" msgstr "" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "" - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "" - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "" @@ -1531,10 +1256,6 @@ msgstr "" msgid "Maximum x value when mirrored is %d" msgstr "" -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" @@ -1548,10 +1269,14 @@ msgstr "" msgid "Mismatched swap flag" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1587,11 +1312,6 @@ msgstr "" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" @@ -1652,15 +1372,23 @@ msgid "No I2C device at address: 0x%x" msgstr "" #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1699,16 +1427,6 @@ msgstr "" 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/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "" @@ -1853,10 +1571,13 @@ msgid "Only one address is allowed" msgstr "" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "" @@ -1888,11 +1609,6 @@ msgstr "" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "" @@ -1903,12 +1619,11 @@ msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +"PWM frequency not writable when variable_frequency is False on construction." msgstr "" -#: shared-bindings/pwmio/PWMOut.c -msgid "" -"PWM frequency not writable when variable_frequency is False on construction." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" msgstr "" #: ports/raspberrypi/common-hal/countio/Counter.c @@ -1927,29 +1642,14 @@ msgstr "" msgid "Permission denied" msgstr "" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2016,18 +1716,10 @@ msgstr "" msgid "Program does OUT without loading OSR" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "" - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -2049,8 +1741,9 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" +#: 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 "RS485" msgstr "" #: ports/espressif/common-hal/busio/UART.c @@ -2058,21 +1751,10 @@ msgstr "" msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "" - #: shared-bindings/alarm/time/TimeAlarm.c 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/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 "" @@ -2122,6 +1804,10 @@ msgstr "" msgid "SD card CSD format not supported" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2132,29 +1818,20 @@ msgstr "" 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 "" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" 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" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c @@ -2175,14 +1852,6 @@ msgstr "" msgid "Server side context cannot have hostname" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "" @@ -2218,10 +1887,6 @@ msgstr "" msgid "Splitting with sub-captures" msgstr "" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "" @@ -2307,10 +1972,6 @@ msgstr "" 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 "" @@ -2330,6 +1991,9 @@ msgid "To exit, please reset the board without " msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample" +msgstr "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -2362,23 +2026,20 @@ msgid "Tuple or struct_time argument required" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" +msgid "UART re-init" 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" +msgid "UART write" msgstr "" #: shared-module/usb_hid/Device.c @@ -2515,12 +2176,6 @@ msgid "" "declined or ignored." msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "" @@ -2595,10 +2250,6 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" -msgstr "" - #: main.c msgid "Woken up by alarm.\n" msgstr "" @@ -2751,10 +2402,6 @@ msgstr "" msgid "bits must be 32 or less" msgstr "" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -2792,11 +2439,6 @@ msgstr "" msgid "byteorder is not a string" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/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 "" @@ -2805,7 +2447,7 @@ msgstr "" msgid "bytes value out of range" msgstr "" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "" @@ -2813,12 +2455,9 @@ msgstr "" msgid "calibration is read only" msgstr "" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" +msgid "can only have one parent" msgstr "" #: py/emitinlinethumb.c @@ -2989,6 +2628,10 @@ msgstr "" msgid "casting" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "" @@ -3001,10 +2644,6 @@ msgstr "" 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/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "" @@ -3429,6 +3068,10 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "" @@ -3679,10 +3322,6 @@ msgstr "" msgid "matrix is not positive definite" msgstr "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3690,10 +3329,6 @@ 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 "" - #: extmod/ulab/code/ndarray.c msgid "maximum number of dimensions is 4" msgstr "" @@ -4064,10 +3699,6 @@ msgstr "" msgid "poll on file not available on win32" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" @@ -4114,14 +3745,6 @@ msgstr "" msgid "pull masks conflict with direction masks" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "" @@ -4292,10 +3915,6 @@ msgstr "" 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 "" @@ -4344,10 +3963,6 @@ msgstr "" msgid "threshold must be in the range 0-65536" msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "" @@ -4367,10 +3982,6 @@ msgstr "" msgid "timeout must be < 655.35 secs" 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 "" @@ -4379,6 +3990,10 @@ msgstr "" msgid "timeout waiting for v2 card" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "" @@ -4570,13 +4185,7 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" diff --git a/locale/en_GB.po b/locale/en_GB.po index 399fbfd5e7..21480626d3 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -73,10 +73,24 @@ msgid "" msgstr "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "%q and %q contain duplicate pins" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "%q contains duplicate pins" @@ -89,12 +103,7 @@ msgstr "%q failure: %d" msgid "%q in use" msgstr "%q in use" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "%q index out of range" @@ -102,14 +111,34 @@ msgstr "%q index out of range" msgid "%q indices must be integers, not %s" msgstr "%q indices must be integers, not %s" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "%q length must be %d-%d" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "%q length must be >= 1" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "%q must be %d-%d" @@ -126,14 +155,10 @@ msgstr "" msgid "%q must be >= %d" msgstr "%q must be >= %d" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "%q must be >= 0" -#: 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 "%q must be >= 1" @@ -142,14 +167,9 @@ msgstr "%q must be >= 1" msgid "%q must be a string" msgstr "%q must be a string" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "%q must be a tuple of length 2" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" -msgstr "%q must be between %d and %d" +#: py/argcheck.c +msgid "%q must be an int" +msgstr "" #: py/argcheck.c msgid "%q must be of type %q" @@ -167,7 +187,11 @@ msgstr "%q must be power of 2" msgid "%q 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/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q out of range" @@ -176,10 +200,6 @@ msgstr "%q out of range" msgid "%q pin invalid" msgstr "%q pin invalid" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%q should be an int" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "" @@ -342,10 +362,6 @@ msgstr "'yield from' inside async function" msgid "'yield' outside function" msgstr "'yield' outside function" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "(x,y) integers required" - #: py/compile.c msgid "*x must be assignment target" msgstr "*x must be assignment target" @@ -381,10 +397,6 @@ msgstr "ADC2 is being used by WiFi" msgid "Address must be %d bytes long" msgstr "Address must be %d bytes long" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "Address type out of range" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "All CAN peripherals are in use" @@ -475,25 +487,6 @@ msgstr "Already running" msgid "Already scanning for wifi networks" msgstr "Already scanning for WiFi networks" -#: ports/cxd56/common-hal/analogio/AnalogIn.c -msgid "AnalogIn not supported on given pin" -msgstr "AnalogIn not supported on given pin" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "AnalogOut functionality not supported" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "AnalogOut is only 16 bits. Value must be less than 65536." - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "AnalogOut not supported on given pin" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "Another PWMAudioOut is already active" @@ -565,11 +558,6 @@ msgstr "Bit clock and word select must be sequential pins" msgid "Bit clock and word select must share a clock unit" msgstr "Bit clock and word select must share a clock unit" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "Bit depth must be from 1 to 6 inclusive, not %d" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "Bit depth must be multiple of 8." @@ -611,11 +599,6 @@ msgstr "Buffer + offset too small %d %d %d" msgid "Buffer elements must be 4 bytes long or less" msgstr "Buffer elements must be 4 bytes long or less" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "Buffer incorrect size. Should be %d bytes." - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "Buffer is not a bytearray." @@ -625,7 +608,6 @@ msgstr "Buffer is not a bytearray." msgid "Buffer is too small" msgstr "Buffer is too small" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -640,10 +622,6 @@ msgstr "Buffer length must be a multiple of 512" msgid "Buffer must be a multiple of 512 bytes" msgstr "Buffer must be a multiple of 512 bytes" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "Buffer must be at least length 1" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -665,10 +643,6 @@ msgstr "Bus pin %d is already in use" msgid "Byte buffer must be 16 bytes." msgstr "Byte buffer must be 16 bytes." -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "Bytes must be between 0 and 255." - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "CBC blocks must be multiples of 16 bytes" @@ -685,6 +659,10 @@ msgstr "CRC or checksum was invalid" msgid "Call super().__init__() before accessing native object." msgstr "Call super().__init__() before accessing native object." +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "Can only alarm on RTC IO from deep sleep." @@ -732,18 +710,10 @@ msgstr "Cannot get temperature" msgid "Cannot have scan responses for extended, connectable advertisements." msgstr "Cannot have scan responses for extended, connectable advertisements." -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Cannot output both channels on the same pin" -msgstr "Cannot output both channels on the same pin" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "Cannot pull on input-only pin." -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "Cannot read without MISO pin." - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "Cannot record to a file" @@ -755,8 +725,8 @@ msgstr "Cannot remount '/' when visible via 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 "Cannot reset into bootloader because no bootloader is present." +msgid "Cannot reset into bootloader because no bootloader is present" +msgstr "" #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -776,22 +746,21 @@ msgid "Cannot subclass slice" msgstr "Cannot subclass slice" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." -msgstr "Cannot transfer without MOSI and MISO pins." +msgid "Cannot transfer without MOSI and MISO pins" +msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "Cannot vary frequency on a timer that is already in use" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge, only level" +msgstr "" + +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge. Only level." msgstr "Cannot wake on pin edge. Only level." -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." -msgstr "Cannot write without MOSI pin." - #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" msgstr "CharacteristicBuffer writing not provided" @@ -804,10 +773,6 @@ msgstr "CircuitPython core code crashed hard. Crikey!\n" msgid "CircuitPython was unable to allocate the heap." msgstr "CircuitPython was unable to allocate the heap." -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "Clock pin init failed." - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "Clock stretch too long" @@ -816,11 +781,6 @@ msgstr "Clock stretch too long" msgid "Clock unit in use" msgstr "Clock unit in use" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -msgid "Command must be an int between 0 and 255" -msgstr "Command must be an int between 0 and 255" - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -833,35 +793,6 @@ msgstr "" msgid "Corrupt .mpy file" msgstr "Corrupt .mpy file" -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Could not initialize Camera" -msgstr "Could not initialise camera" - -#: ports/cxd56/common-hal/gnss/GNSS.c -msgid "Could not initialize GNSS" -msgstr "Could not initialise GNSS" - -#: ports/cxd56/common-hal/sdioio/SDCard.c -msgid "Could not initialize SDCard" -msgstr "Could not initialise SDCard" - -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "Could not initialise UART" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init channel" -msgstr "Could not reinit channel" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init timer" -msgstr "Could not reinit timer" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not restart PWM" -msgstr "Could not restart PWM" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "Could not retrieve clock" @@ -882,20 +813,6 @@ msgstr "Could not start interrupt, RX busy" msgid "Couldn't allocate decoder" msgstr "Couldn't allocate decoder" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate first buffer" -msgstr "Couldn't allocate first buffer" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate input buffer" -msgstr "Couldn't allocate input buffer" - -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate second buffer" -msgstr "Couldn't allocate second buffer" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "Crash into the HardFault_Handler." @@ -943,10 +860,6 @@ msgstr "Destination capacity is smaller than destination_length." msgid "Device in use" msgstr "Device in use" -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -msgstr "DigitalInOut not supported on given pin" - #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." @@ -1002,11 +915,6 @@ msgstr "Expected a %q" msgid "Expected an alarm" msgstr "Expected an alarm" -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "Expected tuple of length %d, got %d" - #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." @@ -1033,22 +941,6 @@ msgstr "Failed sending command." msgid "Failed to acquire mutex, err 0x%04x" msgstr "Failed to acquire mutex, err 0x%04x" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -msgstr "Failed to allocate 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/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -#, c-format -msgid "Failed to allocate RX buffer of %d bytes" -msgstr "Failed to allocate RX buffer of %d bytes" - #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "Failed to allocate WiFi memory" @@ -1117,11 +1009,6 @@ msgstr "" msgid "Format not supported" msgstr "Format not supported" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" -msgstr "Framebuffer requires %d bytes" - #: ports/mimxrt10xx/common-hal/microcontroller/Processor.c msgid "" "Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" @@ -1136,6 +1023,10 @@ msgstr "Frequency must match existing PWMOut using this timer" msgid "Function requires lock" msgstr "Function requires lock" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "Generic Failure" @@ -1163,17 +1054,13 @@ msgstr "Hardware busy, try alternative pins" msgid "Hardware in use, try alternative pins" msgstr "Hardware in use, try alternative pins" -#: shared-bindings/wifi/Radio.c -msgid "Hostname must be between 1 and 253 characters" -msgstr "Hostname must be between 1 and 253 characters" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "I/O operation on closed file" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "I2C init error" +msgid "I2C init error" +msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c msgid "I2C peripheral in use" @@ -1282,75 +1169,33 @@ msgstr "" msgid "Internal error #%d" msgstr "Internal error #%d" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: py/argcheck.c msgid "Invalid %q" msgstr "Invalid %q" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c msgid "Invalid %q pin" msgstr "Invalid %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 -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Invalid %q pin selection" -msgstr "Invalid %q pin selection" - #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "Invalid ADC unit value" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "Invalid AuthMode" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "Invalid BLE parameter" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "Invalid BMP file" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "Invalid BSSID" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "Invalid DAC pin supplied" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "Invalid MIDI file" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "Invalid PWM frequency" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "Invalid pin" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "Invalid argument" @@ -1358,42 +1203,11 @@ msgstr "Invalid argument" msgid "Invalid bits per value" msgstr "Invalid bits per value" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "Invalid buffer size" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "Invalid byteorder string" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "Invalid capture period. Valid range: 1 - 500" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "Invalid channel count" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "Invalid data_count %d" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "Invalid data_pins[%d]" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "Invalid direction." - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "Invalid file" - #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Invalid format chunk size" @@ -1402,78 +1216,14 @@ msgstr "Invalid format chunk size" msgid "Invalid memory access." msgstr "Invalid memory access." -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "Invalid number of bits" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "Invalid phase" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "Invalid pin" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "Invalid pin for left channel" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -msgstr "Invalid pin for right 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/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/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "Invalid pins" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "Invalid polarity" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "Invalid properties" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "Invalid run mode." - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "Invalid security_mode" - #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "Invalid size" @@ -1486,23 +1236,6 @@ msgstr "Invalid socket for TLS" msgid "Invalid state" msgstr "Invalid state" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "Invalid voice" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "Invalid voice count" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "Invalid wave file" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "Invalid word/bit length" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "Key must be 16, 24, or 32 bytes long" @@ -1516,25 +1249,17 @@ msgid "LHS of keyword arg must be an id" msgstr "LHS of keyword arg must be an id" #: shared-module/displayio/Group.c -msgid "Layer already in a group." -msgstr "Layer already in a group." +msgid "Layer already in a group" +msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." -msgstr "Layer must be a Group or TileGrid subclass." +msgid "Layer must be a Group or TileGrid subclass" +msgstr "" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "MAC address was invalid" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "MISO pin init failed." - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "MOSI pin init failed." - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "" @@ -1544,10 +1269,6 @@ msgstr "" msgid "Maximum x value when mirrored is %d" msgstr "Maximum x value when mirrored is %d" -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "Messages limited to 8 bytes" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Microphone startup delay must be in range 0.0 to 1.0" @@ -1561,10 +1282,14 @@ msgstr "" msgid "Mismatched swap flag" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "Missing MISO or MOSI pin" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1600,11 +1325,6 @@ msgstr "Missing first_set_pin. Instruction %d sets pin(s)" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "Missing jmp_pin. Instruction %d jumps on pin" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "More than %d report ids not supported" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "Must be a %q subclass." @@ -1665,15 +1385,23 @@ msgid "No I2C device at address: 0x%x" msgstr "" #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "No MISO pin" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "No MOSI pin" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1712,16 +1440,6 @@ msgstr "No free GCLKs" msgid "No hardware random available" msgstr "No hardware random available" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "No hardware support on clk pin" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "No hardware support on pin" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "No in in program" @@ -1870,10 +1588,13 @@ msgid "Only one address is allowed" msgstr "" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "Only one alarm.time alarm can be set." @@ -1905,11 +1626,6 @@ msgstr "Out of sockets" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "Out-buffer elements must be <= 4 bytes long" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "Output buffer must be at least %d bytes" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Oversample must be multiple of 8." @@ -1920,15 +1636,13 @@ msgstr "PDMIn not available" #: shared-bindings/pwmio/PWMOut.c msgid "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +"PWM frequency not writable when variable_frequency is False on construction." msgstr "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +"PWM frequency not writable when variable_frequency is False on construction." -#: shared-bindings/pwmio/PWMOut.c -msgid "" -"PWM frequency not writable when variable_frequency is False on construction." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" msgstr "" -"PWM frequency not writable when variable_frequency is False on construction." #: ports/raspberrypi/common-hal/countio/Counter.c msgid "PWM slice already in use" @@ -1946,29 +1660,14 @@ msgstr "Peripheral in use" msgid "Permission denied" msgstr "Permission denied" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "Pin cannot wake from Deep Sleep" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "Pin count must be at least 1" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "Pin count too large" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "Pin does not have ADC capabilities" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2038,18 +1737,10 @@ msgstr "Program does IN without loading ISR" msgid "Program does OUT without loading OSR" msgstr "Program does OUT without loading OSR" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "Program must contain at least one 16-bit instruction." - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "Program size invalid" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "Program too large" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Pull not used when direction is output." @@ -2071,30 +1762,20 @@ msgstr "RNG deinit Error" msgid "RNG Init Error" msgstr "RNG init Error" -#: ports/nrf/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" -msgstr "RS485 not yet supported on this device" +#: 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 "RS485" +msgstr "" #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "RS485 inversion specified when not in RS485 mode" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "RTC calibration is not supported on this board" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "RTC is not supported on this board" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/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 not yet supported on this device" - #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" msgstr "Random number generation error" @@ -2144,6 +1825,10 @@ msgstr "Running in safe mode! Not running saved code.\n" msgid "SD card CSD format not supported" msgstr "SD card CSD format not supported" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2154,30 +1839,21 @@ msgstr "SDIO GetCardInfo error %d" msgid "SDIO Init Error %d" msgstr "SDIO init error %d" -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "SPI init error" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "SPI reinitialisation error" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "SPI configuration failed" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "SPI peripheral in use" -#: shared-bindings/audiomixer/Mixer.c -msgid "Sample rate must be positive" -msgstr "Sample rate must be positive" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" -msgstr "Sample rate too high. It must be less than %d" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" +msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c msgid "Scale dimensions must divide by 3" @@ -2197,14 +1873,6 @@ msgstr "Serialiser in use" msgid "Server side context cannot have hostname" msgstr "Server side context cannot have hostname" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "Set pin count must be between 1 and 5" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "Side set pin count must be between 1 and 5" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "Size not supported" @@ -2240,10 +1908,6 @@ msgstr "" msgid "Splitting with sub-captures" msgstr "Splitting with sub-captures" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "Stack size must be at least 256" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "Stereo left must be on PWM channel A" @@ -2336,10 +2000,6 @@ msgstr "Tile height must exactly divide bitmap height" msgid "Tile index out of bounds" msgstr "Tile index out of bounds" -#: shared-bindings/displayio/TileGrid.c -msgid "Tile value out of bounds" -msgstr "Tile value out of bounds" - #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" msgstr "Tile width must exactly divide bitmap width" @@ -2359,6 +2019,9 @@ msgid "To exit, please reset the board without " msgstr "To exit, please reset the board without " #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample" +msgstr "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Too many channels in sample." @@ -2391,24 +2054,21 @@ msgid "Tuple or struct_time argument required" msgstr "Tuple or struct_time argument required" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "UART buffer allocation error" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" +msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "UART deinit error" +msgid "UART re-init" +msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "UART init Error" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "UART reinit error" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" -msgstr "UART write error" +msgid "UART write" +msgstr "" #: shared-module/usb_hid/Device.c msgid "USB busy" @@ -2546,12 +2206,6 @@ msgstr "" "Unspecified issue. Can be that the pairing prompt on the other device was " "declined or ignored." -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "Unsupported baudrate" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "" @@ -2626,10 +2280,6 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" -msgstr "WiFi password must be between 8 and 63 characters" - #: main.c msgid "Woken up by alarm.\n" msgstr "Woken up by alarm.\n" @@ -2783,10 +2433,6 @@ msgstr "" msgid "bits must be 32 or less" msgstr "bits must be 32 or less" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "bits must be in range 5 to 9" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample must be 8 or 16" @@ -2824,11 +2470,6 @@ msgstr "Buffer too small for requested bytes" msgid "byteorder is not a string" msgstr "Byteorder is not a string" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "bytes > 8 bits not supported" -msgstr "Bytes > 8 bits not supported" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "Bytes length not a multiple of item size" @@ -2837,7 +2478,7 @@ msgstr "Bytes length not a multiple of item size" msgid "bytes value out of range" msgstr "Bytes value out of range" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "Calibration is out of range" @@ -2845,12 +2486,9 @@ msgstr "Calibration is out of range" msgid "calibration is read only" msgstr "Calibration is read only" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "Calibration value out of range +/-127" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" +msgid "can only have one parent" msgstr "" #: py/emitinlinethumb.c @@ -3023,6 +2661,10 @@ msgstr "cannot unambiguously get sizeof scalar" msgid "casting" msgstr "casting" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "chars buffer too small" @@ -3035,10 +2677,6 @@ msgstr "chr() arg not in range(0x110000)" msgid "chr() arg not in range(256)" msgstr "chr() arg not in range(256)" -#: shared-module/vectorio/Circle.c -msgid "circle can only be registered in one parent" -msgstr "circle can only be registered in one parent" - #: shared-bindings/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "clip point must be (x,y) tuple" @@ -3464,6 +3102,10 @@ msgstr "indices must be integers" msgid "indices must be integers, slices, or Boolean lists" msgstr "indices must be integers, slices, or Boolean lists" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "initial values must be iterable" @@ -3714,10 +3356,6 @@ msgstr "math domain error" msgid "matrix is not positive definite" msgstr "matrix is not positive definite" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3725,10 +3363,6 @@ msgstr "" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "max_length must be 0-%d when fixed_length is %s" -#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c -msgid "max_length must be >= 0" -msgstr "max_length must be >= 0" - #: extmod/ulab/code/ndarray.c msgid "maximum number of dimensions is 4" msgstr "maximum number of dimensions is 4" @@ -4099,10 +3733,6 @@ msgstr "pixel_shader must be displayio.Palette or displayio.ColorConverter" msgid "poll on file not available on win32" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "polygon can only be registered in one parent" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop from an empty PulseIn" @@ -4149,14 +3779,6 @@ msgstr "pressing the left button at start up\n" msgid "pull masks conflict with direction masks" msgstr "pull masks conflict with direction masks" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "pull_threshold must be between 1 and 32" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "push_threshold must be between 1 and 32" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "queue overflow" @@ -4329,10 +3951,6 @@ msgstr "start_x should be an int" msgid "step must be non-zero" msgstr "step must be non-zero" -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "stop must be 1 or 2" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "stop not reachable from start" @@ -4381,10 +3999,6 @@ msgstr "syntax error in uctypes descriptor" msgid "threshold must be in the range 0-65536" msgstr "threshold must be in the range 0-65536" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "tile must be greater than zero" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() takes a 9-sequence" @@ -4404,10 +4018,6 @@ msgstr "timeout must be 0.0-100.0 seconds" msgid "timeout must be < 655.35 secs" msgstr "timeout must be < 655.35 secs" -#: shared-bindings/_bleio/CharacteristicBuffer.c -msgid "timeout must be >= 0.0" -msgstr "timeout must be >= 0.0" - #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" msgstr "timeout waiting for v1 card" @@ -4416,6 +4026,10 @@ msgstr "timeout waiting for v1 card" msgid "timeout waiting for v2 card" msgstr "timeout waiting for v2 card" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "timestamp out of range for platform time_t" @@ -4607,13 +4221,7 @@ msgstr "WatchDog not initialised" msgid "watchdog timeout must be greater than 0" msgstr "WatchDog timeout must be greater than 0" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "width must be from 2 to 8 (inclusive), not %d" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "width must be greater than zero" @@ -4685,6 +4293,342 @@ msgstr "zi must be of float type" msgid "zi must be of shape (n_section, 2)" msgstr "zi must be of shape (n_section, 2)" +#~ msgid "%q must be a tuple of length 2" +#~ msgstr "%q must be a tuple of length 2" + +#~ msgid "%q must be between %d and %d" +#~ msgstr "%q must be between %d and %d" + +#~ msgid "%q should be an int" +#~ msgstr "%q should be an int" + +#~ msgid "(x,y) integers required" +#~ msgstr "(x,y) integers required" + +#~ msgid "Address type out of range" +#~ msgstr "Address type out of range" + +#~ msgid "AnalogIn not supported on given pin" +#~ msgstr "AnalogIn not supported on given pin" + +#~ msgid "AnalogOut functionality not supported" +#~ msgstr "AnalogOut functionality not supported" + +#~ msgid "AnalogOut is only 16 bits. Value must be less than 65536." +#~ msgstr "AnalogOut is only 16 bits. Value must be less than 65536." + +#~ msgid "AnalogOut not supported on given pin" +#~ msgstr "AnalogOut not supported on given pin" + +#, c-format +#~ msgid "Bit depth must be from 1 to 6 inclusive, not %d" +#~ msgstr "Bit depth must be from 1 to 6 inclusive, not %d" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "Buffer incorrect size. Should be %d bytes." + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "Buffer must be at least length 1" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "Bytes must be between 0 and 255." + +#~ msgid "Cannot output both channels on the same pin" +#~ msgstr "Cannot output both channels on the same pin" + +#~ msgid "Cannot read without MISO pin." +#~ msgstr "Cannot read without MISO pin." + +#~ msgid "Cannot reset into bootloader because no bootloader is present." +#~ msgstr "Cannot reset into bootloader because no bootloader is present." + +#~ msgid "Cannot transfer without MOSI and MISO pins." +#~ msgstr "Cannot transfer without MOSI and MISO pins." + +#~ msgid "Cannot write without MOSI pin." +#~ msgstr "Cannot write without MOSI pin." + +#~ msgid "Clock pin init failed." +#~ msgstr "Clock pin init failed." + +#~ msgid "Command must be an int between 0 and 255" +#~ msgstr "Command must be an int between 0 and 255" + +#~ msgid "Could not initialize Camera" +#~ msgstr "Could not initialise camera" + +#~ msgid "Could not initialize GNSS" +#~ msgstr "Could not initialise GNSS" + +#~ msgid "Could not initialize SDCard" +#~ msgstr "Could not initialise SDCard" + +#~ msgid "Could not initialize UART" +#~ msgstr "Could not initialise UART" + +#~ msgid "Could not re-init channel" +#~ msgstr "Could not reinit channel" + +#~ msgid "Could not re-init timer" +#~ msgstr "Could not reinit timer" + +#~ msgid "Could not restart PWM" +#~ msgstr "Could not restart PWM" + +#~ msgid "Couldn't allocate first buffer" +#~ msgstr "Couldn't allocate first buffer" + +#~ msgid "Couldn't allocate input buffer" +#~ msgstr "Couldn't allocate input buffer" + +#~ msgid "Couldn't allocate second buffer" +#~ msgstr "Couldn't allocate second buffer" + +#~ msgid "DigitalInOut not supported on given pin" +#~ msgstr "DigitalInOut not supported on given pin" + +#, c-format +#~ msgid "Expected tuple of length %d, got %d" +#~ msgstr "Expected tuple of length %d, got %d" + +#~ msgid "Failed to allocate RX buffer" +#~ msgstr "Failed to allocate RX buffer" + +#, c-format +#~ msgid "Failed to allocate RX buffer of %d bytes" +#~ msgstr "Failed to allocate RX buffer of %d bytes" + +#, c-format +#~ msgid "Framebuffer requires %d bytes" +#~ msgstr "Framebuffer requires %d bytes" + +#~ msgid "Hostname must be between 1 and 253 characters" +#~ msgstr "Hostname must be between 1 and 253 characters" + +#~ msgid "I2C Init Error" +#~ msgstr "I2C init error" + +#~ msgid "Invalid %q pin selection" +#~ msgstr "Invalid %q pin selection" + +#~ msgid "Invalid AuthMode" +#~ msgstr "Invalid AuthMode" + +#~ msgid "Invalid BMP file" +#~ msgstr "Invalid BMP file" + +#~ msgid "Invalid DAC pin supplied" +#~ msgstr "Invalid DAC pin supplied" + +#~ msgid "Invalid MIDI file" +#~ msgstr "Invalid MIDI file" + +#~ msgid "Invalid PWM frequency" +#~ msgstr "Invalid PWM frequency" + +#~ msgid "Invalid Pin" +#~ msgstr "Invalid pin" + +#~ msgid "Invalid buffer size" +#~ msgstr "Invalid buffer size" + +#~ msgid "Invalid byteorder string" +#~ msgstr "Invalid byteorder string" + +#~ msgid "Invalid capture period. Valid range: 1 - 500" +#~ msgstr "Invalid capture period. Valid range: 1 - 500" + +#~ msgid "Invalid channel count" +#~ msgstr "Invalid channel count" + +#, c-format +#~ msgid "Invalid data_count %d" +#~ msgstr "Invalid data_count %d" + +#~ msgid "Invalid direction." +#~ msgstr "Invalid direction." + +#~ msgid "Invalid file" +#~ msgstr "Invalid file" + +#~ msgid "Invalid number of bits" +#~ msgstr "Invalid number of bits" + +#~ msgid "Invalid phase" +#~ msgstr "Invalid phase" + +#~ msgid "Invalid pin" +#~ msgstr "Invalid pin" + +#~ msgid "Invalid pin for left channel" +#~ msgstr "Invalid pin for left channel" + +#~ msgid "Invalid pin for right channel" +#~ msgstr "Invalid pin for right channel" + +#~ msgid "Invalid polarity" +#~ msgstr "Invalid polarity" + +#~ msgid "Invalid properties" +#~ msgstr "Invalid properties" + +#~ msgid "Invalid run mode." +#~ msgstr "Invalid run mode." + +#~ msgid "Invalid security_mode" +#~ msgstr "Invalid security_mode" + +#~ msgid "Invalid voice" +#~ msgstr "Invalid voice" + +#~ msgid "Invalid voice count" +#~ msgstr "Invalid voice count" + +#~ msgid "Invalid wave file" +#~ msgstr "Invalid wave file" + +#~ msgid "Invalid word/bit length" +#~ msgstr "Invalid word/bit length" + +#~ msgid "Layer already in a group." +#~ msgstr "Layer already in a group." + +#~ msgid "Layer must be a Group or TileGrid subclass." +#~ msgstr "Layer must be a Group or TileGrid subclass." + +#~ msgid "MISO pin init failed." +#~ msgstr "MISO pin init failed." + +#~ msgid "MOSI pin init failed." +#~ msgstr "MOSI pin init failed." + +#~ msgid "Messages limited to 8 bytes" +#~ msgstr "Messages limited to 8 bytes" + +#, c-format +#~ msgid "More than %d report ids not supported" +#~ msgstr "More than %d report ids not supported" + +#~ msgid "No hardware support on clk pin" +#~ msgstr "No hardware support on clk pin" + +#~ msgid "No hardware support on pin" +#~ msgstr "No hardware support on pin" + +#, c-format +#~ msgid "Output buffer must be at least %d bytes" +#~ msgstr "Output buffer must be at least %d bytes" + +#~ msgid "" +#~ "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +#~ msgstr "" +#~ "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" + +#~ msgid "Pin count must be at least 1" +#~ msgstr "Pin count must be at least 1" + +#~ msgid "Pin does not have ADC capabilities" +#~ msgstr "Pin does not have ADC capabilities" + +#~ msgid "Program must contain at least one 16-bit instruction." +#~ msgstr "Program must contain at least one 16-bit instruction." + +#~ msgid "Program too large" +#~ msgstr "Program too large" + +#~ msgid "RS485 Not yet supported on this device" +#~ msgstr "RS485 not yet supported on this device" + +#~ msgid "RTC calibration is not supported on this board" +#~ msgstr "RTC calibration is not supported on this board" + +#~ msgid "RTS/CTS/RS485 Not yet supported on this device" +#~ msgstr "RTS/CTS/RS485 not yet supported on this device" + +#~ msgid "SPI Init Error" +#~ msgstr "SPI init error" + +#~ msgid "SPI Re-initialization error" +#~ msgstr "SPI reinitialisation error" + +#~ msgid "Sample rate must be positive" +#~ msgstr "Sample rate must be positive" + +#, c-format +#~ msgid "Sample rate too high. It must be less than %d" +#~ msgstr "Sample rate too high. It must be less than %d" + +#~ msgid "Set pin count must be between 1 and 5" +#~ msgstr "Set pin count must be between 1 and 5" + +#~ msgid "Side set pin count must be between 1 and 5" +#~ msgstr "Side set pin count must be between 1 and 5" + +#~ msgid "Stack size must be at least 256" +#~ msgstr "Stack size must be at least 256" + +#~ msgid "Tile value out of bounds" +#~ msgstr "Tile value out of bounds" + +#~ msgid "UART Buffer allocation error" +#~ msgstr "UART buffer allocation error" + +#~ msgid "UART De-init error" +#~ msgstr "UART deinit error" + +#~ msgid "UART Init Error" +#~ msgstr "UART init Error" + +#~ msgid "UART Re-init error" +#~ msgstr "UART reinit error" + +#~ msgid "UART write error" +#~ msgstr "UART write error" + +#~ msgid "Unsupported baudrate" +#~ msgstr "Unsupported baudrate" + +#~ msgid "WiFi password must be between 8 and 63 characters" +#~ msgstr "WiFi password must be between 8 and 63 characters" + +#~ msgid "bits must be in range 5 to 9" +#~ msgstr "bits must be in range 5 to 9" + +#~ msgid "bytes > 8 bits not supported" +#~ msgstr "Bytes > 8 bits not supported" + +#~ msgid "calibration value out of range +/-127" +#~ msgstr "Calibration value out of range +/-127" + +#~ msgid "circle can only be registered in one parent" +#~ msgstr "circle can only be registered in one parent" + +#~ msgid "max_length must be >= 0" +#~ msgstr "max_length must be >= 0" + +#~ msgid "polygon can only be registered in one parent" +#~ msgstr "polygon can only be registered in one parent" + +#~ msgid "pull_threshold must be between 1 and 32" +#~ msgstr "pull_threshold must be between 1 and 32" + +#~ msgid "push_threshold must be between 1 and 32" +#~ msgstr "push_threshold must be between 1 and 32" + +#~ msgid "stop must be 1 or 2" +#~ msgstr "stop must be 1 or 2" + +#~ msgid "tile must be greater than zero" +#~ msgstr "tile must be greater than zero" + +#~ msgid "timeout must be >= 0.0" +#~ msgstr "timeout must be >= 0.0" + +#, c-format +#~ msgid "width must be from 2 to 8 (inclusive), not %d" +#~ msgstr "width must be from 2 to 8 (inclusive), not %d" + #~ msgid "Unsupported operation" #~ msgstr "Unsupported operation" diff --git a/locale/es.po b/locale/es.po index d1e4f3205e..22a2910295 100644 --- a/locale/es.po +++ b/locale/es.po @@ -75,10 +75,24 @@ msgstr "" "%d pines de dirección, %d pines rgb y %d tiles indican una altura de %d, y " "no de %d" +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "" @@ -91,12 +105,7 @@ msgstr "%q fallo: %d" msgid "%q in use" msgstr "%q está siendo utilizado" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "%q indice fuera de rango" @@ -104,14 +113,34 @@ msgstr "%q indice fuera de rango" msgid "%q indices must be integers, not %s" msgstr "%q indices deben ser enteros, no %s" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "%q debe ser %d-%d" @@ -128,14 +157,10 @@ msgstr "" msgid "%q must be >= %d" msgstr "%q debe ser >= %d" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "%q debe ser >= 0" -#: 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 "%q debe ser >= 1" @@ -144,14 +169,9 @@ msgstr "%q debe ser >= 1" msgid "%q must be a string" msgstr "%q debe ser una cadena" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "%q debe ser una tupla de longitud 2" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" -msgstr "%q debe estar entre %d y %d" +#: py/argcheck.c +msgid "%q must be an int" +msgstr "" #: py/argcheck.c msgid "%q must be of type %q" @@ -169,7 +189,11 @@ msgstr "" msgid "%q 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/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q fuera de rango" @@ -178,10 +202,6 @@ msgstr "%q fuera de rango" msgid "%q pin invalid" msgstr "pin inválido %q" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%q debe ser un int" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "" @@ -344,10 +364,6 @@ msgstr "'yield from' dentro de una función asincrónica" msgid "'yield' outside function" msgstr "'yield' fuera de una función" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "" - #: py/compile.c msgid "*x must be assignment target" msgstr "*x debe ser objetivo de la tarea" @@ -383,10 +399,6 @@ msgstr "ADC2 está siendo usado por WiFi" msgid "Address must be %d bytes long" msgstr "La dirección debe tener %d bytes de largo" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "Tipo de dirección fuera de rango" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "Todos los periféricos CAN están en uso" @@ -479,25 +491,6 @@ msgstr "Ya está en ejecución" msgid "Already scanning for wifi networks" msgstr "Ya se están buscando redes wifi" -#: ports/cxd56/common-hal/analogio/AnalogIn.c -msgid "AnalogIn not supported on given pin" -msgstr "El pin proporcionado no soporta AnalogIn" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -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. El valor debe ser menor que 65536." - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "El pin proporcionado no soporta AnalogOut" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "Otra salida PWMAudioOut esta ya activada" @@ -569,11 +562,6 @@ msgstr "Le reloj de bit y de selector de palabra deben ser pines secuenciales" msgid "Bit clock and word select must share a clock unit" msgstr "Bit clock y word select deben compartir una unidad de reloj" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "Bit depth tiene que ser de 1 a 6 inclusivo, no %d" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "Bits depth debe ser múltiplo de 8." @@ -616,11 +604,6 @@ msgid "Buffer elements must be 4 bytes long or less" msgstr "" "Los elementos del búfer deben de ser de una longitud de 4 bytes o menos" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "Tamaño de buffer incorrecto. Debe ser de %d bytes." - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "Buffer no es un bytearray." @@ -630,7 +613,6 @@ msgstr "Buffer no es un bytearray." msgid "Buffer is too small" msgstr "El buffer es muy pequeño" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -645,10 +627,6 @@ msgstr "El tamaño del búfer debe ser múltiplo de 512" msgid "Buffer must be a multiple of 512 bytes" msgstr "Búfer deber ser un múltiplo de 512 bytes" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "Buffer debe ser de longitud 1 como minimo" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -670,10 +648,6 @@ msgstr "Bus pin %d ya está siendo utilizado" msgid "Byte buffer must be 16 bytes." msgstr "Búfer Byte debe de ser 16 bytes." -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "Bytes debe estar entre 0 y 255." - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "Los bloques CBC deben ser múltiplos de 16 bytes" @@ -690,6 +664,10 @@ msgstr "CRC o suma de comprobación inválida" msgid "Call super().__init__() before accessing native object." msgstr "Llame a super().__init__() antes de acceder al objeto nativo." +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "Solo puede alertar en RTC IO de deep sleep." @@ -741,18 +719,10 @@ 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" -msgstr "No se puede tener ambos canales en el mismo pin" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "No puede hacer pull en un pin de entrada sola." -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "No se puede leer sin pin MISO." - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "No se puede grabar en un archivo" @@ -764,8 +734,8 @@ msgstr "No se puede remountar '/' cuanto se es visible vía 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 "No se puede reiniciar a bootloader porque no hay bootloader presente." +msgid "Cannot reset into bootloader because no bootloader is present" +msgstr "" #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -785,22 +755,21 @@ msgid "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." -msgstr "No se puede transmitir sin pines MOSI y MISO." +msgid "Cannot transfer without MOSI and MISO pins" +msgstr "" #: shared-bindings/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" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge, only level" +msgstr "" + +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge. Only level." msgstr "No puede despertar en pin edge, solo en nivel." -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." -msgstr "No se puede escribir sin pin MOSI." - #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" msgstr "CharateristicBuffer escritura no proporcionada" @@ -813,10 +782,6 @@ msgstr "El código central de CircuitPython se estrelló con fuerza. ¡Whoops!\n msgid "CircuitPython was unable to allocate the heap." msgstr "CircuitPython no puedo encontrar el montículo." -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "Iniciado de pin de reloj fallido." - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "Estirado de reloj demasiado largo" @@ -825,11 +790,6 @@ msgstr "Estirado de reloj demasiado largo" msgid "Clock unit in use" msgstr "Clock unit está siendo utilizado" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -msgid "Command must be an int between 0 and 255" -msgstr "Command debe ser un int entre 0 y 255" - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -842,35 +802,6 @@ msgstr "" msgid "Corrupt .mpy file" msgstr "Archivo .mpy corrupto" -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Could not initialize Camera" -msgstr "No se puede inicializar Camera" - -#: ports/cxd56/common-hal/gnss/GNSS.c -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 "No se pudo inicializar SDCard" - -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "No se puede inicializar la UART" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init channel" -msgstr "No se pudo reiniciar el canal" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init timer" -msgstr "No se pudo reiniciar el temporizador" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not restart PWM" -msgstr "No se pudo reiniciar el PWM" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "No puedo traer el reloj" @@ -891,20 +822,6 @@ msgstr "No se pudo iniciar la interrupción, RX ocupado" msgid "Couldn't allocate decoder" msgstr "No se pudo encontrar el decodificador" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate first buffer" -msgstr "No se pudo asignar el primer buffer" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate input buffer" -msgstr "No se pudo encontrar el buffer de entrada" - -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate second buffer" -msgstr "No se pudo asignar el segundo buffer" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "Choque contra el HardFault_Handler." @@ -953,10 +870,6 @@ msgstr "Capacidad de destino es mas pequeña que destination_length." msgid "Device in use" msgstr "Dispositivo en uso" -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -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." @@ -1012,11 +925,6 @@ msgstr "Se espera un %q" msgid "Expected an alarm" msgstr "Un objecto alarm era esperado" -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "Se esperaba un tuple de %d, se obtuvo %d" - #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." @@ -1043,22 +951,6 @@ msgstr "Fallo enviando comando." msgid "Failed to acquire mutex, err 0x%04x" msgstr "No se puede adquirir el mutex, error 0x%04x" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -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/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/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/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "Fallo al tomar memoria Wifi" @@ -1127,11 +1019,6 @@ msgstr "" msgid "Format not supported" msgstr "Sin capacidades para el formato" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" -msgstr "Framebuffer requiere %d bytes" - #: ports/mimxrt10xx/common-hal/microcontroller/Processor.c msgid "" "Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" @@ -1147,6 +1034,10 @@ msgstr "" msgid "Function requires lock" msgstr "La función requiere lock" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "Fallo Genérico" @@ -1174,17 +1065,13 @@ 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 "Hostname debe ser entre 1 y 253 caracteres" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "Operación I/O en archivo cerrado" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "I2C Error de inicio" +msgid "I2C init error" +msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c msgid "I2C peripheral in use" @@ -1300,75 +1187,33 @@ msgstr "" msgid "Internal error #%d" msgstr "Error interno #%d" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: py/argcheck.c msgid "Invalid %q" msgstr "%q inválido" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c 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/canio/CAN.c -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Invalid %q pin selection" -msgstr "selección inválida de pin %q" - #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "Valor de unidad de ADC no válido" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "AuthMode invalido" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "Parámetro BLE invalido" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "Archivo BMP inválido" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "BSSID inválido" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "Pin suministrado inválido para DAC" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "Archivo MIDI inválido" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "Frecuencia PWM inválida" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "Pin inválido" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "Argumento inválido" @@ -1376,42 +1221,11 @@ msgstr "Argumento inválido" msgid "Invalid bits per value" msgstr "Inválido bits por valor" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "Tamaño de buffer inválido" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "Cadena de byteorder inválida" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "Inválido periodo de captura. Rango válido: 1 - 500" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "Cuenta de canales inválida" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "data_count inválido %d" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "Inválidos los data_pins[%d]" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "Dirección inválida." - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "Archivo inválido" - #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Formato de fragmento de formato no válido" @@ -1420,78 +1234,14 @@ msgstr "Formato de fragmento de formato no válido" msgid "Invalid memory access." msgstr "Acceso a memoria no válido." -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "Numero inválido de bits" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "Fase inválida" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "Pin inválido" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "Pin inválido para canal izquierdo" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -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/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/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "pines inválidos" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "Polaridad inválida" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "Propiedades inválidas" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "Modo de ejecución inválido." - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "'security_mode' no válido" - #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "Tamaño incorrecto" @@ -1504,23 +1254,6 @@ msgstr "socket invalido para TLS" msgid "Invalid state" msgstr "Estado invalido" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "Voz inválida" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "Cuenta de voces inválida" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "Archivo wave inválido" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -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 "La llave debe tener 16, 24 o 32 bytes de longitud" @@ -1534,25 +1267,17 @@ msgid "LHS of keyword arg must be an id" msgstr "LHS del agumento por palabra clave deberia ser un identificador" #: shared-module/displayio/Group.c -msgid "Layer already in a group." -msgstr "La capa ya pertenece a un grupo." +msgid "Layer already in a group" +msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." -msgstr "Layer debe ser una subclase de Group o TileGrid." +msgid "Layer must be a Group or TileGrid subclass" +msgstr "" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "La dirección MAC es incorrecta" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "MISO pin init fallido." - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "MOSI pin init fallido." - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "" @@ -1562,10 +1287,6 @@ msgstr "" 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 "Mensajes limitados a 8 bytes" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Micrófono demora de inicio debe estar en el rango 0.0 a 1.0" @@ -1579,10 +1300,14 @@ msgstr "" msgid "Mismatched swap flag" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "Falta el pin MISO o MOSI" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1622,11 +1347,6 @@ msgstr "" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "Debe de ser una subclase de %q." @@ -1687,15 +1407,23 @@ msgid "No I2C device at address: 0x%x" msgstr "" #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "Sin pin MISO" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Sin pin MOSI" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1734,16 +1462,6 @@ msgstr "Sin GCLKs libres" msgid "No hardware random available" msgstr "No hay hardware random disponible" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "Sin soporte de hardware en el pin clk" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "Sin soporte de hardware en pin" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "No hay \"in\" en el programa" @@ -1894,10 +1612,13 @@ msgid "Only one address is allowed" msgstr "" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "Solamente una alarm.time puede ser configurada." @@ -1929,11 +1650,6 @@ msgstr "Se acabaron los enchufes" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "Los elementos del búfer de salida deben ser de una longitud <= 4 bytes" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "buffer de salida debe ser de por lo menos %d bytes" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "El sobremuestreo debe ser un múltiplo de 8." @@ -1942,11 +1658,6 @@ msgstr "El sobremuestreo debe ser un múltiplo de 8." msgid "PDMIn not available" msgstr "PDMIn no esta disponible" -#: 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/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." @@ -1954,6 +1665,10 @@ msgstr "" "La frecuencia de PWM no se puede escribir variable_frequency es False en la " "construcción." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" +msgstr "" + #: ports/raspberrypi/common-hal/countio/Counter.c msgid "PWM slice already in use" msgstr "Segmento PWM ya esta en uso" @@ -1970,29 +1685,14 @@ msgstr "Periférico en uso" msgid "Permission denied" msgstr "Permiso denegado" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "El Pin no se puede despertar de un sueño profundo" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "El total de pines debe ser por lo menos 1" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "Total de pines demasiado grande" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "Pin no tiene capacidad ADC" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2065,18 +1765,10 @@ msgstr "El programa hace un IN sin cargar ISR" msgid "Program does OUT without loading OSR" msgstr "El programa hace OUT sin cargar OSR" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "El programa debe contener por lo menos una instrucción de 16 bits." - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "El tamaño del programa no es correcto" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "Programa demasiado grande" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Pull no se usa cuando la dirección es output." @@ -2098,30 +1790,20 @@ msgstr "Error de desinicialización de RNG" msgid "RNG Init Error" msgstr "Error de inicialización de RNG" -#: ports/nrf/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" -msgstr "RS485 no esta soportado todavía en este dispositivo" +#: 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 "RS485" +msgstr "" #: ports/espressif/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 si no está en modo RS485" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/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" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "RTC no soportado en esta placa" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "Sin capacidad de RTS/CTS/RS485 para este dispositivo" - #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" msgstr "Error de generación de números aleatorios" @@ -2172,6 +1854,10 @@ msgstr "" msgid "SD card CSD format not supported" msgstr "Sin capacidad para formato CSD para tarjeta SD" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2182,30 +1868,21 @@ msgstr "Error SDIO GetCardInfo %d" msgid "SDIO Init Error %d" msgstr "Error de iniciado de SDIO %d" -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "Error de inicio de SPI" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "Error de reinicialización de SPI" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "Configuración de SPI fallida" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "Periférico SPI en uso" -#: shared-bindings/audiomixer/Mixer.c -msgid "Sample rate must be positive" -msgstr "Sample rate debe ser positivo" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" -msgstr "Frecuencia de muestreo demasiado alta. Debe ser menor a %d" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" +msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c msgid "Scale dimensions must divide by 3" @@ -2225,14 +1902,6 @@ msgstr "Serializer está siendo utilizado" msgid "Server side context cannot have hostname" msgstr "El contexto del lado del servidor no puede tener un hostname" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "La suma de pines configurados debe estar entre 1 y 5" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "El conteo de pines de Side set debe estar entre 1 y 5" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "Sin capacidades para el tamaño" @@ -2268,10 +1937,6 @@ msgstr "" msgid "Splitting with sub-captures" msgstr "Dividiendo con sub-capturas" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "El tamaño de la pila debe ser de al menos 256" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "Estéreo izquierdo debe estar en el canal PWM A" @@ -2365,10 +2030,6 @@ msgstr "La altura del Tile debe dividir exacto la altura del bitmap" msgid "Tile index out of bounds" msgstr "Índice de mosaico fuera de límites" -#: shared-bindings/displayio/TileGrid.c -msgid "Tile value out of bounds" -msgstr "Valor de mosaico fuera de límites" - #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" msgstr "Ancho del Tile debe dividir exactamente el ancho de mapa de bits" @@ -2390,6 +2051,9 @@ 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 "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Demasiados canales en sample." @@ -2422,24 +2086,21 @@ msgid "Tuple or struct_time argument required" msgstr "Argumento tuple o struct_time requerido" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "No se pudo encontrar el búfer para UART" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" +msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "Error de desinicialización de UART" +msgid "UART re-init" +msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" -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 UART" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" -msgstr "Error de escritura UART" +msgid "UART write" +msgstr "" #: shared-module/usb_hid/Device.c msgid "USB busy" @@ -2577,12 +2238,6 @@ msgstr "" "Problema no especificado. Puede ser que la señal de emparejamiento del otro " "dispositivo fue denegada o ignorada." -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "Baudrate no soportado" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "" @@ -2660,10 +2315,6 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" -msgstr "La clave de WiFi debe ser entre 8 y 63 caracteres" - #: main.c msgid "Woken up by alarm.\n" msgstr "Despertado por la alarma.\n" @@ -2818,10 +2469,6 @@ msgstr "" msgid "bits must be 32 or less" msgstr "los bits deben ser 32 o menos" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "los bits deben estar en el rango de 5 a 9" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample debe ser 8 ó 16" @@ -2859,11 +2506,6 @@ msgstr "búfer muy pequeño para los bytes solicitados" msgid "byteorder is not a string" msgstr "byteorder no es una cadena" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -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 "el tamaño en bytes no es un múltiplo del tamaño del item" @@ -2872,7 +2514,7 @@ msgstr "el tamaño en bytes no es un múltiplo del tamaño del item" msgid "bytes value out of range" msgstr "valor de bytes fuera de rango" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "calibration esta fuera de rango" @@ -2880,12 +2522,9 @@ msgstr "calibration esta fuera de rango" msgid "calibration is read only" msgstr "calibration es de solo lectura" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "Valor de calibración fuera del rango +/-127" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" +msgid "can only have one parent" msgstr "" #: py/emitinlinethumb.c @@ -3061,6 +2700,10 @@ msgstr "no se puede sin ambiguedades traer el sizeof del escalar" msgid "casting" msgstr "convirtiendo tipo" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "chars buffer es demasiado pequeño" @@ -3073,10 +2716,6 @@ msgstr "El argumento de chr() esta fuera de rango(0x110000)" msgid "chr() arg not in range(256)" 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 "circulo solo puede ser registrado con un pariente" - #: shared-bindings/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "El punto de recorte debe ser una tupla (x, y)" @@ -3503,6 +3142,10 @@ 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" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "los valores iniciales deben permitir iteración" @@ -3756,10 +3399,6 @@ msgstr "error de dominio matemático" msgid "matrix is not positive definite" msgstr "matrix no es definida positiva" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3767,10 +3406,6 @@ msgstr "" 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 "max_length debe ser >= 0" - #: extmod/ulab/code/ndarray.c msgid "maximum number of dimensions is 4" msgstr "Máximo número de dimensiones es 4" @@ -4145,10 +3780,6 @@ msgstr "pixel_shader debe ser displayio.Palette o displayio.ColorConverter" msgid "poll on file not available on win32" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "el polígono solo se puede registrar en uno de los padres" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop de un PulseIn vacío" @@ -4195,14 +3826,6 @@ msgstr "presione el botón izquierdo al arranque\n" msgid "pull masks conflict with direction masks" msgstr "máscara de pull en conflicto con máscara de dirección" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "pull_threshold debe esta entre 1 y 32" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "push_threshold debe esta entre 1 y 32" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "desbordamiento de cola(queue)" @@ -4375,10 +3998,6 @@ msgstr "start_x deberia ser un int" msgid "step must be non-zero" msgstr "paso debe ser numero no cero" -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "stop debe ser 1 ó 2" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "stop no se puede alcanzar del principio" @@ -4427,10 +4046,6 @@ msgstr "error de sintaxis en el descriptor uctypes" msgid "threshold must be in the range 0-65536" msgstr "limite debe ser en el rango 0-65536" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "tile debe sera mas grande que cero" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() toma un sequencio 9" @@ -4451,10 +4066,6 @@ msgstr "el tiempo de espera debe ser 0.0-100.0 segundos" msgid "timeout must be < 655.35 secs" msgstr "timeout debe ser < 655.35 segundos" -#: shared-bindings/_bleio/CharacteristicBuffer.c -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 "tiempo de espera agotado esperando por tarjeta v1" @@ -4463,6 +4074,10 @@ msgstr "tiempo de espera agotado esperando por tarjeta v1" msgid "timeout waiting for v2 card" msgstr "tiempo de espera agotado esperando a tarjeta v2" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "timestamp fuera de rango para plataform time_t" @@ -4654,13 +4269,7 @@ msgstr "watchdog no inicializado" msgid "watchdog timeout must be greater than 0" msgstr "el tiempo de espera del perro guardián debe ser mayor a 0" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "ancho debe estar entre 2 y 8 (inclusivamente), no %d" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "el ancho debe ser mayor que cero" @@ -4732,6 +4341,336 @@ 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 must be a tuple of length 2" +#~ msgstr "%q debe ser una tupla de longitud 2" + +#~ msgid "%q must be between %d and %d" +#~ msgstr "%q debe estar entre %d y %d" + +#~ msgid "%q should be an int" +#~ msgstr "%q debe ser un int" + +#~ msgid "Address type out of range" +#~ msgstr "Tipo de dirección fuera de rango" + +#~ msgid "AnalogIn not supported on given pin" +#~ msgstr "El pin proporcionado no soporta AnalogIn" + +#~ msgid "AnalogOut functionality not supported" +#~ msgstr "Funcionalidad AnalogOut no soportada" + +#~ msgid "AnalogOut is only 16 bits. Value must be less than 65536." +#~ msgstr "AnalogOut es solo de 16 bits. El valor debe ser menor que 65536." + +#~ msgid "AnalogOut not supported on given pin" +#~ msgstr "El pin proporcionado no soporta AnalogOut" + +#, c-format +#~ msgid "Bit depth must be from 1 to 6 inclusive, not %d" +#~ msgstr "Bit depth tiene que ser de 1 a 6 inclusivo, no %d" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "Tamaño de buffer incorrecto. Debe ser de %d bytes." + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "Buffer debe ser de longitud 1 como minimo" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "Bytes debe estar entre 0 y 255." + +#~ msgid "Cannot output both channels on the same pin" +#~ msgstr "No se puede tener ambos canales en el mismo pin" + +#~ msgid "Cannot read without MISO pin." +#~ msgstr "No se puede leer sin pin MISO." + +#~ msgid "Cannot reset into bootloader because no bootloader is present." +#~ msgstr "" +#~ "No se puede reiniciar a bootloader porque no hay bootloader presente." + +#~ msgid "Cannot transfer without MOSI and MISO pins." +#~ msgstr "No se puede transmitir sin pines MOSI y MISO." + +#~ msgid "Cannot write without MOSI pin." +#~ msgstr "No se puede escribir sin pin MOSI." + +#~ msgid "Clock pin init failed." +#~ msgstr "Iniciado de pin de reloj fallido." + +#~ msgid "Command must be an int between 0 and 255" +#~ msgstr "Command debe ser un int entre 0 y 255" + +#~ msgid "Could not initialize Camera" +#~ msgstr "No se puede inicializar Camera" + +#~ msgid "Could not initialize GNSS" +#~ msgstr "No se pudo inicializar el GNSS" + +#~ msgid "Could not initialize SDCard" +#~ msgstr "No se pudo inicializar SDCard" + +#~ msgid "Could not initialize UART" +#~ msgstr "No se puede inicializar la UART" + +#~ msgid "Could not re-init channel" +#~ msgstr "No se pudo reiniciar el canal" + +#~ msgid "Could not re-init timer" +#~ msgstr "No se pudo reiniciar el temporizador" + +#~ msgid "Could not restart PWM" +#~ msgstr "No se pudo reiniciar el PWM" + +#~ msgid "Couldn't allocate first buffer" +#~ msgstr "No se pudo asignar el primer buffer" + +#~ msgid "Couldn't allocate input buffer" +#~ msgstr "No se pudo encontrar el buffer de entrada" + +#~ msgid "Couldn't allocate second buffer" +#~ msgstr "No se pudo asignar el segundo buffer" + +#~ msgid "DigitalInOut not supported on given pin" +#~ msgstr "DigitalInOut no es compatible con un pin dado" + +#, c-format +#~ msgid "Expected tuple of length %d, got %d" +#~ msgstr "Se esperaba un tuple de %d, se obtuvo %d" + +#~ msgid "Failed to allocate RX buffer" +#~ msgstr "Ha fallado la asignación del buffer RX" + +#, c-format +#~ msgid "Failed to allocate RX buffer of %d bytes" +#~ msgstr "Falló la asignación del buffer RX de %d bytes" + +#, c-format +#~ msgid "Framebuffer requires %d bytes" +#~ msgstr "Framebuffer requiere %d bytes" + +#~ msgid "Hostname must be between 1 and 253 characters" +#~ msgstr "Hostname debe ser entre 1 y 253 caracteres" + +#~ msgid "I2C Init Error" +#~ msgstr "I2C Error de inicio" + +#~ msgid "Invalid %q pin selection" +#~ msgstr "selección inválida de pin %q" + +#~ msgid "Invalid AuthMode" +#~ msgstr "AuthMode invalido" + +#~ msgid "Invalid BMP file" +#~ msgstr "Archivo BMP inválido" + +#~ msgid "Invalid DAC pin supplied" +#~ msgstr "Pin suministrado inválido para DAC" + +#~ msgid "Invalid MIDI file" +#~ msgstr "Archivo MIDI inválido" + +#~ msgid "Invalid PWM frequency" +#~ msgstr "Frecuencia PWM inválida" + +#~ msgid "Invalid Pin" +#~ msgstr "Pin inválido" + +#~ msgid "Invalid buffer size" +#~ msgstr "Tamaño de buffer inválido" + +#~ msgid "Invalid byteorder string" +#~ msgstr "Cadena de byteorder inválida" + +#~ msgid "Invalid capture period. Valid range: 1 - 500" +#~ msgstr "Inválido periodo de captura. Rango válido: 1 - 500" + +#~ msgid "Invalid channel count" +#~ msgstr "Cuenta de canales inválida" + +#, c-format +#~ msgid "Invalid data_count %d" +#~ msgstr "data_count inválido %d" + +#~ msgid "Invalid direction." +#~ msgstr "Dirección inválida." + +#~ msgid "Invalid file" +#~ msgstr "Archivo inválido" + +#~ msgid "Invalid number of bits" +#~ msgstr "Numero inválido de bits" + +#~ msgid "Invalid phase" +#~ msgstr "Fase inválida" + +#~ msgid "Invalid pin" +#~ msgstr "Pin inválido" + +#~ msgid "Invalid pin for left channel" +#~ msgstr "Pin inválido para canal izquierdo" + +#~ msgid "Invalid pin for right channel" +#~ msgstr "Pin inválido para canal derecho" + +#~ msgid "Invalid polarity" +#~ msgstr "Polaridad inválida" + +#~ msgid "Invalid properties" +#~ msgstr "Propiedades inválidas" + +#~ msgid "Invalid run mode." +#~ msgstr "Modo de ejecución inválido." + +#~ msgid "Invalid security_mode" +#~ msgstr "'security_mode' no válido" + +#~ msgid "Invalid voice" +#~ msgstr "Voz inválida" + +#~ msgid "Invalid voice count" +#~ msgstr "Cuenta de voces inválida" + +#~ msgid "Invalid wave file" +#~ msgstr "Archivo wave inválido" + +#~ msgid "Invalid word/bit length" +#~ msgstr "Tamaño no válido de palabra/bit" + +#~ msgid "Layer already in a group." +#~ msgstr "La capa ya pertenece a un grupo." + +#~ msgid "Layer must be a Group or TileGrid subclass." +#~ msgstr "Layer debe ser una subclase de Group o TileGrid." + +#~ msgid "MISO pin init failed." +#~ msgstr "MISO pin init fallido." + +#~ msgid "MOSI pin init failed." +#~ msgstr "MOSI pin init fallido." + +#~ msgid "Messages limited to 8 bytes" +#~ msgstr "Mensajes limitados a 8 bytes" + +#~ msgid "No hardware support on clk pin" +#~ msgstr "Sin soporte de hardware en el pin clk" + +#~ msgid "No hardware support on pin" +#~ msgstr "Sin soporte de hardware en pin" + +#, c-format +#~ msgid "Output buffer must be at least %d bytes" +#~ msgstr "buffer de salida debe ser de por lo menos %d bytes" + +#~ 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)" + +#~ msgid "Pin count must be at least 1" +#~ msgstr "El total de pines debe ser por lo menos 1" + +#~ msgid "Pin does not have ADC capabilities" +#~ msgstr "Pin no tiene capacidad ADC" + +#~ msgid "Program must contain at least one 16-bit instruction." +#~ msgstr "El programa debe contener por lo menos una instrucción de 16 bits." + +#~ msgid "Program too large" +#~ msgstr "Programa demasiado grande" + +#~ msgid "RS485 Not yet supported on this device" +#~ msgstr "RS485 no esta soportado todavía en este dispositivo" + +#~ msgid "RTC calibration is not supported on this board" +#~ msgstr "Calibración de RTC no es soportada en esta placa" + +#~ msgid "RTS/CTS/RS485 Not yet supported on this device" +#~ msgstr "Sin capacidad de RTS/CTS/RS485 para este dispositivo" + +#~ msgid "SPI Init Error" +#~ msgstr "Error de inicio de SPI" + +#~ msgid "SPI Re-initialization error" +#~ msgstr "Error de reinicialización de SPI" + +#~ msgid "Sample rate must be positive" +#~ msgstr "Sample rate debe ser positivo" + +#, c-format +#~ msgid "Sample rate too high. It must be less than %d" +#~ msgstr "Frecuencia de muestreo demasiado alta. Debe ser menor a %d" + +#~ msgid "Set pin count must be between 1 and 5" +#~ msgstr "La suma de pines configurados debe estar entre 1 y 5" + +#~ msgid "Side set pin count must be between 1 and 5" +#~ msgstr "El conteo de pines de Side set debe estar entre 1 y 5" + +#~ msgid "Stack size must be at least 256" +#~ msgstr "El tamaño de la pila debe ser de al menos 256" + +#~ msgid "Tile value out of bounds" +#~ msgstr "Valor de mosaico fuera de límites" + +#~ msgid "UART Buffer allocation error" +#~ msgstr "No se pudo encontrar el búfer para UART" + +#~ msgid "UART De-init error" +#~ msgstr "Error de desinicialización de UART" + +#~ msgid "UART Init Error" +#~ msgstr "Error de inicialización de UART" + +#~ msgid "UART Re-init error" +#~ msgstr "Error de reinicialización de UART" + +#~ msgid "UART write error" +#~ msgstr "Error de escritura UART" + +#~ msgid "Unsupported baudrate" +#~ msgstr "Baudrate no soportado" + +#~ msgid "WiFi password must be between 8 and 63 characters" +#~ msgstr "La clave de WiFi debe ser entre 8 y 63 caracteres" + +#~ msgid "bits must be in range 5 to 9" +#~ msgstr "los bits deben estar en el rango de 5 a 9" + +#~ msgid "bytes > 8 bits not supported" +#~ msgstr "bytes > 8 bits no soportados" + +#~ msgid "calibration value out of range +/-127" +#~ msgstr "Valor de calibración fuera del rango +/-127" + +#~ msgid "circle can only be registered in one parent" +#~ msgstr "circulo solo puede ser registrado con un pariente" + +#~ msgid "max_length must be >= 0" +#~ msgstr "max_length debe ser >= 0" + +#~ msgid "polygon can only be registered in one parent" +#~ msgstr "el polígono solo se puede registrar en uno de los padres" + +#~ msgid "pull_threshold must be between 1 and 32" +#~ msgstr "pull_threshold debe esta entre 1 y 32" + +#~ msgid "push_threshold must be between 1 and 32" +#~ msgstr "push_threshold debe esta entre 1 y 32" + +#~ msgid "stop must be 1 or 2" +#~ msgstr "stop debe ser 1 ó 2" + +#~ msgid "tile must be greater than zero" +#~ msgstr "tile debe sera mas grande que cero" + +#~ msgid "timeout must be >= 0.0" +#~ msgstr "tiempo muerto debe ser >= 0.0" + +#, c-format +#~ msgid "width must be from 2 to 8 (inclusive), not %d" +#~ msgstr "ancho debe estar entre 2 y 8 (inclusivamente), no %d" + #~ msgid "Unsupported operation" #~ msgstr "Operación no soportada" diff --git a/locale/fil.po b/locale/fil.po index ea43686206..ebbb837db1 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -67,10 +67,24 @@ msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "" +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "" @@ -83,12 +97,7 @@ msgstr "" msgid "%q in use" msgstr "%q ay ginagamit" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "%q indeks wala sa sakop" @@ -96,14 +105,34 @@ msgstr "%q indeks wala sa sakop" msgid "%q indices must be integers, not %s" msgstr "%q indeks ay dapat integers, hindi %s" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "" @@ -120,14 +149,10 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.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 #, fuzzy msgid "%q must be >= 1" @@ -137,13 +162,8 @@ msgstr "aarehas na haba dapat ang buffer slices" msgid "%q must be a string" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" +#: py/argcheck.c +msgid "%q must be an int" msgstr "" #: py/argcheck.c @@ -162,7 +182,11 @@ msgstr "" msgid "%q 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/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "" @@ -171,11 +195,6 @@ msgstr "" msgid "%q pin invalid" msgstr "" -#: shared-bindings/fontio/BuiltinFont.c -#, fuzzy -msgid "%q should be an int" -msgstr "y ay dapat int" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "" @@ -339,10 +358,6 @@ msgstr "" msgid "'yield' outside function" msgstr "'yield' sa labas ng function" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "" - #: py/compile.c msgid "*x must be assignment target" msgstr "*x ay dapat na assignment target" @@ -378,10 +393,6 @@ msgstr "" msgid "Address must be %d bytes long" msgstr "ang palette ay dapat 32 bytes ang haba" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "" @@ -473,25 +484,6 @@ msgstr "" msgid "Already scanning for wifi networks" 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 -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "Hindi supportado ang AnalogOut" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "AnalogOut ay 16 bits. Value ay dapat hindi hihigit pa sa 65536." - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "Hindi supportado ang AnalogOut sa ibinigay na pin" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "" @@ -563,11 +555,6 @@ msgstr "" msgid "Bit clock and word select must share a clock unit" msgstr "Ang bit clock at word select dapat makibahagi sa isang clock unit" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "Bit depth ay dapat multiple ng 8." @@ -609,11 +596,6 @@ msgstr "" msgid "Buffer elements must be 4 bytes long or less" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "Mali ang size ng buffer. Dapat %d bytes." - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "" @@ -623,7 +605,6 @@ msgstr "" msgid "Buffer is too small" msgstr "" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -638,10 +619,6 @@ msgstr "" msgid "Buffer must be a multiple of 512 bytes" msgstr "" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "Buffer dapat ay hindi baba sa 1 na haba" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -664,10 +641,6 @@ msgstr "Ginagamit na ang DAC" msgid "Byte buffer must be 16 bytes." msgstr "buffer ay dapat bytes-like object" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "Sa gitna ng 0 o 255 dapat ang bytes." - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "" @@ -684,6 +657,10 @@ msgstr "" msgid "Call super().__init__() before accessing native object." msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" @@ -732,18 +709,10 @@ msgstr "Hindi makuha ang temperatura. status 0x%02x" 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 "Hindi maaaring output ang mga parehong channel sa parehong pin" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "Hindi maaring mabasa kapag walang MISO pin." - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "Hindi ma-record sa isang file" @@ -755,8 +724,8 @@ 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 "Hindi ma-reset sa bootloader dahil walang bootloader." +msgid "Cannot reset into bootloader because no bootloader is present" +msgstr "" #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -776,21 +745,20 @@ msgid "Cannot subclass slice" msgstr "Hindi magawa ang sublcass slice" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." -msgstr "Hindi maaaring ilipat kapag walang MOSI at MISO pin." +msgid "Cannot transfer without MOSI and MISO pins" +msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c -msgid "Cannot wake on pin edge. Only level." +msgid "Cannot wake on pin edge, only level" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." -msgstr "Hindi maaring isulat kapag walang MOSI pin." +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge. Only level." +msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" @@ -804,10 +772,6 @@ msgstr "" msgid "CircuitPython was unable to allocate the heap." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "Nabigo sa pag init ng Clock pin." - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "Masyadong mahaba ang Clock stretch" @@ -816,12 +780,6 @@ msgstr "Masyadong mahaba ang Clock stretch" msgid "Clock unit in use" msgstr "Clock unit ginagamit" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -#, fuzzy -msgid "Command must be an int between 0 and 255" -msgstr "Sa gitna ng 0 o 255 dapat ang bytes." - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -832,35 +790,6 @@ msgstr "" msgid "Corrupt .mpy file" 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 "" - -#: 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 -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "Hindi ma-initialize ang UART" - -#: 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 "" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "" @@ -881,20 +810,6 @@ msgstr "" 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 "Hindi ma-iallocate ang first buffer" - -#: 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 "Hindi ma-iallocate ang second buffer" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "" @@ -945,10 +860,6 @@ msgstr "" 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." @@ -1004,11 +915,6 @@ msgstr "Umasa ng %q" msgid "Expected an alarm" msgstr "" -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "" - #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." @@ -1035,22 +941,6 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "Nabigo sa pag kuha ng mutex, status: 0x%08lX" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -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/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/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/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "" @@ -1119,11 +1009,6 @@ msgstr "" msgid "Format not supported" msgstr "" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" -msgstr "" - #: ports/mimxrt10xx/common-hal/microcontroller/Processor.c msgid "" "Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" @@ -1138,6 +1023,10 @@ msgstr "" msgid "Function requires lock" msgstr "Function nangangailangan ng lock" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1165,16 +1054,12 @@ 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" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" +msgid "I2C init error" msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c @@ -1284,75 +1169,33 @@ msgstr "" msgid "Internal error #%d" msgstr "" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: py/argcheck.c msgid "Invalid %q" msgstr "" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c 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/canio/CAN.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 "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "Mali ang BMP file" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "Mali ang PWM frequency" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "Maling argumento" @@ -1360,42 +1203,11 @@ msgstr "Maling argumento" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "Mali ang buffer size" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "Maling bilang ng channel" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "Mali ang direksyon." - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "Mali ang file" - #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Mali ang format ng chunk size" @@ -1404,78 +1216,14 @@ msgstr "Mali ang format ng chunk size" msgid "Invalid memory access." msgstr "" -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "Mali ang bilang ng bits" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "Mali ang phase" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "Mali ang pin" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "Mali ang pin para sa kaliwang channel" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -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/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/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "Mali ang pins" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "Mali ang polarity" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "Mali ang run mode." - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "" - #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" @@ -1488,23 +1236,6 @@ msgstr "" msgid "Invalid state" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "Maling bilang ng voice" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "May hindi tama sa wave file" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "" @@ -1518,25 +1249,17 @@ msgid "LHS of keyword arg must be an id" msgstr "LHS ng keyword arg ay dapat na id" #: shared-module/displayio/Group.c -msgid "Layer already in a group." +msgid "Layer already in a group" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." +msgid "Layer must be a Group or TileGrid subclass" msgstr "" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "Hindi ma-initialize ang MISO pin." - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "Hindi ma-initialize ang MOSI pin." - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "" @@ -1546,10 +1269,6 @@ msgstr "" msgid "Maximum x value when mirrored is %d" msgstr "" -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Ang delay ng startup ng mikropono ay dapat na nasa 0.0 hanggang 1.0" @@ -1563,10 +1282,14 @@ msgstr "" msgid "Mismatched swap flag" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1602,11 +1325,6 @@ msgstr "" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" @@ -1667,15 +1385,23 @@ msgid "No I2C device at address: 0x%x" msgstr "" #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1714,16 +1440,6 @@ msgstr "Walang libreng GCLKs" msgid "No hardware random available" msgstr "Walang magagamit na hardware random" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "Walang support sa hardware ang pin" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "" @@ -1871,10 +1587,13 @@ msgid "Only one address is allowed" msgstr "" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "" @@ -1906,11 +1625,6 @@ msgstr "" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Oversample ay dapat multiple ng 8." @@ -1919,17 +1633,16 @@ msgstr "Oversample ay dapat multiple ng 8." msgid "PDMIn not available" msgstr "" -#: 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/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" "PWM frequency hindi writable kapag variable_frequency ay False sa pag buo." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" +msgstr "" + #: ports/raspberrypi/common-hal/countio/Counter.c msgid "PWM slice already in use" msgstr "" @@ -1946,29 +1659,14 @@ msgstr "" msgid "Permission denied" msgstr "Walang pahintulot" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "Ang pin ay walang kakayahan sa ADC" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2035,18 +1733,10 @@ msgstr "" msgid "Program does OUT without loading OSR" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "" - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Pull hindi ginagamit kapag ang direksyon ay output." @@ -2068,8 +1758,9 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" +#: 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 "RS485" msgstr "" #: ports/espressif/common-hal/busio/UART.c @@ -2077,21 +1768,10 @@ msgstr "" msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "RTC calibration ay hindi supportado ng board na ito" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "Hindi supportado ang RTC sa board na ito" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/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 "" @@ -2142,6 +1822,10 @@ msgstr "Tumatakbo sa safe mode! Hindi tumatakbo ang nai-save na code.\n" msgid "SD card CSD format not supported" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2152,30 +1836,21 @@ msgstr "" 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 "" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -msgid "Sample rate must be positive" -msgstr "Sample rate ay dapat positibo" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" -msgstr "Sample rate ay masyadong mataas. Ito ay dapat hindi hiigit sa %d" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" +msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c msgid "Scale dimensions must divide by 3" @@ -2195,14 +1870,6 @@ msgstr "Serializer ginagamit" msgid "Server side context cannot have hostname" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "" @@ -2238,10 +1905,6 @@ msgstr "" msgid "Splitting with sub-captures" msgstr "Binibiyak gamit ang sub-captures" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "Ang laki ng stack ay dapat na hindi bababa sa 256" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "" @@ -2327,10 +1990,6 @@ msgstr "" 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 "" @@ -2350,6 +2009,9 @@ 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 "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Sobra ang channels sa sample." @@ -2382,23 +2044,20 @@ msgid "Tuple or struct_time argument required" msgstr "Tuple o struct_time argument kailangan" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" +msgid "UART re-init" 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" +msgid "UART write" msgstr "" #: shared-module/usb_hid/Device.c @@ -2536,12 +2195,6 @@ msgid "" "declined or ignored." msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "Hindi supportadong baudrate" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "" @@ -2617,10 +2270,6 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" -msgstr "" - #: main.c msgid "Woken up by alarm.\n" msgstr "" @@ -2773,10 +2422,6 @@ msgstr "" msgid "bits must be 32 or less" msgstr "" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample ay dapat 8 o 16" @@ -2815,11 +2460,6 @@ msgstr "" msgid "byteorder is not a string" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -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 "" @@ -2828,7 +2468,7 @@ msgstr "" msgid "bytes value out of range" msgstr "bytes value wala sa sakop" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "kalibrasion ay wala sa sakop" @@ -2836,12 +2476,9 @@ msgstr "kalibrasion ay wala sa sakop" msgid "calibration is read only" msgstr "pagkakalibrate ay basahin lamang" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "ang halaga ng pagkakalibrate ay wala sa sakop +/-127" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" +msgid "can only have one parent" msgstr "" #: py/emitinlinethumb.c @@ -3018,6 +2655,10 @@ msgstr "" msgid "casting" msgstr "casting" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "masyadong maliit ang buffer" @@ -3030,10 +2671,6 @@ msgstr "chr() arg wala sa sakop ng range(0x110000)" msgid "chr() arg not in range(256)" msgstr "chr() arg wala sa sakop ng range(256)" -#: shared-module/vectorio/Circle.c -msgid "circle can only be registered in one parent" -msgstr "" - #: shared-bindings/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "" @@ -3464,6 +3101,10 @@ msgstr "ang mga indeks ay dapat na integer" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "" @@ -3718,10 +3359,6 @@ msgstr "may pagkakamali sa math domain" msgid "matrix is not positive definite" msgstr "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3729,10 +3366,6 @@ 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 "" - #: extmod/ulab/code/ndarray.c msgid "maximum number of dimensions is 4" msgstr "" @@ -4105,10 +3738,6 @@ msgstr "pixel_shader ay dapat displayio.Palette o displayio.ColorConverter" msgid "poll on file not available on win32" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop mula sa walang laman na PulseIn" @@ -4155,14 +3784,6 @@ msgstr "" msgid "pull masks conflict with direction masks" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "puno na ang pila (overflow)" @@ -4336,10 +3957,6 @@ msgstr "y ay dapat int" msgid "step must be non-zero" msgstr "step ay dapat hindi zero" -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "stop dapat 1 o 2" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "stop hindi maabot sa simula" @@ -4388,10 +4005,6 @@ msgstr "may pagkakamali sa sintaks sa uctypes descriptor" msgid "threshold must be in the range 0-65536" msgstr "ang threshold ay dapat sa range 0-65536" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() kumukuha ng 9-sequence" @@ -4411,11 +4024,6 @@ msgstr "" msgid "timeout must be < 655.35 secs" msgstr "" -#: shared-bindings/_bleio/CharacteristicBuffer.c -#, fuzzy -msgid "timeout must be >= 0.0" -msgstr "bits ay dapat walo (8)" - #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" msgstr "" @@ -4424,6 +4032,10 @@ msgstr "" msgid "timeout waiting for v2 card" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +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" @@ -4615,13 +4227,7 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" @@ -4695,6 +4301,157 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#, fuzzy +#~ msgid "%q should be an int" +#~ msgstr "y ay dapat int" + +#~ msgid "AnalogOut functionality not supported" +#~ msgstr "Hindi supportado ang AnalogOut" + +#~ msgid "AnalogOut is only 16 bits. Value must be less than 65536." +#~ msgstr "AnalogOut ay 16 bits. Value ay dapat hindi hihigit pa sa 65536." + +#~ msgid "AnalogOut not supported on given pin" +#~ msgstr "Hindi supportado ang AnalogOut sa ibinigay na pin" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "Mali ang size ng buffer. Dapat %d bytes." + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "Buffer dapat ay hindi baba sa 1 na haba" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "Sa gitna ng 0 o 255 dapat ang bytes." + +#~ msgid "Cannot output both channels on the same pin" +#~ msgstr "Hindi maaaring output ang mga parehong channel sa parehong pin" + +#~ msgid "Cannot read without MISO pin." +#~ msgstr "Hindi maaring mabasa kapag walang MISO pin." + +#~ msgid "Cannot reset into bootloader because no bootloader is present." +#~ msgstr "Hindi ma-reset sa bootloader dahil walang bootloader." + +#~ msgid "Cannot transfer without MOSI and MISO pins." +#~ msgstr "Hindi maaaring ilipat kapag walang MOSI at MISO pin." + +#~ msgid "Cannot write without MOSI pin." +#~ msgstr "Hindi maaring isulat kapag walang MOSI pin." + +#~ msgid "Clock pin init failed." +#~ msgstr "Nabigo sa pag init ng Clock pin." + +#, fuzzy +#~ msgid "Command must be an int between 0 and 255" +#~ msgstr "Sa gitna ng 0 o 255 dapat ang bytes." + +#~ msgid "Could not initialize UART" +#~ msgstr "Hindi ma-initialize ang UART" + +#~ msgid "Couldn't allocate first buffer" +#~ msgstr "Hindi ma-iallocate ang first buffer" + +#~ msgid "Couldn't allocate second buffer" +#~ msgstr "Hindi ma-iallocate ang second buffer" + +#~ msgid "Failed to allocate RX buffer" +#~ msgstr "Nabigong ilaan ang RX buffer" + +#, c-format +#~ msgid "Failed to allocate RX buffer of %d bytes" +#~ msgstr "Nabigong ilaan ang RX buffer ng %d bytes" + +#~ msgid "Invalid BMP file" +#~ msgstr "Mali ang BMP file" + +#~ msgid "Invalid PWM frequency" +#~ msgstr "Mali ang PWM frequency" + +#~ msgid "Invalid buffer size" +#~ msgstr "Mali ang buffer size" + +#~ msgid "Invalid channel count" +#~ msgstr "Maling bilang ng channel" + +#~ msgid "Invalid direction." +#~ msgstr "Mali ang direksyon." + +#~ msgid "Invalid file" +#~ msgstr "Mali ang file" + +#~ msgid "Invalid number of bits" +#~ msgstr "Mali ang bilang ng bits" + +#~ msgid "Invalid phase" +#~ msgstr "Mali ang phase" + +#~ msgid "Invalid pin" +#~ msgstr "Mali ang pin" + +#~ msgid "Invalid pin for left channel" +#~ msgstr "Mali ang pin para sa kaliwang channel" + +#~ msgid "Invalid pin for right channel" +#~ msgstr "Mali ang pin para sa kanang channel" + +#~ msgid "Invalid polarity" +#~ msgstr "Mali ang polarity" + +#~ msgid "Invalid run mode." +#~ msgstr "Mali ang run mode." + +#~ msgid "Invalid voice count" +#~ msgstr "Maling bilang ng voice" + +#~ msgid "Invalid wave file" +#~ msgstr "May hindi tama sa wave file" + +#~ msgid "MISO pin init failed." +#~ msgstr "Hindi ma-initialize ang MISO pin." + +#~ msgid "MOSI pin init failed." +#~ msgstr "Hindi ma-initialize ang MOSI pin." + +#~ msgid "No hardware support on pin" +#~ msgstr "Walang support sa hardware ang pin" + +#~ 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)" + +#~ msgid "Pin does not have ADC capabilities" +#~ msgstr "Ang pin ay walang kakayahan sa ADC" + +#~ msgid "RTC calibration is not supported on this board" +#~ msgstr "RTC calibration ay hindi supportado ng board na ito" + +#~ msgid "Sample rate must be positive" +#~ msgstr "Sample rate ay dapat positibo" + +#, c-format +#~ msgid "Sample rate too high. It must be less than %d" +#~ msgstr "Sample rate ay masyadong mataas. Ito ay dapat hindi hiigit sa %d" + +#~ msgid "Stack size must be at least 256" +#~ msgstr "Ang laki ng stack ay dapat na hindi bababa sa 256" + +#~ msgid "Unsupported baudrate" +#~ msgstr "Hindi supportadong baudrate" + +#~ msgid "bytes > 8 bits not supported" +#~ msgstr "hindi sinusuportahan ang bytes > 8 bits" + +#~ msgid "calibration value out of range +/-127" +#~ msgstr "ang halaga ng pagkakalibrate ay wala sa sakop +/-127" + +#~ msgid "stop must be 1 or 2" +#~ msgstr "stop dapat 1 o 2" + +#, fuzzy +#~ msgid "timeout must be >= 0.0" +#~ msgstr "bits ay dapat walo (8)" + #~ msgid "Unsupported operation" #~ msgstr "Hindi sinusuportahang operasyon" diff --git a/locale/fr.po b/locale/fr.po index 27fdb3a54a..ce6c65ce25 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -75,10 +75,24 @@ msgstr "" "%d broches d'adresse, %d broches RGB et %d pour tile indique une hauteur de " "%d, et non %d" +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "%q et %q contiennent des broches en double" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "%q contient des broches en double" @@ -91,12 +105,7 @@ msgstr "Échec de %q : %d" msgid "%q in use" msgstr "%q en cours d'utilisation" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "index %q hors de portée" @@ -104,14 +113,34 @@ msgstr "index %q hors de portée" msgid "%q indices must be integers, not %s" msgstr "les indices %q doivent être des entiers, pas %s" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "La longueur de %q doit être %d-%d" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "La longueur de %q doit être >= 1" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "%q doit être %d-%d" @@ -128,14 +157,10 @@ msgstr "%q doit être <= %d" msgid "%q must be >= %d" msgstr "%q doit être >= %d" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "%q doit être >= 0" -#: 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 "%q doit être >= 1" @@ -144,14 +169,9 @@ msgstr "%q doit être >= 1" msgid "%q must be a string" msgstr "%q doit être une chaîne de caractères" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "%q doit être un tuple de longueur 2" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" -msgstr "%q doit être entre %d et %d" +#: py/argcheck.c +msgid "%q must be an int" +msgstr "" #: py/argcheck.c msgid "%q must be of type %q" @@ -169,7 +189,11 @@ msgstr "%q doit être une puissance de 2" msgid "%q out of bounds" msgstr "%q 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/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q est hors de porté" @@ -178,10 +202,6 @@ msgstr "%q est hors de porté" msgid "%q pin invalid" msgstr "broche %q invalide" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%q doit être un chiffre entier (int)" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "%q avec un identifiant de rapport à 0 doit être de longueur 1" @@ -344,10 +364,6 @@ msgstr "'yield from' dans une fonction async" msgid "'yield' outside function" msgstr "'yield' dehors d'une fonction" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "Des entiers (x,y) requis" - #: py/compile.c msgid "*x must be assignment target" msgstr "*x doit être la cible de l'assignement" @@ -383,10 +399,6 @@ msgstr "ADC2 est utilisé pars le Wifi" msgid "Address must be %d bytes long" msgstr "L'adresse doit être longue de %d octets" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "Type d'adresse hors portée" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "Tous les périphériques CAN sont utilisés" @@ -477,27 +489,6 @@ msgstr "Déjà en cours d'exécution" msgid "Already scanning for wifi networks" msgstr "Déjà à la recherche des réseaux wifi" -#: 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" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "Fonctionnalité AnalogOut non supportée" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "" -"AnalogOut est seulement 16 bits. Les valeurs doivent être inférieures à " -"65536." - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "'AnalogOut' n'est pas supporté sur la broche indiquée" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "Un autre PWMAudioOut est déjà actif" @@ -571,11 +562,6 @@ msgstr "Bit clock et word select doivent êtres sur des broches séquentielles" msgid "Bit clock and word select must share a clock unit" msgstr "'bit clock' et 'word select' doivent partager une horloge" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "Bit depth doit être entre 1 et 6 inclusivement, et non %d" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "La profondeur de bit doit être un multiple de 8." @@ -617,11 +603,6 @@ msgstr "Tampon + décalage trop petit %d %d %d" msgid "Buffer elements must be 4 bytes long or less" msgstr "Éléments du tampon doit être 4 octets ou moins" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "Tampon de taille incorrect. Devrait être de %d octets." - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "Le tampon n'est pas un 'bytearray'." @@ -631,7 +612,6 @@ msgstr "Le tampon n'est pas un 'bytearray'." msgid "Buffer is too small" msgstr "Le tampon est trop petit" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -646,10 +626,6 @@ msgstr "La longueur de la mémoire tampon doit être un multiple de 512" msgid "Buffer must be a multiple of 512 bytes" msgstr "La mémoire tampon doit être un multiple de 512" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "Le tampon doit être de longueur au moins 1" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -671,10 +647,6 @@ msgstr "La broche %d du bus est déjà utilisée" msgid "Byte buffer must be 16 bytes." msgstr "Le tampon doit être de 16 octets." -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "Les octets 'bytes' doivent être entre 0 et 255." - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "Les blocs CBC doivent être des multiples de 16 octets" @@ -691,6 +663,10 @@ msgstr "CRC ou somme de contrôle invalide" msgid "Call super().__init__() before accessing native object." msgstr "Appelez super().__init__() avant d'accéder à l'objet natif." +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "L'alarme peut seulement être depuis TRC IO depuis le someil profond." @@ -745,18 +721,10 @@ msgstr "" "Impossible d'avoir des réponses d'analyse pour les publicités étendues et " "connectables." -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Cannot output both channels on the same pin" -msgstr "Les 2 canaux de sortie ne peuvent être sur la même broche" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "Ne peut tirer ('pull') sur une broche d'entrée ('input') seule." -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "Impossible de lire sans broche MISO." - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "Impossible d'enregistrer vers un fichier" @@ -768,9 +736,8 @@ msgstr "Ne peut démonter '/' quand est visible par 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." +msgid "Cannot reset into bootloader because no bootloader is present" msgstr "" -"Ne peut être redémarré vers le bootloader car il n'y a pas de bootloader." #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -791,22 +758,21 @@ msgid "Cannot subclass slice" msgstr "On ne peut faire de sous-classes de tranches" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." -msgstr "Pas de transfert sans broches MOSI et MISO." +msgid "Cannot transfer without MOSI and MISO pins" +msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "Impossible de faire varier la fréquence sur un minuteur déjà utilisée" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge, only level" +msgstr "" + +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge. Only level." msgstr "Ne peut reveillé sur le board de broche. Seuleument à niveau." -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." -msgstr "Impossible d'écrire sans broche MOSI." - #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" msgstr "Ecriture sur 'CharacteristicBuffer' non fournie" @@ -819,10 +785,6 @@ msgstr "Le code principal de CircuitPython s'est écrasé durement. Oups !\n" msgid "CircuitPython was unable to allocate the heap." msgstr "CircuitPython n'as pu faire l'allocation de la pile." -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "Échec de l'initialization de la broche d'horloge." - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "Période de l'horloge trop longue" @@ -831,11 +793,6 @@ msgstr "Période de l'horloge trop longue" msgid "Clock unit in use" msgstr "Horloge en cours d'utilisation" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -msgid "Command must be an int between 0 and 255" -msgstr "La commande doit être un chiffre entier entre 0 et 255" - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -848,35 +805,6 @@ msgstr "" msgid "Corrupt .mpy file" msgstr "Fichier .mpy corrompu" -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Could not initialize Camera" -msgstr "Impossible d'initialiser Camera" - -#: ports/cxd56/common-hal/gnss/GNSS.c -msgid "Could not initialize GNSS" -msgstr "Impossible d'initialiser GNSS" - -#: ports/cxd56/common-hal/sdioio/SDCard.c -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/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "Impossible d'initialiser UART" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init channel" -msgstr "Impossible de réinitialiser le canal" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init timer" -msgstr "Impossible de réinitialiser le minuteur" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not restart PWM" -msgstr "Impossible de redémarrer PWM" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "Impossible d’obtenir l’horloge" @@ -897,20 +825,6 @@ msgstr "Impossible de démarrer l'interruption, RX occupé" msgid "Couldn't allocate decoder" msgstr "Impossible d'allouer le décodeur" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate first buffer" -msgstr "Impossible d'allouer le premier tampon" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate input buffer" -msgstr "Impossible d'allouer le tampon d'entrée" - -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate second buffer" -msgstr "Impossible d'allouer le deuxième tampon" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "Échec vers le HardFault_Handler." @@ -959,10 +873,6 @@ msgstr "La capacité de destination est plus petite que 'destination_length'." msgid "Device in use" msgstr "Appareil utilisé" -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -msgstr "DigitalInOut non pris en charge sur la broche donnée" - #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." @@ -1019,11 +929,6 @@ msgstr "Attendu un %q" msgid "Expected an alarm" msgstr "Une alarme était prévue" -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "Tuple de longueur %d attendu, obtenu %d" - #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." @@ -1051,22 +956,6 @@ msgstr "Échec de l'envoi de la commande." msgid "Failed to acquire mutex, err 0x%04x" msgstr "Echec de l'obtention de mutex, err 0x%04x" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -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/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/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/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "Impossible d’allouer la mémoire pour Wifi" @@ -1137,11 +1026,6 @@ msgstr "" msgid "Format not supported" msgstr "Format non supporté" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" -msgstr "FrameBuffer nécessite %d octets" - #: ports/mimxrt10xx/common-hal/microcontroller/Processor.c msgid "" "Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" @@ -1158,6 +1042,10 @@ msgstr "" msgid "Function requires lock" msgstr "La fonction nécessite un verrou ('lock')" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "Échec génerique" @@ -1185,17 +1073,13 @@ 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 "Hostname doit être entre 1 et 253 caractères" - #: 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é" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "Erreur d'initialisation I2C" +msgid "I2C init error" +msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c msgid "I2C peripheral in use" @@ -1313,75 +1197,33 @@ msgstr "Erreur interne" msgid "Internal error #%d" msgstr "Erreur interne #%d" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: py/argcheck.c msgid "Invalid %q" msgstr "%q invalide" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c 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/canio/CAN.c -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Invalid %q pin selection" -msgstr "Sélection de broche %q invalide" - #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "Valeur d'unité ADC non valide" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "AuthMode invalide" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "Paramètre BLE invalide" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "Fichier BMP invalide" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "BSSID invalide" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "Broche DAC non valide fournie" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "Adresse MAC invalide" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "Fichier MIDI invalide" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "Fréquence de PWM invalide" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "Broche invalide" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "Paramètre invalide" @@ -1389,42 +1231,11 @@ msgstr "Paramètre invalide" msgid "Invalid bits per value" msgstr "Bits par valeur invalides" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "Longueur de tampon invalide" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "Chaîne byteorder non valide" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "Période de capture invalide. Portée valide : 1 à 500" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "Nombre de canaux invalide" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "data_count invalide %d" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "data_pins[%d] invalide" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "Direction invalide." - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "Fichier invalide" - #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Taille de bloc de formatage invalide" @@ -1433,78 +1244,14 @@ msgstr "Taille de bloc de formatage invalide" msgid "Invalid memory access." msgstr "Accès à la mémoire invalide." -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "Adresse MAC multicast invalide" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "Nombre de bits invalide" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "Phase invalide" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "Broche invalide" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "Broche invalide pour le canal gauche" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -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/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/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "Broches invalides" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "Polarité invalide" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "Propriétés invalides" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "Mode de lancement invalide." - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "'security_mode' invalide" - #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "Taille invalide" @@ -1517,23 +1264,6 @@ msgstr "Socket non valide pour TLS" msgid "Invalid state" msgstr "État invalide" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "Voix invalide" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "Nombre de voix invalide" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "Fichier WAVE invalide" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "Longueur de mot / bit invalide" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "La clé doit comporter 16, 24 ou 32 octets" @@ -1547,25 +1277,17 @@ msgid "LHS of keyword arg must be an id" msgstr "La partie gauche de l'argument nommé doit être un identifiant" #: shared-module/displayio/Group.c -msgid "Layer already in a group." -msgstr "Couche déjà dans un groupe." +msgid "Layer already in a group" +msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." -msgstr "'Layer' doit être un 'Group' ou une sous-classe 'TileGrid'." +msgid "Layer must be a Group or TileGrid subclass" +msgstr "" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "Adresse physique (MAC) invalide" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "Échec de l'initialization de la broche MISO." - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "Échec de l'initialization de la broche MOSI." - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "" @@ -1575,10 +1297,6 @@ msgstr "" msgid "Maximum x value when mirrored is %d" msgstr "La valeur maximale de x est %d lors d'une opération miroir" -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "Messages limités à 8 octets" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Le délais au démarrage du micro doit être entre 0.0 et 1.0" @@ -1592,10 +1310,14 @@ msgstr "" msgid "Mismatched swap flag" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "Broche MISO ou MOSI manquante" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1633,11 +1355,6 @@ msgstr "first_set_pin manquant. L'instruction %d règle la/les broche(s)" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "jmp_pin manquant. L'instruction %d va passer à la broche" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "Plus de %d identifiants de rapport ne sont pas supportés" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "Doit être une sous-classe de %q." @@ -1698,15 +1415,23 @@ msgid "No I2C device at address: 0x%x" msgstr "" #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "Pas de broche MISO" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Pas de broche MOSI" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1745,16 +1470,6 @@ msgstr "Pas de GCLK libre" msgid "No hardware random available" msgstr "Aucunes source de valeurs aléatoire matérielle disponible" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "Pas de support matériel sur la broche clk" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "Pas de support matériel pour cette broche" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "Programme n'a pas de \"in\"" @@ -1905,10 +1620,13 @@ msgid "Only one address is allowed" msgstr "Seulement une adresse est autorisée" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "Seulement une alarme alarm.time peut être réglée." @@ -1940,11 +1658,6 @@ msgstr "Plus de sockets" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "Éléments du tampon de sortie doivent être <= à 4 octets" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "Tampon de sortie doit être au moins %d octets" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Le sur-échantillonage doit être un multiple de 8." @@ -1953,13 +1666,6 @@ msgstr "Le sur-échantillonage doit être un multiple de 8." msgid "PDMIn not available" msgstr "PDMIn non disponible" -#: shared-bindings/pwmio/PWMOut.c -msgid "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" -msgstr "" -"La valeur de duty_cycle de PWM doit être entre 0 et 65535 inclusivement " -"(résolution de 16 bits)" - #: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." @@ -1967,6 +1673,10 @@ msgstr "" "La fréquence de PWM n'est pas modifiable quand variable_frequency est False " "à la construction." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" +msgstr "" + #: ports/raspberrypi/common-hal/countio/Counter.c msgid "PWM slice already in use" msgstr "PWM slice déja utilisée" @@ -1983,29 +1693,14 @@ msgstr "Périphérique en utilisation" msgid "Permission denied" msgstr "Permission refusée" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "La broche ne peut être réveillée depuis un sommeil profond" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "Nombre de broches doit être au moins 1" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "Nombre de broches trop élevé" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "La broche 'pin' ne supporte pas les capacitées ADC" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2078,18 +1773,10 @@ msgstr "Le programme fait des entrées sans charger d'ISR" msgid "Program does OUT without loading OSR" msgstr "Le programme fait des sorties sans charger d'OSR" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "Le programme doit contenir au moins une instruction de 16 bits." - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "Taille du programme invalide" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "Programme trop grand" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Le tirage 'pull' n'est pas utilisé quand la direction est 'output'." @@ -2111,30 +1798,20 @@ msgstr "Erreur de désinitialisation du RNG" msgid "RNG Init Error" msgstr "Erreur d'initialisation du RNG" -#: ports/nrf/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" -msgstr "RS485 n'est pas encore supporté sur cet appareil" +#: 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 "RS485" +msgstr "" #: ports/espressif/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 sans être en mode RS485" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "La calibration du RTC non supportée sur cette carte" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "RTC non supporté sur cette carte" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/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 Pas encore supporté sur cet appareil" - #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" msgstr "Erreur de génération de chiffres aléatoires" @@ -2184,6 +1861,10 @@ msgstr "Mode sans-échec ! Le code sauvegardé n'est pas éxecuté.\n" msgid "SD card CSD format not supported" msgstr "Le format de carte SD CSD n'est pas supporté" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2194,30 +1875,21 @@ msgstr "Erreur de SDIO GetCardInfo %d" msgid "SDIO Init Error %d" msgstr "Erreur d'initialisation SDIO %d" -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "Erreur d'initialisation SPI" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "Erreur de réinitialisation SPI" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "La configuration SPI a échoué" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "Périphérique SPI utilisé" -#: shared-bindings/audiomixer/Mixer.c -msgid "Sample rate must be positive" -msgstr "Le taux d'échantillonage doit être positif" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" -msgstr "Taux d'échantillonage trop élevé. Doit être inférieur à %d" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" +msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c msgid "Scale dimensions must divide by 3" @@ -2237,14 +1909,6 @@ msgstr "Sérialiseur en cours d'utilisation" msgid "Server side context cannot have hostname" msgstr "Un contexte niveau serveur ne peut avoir de hostname" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "Nombre de broches configurées doit être entre 1 et 5" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "Nombre de broches Side configurées doit être entre 1 et 5" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "Taille n'est pas supportée" @@ -2280,10 +1944,6 @@ msgstr "Spécifiez une unique broche parmi data0 ou data_pins" msgid "Splitting with sub-captures" msgstr "Fractionnement avec des sous-captures" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "La pile doit être au moins de 256" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "Canal stéréo gauche doit être sur le canal PWM A" @@ -2380,10 +2040,6 @@ msgstr "La hauteur de la tuile doit diviser exactement la hauteur de l'image" msgid "Tile index out of bounds" msgstr "Index des tuiles hors limites" -#: shared-bindings/displayio/TileGrid.c -msgid "Tile value out of bounds" -msgstr "Valeur de tuile hors limites" - #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" msgstr "La largeur de la tuile doit diviser exactement la largeur de l'image" @@ -2403,6 +2059,9 @@ msgid "To exit, please reset the board without " msgstr "Pour quitter, SVP redémarrez la carte sans " #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample" +msgstr "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Trop de canaux dans l'échantillon." @@ -2435,24 +2094,21 @@ msgid "Tuple or struct_time argument required" msgstr "Paramètre de type tuple ou struct_time requis" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "Erreur d'allocation de tampon UART" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" +msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "Erreur de désactivation UART" +msgid "UART re-init" +msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "Erreur d'initialisation UART" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "Erreur de réinitialisation UART" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" -msgstr "Erreur d'écriture UART" +msgid "UART write" +msgstr "" #: shared-module/usb_hid/Device.c msgid "USB busy" @@ -2594,12 +2250,6 @@ msgstr "" "Problème non spécifié. Il se peut que l'invite d'association sur l'autre " "appareil ait été refusée ou ignorée." -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "Débit en bauds non supporté" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "Espace de couleur non supporté" @@ -2683,10 +2333,6 @@ msgstr "" "\n" "Pour lister les modules internes, entrez `help(\"modules\")`.\n" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" -msgstr "Le mot de passe WiFi doit faire entre 8 et 63 caractères" - #: main.c msgid "Woken up by alarm.\n" msgstr "Réveil par alarme.\n" @@ -2841,10 +2487,6 @@ msgstr "Les tailles des images doivent correspondre" msgid "bits must be 32 or less" msgstr "Les bits doivent être 32 ou moins" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "les bits doivent être compris entre 5 et 9" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "'bits_per_sample' doivent être 8 ou 16" @@ -2882,11 +2524,6 @@ msgstr "tampon trop petit pour le nombre d'octets demandé" msgid "byteorder is not a string" msgstr "byteorder n'est pas une chaîne" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -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 "bytes length n'est pas un multiple de la taille d'un élément" @@ -2895,7 +2532,7 @@ msgstr "bytes length n'est pas un multiple de la taille d'un élément" msgid "bytes value out of range" msgstr "valeur des octets hors bornes" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "étalonnage hors bornes" @@ -2903,12 +2540,9 @@ msgstr "étalonnage hors bornes" msgid "calibration is read only" msgstr "étalonnage en lecture seule" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "valeur de étalonnage hors bornes +/-127" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" +msgid "can only have one parent" msgstr "" #: py/emitinlinethumb.c @@ -3086,6 +2720,10 @@ msgstr "ne peut récupérer sans ambigüité le sizeof d'un scalaire" msgid "casting" msgstr "typage" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "tampon de caractères trop petit" @@ -3098,10 +2736,6 @@ msgstr "paramètre de chr() hors les bornes de range(0x11000)" msgid "chr() arg not in range(256)" msgstr "paramètre de chr() hors les bornes de range(256)" -#: shared-module/vectorio/Circle.c -msgid "circle can only be registered in one parent" -msgstr "le cercle ne peut être enregistré que dans un seul parent" - #: shared-bindings/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "point de coupure doît être un tuple (x,y)" @@ -3531,6 +3165,10 @@ msgid "indices must be integers, slices, or Boolean lists" msgstr "" "les indices doivent être des entiers, des tranches ou des listes booléennes" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "les valeurs initiales doivent être itérables" @@ -3786,10 +3424,6 @@ msgstr "erreur de domaine math" msgid "matrix is not positive definite" msgstr "la matrice n'est pas définie positive" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3797,10 +3431,6 @@ msgstr "" 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 "max_length doit être >= 0" - #: extmod/ulab/code/ndarray.c msgid "maximum number of dimensions is 4" msgstr "nombre maximal de dimensions est 4" @@ -4176,10 +3806,6 @@ msgstr "" msgid "poll on file not available on win32" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "le polygone ne peut être enregistré que dans un parent" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "'pop' d'une entrée PulseIn vide" @@ -4226,14 +3852,6 @@ msgstr "appuyer le bouton de gauche au démarage\n" msgid "pull masks conflict with direction masks" msgstr "masque pull est en conflit avec les masques de direction" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "pull_threshold doit être entre 1 et 32" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "push_threshold doit être entre 1 et 32" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "dépassement de file" @@ -4406,10 +4024,6 @@ msgstr "'start_x' doit être un entier 'int'" msgid "step must be non-zero" msgstr "le pas 'step' doit être non nul" -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "stop doit être 1 ou 2" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "stop n'est pas accessible au démarrage" @@ -4459,10 +4073,6 @@ msgstr "erreur de syntaxe dans le descripteur d'uctypes" msgid "threshold must be in the range 0-65536" msgstr "le seuil doit être dans la portée 0-65536" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "tile doit être plus que zéro" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() prend une séquence de longueur 9" @@ -4482,10 +4092,6 @@ msgstr "le délai doit être compris entre 0.0 et 100.0 secondes" msgid "timeout must be < 655.35 secs" msgstr "le délai (timeout) doit être < 655.35 secondes" -#: shared-bindings/_bleio/CharacteristicBuffer.c -msgid "timeout must be >= 0.0" -msgstr "'timeout' doit être >= 0.0" - #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" msgstr "Délai d’expiration dépassé en attendant une carte v1" @@ -4494,6 +4100,10 @@ msgstr "Délai d’expiration dépassé en attendant une carte v1" msgid "timeout waiting for v2 card" msgstr "Délai d’expiration dépassé en attendant une carte v2" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +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" @@ -4685,13 +4295,7 @@ msgstr "chien de garde (watchdog) non initialisé" msgid "watchdog timeout must be greater than 0" msgstr "watchdog timeout doit être supérieur à 0" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "width doit être entre 2 et 8 (inclusivement), non %d" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "width doit être plus que zero" @@ -4763,6 +4367,346 @@ msgstr "zi doit être de type float" msgid "zi must be of shape (n_section, 2)" msgstr "zi doit être de forme (n_section, 2)" +#~ msgid "%q must be a tuple of length 2" +#~ msgstr "%q doit être un tuple de longueur 2" + +#~ msgid "%q must be between %d and %d" +#~ msgstr "%q doit être entre %d et %d" + +#~ msgid "%q should be an int" +#~ msgstr "%q doit être un chiffre entier (int)" + +#~ msgid "(x,y) integers required" +#~ msgstr "Des entiers (x,y) requis" + +#~ msgid "Address type out of range" +#~ msgstr "Type d'adresse hors portée" + +#~ msgid "AnalogIn not supported on given pin" +#~ msgstr "'AnalogOut' n'est pas supporté sur la broche indiquée" + +#~ msgid "AnalogOut functionality not supported" +#~ msgstr "Fonctionnalité AnalogOut non supportée" + +#~ msgid "AnalogOut is only 16 bits. Value must be less than 65536." +#~ msgstr "" +#~ "AnalogOut est seulement 16 bits. Les valeurs doivent être inférieures à " +#~ "65536." + +#~ msgid "AnalogOut not supported on given pin" +#~ msgstr "'AnalogOut' n'est pas supporté sur la broche indiquée" + +#, c-format +#~ msgid "Bit depth must be from 1 to 6 inclusive, not %d" +#~ msgstr "Bit depth doit être entre 1 et 6 inclusivement, et non %d" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "Tampon de taille incorrect. Devrait être de %d octets." + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "Le tampon doit être de longueur au moins 1" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "Les octets 'bytes' doivent être entre 0 et 255." + +#~ msgid "Cannot output both channels on the same pin" +#~ msgstr "Les 2 canaux de sortie ne peuvent être sur la même broche" + +#~ msgid "Cannot read without MISO pin." +#~ msgstr "Impossible de lire sans broche MISO." + +#~ msgid "Cannot reset into bootloader because no bootloader is present." +#~ msgstr "" +#~ "Ne peut être redémarré vers le bootloader car il n'y a pas de bootloader." + +#~ msgid "Cannot transfer without MOSI and MISO pins." +#~ msgstr "Pas de transfert sans broches MOSI et MISO." + +#~ msgid "Cannot write without MOSI pin." +#~ msgstr "Impossible d'écrire sans broche MOSI." + +#~ msgid "Clock pin init failed." +#~ msgstr "Échec de l'initialization de la broche d'horloge." + +#~ msgid "Command must be an int between 0 and 255" +#~ msgstr "La commande doit être un chiffre entier entre 0 et 255" + +#~ msgid "Could not initialize Camera" +#~ msgstr "Impossible d'initialiser Camera" + +#~ msgid "Could not initialize GNSS" +#~ msgstr "Impossible d'initialiser GNSS" + +#~ msgid "Could not initialize SDCard" +#~ msgstr "Impossible d'initialiser la carte SD" + +#~ msgid "Could not initialize UART" +#~ msgstr "Impossible d'initialiser UART" + +#~ msgid "Could not re-init channel" +#~ msgstr "Impossible de réinitialiser le canal" + +#~ msgid "Could not re-init timer" +#~ msgstr "Impossible de réinitialiser le minuteur" + +#~ msgid "Could not restart PWM" +#~ msgstr "Impossible de redémarrer PWM" + +#~ msgid "Couldn't allocate first buffer" +#~ msgstr "Impossible d'allouer le premier tampon" + +#~ msgid "Couldn't allocate input buffer" +#~ msgstr "Impossible d'allouer le tampon d'entrée" + +#~ msgid "Couldn't allocate second buffer" +#~ msgstr "Impossible d'allouer le deuxième tampon" + +#~ msgid "DigitalInOut not supported on given pin" +#~ msgstr "DigitalInOut non pris en charge sur la broche donnée" + +#, c-format +#~ msgid "Expected tuple of length %d, got %d" +#~ msgstr "Tuple de longueur %d attendu, obtenu %d" + +#~ msgid "Failed to allocate RX buffer" +#~ msgstr "Echec de l'allocation du tampon RX" + +#, c-format +#~ msgid "Failed to allocate RX buffer of %d bytes" +#~ msgstr "Echec de l'allocation de %d octets du tampon RX" + +#, c-format +#~ msgid "Framebuffer requires %d bytes" +#~ msgstr "FrameBuffer nécessite %d octets" + +#~ msgid "Hostname must be between 1 and 253 characters" +#~ msgstr "Hostname doit être entre 1 et 253 caractères" + +#~ msgid "I2C Init Error" +#~ msgstr "Erreur d'initialisation I2C" + +#~ msgid "Invalid %q pin selection" +#~ msgstr "Sélection de broche %q invalide" + +#~ msgid "Invalid AuthMode" +#~ msgstr "AuthMode invalide" + +#~ msgid "Invalid BMP file" +#~ msgstr "Fichier BMP invalide" + +#~ msgid "Invalid DAC pin supplied" +#~ msgstr "Broche DAC non valide fournie" + +#~ msgid "Invalid MIDI file" +#~ msgstr "Fichier MIDI invalide" + +#~ msgid "Invalid PWM frequency" +#~ msgstr "Fréquence de PWM invalide" + +#~ msgid "Invalid Pin" +#~ msgstr "Broche invalide" + +#~ msgid "Invalid buffer size" +#~ msgstr "Longueur de tampon invalide" + +#~ msgid "Invalid byteorder string" +#~ msgstr "Chaîne byteorder non valide" + +#~ msgid "Invalid capture period. Valid range: 1 - 500" +#~ msgstr "Période de capture invalide. Portée valide : 1 à 500" + +#~ msgid "Invalid channel count" +#~ msgstr "Nombre de canaux invalide" + +#, c-format +#~ msgid "Invalid data_count %d" +#~ msgstr "data_count invalide %d" + +#~ msgid "Invalid direction." +#~ msgstr "Direction invalide." + +#~ msgid "Invalid file" +#~ msgstr "Fichier invalide" + +#~ msgid "Invalid number of bits" +#~ msgstr "Nombre de bits invalide" + +#~ msgid "Invalid phase" +#~ msgstr "Phase invalide" + +#~ msgid "Invalid pin" +#~ msgstr "Broche invalide" + +#~ msgid "Invalid pin for left channel" +#~ msgstr "Broche invalide pour le canal gauche" + +#~ msgid "Invalid pin for right channel" +#~ msgstr "Broche invalide pour le canal droit" + +#~ msgid "Invalid polarity" +#~ msgstr "Polarité invalide" + +#~ msgid "Invalid properties" +#~ msgstr "Propriétés invalides" + +#~ msgid "Invalid run mode." +#~ msgstr "Mode de lancement invalide." + +#~ msgid "Invalid security_mode" +#~ msgstr "'security_mode' invalide" + +#~ msgid "Invalid voice" +#~ msgstr "Voix invalide" + +#~ msgid "Invalid voice count" +#~ msgstr "Nombre de voix invalide" + +#~ msgid "Invalid wave file" +#~ msgstr "Fichier WAVE invalide" + +#~ msgid "Invalid word/bit length" +#~ msgstr "Longueur de mot / bit invalide" + +#~ msgid "Layer already in a group." +#~ msgstr "Couche déjà dans un groupe." + +#~ msgid "Layer must be a Group or TileGrid subclass." +#~ msgstr "'Layer' doit être un 'Group' ou une sous-classe 'TileGrid'." + +#~ msgid "MISO pin init failed." +#~ msgstr "Échec de l'initialization de la broche MISO." + +#~ msgid "MOSI pin init failed." +#~ msgstr "Échec de l'initialization de la broche MOSI." + +#~ msgid "Messages limited to 8 bytes" +#~ msgstr "Messages limités à 8 octets" + +#, c-format +#~ msgid "More than %d report ids not supported" +#~ msgstr "Plus de %d identifiants de rapport ne sont pas supportés" + +#~ msgid "No hardware support on clk pin" +#~ msgstr "Pas de support matériel sur la broche clk" + +#~ msgid "No hardware support on pin" +#~ msgstr "Pas de support matériel pour cette broche" + +#, c-format +#~ msgid "Output buffer must be at least %d bytes" +#~ msgstr "Tampon de sortie doit être au moins %d octets" + +#~ msgid "" +#~ "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +#~ msgstr "" +#~ "La valeur de duty_cycle de PWM doit être entre 0 et 65535 inclusivement " +#~ "(résolution de 16 bits)" + +#~ msgid "Pin count must be at least 1" +#~ msgstr "Nombre de broches doit être au moins 1" + +#~ msgid "Pin does not have ADC capabilities" +#~ msgstr "La broche 'pin' ne supporte pas les capacitées ADC" + +#~ msgid "Program must contain at least one 16-bit instruction." +#~ msgstr "Le programme doit contenir au moins une instruction de 16 bits." + +#~ msgid "Program too large" +#~ msgstr "Programme trop grand" + +#~ msgid "RS485 Not yet supported on this device" +#~ msgstr "RS485 n'est pas encore supporté sur cet appareil" + +#~ msgid "RTC calibration is not supported on this board" +#~ msgstr "La calibration du RTC non supportée sur cette carte" + +#~ msgid "RTS/CTS/RS485 Not yet supported on this device" +#~ msgstr "RTS / CTS / RS485 Pas encore supporté sur cet appareil" + +#~ msgid "SPI Init Error" +#~ msgstr "Erreur d'initialisation SPI" + +#~ msgid "SPI Re-initialization error" +#~ msgstr "Erreur de réinitialisation SPI" + +#~ msgid "Sample rate must be positive" +#~ msgstr "Le taux d'échantillonage doit être positif" + +#, c-format +#~ msgid "Sample rate too high. It must be less than %d" +#~ msgstr "Taux d'échantillonage trop élevé. Doit être inférieur à %d" + +#~ msgid "Set pin count must be between 1 and 5" +#~ msgstr "Nombre de broches configurées doit être entre 1 et 5" + +#~ msgid "Side set pin count must be between 1 and 5" +#~ msgstr "Nombre de broches Side configurées doit être entre 1 et 5" + +#~ msgid "Stack size must be at least 256" +#~ msgstr "La pile doit être au moins de 256" + +#~ msgid "Tile value out of bounds" +#~ msgstr "Valeur de tuile hors limites" + +#~ msgid "UART Buffer allocation error" +#~ msgstr "Erreur d'allocation de tampon UART" + +#~ msgid "UART De-init error" +#~ msgstr "Erreur de désactivation UART" + +#~ msgid "UART Init Error" +#~ msgstr "Erreur d'initialisation UART" + +#~ msgid "UART Re-init error" +#~ msgstr "Erreur de réinitialisation UART" + +#~ msgid "UART write error" +#~ msgstr "Erreur d'écriture UART" + +#~ msgid "Unsupported baudrate" +#~ msgstr "Débit en bauds non supporté" + +#~ msgid "WiFi password must be between 8 and 63 characters" +#~ msgstr "Le mot de passe WiFi doit faire entre 8 et 63 caractères" + +#~ msgid "bits must be in range 5 to 9" +#~ msgstr "les bits doivent être compris entre 5 et 9" + +#~ msgid "bytes > 8 bits not supported" +#~ msgstr "octets > 8 bits non supporté" + +#~ msgid "calibration value out of range +/-127" +#~ msgstr "valeur de étalonnage hors bornes +/-127" + +#~ msgid "circle can only be registered in one parent" +#~ msgstr "le cercle ne peut être enregistré que dans un seul parent" + +#~ msgid "max_length must be >= 0" +#~ msgstr "max_length doit être >= 0" + +#~ msgid "polygon can only be registered in one parent" +#~ msgstr "le polygone ne peut être enregistré que dans un parent" + +#~ msgid "pull_threshold must be between 1 and 32" +#~ msgstr "pull_threshold doit être entre 1 et 32" + +#~ msgid "push_threshold must be between 1 and 32" +#~ msgstr "push_threshold doit être entre 1 et 32" + +#~ msgid "stop must be 1 or 2" +#~ msgstr "stop doit être 1 ou 2" + +#~ msgid "tile must be greater than zero" +#~ msgstr "tile doit être plus que zéro" + +#~ msgid "timeout must be >= 0.0" +#~ msgstr "'timeout' doit être >= 0.0" + +#, c-format +#~ msgid "width must be from 2 to 8 (inclusive), not %d" +#~ msgstr "width doit être entre 2 et 8 (inclusivement), non %d" + #~ msgid "Unsupported operation" #~ msgstr "Opération non supportée" diff --git a/locale/hi.po b/locale/hi.po index 5f18b16a23..b3367cf365 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -66,10 +66,24 @@ msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "" +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "" @@ -82,12 +96,7 @@ msgstr "" msgid "%q in use" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "" @@ -95,14 +104,34 @@ msgstr "" msgid "%q indices must be integers, not %s" msgstr "" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "" @@ -119,14 +148,10 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.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 "" @@ -135,13 +160,8 @@ msgstr "" msgid "%q must be a string" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" +#: py/argcheck.c +msgid "%q must be an int" msgstr "" #: py/argcheck.c @@ -160,7 +180,11 @@ msgstr "" msgid "%q 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/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "" @@ -169,10 +193,6 @@ msgstr "" msgid "%q pin invalid" msgstr "" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "" @@ -335,10 +355,6 @@ msgstr "" msgid "'yield' outside function" msgstr "" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "" - #: py/compile.c msgid "*x must be assignment target" msgstr "" @@ -374,10 +390,6 @@ msgstr "" msgid "Address must be %d bytes long" msgstr "" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "" @@ -468,25 +480,6 @@ msgstr "" msgid "Already scanning for wifi networks" 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 -#: ports/raspberrypi/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/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "" @@ -556,11 +549,6 @@ msgstr "" msgid "Bit clock and word select must share a clock unit" msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "" @@ -602,11 +590,6 @@ msgstr "" msgid "Buffer elements must be 4 bytes long or less" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "" - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "" @@ -616,7 +599,6 @@ msgstr "" msgid "Buffer is too small" msgstr "" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -631,10 +613,6 @@ msgstr "" msgid "Buffer must be a multiple of 512 bytes" msgstr "" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -656,10 +634,6 @@ msgstr "" msgid "Byte buffer must be 16 bytes." msgstr "" -#: shared-bindings/alarm/SleepMemory.c 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 "" @@ -676,6 +650,10 @@ msgstr "" msgid "Call super().__init__() before accessing native object." msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" @@ -723,18 +701,10 @@ msgstr "" 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 "" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only 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 "" @@ -746,7 +716,7 @@ 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." +msgid "Cannot reset into bootloader because no bootloader is present" msgstr "" #: ports/espressif/common-hal/socketpool/Socket.c @@ -767,20 +737,19 @@ msgid "Cannot subclass slice" msgstr "" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." +msgid "Cannot transfer without MOSI and MISO pins" msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c -msgid "Cannot wake on pin edge. Only level." +msgid "Cannot wake on pin edge, only level" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge. Only level." msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -795,10 +764,6 @@ msgstr "" msgid "CircuitPython was unable to allocate the heap." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "" - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "" @@ -807,11 +772,6 @@ msgstr "" msgid "Clock unit in use" msgstr "" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/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 " @@ -822,35 +782,6 @@ msgstr "" msgid "Corrupt .mpy file" 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 "" - -#: 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 -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -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 "" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "" @@ -871,20 +802,6 @@ msgstr "" 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 "" @@ -932,10 +849,6 @@ msgstr "" 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." @@ -991,11 +904,6 @@ msgstr "" msgid "Expected an alarm" msgstr "" -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "" - #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." @@ -1022,22 +930,6 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/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/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/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/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "" @@ -1106,11 +998,6 @@ msgstr "" msgid "Format not supported" msgstr "" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" -msgstr "" - #: ports/mimxrt10xx/common-hal/microcontroller/Processor.c msgid "" "Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" @@ -1125,6 +1012,10 @@ msgstr "" msgid "Function requires lock" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1152,16 +1043,12 @@ 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 "" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" +msgid "I2C init error" msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c @@ -1269,75 +1156,33 @@ msgstr "" msgid "Internal error #%d" msgstr "" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: py/argcheck.c msgid "Invalid %q" msgstr "" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.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/canio/CAN.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 "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "" @@ -1345,42 +1190,11 @@ msgstr "" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" 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 "" @@ -1389,78 +1203,14 @@ msgstr "" msgid "Invalid memory access." msgstr "" -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" 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 -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.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/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" 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 "" - #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" @@ -1473,23 +1223,6 @@ msgstr "" msgid "Invalid state" 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/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "" @@ -1503,25 +1236,17 @@ msgid "LHS of keyword arg must be an id" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer already in a group." +msgid "Layer already in a group" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." +msgid "Layer must be a Group or TileGrid subclass" msgstr "" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "" - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "" - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "" @@ -1531,10 +1256,6 @@ msgstr "" msgid "Maximum x value when mirrored is %d" msgstr "" -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" @@ -1548,10 +1269,14 @@ msgstr "" msgid "Mismatched swap flag" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1587,11 +1312,6 @@ msgstr "" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" @@ -1652,15 +1372,23 @@ msgid "No I2C device at address: 0x%x" msgstr "" #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1699,16 +1427,6 @@ msgstr "" 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/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "" @@ -1853,10 +1571,13 @@ msgid "Only one address is allowed" msgstr "" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "" @@ -1888,11 +1609,6 @@ msgstr "" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "" @@ -1903,12 +1619,11 @@ msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +"PWM frequency not writable when variable_frequency is False on construction." msgstr "" -#: shared-bindings/pwmio/PWMOut.c -msgid "" -"PWM frequency not writable when variable_frequency is False on construction." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" msgstr "" #: ports/raspberrypi/common-hal/countio/Counter.c @@ -1927,29 +1642,14 @@ msgstr "" msgid "Permission denied" msgstr "" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2016,18 +1716,10 @@ msgstr "" msgid "Program does OUT without loading OSR" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "" - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -2049,8 +1741,9 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" +#: 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 "RS485" msgstr "" #: ports/espressif/common-hal/busio/UART.c @@ -2058,21 +1751,10 @@ msgstr "" msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "" - #: shared-bindings/alarm/time/TimeAlarm.c 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/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 "" @@ -2122,6 +1804,10 @@ msgstr "" msgid "SD card CSD format not supported" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2132,29 +1818,20 @@ msgstr "" 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 "" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" 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" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c @@ -2175,14 +1852,6 @@ msgstr "" msgid "Server side context cannot have hostname" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "" @@ -2218,10 +1887,6 @@ msgstr "" msgid "Splitting with sub-captures" msgstr "" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "" @@ -2307,10 +1972,6 @@ msgstr "" 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 "" @@ -2330,6 +1991,9 @@ msgid "To exit, please reset the board without " msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample" +msgstr "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -2362,23 +2026,20 @@ msgid "Tuple or struct_time argument required" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" +msgid "UART re-init" 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" +msgid "UART write" msgstr "" #: shared-module/usb_hid/Device.c @@ -2515,12 +2176,6 @@ msgid "" "declined or ignored." msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "" @@ -2595,10 +2250,6 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" -msgstr "" - #: main.c msgid "Woken up by alarm.\n" msgstr "" @@ -2751,10 +2402,6 @@ msgstr "" msgid "bits must be 32 or less" msgstr "" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -2792,11 +2439,6 @@ msgstr "" msgid "byteorder is not a string" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/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 "" @@ -2805,7 +2447,7 @@ msgstr "" msgid "bytes value out of range" msgstr "" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "" @@ -2813,12 +2455,9 @@ msgstr "" msgid "calibration is read only" msgstr "" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" +msgid "can only have one parent" msgstr "" #: py/emitinlinethumb.c @@ -2989,6 +2628,10 @@ msgstr "" msgid "casting" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "" @@ -3001,10 +2644,6 @@ msgstr "" 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/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "" @@ -3429,6 +3068,10 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "" @@ -3679,10 +3322,6 @@ msgstr "" msgid "matrix is not positive definite" msgstr "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3690,10 +3329,6 @@ 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 "" - #: extmod/ulab/code/ndarray.c msgid "maximum number of dimensions is 4" msgstr "" @@ -4064,10 +3699,6 @@ msgstr "" msgid "poll on file not available on win32" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" @@ -4114,14 +3745,6 @@ msgstr "" msgid "pull masks conflict with direction masks" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "" @@ -4292,10 +3915,6 @@ msgstr "" 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 "" @@ -4344,10 +3963,6 @@ msgstr "" msgid "threshold must be in the range 0-65536" msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "" @@ -4367,10 +3982,6 @@ msgstr "" msgid "timeout must be < 655.35 secs" 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 "" @@ -4379,6 +3990,10 @@ msgstr "" msgid "timeout waiting for v2 card" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "" @@ -4570,13 +4185,7 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 08fd145a80..779b284b35 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -73,10 +73,24 @@ msgid "" msgstr "" "%d pin indirizzo, %d pin rgb e %d tessere indicano l'altezza di %d, non %d" +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "" @@ -89,12 +103,7 @@ msgstr "%q fallito: %d" msgid "%q in use" msgstr "%q in uso" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "indice %q fuori intervallo" @@ -102,14 +111,34 @@ msgstr "indice %q fuori intervallo" msgid "%q indices must be integers, not %s" msgstr "gli indici %q devono essere interi, non %s" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "" @@ -126,14 +155,10 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "%q deve essere >= 0" -#: 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 #, fuzzy msgid "%q must be >= 1" @@ -143,13 +168,8 @@ msgstr "slice del buffer devono essere della stessa lunghezza" msgid "%q must be a string" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "%q deve essere una tupla di lunghezza 2" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" +#: py/argcheck.c +msgid "%q must be an int" msgstr "" #: py/argcheck.c @@ -168,7 +188,11 @@ msgstr "" msgid "%q 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/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q oltre il limite" @@ -177,10 +201,6 @@ msgstr "%q oltre il limite" msgid "%q pin invalid" msgstr "%q pin non valido" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%q dovrebbe essere un int" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "" @@ -344,10 +364,6 @@ msgstr "'yield from' è nella funzione sincronizzazione" msgid "'yield' outside function" msgstr "'yield' al di fuori della funzione" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "" - #: py/compile.c msgid "*x must be assignment target" msgstr "*x deve essere il bersaglio del assegnamento" @@ -383,10 +399,6 @@ msgstr "ADC2 sta usando il WiFi" msgid "Address must be %d bytes long" msgstr "L'indirizzo deve essere lungo %d byte" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "Tipo di indirizzo fuori intervallo" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "Tutte le periferiche CAN sono in uso" @@ -478,25 +490,6 @@ msgstr "Già in funzione" msgid "Already scanning for wifi networks" msgstr "Già in ricerca di collegamenti WiFi" -#: 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 -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "funzionalità AnalogOut non supportata" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "AnalogOut ha solo 16 bit. Il valore deve essere meno di 65536." - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "AnalogOut non supportato sul pin scelto" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "" @@ -569,11 +562,6 @@ msgid "Bit clock and word select must share a clock unit" msgstr "" "Clock di bit e selezione parola devono condividere la stessa unità di clock" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "La profondità dei bit deve essere inclusiva da 1 a 6, non %d" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "La profondità di bit deve essere un multiplo di 8." @@ -615,11 +603,6 @@ msgstr "Buffer + offset troppo piccolo %d %d %d" msgid "Buffer elements must be 4 bytes long or less" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "Buffer di lunghezza non valida. Dovrebbe essere di %d bytes." - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "Buffer non è un array di bites." @@ -629,7 +612,6 @@ msgstr "Buffer non è un array di bites." msgid "Buffer is too small" msgstr "Buffer troppo piccolo" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -644,10 +626,6 @@ msgstr "La lunghezza del buffer deve essere un multiplo di 512" msgid "Buffer must be a multiple of 512 bytes" msgstr "Il buffer deve essere un multiplo di 512 bytes" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "Il buffer deve essere lungo almeno 1" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -669,10 +647,6 @@ msgstr "Bus pin %d è già in uso" msgid "Byte buffer must be 16 bytes." msgstr "I buffer byte devono essere di almeno 16 bytes." -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "I byte devono essere compresi tra 0 e 255." - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "I blocchi CBC devono essere multipli di 16 bytes" @@ -689,6 +663,10 @@ msgstr "CRC o controllo totale è risultato non valido" msgid "Call super().__init__() before accessing native object." msgstr "Chiama super().__init__() prima di accedere ad un oggetto nativo." +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" @@ -737,18 +715,10 @@ msgstr "Impossibile leggere la temperatura. status: 0x%02x" 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 "Impossibile dare in output entrambi i canal sullo stesso pin" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "Impossibile leggere senza pin MISO." - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "Impossibile registrare in un file" @@ -760,9 +730,8 @@ 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." +msgid "Cannot reset into bootloader because no bootloader is present" msgstr "" -"Impossibile resettare nel bootloader poiché nessun bootloader è presente." #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -782,21 +751,20 @@ msgid "Cannot subclass slice" msgstr "Impossibile subclasare slice" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." -msgstr "Impossibile trasferire senza i pin MOSI e MISO." +msgid "Cannot transfer without MOSI and MISO pins" +msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c -msgid "Cannot wake on pin edge. Only level." +msgid "Cannot wake on pin edge, only level" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." -msgstr "Impossibile scrivere senza pin MOSI." +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge. Only level." +msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" @@ -810,10 +778,6 @@ msgstr "" msgid "CircuitPython was unable to allocate the heap." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "Inizializzazione del pin di clock fallita." - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "Orologio e troppo allungato" @@ -822,12 +786,6 @@ msgstr "Orologio e troppo allungato" msgid "Clock unit in use" msgstr "Unità di clock in uso" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -#, fuzzy -msgid "Command must be an int between 0 and 255" -msgstr "I byte devono essere compresi tra 0 e 255" - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -838,35 +796,6 @@ msgstr "" msgid "Corrupt .mpy file" 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 "" - -#: 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 -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "Impossibile inizializzare l'UART" - -#: 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 "" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "" @@ -887,20 +816,6 @@ msgstr "" 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 "Impossibile allocare il primo buffer" - -#: 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 "Impossibile allocare il secondo buffer" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "" @@ -950,10 +865,6 @@ msgstr "La capacità di destinazione è più piccola di destination_length." 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." @@ -1009,11 +920,6 @@ msgstr "Atteso un %q" msgid "Expected an alarm" msgstr "" -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "" - #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." @@ -1040,22 +946,6 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "Impossibile acquisire il mutex, err 0x%04x" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -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/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/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/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "" @@ -1124,11 +1014,6 @@ msgstr "" msgid "Format not supported" msgstr "" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" -msgstr "" - #: ports/mimxrt10xx/common-hal/microcontroller/Processor.c msgid "" "Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" @@ -1143,6 +1028,10 @@ msgstr "" msgid "Function requires lock" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1170,16 +1059,12 @@ 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" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" +msgid "I2C init error" msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c @@ -1289,75 +1174,33 @@ msgstr "" msgid "Internal error #%d" msgstr "" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: py/argcheck.c msgid "Invalid %q" msgstr "" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c 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/canio/CAN.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 "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "File BMP non valido" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "Frequenza PWM non valida" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "Argomento non valido" @@ -1365,44 +1208,11 @@ msgstr "Argomento non valido" msgid "Invalid bits per value" msgstr "bits per valore invalido" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -#, fuzzy -msgid "Invalid buffer size" -msgstr "lunghezza del buffer non valida" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "periodo di cattura invalido. Zona valida: 1 - 500" - -#: shared-bindings/audiomixer/Mixer.c -#, fuzzy -msgid "Invalid channel count" -msgstr "Argomento non valido" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "Direzione non valida." - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "File non valido" - #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "" @@ -1411,78 +1221,14 @@ msgstr "" msgid "Invalid memory access." msgstr "" -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "Numero di bit non valido" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "Fase non valida" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "Pin non valido" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "Pin non valido per il canale sinistro" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -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/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/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "Pin non validi" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "Polarità non valida" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "Modalità di esecuzione non valida." - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "" - #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" @@ -1495,24 +1241,6 @@ msgstr "" msgid "Invalid state" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -#, fuzzy -msgid "Invalid voice count" -msgstr "Tipo di servizio non valido" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "File wave non valido" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "" @@ -1526,25 +1254,17 @@ msgid "LHS of keyword arg must be an id" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer already in a group." +msgid "Layer already in a group" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." -msgstr "Layer deve essere un Group o TileGrid subclass" +msgid "Layer must be a Group or TileGrid subclass" +msgstr "" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "inizializzazione del pin MISO fallita." - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "inizializzazione del pin MOSI fallita." - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "" @@ -1554,10 +1274,6 @@ msgstr "" 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 "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" @@ -1572,10 +1288,14 @@ msgstr "" msgid "Mismatched swap flag" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1611,11 +1331,6 @@ msgstr "" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" @@ -1676,15 +1391,23 @@ msgid "No I2C device at address: 0x%x" msgstr "" #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1723,16 +1446,6 @@ msgstr "Nessun GCLK libero" msgid "No hardware random available" msgstr "Nessun generatore hardware di numeri casuali disponibile" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "Nessun supporto hardware sul pin" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "" @@ -1881,10 +1594,13 @@ msgid "Only one address is allowed" msgstr "" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "" @@ -1916,11 +1632,6 @@ msgstr "" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "L'oversampling deve essere multiplo di 8." @@ -1929,13 +1640,6 @@ msgstr "L'oversampling deve essere multiplo di 8." msgid "PDMIn not available" msgstr "" -#: 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/pwmio/PWMOut.c #, fuzzy msgid "" @@ -1944,6 +1648,10 @@ msgstr "" "frequenza PWM frequency non è scrivibile quando variable_frequency è " "impostato nel costruttore a False." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" +msgstr "" + #: ports/raspberrypi/common-hal/countio/Counter.c msgid "PWM slice already in use" msgstr "" @@ -1960,29 +1668,14 @@ msgstr "" msgid "Permission denied" msgstr "Permesso negato" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "Il pin non ha capacità di ADC" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2050,18 +1743,10 @@ msgstr "" msgid "Program does OUT without loading OSR" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "" - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -2083,8 +1768,9 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" +#: 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 "RS485" msgstr "" #: ports/espressif/common-hal/busio/UART.c @@ -2092,21 +1778,10 @@ msgstr "" msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "calibrazione RTC non supportata su questa scheda" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "RTC non supportato su questa scheda" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/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 "" @@ -2157,6 +1832,10 @@ msgstr "Modalità sicura in esecuzione! Codice salvato non in esecuzione.\n" msgid "SD card CSD format not supported" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2167,32 +1846,21 @@ msgstr "" 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 "" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -#, fuzzy -msgid "Sample rate must be positive" -msgstr "STA deve essere attiva" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" msgstr "" -"Frequenza di campionamento troppo alta. Il valore deve essere inferiore a %d" #: shared-bindings/is31fl3741/FrameBuffer.c msgid "Scale dimensions must divide by 3" @@ -2212,14 +1880,6 @@ msgstr "Serializer in uso" msgid "Server side context cannot have hostname" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "" @@ -2255,10 +1915,6 @@ msgstr "" msgid "Splitting with sub-captures" msgstr "Suddivisione con sotto-catture" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "La dimensione dello stack deve essere almeno 256" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "" @@ -2344,10 +2000,6 @@ msgstr "" 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 "" @@ -2367,6 +2019,9 @@ 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 "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -2399,23 +2054,20 @@ msgid "Tuple or struct_time argument required" msgstr "Tupla o struct_time richiesto come argomento" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" +msgid "UART re-init" 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" +msgid "UART write" msgstr "" #: shared-module/usb_hid/Device.c @@ -2553,12 +2205,6 @@ msgid "" "declined or ignored." msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "baudrate non supportato" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "" @@ -2634,10 +2280,6 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" -msgstr "" - #: main.c msgid "Woken up by alarm.\n" msgstr "" @@ -2790,10 +2432,6 @@ msgstr "" msgid "bits must be 32 or less" msgstr "" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c #, fuzzy msgid "bits_per_sample must be 8 or 16" @@ -2834,11 +2472,6 @@ msgstr "" msgid "byteorder is not a string" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -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 "" @@ -2847,7 +2480,7 @@ msgstr "" msgid "bytes value out of range" msgstr "valore byte fuori intervallo" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "la calibrazione è fuori intervallo" @@ -2855,12 +2488,9 @@ msgstr "la calibrazione è fuori intervallo" msgid "calibration is read only" msgstr "la calibrazione è in sola lettura" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "valore di calibrazione fuori intervallo +/-127" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" +msgid "can only have one parent" msgstr "" #: py/emitinlinethumb.c @@ -3032,6 +2662,10 @@ msgstr "" msgid "casting" msgstr "casting" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "buffer dei caratteri troppo piccolo" @@ -3044,10 +2678,6 @@ msgstr "argomento di chr() non è in range(0x110000)" msgid "chr() arg not in range(256)" msgstr "argomento di chr() non è in range(256)" -#: shared-module/vectorio/Circle.c -msgid "circle can only be registered in one parent" -msgstr "" - #: shared-bindings/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "" @@ -3479,6 +3109,10 @@ msgstr "gli indici devono essere interi" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "" @@ -3734,10 +3368,6 @@ msgstr "errore di dominio matematico" msgid "matrix is not positive definite" msgstr "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3745,10 +3375,6 @@ 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 "" - #: extmod/ulab/code/ndarray.c msgid "maximum number of dimensions is 4" msgstr "" @@ -4125,10 +3751,6 @@ msgstr "pixel_shader deve essere displayio.Palette o displayio.ColorConverter" msgid "poll on file not available on win32" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop sun un PulseIn vuoto" @@ -4175,14 +3797,6 @@ msgstr "" msgid "pull masks conflict with direction masks" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "overflow della coda" @@ -4356,10 +3970,6 @@ msgstr "y dovrebbe essere un int" msgid "step must be non-zero" msgstr "step deve essere non zero" -#: 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 "stop non raggiungibile dall'inizio" @@ -4408,10 +4018,6 @@ msgstr "errore di sintassi nel descrittore uctypes" msgid "threshold must be in the range 0-65536" msgstr "la soglia deve essere nell'intervallo 0-65536" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "" @@ -4431,11 +4037,6 @@ msgstr "" msgid "timeout must be < 655.35 secs" msgstr "" -#: shared-bindings/_bleio/CharacteristicBuffer.c -#, fuzzy -msgid "timeout must be >= 0.0" -msgstr "i bit devono essere 8" - #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" msgstr "" @@ -4444,6 +4045,10 @@ msgstr "" msgid "timeout waiting for v2 card" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +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" @@ -4635,13 +4240,7 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" @@ -4715,6 +4314,178 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "%q must be a tuple of length 2" +#~ msgstr "%q deve essere una tupla di lunghezza 2" + +#~ msgid "%q should be an int" +#~ msgstr "%q dovrebbe essere un int" + +#~ msgid "Address type out of range" +#~ msgstr "Tipo di indirizzo fuori intervallo" + +#~ msgid "AnalogOut functionality not supported" +#~ msgstr "funzionalità AnalogOut non supportata" + +#~ msgid "AnalogOut is only 16 bits. Value must be less than 65536." +#~ msgstr "AnalogOut ha solo 16 bit. Il valore deve essere meno di 65536." + +#~ msgid "AnalogOut not supported on given pin" +#~ msgstr "AnalogOut non supportato sul pin scelto" + +#, c-format +#~ msgid "Bit depth must be from 1 to 6 inclusive, not %d" +#~ msgstr "La profondità dei bit deve essere inclusiva da 1 a 6, non %d" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "Buffer di lunghezza non valida. Dovrebbe essere di %d bytes." + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "Il buffer deve essere lungo almeno 1" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "I byte devono essere compresi tra 0 e 255." + +#~ msgid "Cannot output both channels on the same pin" +#~ msgstr "Impossibile dare in output entrambi i canal sullo stesso pin" + +#~ msgid "Cannot read without MISO pin." +#~ msgstr "Impossibile leggere senza pin MISO." + +#~ msgid "Cannot reset into bootloader because no bootloader is present." +#~ msgstr "" +#~ "Impossibile resettare nel bootloader poiché nessun bootloader è presente." + +#~ msgid "Cannot transfer without MOSI and MISO pins." +#~ msgstr "Impossibile trasferire senza i pin MOSI e MISO." + +#~ msgid "Cannot write without MOSI pin." +#~ msgstr "Impossibile scrivere senza pin MOSI." + +#~ msgid "Clock pin init failed." +#~ msgstr "Inizializzazione del pin di clock fallita." + +#, fuzzy +#~ msgid "Command must be an int between 0 and 255" +#~ msgstr "I byte devono essere compresi tra 0 e 255" + +#~ msgid "Could not initialize UART" +#~ msgstr "Impossibile inizializzare l'UART" + +#~ msgid "Couldn't allocate first buffer" +#~ msgstr "Impossibile allocare il primo buffer" + +#~ msgid "Couldn't allocate second buffer" +#~ msgstr "Impossibile allocare il secondo buffer" + +#~ msgid "Failed to allocate RX buffer" +#~ msgstr "Impossibile allocare buffer RX" + +#, c-format +#~ msgid "Failed to allocate RX buffer of %d bytes" +#~ msgstr "Fallita allocazione del buffer RX di %d byte" + +#~ msgid "Invalid BMP file" +#~ msgstr "File BMP non valido" + +#~ msgid "Invalid PWM frequency" +#~ msgstr "Frequenza PWM non valida" + +#, fuzzy +#~ msgid "Invalid buffer size" +#~ msgstr "lunghezza del buffer non valida" + +#~ msgid "Invalid capture period. Valid range: 1 - 500" +#~ msgstr "periodo di cattura invalido. Zona valida: 1 - 500" + +#, fuzzy +#~ msgid "Invalid channel count" +#~ msgstr "Argomento non valido" + +#~ msgid "Invalid direction." +#~ msgstr "Direzione non valida." + +#~ msgid "Invalid file" +#~ msgstr "File non valido" + +#~ msgid "Invalid number of bits" +#~ msgstr "Numero di bit non valido" + +#~ msgid "Invalid phase" +#~ msgstr "Fase non valida" + +#~ msgid "Invalid pin" +#~ msgstr "Pin non valido" + +#~ msgid "Invalid pin for left channel" +#~ msgstr "Pin non valido per il canale sinistro" + +#~ msgid "Invalid pin for right channel" +#~ msgstr "Pin non valido per il canale destro" + +#~ msgid "Invalid polarity" +#~ msgstr "Polarità non valida" + +#~ msgid "Invalid run mode." +#~ msgstr "Modalità di esecuzione non valida." + +#, fuzzy +#~ msgid "Invalid voice count" +#~ msgstr "Tipo di servizio non valido" + +#~ msgid "Invalid wave file" +#~ msgstr "File wave non valido" + +#~ msgid "Layer must be a Group or TileGrid subclass." +#~ msgstr "Layer deve essere un Group o TileGrid subclass" + +#~ msgid "MISO pin init failed." +#~ msgstr "inizializzazione del pin MISO fallita." + +#~ msgid "MOSI pin init failed." +#~ msgstr "inizializzazione del pin MOSI fallita." + +#~ msgid "No hardware support on pin" +#~ msgstr "Nessun supporto hardware sul pin" + +#~ 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)" + +#~ msgid "Pin does not have ADC capabilities" +#~ msgstr "Il pin non ha capacità di ADC" + +#~ msgid "RTC calibration is not supported on this board" +#~ msgstr "calibrazione RTC non supportata su questa scheda" + +#, fuzzy +#~ msgid "Sample rate must be positive" +#~ msgstr "STA deve essere attiva" + +#, c-format +#~ msgid "Sample rate too high. It must be less than %d" +#~ msgstr "" +#~ "Frequenza di campionamento troppo alta. Il valore deve essere inferiore a " +#~ "%d" + +#~ msgid "Stack size must be at least 256" +#~ msgstr "La dimensione dello stack deve essere almeno 256" + +#~ msgid "Unsupported baudrate" +#~ msgstr "baudrate non supportato" + +#~ msgid "bytes > 8 bits not supported" +#~ msgstr "byte > 8 bit non supportati" + +#~ msgid "calibration value out of range +/-127" +#~ msgstr "valore di calibrazione fuori intervallo +/-127" + +#, fuzzy +#~ msgid "timeout must be >= 0.0" +#~ msgstr "i bit devono essere 8" + #~ msgid "Unsupported operation" #~ msgstr "Operazione non supportata" diff --git a/locale/ja.po b/locale/ja.po index d5615d92f8..7aff0c1fc8 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -71,10 +71,24 @@ msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "" +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "" @@ -87,12 +101,7 @@ msgstr "%q 失敗: %d" msgid "%q in use" msgstr "%qは使用中" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "%q インデックスは範囲外" @@ -100,14 +109,34 @@ msgstr "%q インデックスは範囲外" msgid "%q indices must be integers, not %s" msgstr "" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "" @@ -124,14 +153,10 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "%qは0以上でなければなりません" -#: 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 "%qは1以上でなければなりません" @@ -140,13 +165,8 @@ msgstr "%qは1以上でなければなりません" msgid "%q must be a string" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "%qは長さ2のタプルでなければなりません" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" +#: py/argcheck.c +msgid "%q must be an int" msgstr "" #: py/argcheck.c @@ -165,7 +185,11 @@ msgstr "" msgid "%q 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/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q が範囲外" @@ -174,10 +198,6 @@ msgstr "%q が範囲外" msgid "%q pin invalid" msgstr "%q ピンは無効" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%qはint型でなければなりません" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "" @@ -340,10 +360,6 @@ msgstr "" msgid "'yield' outside function" msgstr "関数外でのyield" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "" - #: py/compile.c msgid "*x must be assignment target" msgstr "*xは代入先でなければなりません" @@ -379,10 +395,6 @@ msgstr "" msgid "Address must be %d bytes long" msgstr "アドレスは、%dバイト長でなければなりません" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "address_typeが範囲外" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "全てのCAN周辺機器が使用中" @@ -473,25 +485,6 @@ msgstr "すでに実行中" msgid "Already scanning for wifi networks" msgstr "" -#: ports/cxd56/common-hal/analogio/AnalogIn.c -msgid "AnalogIn not supported on given pin" -msgstr "指定のピンはAnalogInに対応していません" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "AnalogOut機能に対応していません" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "AnalogOutは16ビットです。値は65536以下でなければなりません" - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "指定のピンはAnalogOutに対応していません" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "" @@ -563,11 +556,6 @@ msgstr "" msgid "Bit clock and word select must share a clock unit" msgstr "bit clockとword selectはクロックユニットを共有しなければなりません" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "ビット深度は8の倍数でなければなりません" @@ -609,11 +597,6 @@ msgstr "buffer + offsetが小さすぎます %d %d %d" msgid "Buffer elements must be 4 bytes long or less" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "バッファサイズが不正です。%dバイトでなければなりません" - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "バッファがbytearrayではありません" @@ -623,7 +606,6 @@ msgstr "バッファがbytearrayではありません" msgid "Buffer is too small" msgstr "バッファが小さすぎます" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -638,10 +620,6 @@ msgstr "バッファ長は512の倍数でなければなりません" msgid "Buffer must be a multiple of 512 bytes" msgstr "バッファは512の倍数でなければなりません" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "バッファ長は少なくとも1以上でなければなりません" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -663,10 +641,6 @@ msgstr "Busピン%dはすでに使用中" msgid "Byte buffer must be 16 bytes." msgstr "バッファは16バイトでなければなりません" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "バイト値は0から255の間でなければなりません" - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "CBCブロックは16バイトの整数倍でなければなりません" @@ -685,6 +659,10 @@ msgstr "" "ネイティブオブジェクトにアクセスする前にsuper().__init__()を呼び出してくださ" "い" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" @@ -732,18 +710,10 @@ msgstr "温度を取得できません" 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 "同じピン上の両チャネルに出力できません" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "MISOピンなしで読み込めません" - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "ファイルへ記録できません" @@ -755,8 +725,8 @@ 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 "ブートローダが存在しないためブートローダへとリセットできません" +msgid "Cannot reset into bootloader because no bootloader is present" +msgstr "" #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -776,21 +746,20 @@ msgid "Cannot subclass slice" msgstr "sliceをサブクラス化することはできません" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." -msgstr "MOSIピンとMISOピンなしに転送できません" +msgid "Cannot transfer without MOSI and MISO pins" +msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "使用中のタイマー上では周波数を変えられません" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c -msgid "Cannot wake on pin edge. Only level." +msgid "Cannot wake on pin edge, only level" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." -msgstr "MOSIピンなしで書き込みできません" +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge. Only level." +msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" @@ -804,10 +773,6 @@ msgstr "CircuitPythonのコアコードが激しくクラッシュしました msgid "CircuitPython was unable to allocate the heap." msgstr "CircuitPythonはヒープを確保できませんでした" -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "クロックピン初期化に失敗" - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "クロックのストレッチが長すぎ" @@ -816,11 +781,6 @@ msgstr "クロックのストレッチが長すぎ" msgid "Clock unit in use" msgstr "クロックユニットは使用中" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -msgid "Command must be an int between 0 and 255" -msgstr "commandは0から255の間の整数でなければなりません" - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -831,35 +791,6 @@ msgstr "接続は切断済みでもう使えません。新しい接続を作成 msgid "Corrupt .mpy file" msgstr "破損した .mpy ファイル" -#: 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を初期化できません" - -#: ports/cxd56/common-hal/sdioio/SDCard.c -msgid "Could not initialize SDCard" -msgstr "SDカードを初期化できません" - -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "UARTを初期化できません" - -#: 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 "PWMを再スタートできません" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "" @@ -880,20 +811,6 @@ msgstr "割り込みをスタートできません。RXビジー" 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 "1つ目のバッファを確保できません" - -#: 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 "2つ目のバッファを確保できません" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "クラッシュしてHardFault_Handlerに入りました" @@ -941,10 +858,6 @@ msgstr "宛先バッファがdestination_lengthより小さい" msgid "Device in use" msgstr "デバイス使用中" -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -msgstr "指定されたピンはDigitalInOutに対応していません" - #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." @@ -1000,11 +913,6 @@ msgstr "%qが必要" msgid "Expected an alarm" msgstr "" -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "" - #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." @@ -1031,22 +939,6 @@ msgstr "コマンド送信に失敗" msgid "Failed to acquire mutex, err 0x%04x" msgstr "ミューテックスの取得に失敗。エラー 0x%04x" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -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/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/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/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "Wi-Fiのメモリの確保に失敗" @@ -1115,11 +1007,6 @@ msgstr "" msgid "Format not supported" msgstr "非対応の形式" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" -msgstr "" - #: ports/mimxrt10xx/common-hal/microcontroller/Processor.c msgid "" "Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" @@ -1134,6 +1021,10 @@ msgstr "このタイマーを使う既存のPWMOutと周波数を一致させる msgid "Function requires lock" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1161,17 +1052,13 @@ 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操作" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "I2C初期化エラー" +msgid "I2C init error" +msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c msgid "I2C peripheral in use" @@ -1280,75 +1167,33 @@ msgstr "" msgid "Internal error #%d" msgstr "内部エラー #%d" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: py/argcheck.c msgid "Invalid %q" msgstr "不正な %q" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c 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/canio/CAN.c -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Invalid %q pin selection" -msgstr "不正な%qピン選択" - #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "不正なADCユニット値" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "不正なBMPファイル" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "不正なBSSID" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "不正なDACピンが与えられました" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "無効なPWM周波数" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "不正な引数" @@ -1356,42 +1201,11 @@ msgstr "不正な引数" msgid "Invalid bits per value" msgstr "不正なbits per value" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "不正なバッファサイズ" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "不正なバイトオーダー文字列" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "不正なキャプチャ周期。有効な周期は1-500" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "不正なチャンネル数" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" 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 "フォーマットチャンクのサイズが不正" @@ -1400,78 +1214,14 @@ msgstr "フォーマットチャンクのサイズが不正" msgid "Invalid memory access." msgstr "不正なメモリアクセス" -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" 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 "不正なphase" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.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/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" 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 "不正なrun mode" - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "不正なsecurity_mode" - #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" @@ -1484,23 +1234,6 @@ msgstr "" msgid "Invalid state" 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 "不正なwaveファイル" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "不正なワード/ビット長" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "Keyの長さは、16, 24, 32バイトのいずれかでなければなりません" @@ -1514,25 +1247,17 @@ msgid "LHS of keyword arg must be an id" msgstr "キーワード引数の左辺には識別子が必要" #: shared-module/displayio/Group.c -msgid "Layer already in a group." -msgstr "レイヤはすでにグループに含まれています" +msgid "Layer already in a group" +msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." -msgstr "レイヤはGroupかTileGridのサブクラスでなければなりません" +msgid "Layer must be a Group or TileGrid subclass" +msgstr "" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "MISOピン初期化に失敗" - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "MOSIピン初期化に失敗" - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "" @@ -1542,10 +1267,6 @@ msgstr "" msgid "Maximum x value when mirrored is %d" msgstr "" -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "マイクのスタートアップディレイは 0.0 から 1.0 の間でなければなりません" @@ -1559,10 +1280,14 @@ msgstr "" msgid "Mismatched swap flag" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "MISOまたはMOSIピンがありません" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1598,11 +1323,6 @@ msgstr "" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "%q のサブクラスでなければなりません" @@ -1663,15 +1383,23 @@ msgid "No I2C device at address: 0x%x" msgstr "" #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "MISOピンなし" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "MOSIピンがありません" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1710,16 +1438,6 @@ msgstr "使われていないGCLKがありません" msgid "No hardware random available" msgstr "利用可能なハードウェア乱数なし" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "clkピンにハードウェア対応がありません" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "ピンにハードウェア対応がありません" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "" @@ -1866,10 +1584,13 @@ msgid "Only one address is allowed" msgstr "" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "" @@ -1901,11 +1622,6 @@ msgstr "" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "オーバーサンプルは8の倍数でなければなりません" @@ -1914,17 +1630,15 @@ msgstr "オーバーサンプルは8の倍数でなければなりません" msgid "PDMIn not available" msgstr "" -#: 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/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "PWM周波数は生成時のvariable_frequencyがFalseのとき書き換え不可" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" +msgstr "" + #: ports/raspberrypi/common-hal/countio/Counter.c msgid "PWM slice already in use" msgstr "" @@ -1941,29 +1655,14 @@ msgstr "" msgid "Permission denied" msgstr "パーミッション拒否" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "ピンにADCの能力がありません" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2030,18 +1729,10 @@ msgstr "" msgid "Program does OUT without loading OSR" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "" - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "方向がoutputのときpullは使われません" @@ -2063,8 +1754,9 @@ msgstr "RNG解体エラー" msgid "RNG Init Error" msgstr "乱数生成器の初期化エラー" -#: ports/nrf/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" +#: 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 "RS485" msgstr "" #: ports/espressif/common-hal/busio/UART.c @@ -2072,21 +1764,10 @@ msgstr "" msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "このボードはRTCのキャリブレーションに非対応" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "このボードはRTCに対応していません" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/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はこのデバイスでは未対応" - #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" msgstr "乱数生成エラー" @@ -2136,6 +1817,10 @@ msgstr "セーフモードで実行中! 保存されたコードは実行し msgid "SD card CSD format not supported" msgstr "SDカードのCSDフォーマットは非対応" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2146,30 +1831,21 @@ msgstr "" msgid "SDIO Init Error %d" msgstr "SDIO初期化エラー %d" -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "SPI初期化エラー" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "SPI再初期化エラー" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" 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 "サンプルレートは%d以下でなければなりません" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" +msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c msgid "Scale dimensions must divide by 3" @@ -2189,14 +1865,6 @@ msgstr "シリアライザは使用中" msgid "Server side context cannot have hostname" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "サイズは対応していません" @@ -2232,10 +1900,6 @@ msgstr "" msgid "Splitting with sub-captures" msgstr "" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "スタックサイズは少なくとも256以上でなければなりません" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "" @@ -2321,10 +1985,6 @@ msgstr "タイルの高さはビットマップの高さを割り切れる値で 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 "タイルの幅はビットマップの幅を割り切れる値でなければなりません" @@ -2344,6 +2004,9 @@ msgid "To exit, please reset the board without " msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample" +msgstr "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "サンプルのチャンネル数が多すぎます" @@ -2376,24 +2039,21 @@ msgid "Tuple or struct_time argument required" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "UARTバッファの確保エラー" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" +msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "UART解放エラー" +msgid "UART re-init" +msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "UARTの初期化エラー" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "UARTの再初期化エラー" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" -msgstr "UART書き込みエラー" +msgid "UART write" +msgstr "" #: shared-module/usb_hid/Device.c msgid "USB busy" @@ -2530,12 +2190,6 @@ msgid "" "declined or ignored." msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "非対応のbaudrate" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "" @@ -2610,10 +2264,6 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" -msgstr "WiFiパスワードは8〜63文字でなければなりません" - #: main.c msgid "Woken up by alarm.\n" msgstr "" @@ -2766,10 +2416,6 @@ msgstr "" msgid "bits must be 32 or less" msgstr "" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sampleは8または16でなければなりません" @@ -2807,11 +2453,6 @@ msgstr "" msgid "byteorder is not a string" msgstr "byteorderが文字列ではありません" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/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 "" @@ -2820,7 +2461,7 @@ msgstr "" msgid "bytes value out of range" msgstr "範囲外のバイト値" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "キャリブレーションが範囲外" @@ -2828,12 +2469,9 @@ msgstr "キャリブレーションが範囲外" msgid "calibration is read only" msgstr "calibrationは読み込み専用" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" +msgid "can only have one parent" msgstr "" #: py/emitinlinethumb.c @@ -3004,6 +2642,10 @@ msgstr "" msgid "casting" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "" @@ -3016,10 +2658,6 @@ msgstr "" 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/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "" @@ -3449,6 +3087,10 @@ msgid "indices must be integers, slices, or Boolean lists" msgstr "" "インデクスは、整数、スライス、boolのリストのいずれかでなければなりません" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "" @@ -3699,10 +3341,6 @@ msgstr "定義域エラー" msgid "matrix is not positive definite" msgstr "正定値行列ではありません" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3710,10 +3348,6 @@ 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 "" - #: extmod/ulab/code/ndarray.c msgid "maximum number of dimensions is 4" msgstr "" @@ -4086,10 +3720,6 @@ msgstr "" msgid "poll on file not available on win32" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" @@ -4136,14 +3766,6 @@ msgstr "" msgid "pull masks conflict with direction masks" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "キューがオーバーフローしました" @@ -4315,10 +3937,6 @@ msgstr "" msgid "step must be non-zero" msgstr "stepは非ゼロ値でなければなりません" -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "stopは1または2のいずれか" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "" @@ -4367,10 +3985,6 @@ msgstr "uctypedディスクリプタの構文エラー" msgid "threshold must be in the range 0-65536" msgstr "threshouldは0から65536まで" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time()は9要素のシーケンスを受け取ります" @@ -4390,10 +4004,6 @@ msgstr "timeoutは0.0〜100.0秒でなければなりません" msgid "timeout must be < 655.35 secs" msgstr "" -#: shared-bindings/_bleio/CharacteristicBuffer.c -msgid "timeout must be >= 0.0" -msgstr "timeoutは0.0以上でなければなりません" - #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" msgstr "v1カードの待機がタイムアウト" @@ -4402,6 +4012,10 @@ msgstr "v1カードの待機がタイムアウト" msgid "timeout waiting for v2 card" msgstr "v2カードの待機がタイムアウトしました" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "timestampがプラットフォームのtime_tの範囲外" @@ -4593,13 +4207,7 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "watchdogのtimeoutは0以上でなければなりません" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" @@ -4671,6 +4279,248 @@ msgstr "ziはfloat値でなければなりません" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "%q must be a tuple of length 2" +#~ msgstr "%qは長さ2のタプルでなければなりません" + +#~ msgid "%q should be an int" +#~ msgstr "%qはint型でなければなりません" + +#~ msgid "Address type out of range" +#~ msgstr "address_typeが範囲外" + +#~ msgid "AnalogIn not supported on given pin" +#~ msgstr "指定のピンはAnalogInに対応していません" + +#~ msgid "AnalogOut functionality not supported" +#~ msgstr "AnalogOut機能に対応していません" + +#~ msgid "AnalogOut is only 16 bits. Value must be less than 65536." +#~ msgstr "AnalogOutは16ビットです。値は65536以下でなければなりません" + +#~ msgid "AnalogOut not supported on given pin" +#~ msgstr "指定のピンはAnalogOutに対応していません" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "バッファサイズが不正です。%dバイトでなければなりません" + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "バッファ長は少なくとも1以上でなければなりません" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "バイト値は0から255の間でなければなりません" + +#~ msgid "Cannot output both channels on the same pin" +#~ msgstr "同じピン上の両チャネルに出力できません" + +#~ msgid "Cannot read without MISO pin." +#~ msgstr "MISOピンなしで読み込めません" + +#~ msgid "Cannot reset into bootloader because no bootloader is present." +#~ msgstr "ブートローダが存在しないためブートローダへとリセットできません" + +#~ msgid "Cannot transfer without MOSI and MISO pins." +#~ msgstr "MOSIピンとMISOピンなしに転送できません" + +#~ msgid "Cannot write without MOSI pin." +#~ msgstr "MOSIピンなしで書き込みできません" + +#~ msgid "Clock pin init failed." +#~ msgstr "クロックピン初期化に失敗" + +#~ msgid "Command must be an int between 0 and 255" +#~ msgstr "commandは0から255の間の整数でなければなりません" + +#~ msgid "Could not initialize Camera" +#~ msgstr "カメラを初期化できません" + +#~ msgid "Could not initialize GNSS" +#~ msgstr "GNSSを初期化できません" + +#~ msgid "Could not initialize SDCard" +#~ msgstr "SDカードを初期化できません" + +#~ msgid "Could not initialize UART" +#~ msgstr "UARTを初期化できません" + +#~ msgid "Could not re-init channel" +#~ msgstr "チャネルを再初期化できません" + +#~ msgid "Could not re-init timer" +#~ msgstr "タイマーを再初期化できません" + +#~ msgid "Could not restart PWM" +#~ msgstr "PWMを再スタートできません" + +#~ msgid "Couldn't allocate first buffer" +#~ msgstr "1つ目のバッファを確保できません" + +#~ msgid "Couldn't allocate input buffer" +#~ msgstr "入力バッファを確保できません" + +#~ msgid "Couldn't allocate second buffer" +#~ msgstr "2つ目のバッファを確保できません" + +#~ msgid "DigitalInOut not supported on given pin" +#~ msgstr "指定されたピンはDigitalInOutに対応していません" + +#~ msgid "Failed to allocate RX buffer" +#~ msgstr "RXバッファの確保に失敗" + +#, c-format +#~ msgid "Failed to allocate RX buffer of %d bytes" +#~ msgstr "%dバイトのRXバッファの確保に失敗" + +#~ msgid "I2C Init Error" +#~ msgstr "I2C初期化エラー" + +#~ msgid "Invalid %q pin selection" +#~ msgstr "不正な%qピン選択" + +#~ msgid "Invalid BMP file" +#~ msgstr "不正なBMPファイル" + +#~ msgid "Invalid DAC pin supplied" +#~ msgstr "不正なDACピンが与えられました" + +#~ msgid "Invalid PWM frequency" +#~ msgstr "無効なPWM周波数" + +#~ msgid "Invalid buffer size" +#~ msgstr "不正なバッファサイズ" + +#~ msgid "Invalid byteorder string" +#~ msgstr "不正なバイトオーダー文字列" + +#~ msgid "Invalid capture period. Valid range: 1 - 500" +#~ msgstr "不正なキャプチャ周期。有効な周期は1-500" + +#~ msgid "Invalid channel count" +#~ msgstr "不正なチャンネル数" + +#~ msgid "Invalid direction." +#~ msgstr "不正な方向" + +#~ msgid "Invalid file" +#~ msgstr "不正なファイル" + +#~ msgid "Invalid number of bits" +#~ msgstr "不正なビット数" + +#~ msgid "Invalid phase" +#~ msgstr "不正なphase" + +#~ msgid "Invalid pin" +#~ msgstr "不正なピン" + +#~ msgid "Invalid pin for left channel" +#~ msgstr "左チャネルのピンが不正" + +#~ msgid "Invalid pin for right channel" +#~ msgstr "右チャネルのピンが不正" + +#~ msgid "Invalid polarity" +#~ msgstr "不正な極性" + +#~ msgid "Invalid properties" +#~ msgstr "不正なプロパティ" + +#~ msgid "Invalid run mode." +#~ msgstr "不正なrun mode" + +#~ msgid "Invalid security_mode" +#~ msgstr "不正なsecurity_mode" + +#~ msgid "Invalid voice" +#~ msgstr "不正なボイス" + +#~ msgid "Invalid voice count" +#~ msgstr "不正なボイス数" + +#~ msgid "Invalid wave file" +#~ msgstr "不正なwaveファイル" + +#~ msgid "Invalid word/bit length" +#~ msgstr "不正なワード/ビット長" + +#~ msgid "Layer already in a group." +#~ msgstr "レイヤはすでにグループに含まれています" + +#~ msgid "Layer must be a Group or TileGrid subclass." +#~ msgstr "レイヤはGroupかTileGridのサブクラスでなければなりません" + +#~ msgid "MISO pin init failed." +#~ msgstr "MISOピン初期化に失敗" + +#~ msgid "MOSI pin init failed." +#~ msgstr "MOSIピン初期化に失敗" + +#~ msgid "No hardware support on clk pin" +#~ msgstr "clkピンにハードウェア対応がありません" + +#~ msgid "No hardware support on pin" +#~ msgstr "ピンにハードウェア対応がありません" + +#~ msgid "" +#~ "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +#~ msgstr "" +#~ "PWMのduty_cycle値は0から65535の間でなければなりません(16ビット解像度)" + +#~ msgid "Pin does not have ADC capabilities" +#~ msgstr "ピンにADCの能力がありません" + +#~ msgid "RTC calibration is not supported on this board" +#~ msgstr "このボードはRTCのキャリブレーションに非対応" + +#~ msgid "RTS/CTS/RS485 Not yet supported on this device" +#~ msgstr "RTS/CTS/RS485はこのデバイスでは未対応" + +#~ msgid "SPI Init Error" +#~ msgstr "SPI初期化エラー" + +#~ msgid "SPI Re-initialization error" +#~ msgstr "SPI再初期化エラー" + +#~ msgid "Sample rate must be positive" +#~ msgstr "サンプルレートは正数でなければなりません" + +#, c-format +#~ msgid "Sample rate too high. It must be less than %d" +#~ msgstr "サンプルレートは%d以下でなければなりません" + +#~ msgid "Stack size must be at least 256" +#~ msgstr "スタックサイズは少なくとも256以上でなければなりません" + +#~ msgid "Tile value out of bounds" +#~ msgstr "タイル値が範囲外" + +#~ msgid "UART Buffer allocation error" +#~ msgstr "UARTバッファの確保エラー" + +#~ msgid "UART De-init error" +#~ msgstr "UART解放エラー" + +#~ msgid "UART Init Error" +#~ msgstr "UARTの初期化エラー" + +#~ msgid "UART Re-init error" +#~ msgstr "UARTの再初期化エラー" + +#~ msgid "UART write error" +#~ msgstr "UART書き込みエラー" + +#~ msgid "Unsupported baudrate" +#~ msgstr "非対応のbaudrate" + +#~ msgid "WiFi password must be between 8 and 63 characters" +#~ msgstr "WiFiパスワードは8〜63文字でなければなりません" + +#~ msgid "stop must be 1 or 2" +#~ msgstr "stopは1または2のいずれか" + +#~ msgid "timeout must be >= 0.0" +#~ msgstr "timeoutは0.0以上でなければなりません" + #~ msgid "Unsupported operation" #~ msgstr "非対応の操作" diff --git a/locale/ko.po b/locale/ko.po index 21e4bd346a..a59b12702a 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -67,10 +67,24 @@ msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "" +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "" @@ -83,12 +97,7 @@ msgstr "" msgid "%q in use" msgstr "%q 사용 중입니다" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "%q 인덱스 범위를 벗어났습니다" @@ -96,14 +105,34 @@ msgstr "%q 인덱스 범위를 벗어났습니다" msgid "%q indices must be integers, not %s" msgstr "%q 인덱스는 %s 가 아닌 정수 여야합니다" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "" @@ -120,14 +149,10 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.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 "%q 는 >=1이어야합니다" @@ -136,13 +161,8 @@ msgstr "%q 는 >=1이어야합니다" msgid "%q must be a string" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" +#: py/argcheck.c +msgid "%q must be an int" msgstr "" #: py/argcheck.c @@ -161,7 +181,11 @@ msgstr "" msgid "%q 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/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "" @@ -170,10 +194,6 @@ msgstr "" msgid "%q pin invalid" msgstr "" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%q 는 정수(int) 여야합니다" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "" @@ -336,10 +356,6 @@ msgstr "" msgid "'yield' outside function" msgstr "'yield' 는 함수 외부에 존재합니다" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "" - #: py/compile.c msgid "*x must be assignment target" msgstr "" @@ -375,10 +391,6 @@ msgstr "" msgid "Address must be %d bytes long" msgstr "" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "" @@ -469,25 +481,6 @@ msgstr "" msgid "Already scanning for wifi networks" 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 -#: ports/raspberrypi/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/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "" @@ -559,11 +552,6 @@ msgstr "" msgid "Bit clock and word select must share a clock unit" msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "" @@ -605,11 +593,6 @@ msgstr "" msgid "Buffer elements must be 4 bytes long or less" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "잘못된 크기의 버퍼. %d 바이트 여야합니다." - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "" @@ -619,7 +602,6 @@ msgstr "" msgid "Buffer is too small" msgstr "" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -634,10 +616,6 @@ msgstr "" msgid "Buffer must be a multiple of 512 bytes" msgstr "" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "잘못된 크기의 버퍼. >1 여야합니다" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -659,10 +637,6 @@ msgstr "" msgid "Byte buffer must be 16 bytes." msgstr "잘못된 크기의 버퍼. 16 바이트 여야합니다." -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "바이트는 0에서 255 사이 여야합니다." - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "" @@ -679,6 +653,10 @@ msgstr "" msgid "Call super().__init__() before accessing native object." msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" @@ -726,18 +704,10 @@ msgstr "온도 데이터를 수신 할 수 없습니다" 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 "" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "MISO핀이 없으면 읽을 수 없습니다" - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "파일에 녹음 할 수 없습니다" @@ -749,7 +719,7 @@ 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." +msgid "Cannot reset into bootloader because no bootloader is present" msgstr "" #: ports/espressif/common-hal/socketpool/Socket.c @@ -770,20 +740,19 @@ msgid "Cannot subclass slice" msgstr "" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." +msgid "Cannot transfer without MOSI and MISO pins" msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c -msgid "Cannot wake on pin edge. Only level." +msgid "Cannot wake on pin edge, only level" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge. Only level." msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -798,10 +767,6 @@ msgstr "" msgid "CircuitPython was unable to allocate the heap." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "" - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "" @@ -810,11 +775,6 @@ msgstr "" msgid "Clock unit in use" msgstr "" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -msgid "Command must be an int between 0 and 255" -msgstr "명령은 0에서 255 사이의 정수(int) 여야합니다" - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -825,35 +785,6 @@ msgstr "" msgid "Corrupt .mpy file" 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 "" - -#: 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 -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -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 "" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "" @@ -874,20 +805,6 @@ msgstr "" 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 "" @@ -935,10 +852,6 @@ msgstr "" 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." @@ -994,11 +907,6 @@ msgstr "%q 이 예상되었습니다." msgid "Expected an alarm" msgstr "" -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "" - #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." @@ -1025,22 +933,6 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/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/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/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/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "" @@ -1109,11 +1001,6 @@ msgstr "" msgid "Format not supported" msgstr "" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" -msgstr "" - #: ports/mimxrt10xx/common-hal/microcontroller/Processor.c msgid "" "Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" @@ -1128,6 +1015,10 @@ msgstr "" msgid "Function requires lock" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1155,16 +1046,12 @@ 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 "" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" +msgid "I2C init error" msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c @@ -1272,75 +1159,33 @@ msgstr "" msgid "Internal error #%d" msgstr "" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: py/argcheck.c msgid "Invalid %q" msgstr "" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.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/canio/CAN.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 "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "" @@ -1348,42 +1193,11 @@ msgstr "" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" 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 "형식 청크 크기가 잘못되었습니다" @@ -1392,78 +1206,14 @@ msgstr "형식 청크 크기가 잘못되었습니다" msgid "Invalid memory access." msgstr "" -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" 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 -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.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/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" 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 "" - #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" @@ -1476,23 +1226,6 @@ msgstr "" msgid "Invalid state" 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/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "" @@ -1506,25 +1239,17 @@ msgid "LHS of keyword arg must be an id" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer already in a group." +msgid "Layer already in a group" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." +msgid "Layer must be a Group or TileGrid subclass" msgstr "" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "" - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "" - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "" @@ -1534,10 +1259,6 @@ msgstr "" msgid "Maximum x value when mirrored is %d" msgstr "" -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" @@ -1551,10 +1272,14 @@ msgstr "" msgid "Mismatched swap flag" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1590,11 +1315,6 @@ msgstr "" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" @@ -1655,15 +1375,23 @@ msgid "No I2C device at address: 0x%x" msgstr "" #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1702,16 +1430,6 @@ msgstr "" 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/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "" @@ -1856,10 +1574,13 @@ msgid "Only one address is allowed" msgstr "" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "" @@ -1891,11 +1612,6 @@ msgstr "" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "" @@ -1906,12 +1622,11 @@ msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +"PWM frequency not writable when variable_frequency is False on construction." msgstr "" -#: shared-bindings/pwmio/PWMOut.c -msgid "" -"PWM frequency not writable when variable_frequency is False on construction." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" msgstr "" #: ports/raspberrypi/common-hal/countio/Counter.c @@ -1930,29 +1645,14 @@ msgstr "" msgid "Permission denied" msgstr "" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2019,18 +1719,10 @@ msgstr "" msgid "Program does OUT without loading OSR" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "" - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -2052,8 +1744,9 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" +#: 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 "RS485" msgstr "" #: ports/espressif/common-hal/busio/UART.c @@ -2061,21 +1754,10 @@ msgstr "" msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "" - #: shared-bindings/alarm/time/TimeAlarm.c 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/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 "" @@ -2125,6 +1807,10 @@ msgstr "" msgid "SD card CSD format not supported" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2135,29 +1821,20 @@ msgstr "" 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 "" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" 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" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c @@ -2178,14 +1855,6 @@ msgstr "" msgid "Server side context cannot have hostname" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "" @@ -2221,10 +1890,6 @@ msgstr "" msgid "Splitting with sub-captures" msgstr "" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "" @@ -2310,10 +1975,6 @@ msgstr "" 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 "" @@ -2333,6 +1994,9 @@ msgid "To exit, please reset the board without " msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample" +msgstr "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -2365,23 +2029,20 @@ msgid "Tuple or struct_time argument required" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" +msgid "UART re-init" 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" +msgid "UART write" msgstr "" #: shared-module/usb_hid/Device.c @@ -2519,12 +2180,6 @@ msgid "" "declined or ignored." msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "" @@ -2599,10 +2254,6 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" -msgstr "" - #: main.c msgid "Woken up by alarm.\n" msgstr "" @@ -2755,10 +2406,6 @@ msgstr "" msgid "bits must be 32 or less" msgstr "" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample은 8 또는 16이어야합니다." @@ -2796,11 +2443,6 @@ msgstr "" msgid "byteorder is not a string" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/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 "" @@ -2809,7 +2451,7 @@ msgstr "" msgid "bytes value out of range" msgstr "" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "" @@ -2817,12 +2459,9 @@ msgstr "" msgid "calibration is read only" msgstr "" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" +msgid "can only have one parent" msgstr "" #: py/emitinlinethumb.c @@ -2993,6 +2632,10 @@ msgstr "" msgid "casting" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "" @@ -3005,10 +2648,6 @@ msgstr "" 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/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "" @@ -3433,6 +3072,10 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "" @@ -3683,10 +3326,6 @@ msgstr "" msgid "matrix is not positive definite" msgstr "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3694,10 +3333,6 @@ 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 "" - #: extmod/ulab/code/ndarray.c msgid "maximum number of dimensions is 4" msgstr "" @@ -4068,10 +3703,6 @@ msgstr "" msgid "poll on file not available on win32" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" @@ -4118,14 +3749,6 @@ msgstr "" msgid "pull masks conflict with direction masks" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "" @@ -4296,10 +3919,6 @@ msgstr "" 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 "" @@ -4348,10 +3967,6 @@ msgstr "" msgid "threshold must be in the range 0-65536" msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "" @@ -4371,10 +3986,6 @@ msgstr "" msgid "timeout must be < 655.35 secs" 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 "" @@ -4383,6 +3994,10 @@ msgstr "" msgid "timeout waiting for v2 card" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "" @@ -4574,13 +4189,7 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" @@ -4652,6 +4261,43 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "%q should be an int" +#~ msgstr "%q 는 정수(int) 여야합니다" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "잘못된 크기의 버퍼. %d 바이트 여야합니다." + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "잘못된 크기의 버퍼. >1 여야합니다" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "바이트는 0에서 255 사이 여야합니다." + +#~ msgid "Cannot read without MISO pin." +#~ msgstr "MISO핀이 없으면 읽을 수 없습니다" + +#~ msgid "Command must be an int between 0 and 255" +#~ msgstr "명령은 0에서 255 사이의 정수(int) 여야합니다" + +#~ msgid "Invalid file" +#~ msgstr "파일이 유효하지 않습니다" + +#~ msgid "Invalid number of bits" +#~ msgstr "비트 수가 유효하지 않습니다" + +#~ msgid "Invalid phase" +#~ msgstr "단계가 잘못되었습니다" + +#~ msgid "Invalid pin" +#~ msgstr "핀이 잘못되었습니다" + +#~ msgid "Invalid pin for left channel" +#~ msgstr "왼쪽 채널 핀이 유효하지 않습니다" + +#~ msgid "Invalid pin for right channel" +#~ msgstr "오른쪽 채널 핀이 잘못되었습니다" + #~ msgid "Brightness must be between 0 and 255" #~ msgstr "밝기는 0에서 255 사이 여야합니다" diff --git a/locale/nl.po b/locale/nl.po index a2dc9ab51f..f862d7f4f2 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -69,10 +69,24 @@ msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "" +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "" @@ -85,12 +99,7 @@ msgstr "%q fout: %d" msgid "%q in use" msgstr "%q in gebruik" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "%q index buiten bereik" @@ -98,14 +107,34 @@ msgstr "%q index buiten bereik" msgid "%q indices must be integers, not %s" msgstr "%q indexen moeten integers zijn, niet %s" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "" @@ -122,14 +151,10 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "%q moet >= 0 zijn" -#: 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 "%q moet >= 1 zijn" @@ -138,13 +163,8 @@ msgstr "%q moet >= 1 zijn" msgid "%q must be a string" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "%q moet een tuple van lengte 2 zijn" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" +#: py/argcheck.c +msgid "%q must be an int" msgstr "" #: py/argcheck.c @@ -163,7 +183,11 @@ msgstr "" msgid "%q 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/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q buiten bereik" @@ -172,10 +196,6 @@ msgstr "%q buiten bereik" msgid "%q pin invalid" msgstr "%q pin onjuist" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%q moet een int zijn" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "" @@ -338,10 +358,6 @@ msgstr "'yield from' binnen asynchrone functie" msgid "'yield' outside function" msgstr "'yield' buiten de functie" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "" - #: py/compile.c msgid "*x must be assignment target" msgstr "*x moet een assignment target zijn" @@ -377,10 +393,6 @@ msgstr "ADC2 wordt gebruikt door WiFi" msgid "Address must be %d bytes long" msgstr "Adres moet %d bytes lang zijn" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "Adres type buiten bereik" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "Alle CAN-peripherals zijn in gebruik" @@ -471,25 +483,6 @@ msgstr "Wordt al uitgevoerd" msgid "Already scanning for wifi networks" msgstr "Zoekt al naar WiFi netwerken" -#: ports/cxd56/common-hal/analogio/AnalogIn.c -msgid "AnalogIn not supported on given pin" -msgstr "AnalogIn niet ondersteund door gegeven pin" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "AnalogOut functionaliteit niet ondersteund" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "AnalogOut is slechts 16 bits. Waarde moet minder dan 65536 zijn." - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "AnalogOut niet ondersteund door gegeven pin" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "" @@ -561,11 +554,6 @@ msgstr "" msgid "Bit clock and word select must share a clock unit" msgstr "Bit clock en word select moeten een clock eenheid delen" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "Bitdiepte moet tussen 1 en 6 liggen, niet %d" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "Bit diepte moet een meervoud van 8 zijn." @@ -607,11 +595,6 @@ msgstr "Buffer + offset te klein %d %d %d" msgid "Buffer elements must be 4 bytes long or less" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "Buffer heeft incorrect grootte. Moet %d bytes zijn." - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "Buffer is geen bytearray." @@ -621,7 +604,6 @@ msgstr "Buffer is geen bytearray." msgid "Buffer is too small" msgstr "Buffer is te klein" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -636,10 +618,6 @@ msgstr "Buffer lengte moet een veelvoud van 512 zijn" msgid "Buffer must be a multiple of 512 bytes" msgstr "Buffer moet een veelvoud van 512 bytes zijn" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "Buffer moet op zijn minst lengte 1 zijn" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -661,10 +639,6 @@ msgstr "Bus pin %d al in gebruik" msgid "Byte buffer must be 16 bytes." msgstr "Byte buffer moet 16 bytes zijn." -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "Bytes moeten tussen 0 en 255 liggen." - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "CBC blocks moeten meervouden van 16 bytes zijn" @@ -681,6 +655,10 @@ msgstr "" msgid "Call super().__init__() before accessing native object." msgstr "Roep super().__init__() aan voor toegang native object." +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" @@ -729,18 +707,10 @@ msgid "Cannot have scan responses for extended, connectable advertisements." msgstr "" "Kan geen scan responses voor extended, connectable advertisements hebben." -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Cannot output both channels on the same pin" -msgstr "Output van beide kanalen kan niet op dezelfde pin" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "Kan niet lezen zonder MISO pin." - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "Kan niet opnemen naar een bestand" @@ -752,9 +722,8 @@ 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." +msgid "Cannot reset into bootloader because no bootloader is present" msgstr "" -"Kan niet resetten naar bootloader omdat er geen bootloader aanwezig is." #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -774,21 +743,20 @@ msgid "Cannot subclass slice" msgstr "Kan slice niet subclasseren" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." -msgstr "Kan niet overdragen zonder MOSI en MISO pinnen." +msgid "Cannot transfer without MOSI and MISO pins" +msgstr "" #: shared-bindings/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" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c -msgid "Cannot wake on pin edge. Only level." +msgid "Cannot wake on pin edge, only level" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." -msgstr "Kan niet schrijven zonder MOSI pin." +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge. Only level." +msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" @@ -802,10 +770,6 @@ msgstr "CircuitPython core code is hard gecrashed. Ojee!\n" msgid "CircuitPython was unable to allocate the heap." msgstr "CircuitPython kon het heap geheugen niet toewijzen." -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "Clock pin init mislukt." - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "Clock stretch is te lang" @@ -814,11 +778,6 @@ msgstr "Clock stretch is te lang" msgid "Clock unit in use" msgstr "Clock unit in gebruik" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -msgid "Command must be an int between 0 and 255" -msgstr "Command moet een int tussen 0 en 255 zijn" - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -831,35 +790,6 @@ msgstr "" msgid "Corrupt .mpy file" msgstr "Corrupt .mpy bestand" -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Could not initialize Camera" -msgstr "Kon camera niet initialiseren" - -#: ports/cxd56/common-hal/gnss/GNSS.c -msgid "Could not initialize GNSS" -msgstr "Kan GNSS niet initialiseren" - -#: ports/cxd56/common-hal/sdioio/SDCard.c -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/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "Kan UART niet initialiseren" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init channel" -msgstr "Kan kanaal niet her-initialiseren" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init timer" -msgstr "Kan timer niet her-initialiseren" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not restart PWM" -msgstr "Kan PWM niet herstarten" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "Kon klok niet ophalen" @@ -880,20 +810,6 @@ msgstr "Kan interrupt niet starten, RX is bezig" msgid "Couldn't allocate decoder" msgstr "Kan decoder niet alloceren" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate first buffer" -msgstr "Kan eerste buffer niet alloceren" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate input buffer" -msgstr "Kan input buffer niet alloceren" - -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate second buffer" -msgstr "Kan tweede buffer niet alloceren" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "Crash naar de HardFault_Handler." @@ -941,10 +857,6 @@ msgstr "Bestemming grootte is kleiner dan destination_length." msgid "Device in use" msgstr "Apparaat al in gebruik" -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -msgstr "DigitalInOut niet ondersteund door gegeven pin" - #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." @@ -1000,11 +912,6 @@ msgstr "Verwacht een %q" msgid "Expected an alarm" msgstr "Verwachtte een alarm" -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "Verwachtte een tuple met lengte %d, maar kreeg %d" - #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." @@ -1031,22 +938,6 @@ msgstr "Commando verzenden mislukt." msgid "Failed to acquire mutex, err 0x%04x" msgstr "Fout tijdens verkrijgen mutex, err 0x%04x" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -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/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/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/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "Kon WiFi geheugen niet toewijzen" @@ -1115,11 +1006,6 @@ msgstr "" msgid "Format not supported" msgstr "Formaat wordt niet ondersteund" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" -msgstr "Framebuffer benodigd %d bytes" - #: ports/mimxrt10xx/common-hal/microcontroller/Processor.c msgid "" "Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" @@ -1135,6 +1021,10 @@ msgstr "" msgid "Function requires lock" msgstr "Functie vereist lock" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1162,17 +1052,13 @@ 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 "Hostnaam moet tussen 1 en 253 karakters zijn" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "I/O actie op gesloten bestand" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "I2C Init Fout" +msgid "I2C init error" +msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c msgid "I2C peripheral in use" @@ -1281,75 +1167,33 @@ msgstr "" msgid "Internal error #%d" msgstr "Interne fout #%d" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: py/argcheck.c msgid "Invalid %q" msgstr "Ongeldige %q" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c 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/canio/CAN.c -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Invalid %q pin selection" -msgstr "Ongeldige %q pin selectie" - #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "Ongeldige ADC Unit waarde" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "Ongeldig BMP bestand" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "Ongeldig BSSID" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "Ongeldige DAC pin opgegeven" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "Ongeldige PWM frequentie" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "Ongeldige Pin" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "Ongeldig argument" @@ -1357,42 +1201,11 @@ msgstr "Ongeldig argument" msgid "Invalid bits per value" msgstr "Ongeldige bits per waarde" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "Ongeldige buffer grootte" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "Ongeldige byteorder string" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "Ongeldige vastlegging periode. Geldig bereik: 1 - 500" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "Ongeldige kanaal aantallen" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "Ongeldige richting." - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "Ongeldig bestand" - #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Ongeldig formaat stuk grootte" @@ -1401,78 +1214,14 @@ msgstr "Ongeldig formaat stuk grootte" msgid "Invalid memory access." msgstr "Ongeldig geheugen adres." -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "Ongeldig aantal bits" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "Ongeldige fase" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "Ongeldige pin" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "Ongeldige pin voor linker kanaal" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -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/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/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "Ongeldige pinnen" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "Ongeldige polariteit" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "Ongeldige eigenschappen" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "Ongeldige run modus." - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "Ongeldige security_mode" - #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" @@ -1485,23 +1234,6 @@ msgstr "" msgid "Invalid state" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "Ongeldige stem" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "Ongeldig stem aantal" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "Ongeldig wave bestand" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "Ongeldig woord/bit lengte" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "Sleutel moet 16, 24, of 32 bytes lang zijn" @@ -1515,25 +1247,17 @@ msgid "LHS of keyword arg must be an id" msgstr "LHS van sleutelwoord arg moet een id zijn" #: shared-module/displayio/Group.c -msgid "Layer already in a group." -msgstr "Laag al in groep." +msgid "Layer already in a group" +msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." -msgstr "Laag moet een Groep of TileGrid subklasse zijn." +msgid "Layer must be a Group or TileGrid subclass" +msgstr "" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "MISO pin init mislukt." - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "MOSI pin init mislukt." - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "" @@ -1543,10 +1267,6 @@ msgstr "" 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 "Berichten zijn beperkt tot 8 bytes" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Microfoon opstart vertraging moet in bereik van 0.0 tot 1.0 zijn" @@ -1560,10 +1280,14 @@ msgstr "" msgid "Mismatched swap flag" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "Ontbrekende MISO of MOSI Pin" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1599,11 +1323,6 @@ msgstr "" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "%q moet een subklasse zijn." @@ -1664,15 +1383,23 @@ msgid "No I2C device at address: 0x%x" msgstr "" #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "Geen MISO pin" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Geen MOSI pin" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1711,16 +1438,6 @@ msgstr "Geen vrije GCLKs" msgid "No hardware random available" msgstr "Geen hardware random beschikbaar" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "Geen hardware ondersteuning beschikbaar op clk pin" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "Geen hardware ondersteuning op pin" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "" @@ -1871,10 +1588,13 @@ msgid "Only one address is allowed" msgstr "" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "Slechts één alarm.time alarm kan worden ingesteld." @@ -1906,11 +1626,6 @@ msgstr "Geen sockets meer beschikbaar" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Oversample moet een meervoud van 8 zijn." @@ -1919,12 +1634,6 @@ msgstr "Oversample moet een meervoud van 8 zijn." msgid "PDMIn not available" msgstr "" -#: 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/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." @@ -1932,6 +1641,10 @@ msgstr "" "PWM frequentie is niet schrijfbaar wanneer de variable_frequency False is " "tijdens constructie." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" +msgstr "" + #: ports/raspberrypi/common-hal/countio/Counter.c msgid "PWM slice already in use" msgstr "" @@ -1948,29 +1661,14 @@ msgstr "" msgid "Permission denied" msgstr "Toegang geweigerd" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "Pin heeft geen ADC mogelijkheden" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2042,18 +1740,10 @@ msgstr "" msgid "Program does OUT without loading OSR" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "" - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Pull niet gebruikt wanneer de richting output is." @@ -2075,8 +1765,9 @@ msgstr "RNG DeInit Fout" msgid "RNG Init Error" msgstr "RNG Init Fout" -#: ports/nrf/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" +#: 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 "RS485" msgstr "" #: ports/espressif/common-hal/busio/UART.c @@ -2084,21 +1775,10 @@ msgstr "" 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/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "RTC calibratie niet ondersteund door dit board" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "RTC is niet ondersteund door dit board" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/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 Nog niet ondersteund door dit apparaat" - #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" msgstr "Random number generatie fout" @@ -2148,6 +1828,10 @@ msgstr "Draaiende in veilige modus! Opgeslagen code wordt niet uitgevoerd.\n" msgid "SD card CSD format not supported" msgstr "SD kaart CSD formaat niet ondersteund" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2158,30 +1842,21 @@ msgstr "SDIO GetCardInfo Fout %d" msgid "SDIO Init Error %d" msgstr "SDIO Init Fout %d" -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "SPI Init Fout" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "SPI Herinitialisatie Fout" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -msgid "Sample rate must be positive" -msgstr "Sample rate moet positief zijn" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" -msgstr "Sample rate is te hoog. Moet minder dan %d zijn" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" +msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c msgid "Scale dimensions must divide by 3" @@ -2201,14 +1876,6 @@ msgstr "Serializer in gebruik" msgid "Server side context cannot have hostname" msgstr "Context aan de serverkant kan geen hostnaam hebben" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "Afmeting niet ondersteund" @@ -2244,10 +1911,6 @@ msgstr "" msgid "Splitting with sub-captures" msgstr "Splitting met sub-captures" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "Stack grootte moet op zijn minst 256 zijn" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "" @@ -2333,10 +1996,6 @@ msgstr "Tile hoogte moet exact de bitmap hoogte verdelen" msgid "Tile index out of bounds" msgstr "Tile index buiten bereik" -#: shared-bindings/displayio/TileGrid.c -msgid "Tile value out of bounds" -msgstr "Tile waarde buiten bereik" - #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" msgstr "Tile breedte moet exact de bitmap breedte verdelen" @@ -2356,6 +2015,9 @@ msgid "To exit, please reset the board without " msgstr "Om te beëindigen, reset het bord zonder " #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample" +msgstr "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Teveel kanalen in sample." @@ -2388,24 +2050,21 @@ msgid "Tuple or struct_time argument required" msgstr "Tuple of struct_time argument vereist" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "UART Buffer allocatie fout" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" +msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "UART De-init fout" +msgid "UART re-init" +msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "UART Init Fout" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "UART Re-init Fout" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" -msgstr "UART schrijf fout" +msgid "UART write" +msgstr "" #: shared-module/usb_hid/Device.c msgid "USB busy" @@ -2543,12 +2202,6 @@ msgstr "" "Ongespecificeerd probleem. Kan zijn dat de pariteit prompt op het andere " "apparaat geweigerd of genegeerd werd." -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "Niet-ondersteunde baudsnelheid" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "" @@ -2627,10 +2280,6 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" -msgstr "WiFi wachtwoord moet tussen 8 en 63 karakters bevatten" - #: main.c msgid "Woken up by alarm.\n" msgstr "Gewekt door alarm.\n" @@ -2783,10 +2432,6 @@ msgstr "" msgid "bits must be 32 or less" msgstr "" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample moet 8 of 16 zijn" @@ -2824,11 +2469,6 @@ msgstr "buffer te klein voor gevraagde bytes" msgid "byteorder is not a string" msgstr "byteorder is geen string" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "bytes > 8 bits not supported" -msgstr "butes > 8 niet ondersteund" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "bytes lengte is geen veelvoud van itemgrootte" @@ -2837,7 +2477,7 @@ msgstr "bytes lengte is geen veelvoud van itemgrootte" msgid "bytes value out of range" msgstr "bytes waarde buiten bereik" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "calibration is buiten bereik" @@ -2845,12 +2485,9 @@ msgstr "calibration is buiten bereik" msgid "calibration is read only" msgstr "calibration is alleen-lezen" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "calibration waarde buiten bereik +/-127" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" +msgid "can only have one parent" msgstr "" #: py/emitinlinethumb.c @@ -3022,6 +2659,10 @@ msgstr "" msgid "casting" msgstr "casting" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "chars buffer te klein" @@ -3034,11 +2675,6 @@ msgstr "chr() arg niet binnen bereik (0x110000)" msgid "chr() arg not in range(256)" msgstr "chr() arg niet binnen bereik (256)" -#: shared-module/vectorio/Circle.c -msgid "circle can only be registered in one parent" -msgstr "" -"cirkel kan slechts bij één object van een hoger niveau worden geregistreerd" - #: shared-bindings/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "" @@ -3466,6 +3102,10 @@ msgstr "indices moeten integers zijn" msgid "indices must be integers, slices, or Boolean lists" msgstr "indices moeten integers, segmenten (slices) of Boolean lijsten zijn" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "oorspronkelijke waarden moeten itereerbaar zijn" @@ -3719,10 +3359,6 @@ msgstr "fout in het wiskundig domein (math domain error)" msgid "matrix is not positive definite" msgstr "matrix is niet positief-definiet" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3730,10 +3366,6 @@ msgstr "" 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 "" - #: extmod/ulab/code/ndarray.c msgid "maximum number of dimensions is 4" msgstr "maximaal aantal dimensies is 4" @@ -4104,11 +3736,6 @@ msgstr "pixel_shader moet displayio.Palette of displayio.ColorConverter zijn" msgid "poll on file not available on win32" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "" -"polygoon kan slechts bij één object van een hoger niveau worden geregistreerd" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop van een lege PulseIn" @@ -4155,14 +3782,6 @@ msgstr "" msgid "pull masks conflict with direction masks" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "wachtrij overloop" @@ -4335,10 +3954,6 @@ msgstr "start_x moet een int zijn" msgid "step must be non-zero" msgstr "step mag geen nul zijn" -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "stop moet 1 of 2 zijn" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "stop is niet bereikbaar vanaf start" @@ -4387,10 +4002,6 @@ msgstr "syntaxisfout in uctypes aanduiding" msgid "threshold must be in the range 0-65536" msgstr "drempelwaarde moet in het bereik 0-65536 liggen" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() accepteert een 9-rij" @@ -4410,10 +4021,6 @@ msgstr "timeout moet tussen 0.0 en 100.0 seconden zijn" msgid "timeout must be < 655.35 secs" msgstr "" -#: shared-bindings/_bleio/CharacteristicBuffer.c -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 "timeout bij wachten op v1 kaart" @@ -4422,6 +4029,10 @@ msgstr "timeout bij wachten op v1 kaart" msgid "timeout waiting for v2 card" msgstr "timeout bij wachten op v2 kaart" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "timestamp buiten bereik voor platform time_t" @@ -4613,13 +4224,7 @@ msgstr "watchdog niet geïnitialiseerd" msgid "watchdog timeout must be greater than 0" msgstr "watchdog time-out moet groter zijn dan 0" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "breedte moet groter dan nul zijn" @@ -4691,6 +4296,286 @@ 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 must be a tuple of length 2" +#~ msgstr "%q moet een tuple van lengte 2 zijn" + +#~ msgid "%q should be an int" +#~ msgstr "%q moet een int zijn" + +#~ msgid "Address type out of range" +#~ msgstr "Adres type buiten bereik" + +#~ msgid "AnalogIn not supported on given pin" +#~ msgstr "AnalogIn niet ondersteund door gegeven pin" + +#~ msgid "AnalogOut functionality not supported" +#~ msgstr "AnalogOut functionaliteit niet ondersteund" + +#~ msgid "AnalogOut is only 16 bits. Value must be less than 65536." +#~ msgstr "AnalogOut is slechts 16 bits. Waarde moet minder dan 65536 zijn." + +#~ msgid "AnalogOut not supported on given pin" +#~ msgstr "AnalogOut niet ondersteund door gegeven pin" + +#, c-format +#~ msgid "Bit depth must be from 1 to 6 inclusive, not %d" +#~ msgstr "Bitdiepte moet tussen 1 en 6 liggen, niet %d" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "Buffer heeft incorrect grootte. Moet %d bytes zijn." + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "Buffer moet op zijn minst lengte 1 zijn" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "Bytes moeten tussen 0 en 255 liggen." + +#~ msgid "Cannot output both channels on the same pin" +#~ msgstr "Output van beide kanalen kan niet op dezelfde pin" + +#~ msgid "Cannot read without MISO pin." +#~ msgstr "Kan niet lezen zonder MISO pin." + +#~ msgid "Cannot reset into bootloader because no bootloader is present." +#~ msgstr "" +#~ "Kan niet resetten naar bootloader omdat er geen bootloader aanwezig is." + +#~ msgid "Cannot transfer without MOSI and MISO pins." +#~ msgstr "Kan niet overdragen zonder MOSI en MISO pinnen." + +#~ msgid "Cannot write without MOSI pin." +#~ msgstr "Kan niet schrijven zonder MOSI pin." + +#~ msgid "Clock pin init failed." +#~ msgstr "Clock pin init mislukt." + +#~ msgid "Command must be an int between 0 and 255" +#~ msgstr "Command moet een int tussen 0 en 255 zijn" + +#~ msgid "Could not initialize Camera" +#~ msgstr "Kon camera niet initialiseren" + +#~ msgid "Could not initialize GNSS" +#~ msgstr "Kan GNSS niet initialiseren" + +#~ msgid "Could not initialize SDCard" +#~ msgstr "Kan SDCard niet initialiseren" + +#~ msgid "Could not initialize UART" +#~ msgstr "Kan UART niet initialiseren" + +#~ msgid "Could not re-init channel" +#~ msgstr "Kan kanaal niet her-initialiseren" + +#~ msgid "Could not re-init timer" +#~ msgstr "Kan timer niet her-initialiseren" + +#~ msgid "Could not restart PWM" +#~ msgstr "Kan PWM niet herstarten" + +#~ msgid "Couldn't allocate first buffer" +#~ msgstr "Kan eerste buffer niet alloceren" + +#~ msgid "Couldn't allocate input buffer" +#~ msgstr "Kan input buffer niet alloceren" + +#~ msgid "Couldn't allocate second buffer" +#~ msgstr "Kan tweede buffer niet alloceren" + +#~ msgid "DigitalInOut not supported on given pin" +#~ msgstr "DigitalInOut niet ondersteund door gegeven pin" + +#, c-format +#~ msgid "Expected tuple of length %d, got %d" +#~ msgstr "Verwachtte een tuple met lengte %d, maar kreeg %d" + +#~ msgid "Failed to allocate RX buffer" +#~ msgstr "RX buffer alloceren mislukt" + +#, c-format +#~ msgid "Failed to allocate RX buffer of %d bytes" +#~ msgstr "Mislukt een RX buffer van %d bytes te alloceren" + +#, c-format +#~ msgid "Framebuffer requires %d bytes" +#~ msgstr "Framebuffer benodigd %d bytes" + +#~ msgid "Hostname must be between 1 and 253 characters" +#~ msgstr "Hostnaam moet tussen 1 en 253 karakters zijn" + +#~ msgid "I2C Init Error" +#~ msgstr "I2C Init Fout" + +#~ msgid "Invalid %q pin selection" +#~ msgstr "Ongeldige %q pin selectie" + +#~ msgid "Invalid BMP file" +#~ msgstr "Ongeldig BMP bestand" + +#~ msgid "Invalid DAC pin supplied" +#~ msgstr "Ongeldige DAC pin opgegeven" + +#~ msgid "Invalid PWM frequency" +#~ msgstr "Ongeldige PWM frequentie" + +#~ msgid "Invalid Pin" +#~ msgstr "Ongeldige Pin" + +#~ msgid "Invalid buffer size" +#~ msgstr "Ongeldige buffer grootte" + +#~ msgid "Invalid byteorder string" +#~ msgstr "Ongeldige byteorder string" + +#~ msgid "Invalid capture period. Valid range: 1 - 500" +#~ msgstr "Ongeldige vastlegging periode. Geldig bereik: 1 - 500" + +#~ msgid "Invalid channel count" +#~ msgstr "Ongeldige kanaal aantallen" + +#~ msgid "Invalid direction." +#~ msgstr "Ongeldige richting." + +#~ msgid "Invalid file" +#~ msgstr "Ongeldig bestand" + +#~ msgid "Invalid number of bits" +#~ msgstr "Ongeldig aantal bits" + +#~ msgid "Invalid phase" +#~ msgstr "Ongeldige fase" + +#~ msgid "Invalid pin" +#~ msgstr "Ongeldige pin" + +#~ msgid "Invalid pin for left channel" +#~ msgstr "Ongeldige pin voor linker kanaal" + +#~ msgid "Invalid pin for right channel" +#~ msgstr "Ongeldige pin voor rechter kanaal" + +#~ msgid "Invalid polarity" +#~ msgstr "Ongeldige polariteit" + +#~ msgid "Invalid properties" +#~ msgstr "Ongeldige eigenschappen" + +#~ msgid "Invalid run mode." +#~ msgstr "Ongeldige run modus." + +#~ msgid "Invalid security_mode" +#~ msgstr "Ongeldige security_mode" + +#~ msgid "Invalid voice" +#~ msgstr "Ongeldige stem" + +#~ msgid "Invalid voice count" +#~ msgstr "Ongeldig stem aantal" + +#~ msgid "Invalid wave file" +#~ msgstr "Ongeldig wave bestand" + +#~ msgid "Invalid word/bit length" +#~ msgstr "Ongeldig woord/bit lengte" + +#~ msgid "Layer already in a group." +#~ msgstr "Laag al in groep." + +#~ msgid "Layer must be a Group or TileGrid subclass." +#~ msgstr "Laag moet een Groep of TileGrid subklasse zijn." + +#~ msgid "MISO pin init failed." +#~ msgstr "MISO pin init mislukt." + +#~ msgid "MOSI pin init failed." +#~ msgstr "MOSI pin init mislukt." + +#~ msgid "Messages limited to 8 bytes" +#~ msgstr "Berichten zijn beperkt tot 8 bytes" + +#~ msgid "No hardware support on clk pin" +#~ msgstr "Geen hardware ondersteuning beschikbaar op clk pin" + +#~ msgid "No hardware support on pin" +#~ msgstr "Geen hardware ondersteuning op pin" + +#~ 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)" + +#~ msgid "Pin does not have ADC capabilities" +#~ msgstr "Pin heeft geen ADC mogelijkheden" + +#~ msgid "RTC calibration is not supported on this board" +#~ msgstr "RTC calibratie niet ondersteund door dit board" + +#~ msgid "RTS/CTS/RS485 Not yet supported on this device" +#~ msgstr "RTS/CTS/RS485 Nog niet ondersteund door dit apparaat" + +#~ msgid "SPI Init Error" +#~ msgstr "SPI Init Fout" + +#~ msgid "SPI Re-initialization error" +#~ msgstr "SPI Herinitialisatie Fout" + +#~ msgid "Sample rate must be positive" +#~ msgstr "Sample rate moet positief zijn" + +#, c-format +#~ msgid "Sample rate too high. It must be less than %d" +#~ msgstr "Sample rate is te hoog. Moet minder dan %d zijn" + +#~ msgid "Stack size must be at least 256" +#~ msgstr "Stack grootte moet op zijn minst 256 zijn" + +#~ msgid "Tile value out of bounds" +#~ msgstr "Tile waarde buiten bereik" + +#~ msgid "UART Buffer allocation error" +#~ msgstr "UART Buffer allocatie fout" + +#~ msgid "UART De-init error" +#~ msgstr "UART De-init fout" + +#~ msgid "UART Init Error" +#~ msgstr "UART Init Fout" + +#~ msgid "UART Re-init error" +#~ msgstr "UART Re-init Fout" + +#~ msgid "UART write error" +#~ msgstr "UART schrijf fout" + +#~ msgid "Unsupported baudrate" +#~ msgstr "Niet-ondersteunde baudsnelheid" + +#~ msgid "WiFi password must be between 8 and 63 characters" +#~ msgstr "WiFi wachtwoord moet tussen 8 en 63 karakters bevatten" + +#~ msgid "bytes > 8 bits not supported" +#~ msgstr "butes > 8 niet ondersteund" + +#~ msgid "calibration value out of range +/-127" +#~ msgstr "calibration waarde buiten bereik +/-127" + +#~ msgid "circle can only be registered in one parent" +#~ msgstr "" +#~ "cirkel kan slechts bij één object van een hoger niveau worden " +#~ "geregistreerd" + +#~ msgid "polygon can only be registered in one parent" +#~ msgstr "" +#~ "polygoon kan slechts bij één object van een hoger niveau worden " +#~ "geregistreerd" + +#~ msgid "stop must be 1 or 2" +#~ msgstr "stop moet 1 of 2 zijn" + +#~ msgid "timeout must be >= 0.0" +#~ msgstr "timeout moet groter dan 0.0 zijn" + #~ msgid "Unsupported operation" #~ msgstr "Niet-ondersteunde operatie" diff --git a/locale/pl.po b/locale/pl.po index 2b1d6ea123..5e44013409 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -71,10 +71,24 @@ msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "" +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "" @@ -87,12 +101,7 @@ msgstr "%q niepowodzenie: %d" msgid "%q in use" msgstr "%q w użyciu" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "%q poza zakresem" @@ -100,14 +109,34 @@ msgstr "%q poza zakresem" msgid "%q indices must be integers, not %s" msgstr "%q indeks musi być liczbą całkowitą, a nie %s" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "" @@ -124,14 +153,10 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "%q musi być >= 0" -#: 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 "%q musi być >= 1" @@ -140,13 +165,8 @@ msgstr "%q musi być >= 1" msgid "%q must be a string" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "%q musi być krotką o długości 2" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" +#: py/argcheck.c +msgid "%q must be an int" msgstr "" #: py/argcheck.c @@ -165,7 +185,11 @@ msgstr "" msgid "%q 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/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q poza zakresem" @@ -174,10 +198,6 @@ msgstr "%q poza zakresem" msgid "%q pin invalid" msgstr "nieprawidłowy pin %q" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%q powinno być typu int" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "" @@ -340,10 +360,6 @@ msgstr "'yield from' wewnątrz funkcji asynchronicznej" msgid "'yield' outside function" msgstr "'yield' poza funkcją" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "" - #: py/compile.c msgid "*x must be assignment target" msgstr "*x musi być obiektem przypisania" @@ -379,10 +395,6 @@ msgstr "ADC2 jest używany przez WiFi" msgid "Address must be %d bytes long" msgstr "Adres musi mieć %d bajtów" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "Typ adresu poza zakresem" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "" @@ -473,25 +485,6 @@ msgstr "" 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" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "AnalogOut jest niewspierane" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "AnalogOut ma 16 bitów. Wartość musi być mniejsza od 65536." - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "AnalogOut niewspierany na tej nóżce" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "" @@ -563,11 +556,6 @@ msgstr "" msgid "Bit clock and word select must share a clock unit" msgstr "Zegar bitowy i wybór słowa muszą współdzielić jednostkę zegara" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "Głębia musi być wielokrotnością 8." @@ -609,11 +597,6 @@ msgstr "Bufor + przesunięcie za małe %d %d %d" msgid "Buffer elements must be 4 bytes long or less" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "Zła wielkość bufora. Powinno być %d bajtów." - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "" @@ -623,7 +606,6 @@ msgstr "" msgid "Buffer is too small" msgstr "Bufor jest za mały" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -638,10 +620,6 @@ msgstr "Długość bufora musi być wielokrotnością 512" msgid "Buffer must be a multiple of 512 bytes" msgstr "Bufor musi być wielokrotnością 512 bajtów" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "Bufor musi mieć długość 1 lub więcej" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -663,10 +641,6 @@ msgstr "Nóżka magistrali %d jest w użyciu" msgid "Byte buffer must be 16 bytes." msgstr "Bufor musi mieć 16 bajtów." -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "Bytes musi być między 0 a 255." - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "Bloki CBC muszą być wielokrotnościami 16 bajtów" @@ -683,6 +657,10 @@ msgstr "" msgid "Call super().__init__() before accessing native object." msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" @@ -730,18 +708,10 @@ msgstr "Nie można odczytać temperatury" 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 "Nie można mieć obu kanałów na tej samej nóżce" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "Nie można czytać bez nóżki MISO." - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "Nie można nagrać do pliku" @@ -753,8 +723,8 @@ 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 "Nie można zrestartować -- nie ma bootloadera." +msgid "Cannot reset into bootloader because no bootloader is present" +msgstr "" #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -774,21 +744,20 @@ msgid "Cannot subclass slice" msgstr "Nie można dziedziczyć ze slice" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." -msgstr "Nie można przesyłać bez nóżek MOSI i MISO." +msgid "Cannot transfer without MOSI and MISO pins" +msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "Nie można zmieniać częstotliwości timera, który jest już używany" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c -msgid "Cannot wake on pin edge. Only level." +msgid "Cannot wake on pin edge, only level" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." -msgstr "Nie można pisać bez nóżki MOSI." +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge. Only level." +msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" @@ -802,10 +771,6 @@ msgstr "" msgid "CircuitPython was unable to allocate the heap." msgstr "CircuitPython nie mógł przydzielić sterty." -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "Inicjalizacja nóżki zegara nie powiodła się." - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "Rozciągnięcie zegara zbyt duże" @@ -814,11 +779,6 @@ msgstr "Rozciągnięcie zegara zbyt duże" msgid "Clock unit in use" msgstr "Jednostka zegara w użyciu" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -msgid "Command must be an int between 0 and 255" -msgstr "Komenda musi być int pomiędzy 0 a 255" - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -831,35 +791,6 @@ msgstr "" msgid "Corrupt .mpy file" msgstr "Uszkodzony plik .mpy" -#: 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" - -#: ports/cxd56/common-hal/sdioio/SDCard.c -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/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "Ustawienie UART nie powiodło się" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init channel" -msgstr "Nie można ponownie zainicjować kanału" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init timer" -msgstr "Nie można ponownie zainicjować timera" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not restart PWM" -msgstr "Nie można ponownie uruchomić PWM" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "" @@ -880,20 +811,6 @@ msgstr "Nie można rozpocząć przerwania, RX jest zajęty" msgid "Couldn't allocate decoder" msgstr "Nie udało się przydzielić dekodera" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate first buffer" -msgstr "Nie udała się alokacja pierwszego bufora" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate input buffer" -msgstr "Nie można przydzielić bufora wejściowego" - -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate second buffer" -msgstr "Nie udała się alokacja drugiego bufora" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "" @@ -941,10 +858,6 @@ msgstr "Pojemność celu mniejsza od destination_length." msgid "Device in use" msgstr "Urządzenie w użyciu" -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -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." @@ -1000,11 +913,6 @@ msgstr "Oczekiwano %q" msgid "Expected an alarm" msgstr "" -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "Oczekiwano krotkę długości %d, otrzymano %d" - #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." @@ -1031,22 +939,6 @@ msgstr "Nie udało się wysłać polecenia." msgid "Failed to acquire mutex, err 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 -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -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/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/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/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "" @@ -1115,11 +1007,6 @@ msgstr "" msgid "Format not supported" msgstr "Nie wspierany format" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" -msgstr "Bufor ramki wymaga %d bajtów" - #: ports/mimxrt10xx/common-hal/microcontroller/Processor.c msgid "" "Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" @@ -1134,6 +1021,10 @@ msgstr "" msgid "Function requires lock" msgstr "Funkcja wymaga blokady" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1161,17 +1052,13 @@ 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" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "Błąd inicjalizacji I2C" +msgid "I2C init error" +msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c msgid "I2C peripheral in use" @@ -1280,75 +1167,33 @@ msgstr "" msgid "Internal error #%d" msgstr "Błąd wewnętrzny #%d" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: py/argcheck.c msgid "Invalid %q" msgstr "Nieprawidłowe %q" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c 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/canio/CAN.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 "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "Zły BMP" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "Zła częstotliwość PWM" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "Zły argument" @@ -1356,42 +1201,11 @@ msgstr "Zły argument" msgid "Invalid bits per value" msgstr "Zła liczba bitów wartości" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "Zła wielkość bufora" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "Zły okres. Poprawny zakres to: 1 - 500" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "Zła liczba kanałów" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "Nieprawidłowy kierunek." - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "Zły plik" - #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Zła wielkość fragmentu formatu" @@ -1400,78 +1214,14 @@ msgstr "Zła wielkość fragmentu formatu" msgid "Invalid memory access." msgstr "Nieprawidłowy dostęp do pamięci." -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "Zła liczba bitów" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "Zła faza" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "Zła nóżka" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "Zła nóżka dla lewego kanału" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -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/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/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "Złe nóżki" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "Zła polaryzacja" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "Nieprawidłowe właściwości" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "Zły tryb uruchomienia." - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "Nieprawidłowy security_mode" - #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "Nieprawidłowy rozmiar" @@ -1484,23 +1234,6 @@ msgstr "" msgid "Invalid state" msgstr "Nieprawidłowy stan" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "Zła liczba głosów" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "Zły plik wave" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "Niepoprawna długość słowa/bitu" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "Klucz musi mieć długość 16, 24 lub 32 bajtów" @@ -1514,25 +1247,17 @@ msgid "LHS of keyword arg must be an id" msgstr "Lewa strona argumentu nazwanego musi być nazwą" #: shared-module/displayio/Group.c -msgid "Layer already in a group." +msgid "Layer already in a group" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." -msgstr "Layer musi dziedziczyć z Group albo TileGrid." +msgid "Layer must be a Group or TileGrid subclass" +msgstr "" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "Nie powiodło się ustawienie pinu MISO." - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "Nie powiodło się ustawienie pinu MOSI." - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "" @@ -1542,10 +1267,6 @@ msgstr "" 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 "Wiadomości ograniczone do 8 bajtów" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Opóźnienie włączenia mikrofonu musi być w zakresie od 0.0 do 1.0" @@ -1559,10 +1280,14 @@ msgstr "" msgid "Mismatched swap flag" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "Brak pinu MISO lub MOSI" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1598,11 +1323,6 @@ msgstr "" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" @@ -1663,15 +1383,23 @@ msgid "No I2C device at address: 0x%x" msgstr "" #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "Brak pinu MISO" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Brak pinu MOSI" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1710,16 +1438,6 @@ msgstr "Brak wolnych GLCK" msgid "No hardware random available" msgstr "Brak generatora liczb losowych" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "Brak sprzętowej obsługi na nóżce" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "" @@ -1864,10 +1582,13 @@ msgid "Only one address is allowed" msgstr "" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "" @@ -1899,11 +1620,6 @@ msgstr "" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Nadpróbkowanie musi być wielokrotnością 8." @@ -1912,16 +1628,15 @@ msgstr "Nadpróbkowanie musi być wielokrotnością 8." msgid "PDMIn not available" msgstr "" -#: 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/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." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" +msgstr "" + #: ports/raspberrypi/common-hal/countio/Counter.c msgid "PWM slice already in use" msgstr "" @@ -1938,29 +1653,14 @@ msgstr "" msgid "Permission denied" msgstr "Odmowa dostępu" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "Nóżka nie obsługuje ADC" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2027,18 +1727,10 @@ msgstr "" msgid "Program does OUT without loading OSR" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "" - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Podciągnięcie nieużywane w trybie wyjścia." @@ -2060,8 +1752,9 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" +#: 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 "RS485" msgstr "" #: ports/espressif/common-hal/busio/UART.c @@ -2069,21 +1762,10 @@ msgstr "" msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "Brak obsługi kalibracji RTC" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "Brak obsługi RTC" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/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 "Błąd generowania liczb losowych" @@ -2133,6 +1815,10 @@ msgstr "Uruchomiony tryb bezpieczeństwa! Zapisany kod nie jest uruchamiany.\n" msgid "SD card CSD format not supported" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2143,30 +1829,21 @@ msgstr "" msgid "SDIO Init Error %d" msgstr "" -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "Błąd inicjowania SPI" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "Błąd ponownej inicjalizacji SPI" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -msgid "Sample rate must be positive" -msgstr "Częstotliwość próbkowania musi być dodatnia" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" -msgstr "Zbyt wysoka częstotliwość próbkowania. Musi być mniejsza niż %d" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" +msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c msgid "Scale dimensions must divide by 3" @@ -2186,14 +1863,6 @@ msgstr "Serializator w użyciu" msgid "Server side context cannot have hostname" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "" @@ -2229,10 +1898,6 @@ msgstr "" msgid "Splitting with sub-captures" msgstr "Podział z podgrupami" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "Stos musi mieć co najmniej 256 bajtów" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "" @@ -2318,10 +1983,6 @@ msgstr "Wysokość bitmapy musi być wielokrotnością wysokości kafelka" 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 "Szerokość bitmapy musi być wielokrotnością szerokości kafelka" @@ -2341,6 +2002,9 @@ 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 "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Zbyt wiele kanałów." @@ -2373,25 +2037,22 @@ msgid "Tuple or struct_time argument required" msgstr "Wymagana krotka lub struct_time" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "Błąd alokacji bufora UART" +msgid "UART de-init" +msgstr "" -#: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" +msgid "UART re-init" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Re-init error" +msgid "UART write" msgstr "" -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" -msgstr "Błąd zapisu UART" - #: shared-module/usb_hid/Device.c msgid "USB busy" msgstr "" @@ -2526,12 +2187,6 @@ msgid "" "declined or ignored." msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "Zła szybkość transmisji" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "" @@ -2606,10 +2261,6 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" -msgstr "" - #: main.c msgid "Woken up by alarm.\n" msgstr "" @@ -2762,10 +2413,6 @@ msgstr "" msgid "bits must be 32 or less" msgstr "" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample musi być 8 lub 16" @@ -2803,11 +2450,6 @@ msgstr "" msgid "byteorder is not a string" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -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 "" @@ -2816,7 +2458,7 @@ msgstr "" msgid "bytes value out of range" msgstr "wartość bytes poza zakresem" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "kalibracja poza zakresem" @@ -2824,12 +2466,9 @@ msgstr "kalibracja poza zakresem" msgid "calibration is read only" msgstr "kalibracja tylko do odczytu" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "wartość kalibracji poza zakresem +/-127" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" +msgid "can only have one parent" msgstr "" #: py/emitinlinethumb.c @@ -3000,6 +2639,10 @@ msgstr "" msgid "casting" msgstr "rzutowanie" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "bufor chars zbyt mały" @@ -3012,10 +2655,6 @@ msgstr "argument chr() poza zakresem range(0x110000)" msgid "chr() arg not in range(256)" msgstr "argument chr() poza zakresem range(256)" -#: shared-module/vectorio/Circle.c -msgid "circle can only be registered in one parent" -msgstr "" - #: shared-bindings/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "" @@ -3441,6 +3080,10 @@ msgstr "indeksy muszą być całkowite" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "wartości początkowe muszą być iterowalne" @@ -3691,10 +3334,6 @@ msgstr "błąd domeny" msgid "matrix is not positive definite" msgstr "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3702,10 +3341,6 @@ 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 "" - #: extmod/ulab/code/ndarray.c msgid "maximum number of dimensions is 4" msgstr "" @@ -4077,10 +3712,6 @@ msgstr "" msgid "poll on file not available on win32" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop z pustego PulseIn" @@ -4127,14 +3758,6 @@ msgstr "" msgid "pull masks conflict with direction masks" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "przepełnienie kolejki" @@ -4306,10 +3929,6 @@ msgstr "start_x powinien być całkowity" msgid "step must be non-zero" msgstr "step nie może być zerowe" -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "stop musi być 1 lub 2" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "stop nie jest osiągalne ze start" @@ -4358,10 +3977,6 @@ msgstr "błąd składni w deskryptorze uctypes" msgid "threshold must be in the range 0-65536" msgstr "threshold musi być w zakresie 0-65536" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() wymaga 9-elementowej sekwencji" @@ -4381,10 +3996,6 @@ msgstr "" msgid "timeout must be < 655.35 secs" msgstr "" -#: shared-bindings/_bleio/CharacteristicBuffer.c -msgid "timeout must be >= 0.0" -msgstr "timeout musi być >= 0.0" - #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" msgstr "" @@ -4393,6 +4004,10 @@ msgstr "" msgid "timeout waiting for v2 card" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +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" @@ -4584,13 +4199,7 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "szerokość musi być większa niż zero" @@ -4662,6 +4271,226 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "%q must be a tuple of length 2" +#~ msgstr "%q musi być krotką o długości 2" + +#~ msgid "%q should be an int" +#~ msgstr "%q powinno być typu int" + +#~ msgid "Address type out of range" +#~ msgstr "Typ adresu poza zakresem" + +#~ msgid "AnalogIn not supported on given pin" +#~ msgstr "AnalogIn nie jest obsługiwany na danym pinie" + +#~ msgid "AnalogOut functionality not supported" +#~ msgstr "AnalogOut jest niewspierane" + +#~ msgid "AnalogOut is only 16 bits. Value must be less than 65536." +#~ msgstr "AnalogOut ma 16 bitów. Wartość musi być mniejsza od 65536." + +#~ msgid "AnalogOut not supported on given pin" +#~ msgstr "AnalogOut niewspierany na tej nóżce" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "Zła wielkość bufora. Powinno być %d bajtów." + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "Bufor musi mieć długość 1 lub więcej" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "Bytes musi być między 0 a 255." + +#~ msgid "Cannot output both channels on the same pin" +#~ msgstr "Nie można mieć obu kanałów na tej samej nóżce" + +#~ msgid "Cannot read without MISO pin." +#~ msgstr "Nie można czytać bez nóżki MISO." + +#~ msgid "Cannot reset into bootloader because no bootloader is present." +#~ msgstr "Nie można zrestartować -- nie ma bootloadera." + +#~ msgid "Cannot transfer without MOSI and MISO pins." +#~ msgstr "Nie można przesyłać bez nóżek MOSI i MISO." + +#~ msgid "Cannot write without MOSI pin." +#~ msgstr "Nie można pisać bez nóżki MOSI." + +#~ msgid "Clock pin init failed." +#~ msgstr "Inicjalizacja nóżki zegara nie powiodła się." + +#~ msgid "Command must be an int between 0 and 255" +#~ msgstr "Komenda musi być int pomiędzy 0 a 255" + +#~ msgid "Could not initialize GNSS" +#~ msgstr "Nie można zainicjować GNSS" + +#~ msgid "Could not initialize SDCard" +#~ msgstr "Nie można zainicjować SDCard" + +#~ msgid "Could not initialize UART" +#~ msgstr "Ustawienie UART nie powiodło się" + +#~ msgid "Could not re-init channel" +#~ msgstr "Nie można ponownie zainicjować kanału" + +#~ msgid "Could not re-init timer" +#~ msgstr "Nie można ponownie zainicjować timera" + +#~ msgid "Could not restart PWM" +#~ msgstr "Nie można ponownie uruchomić PWM" + +#~ msgid "Couldn't allocate first buffer" +#~ msgstr "Nie udała się alokacja pierwszego bufora" + +#~ msgid "Couldn't allocate input buffer" +#~ msgstr "Nie można przydzielić bufora wejściowego" + +#~ msgid "Couldn't allocate second buffer" +#~ msgstr "Nie udała się alokacja drugiego bufora" + +#~ msgid "DigitalInOut not supported on given pin" +#~ msgstr "DigitalInOut nie jest obsługiwany na podanym pinie" + +#, c-format +#~ msgid "Expected tuple of length %d, got %d" +#~ msgstr "Oczekiwano krotkę długości %d, otrzymano %d" + +#~ msgid "Failed to allocate RX buffer" +#~ msgstr "Nie udała się alokacja bufora RX" + +#, c-format +#~ msgid "Failed to allocate RX buffer of %d bytes" +#~ msgstr "Nie udała się alokacja %d bajtów na bufor RX" + +#, c-format +#~ msgid "Framebuffer requires %d bytes" +#~ msgstr "Bufor ramki wymaga %d bajtów" + +#~ msgid "I2C Init Error" +#~ msgstr "Błąd inicjalizacji I2C" + +#~ msgid "Invalid BMP file" +#~ msgstr "Zły BMP" + +#~ msgid "Invalid PWM frequency" +#~ msgstr "Zła częstotliwość PWM" + +#~ msgid "Invalid buffer size" +#~ msgstr "Zła wielkość bufora" + +#~ msgid "Invalid capture period. Valid range: 1 - 500" +#~ msgstr "Zły okres. Poprawny zakres to: 1 - 500" + +#~ msgid "Invalid channel count" +#~ msgstr "Zła liczba kanałów" + +#~ msgid "Invalid direction." +#~ msgstr "Nieprawidłowy kierunek." + +#~ msgid "Invalid file" +#~ msgstr "Zły plik" + +#~ msgid "Invalid number of bits" +#~ msgstr "Zła liczba bitów" + +#~ msgid "Invalid phase" +#~ msgstr "Zła faza" + +#~ msgid "Invalid pin" +#~ msgstr "Zła nóżka" + +#~ msgid "Invalid pin for left channel" +#~ msgstr "Zła nóżka dla lewego kanału" + +#~ msgid "Invalid pin for right channel" +#~ msgstr "Zła nóżka dla prawego kanału" + +#~ msgid "Invalid polarity" +#~ msgstr "Zła polaryzacja" + +#~ msgid "Invalid properties" +#~ msgstr "Nieprawidłowe właściwości" + +#~ msgid "Invalid run mode." +#~ msgstr "Zły tryb uruchomienia." + +#~ msgid "Invalid security_mode" +#~ msgstr "Nieprawidłowy security_mode" + +#~ msgid "Invalid voice count" +#~ msgstr "Zła liczba głosów" + +#~ msgid "Invalid wave file" +#~ msgstr "Zły plik wave" + +#~ msgid "Invalid word/bit length" +#~ msgstr "Niepoprawna długość słowa/bitu" + +#~ msgid "Layer must be a Group or TileGrid subclass." +#~ msgstr "Layer musi dziedziczyć z Group albo TileGrid." + +#~ msgid "MISO pin init failed." +#~ msgstr "Nie powiodło się ustawienie pinu MISO." + +#~ msgid "MOSI pin init failed." +#~ msgstr "Nie powiodło się ustawienie pinu MOSI." + +#~ msgid "Messages limited to 8 bytes" +#~ msgstr "Wiadomości ograniczone do 8 bajtów" + +#~ msgid "No hardware support on pin" +#~ msgstr "Brak sprzętowej obsługi na nóżce" + +#~ 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)" + +#~ msgid "Pin does not have ADC capabilities" +#~ msgstr "Nóżka nie obsługuje ADC" + +#~ msgid "RTC calibration is not supported on this board" +#~ msgstr "Brak obsługi kalibracji RTC" + +#~ msgid "SPI Init Error" +#~ msgstr "Błąd inicjowania SPI" + +#~ msgid "SPI Re-initialization error" +#~ msgstr "Błąd ponownej inicjalizacji SPI" + +#~ msgid "Sample rate must be positive" +#~ msgstr "Częstotliwość próbkowania musi być dodatnia" + +#, c-format +#~ msgid "Sample rate too high. It must be less than %d" +#~ msgstr "Zbyt wysoka częstotliwość próbkowania. Musi być mniejsza niż %d" + +#~ msgid "Stack size must be at least 256" +#~ msgstr "Stos musi mieć co najmniej 256 bajtów" + +#~ msgid "UART Buffer allocation error" +#~ msgstr "Błąd alokacji bufora UART" + +#~ msgid "UART write error" +#~ msgstr "Błąd zapisu UART" + +#~ msgid "Unsupported baudrate" +#~ msgstr "Zła szybkość transmisji" + +#~ msgid "bytes > 8 bits not supported" +#~ msgstr "bajty większe od 8 bitów są niewspierane" + +#~ msgid "calibration value out of range +/-127" +#~ msgstr "wartość kalibracji poza zakresem +/-127" + +#~ msgid "stop must be 1 or 2" +#~ msgstr "stop musi być 1 lub 2" + +#~ msgid "timeout must be >= 0.0" +#~ msgstr "timeout musi być >= 0.0" + #~ msgid "Unsupported operation" #~ msgstr "Zła operacja" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index e9cf974632..b29c0a79eb 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -75,10 +75,24 @@ msgstr "" "%d pinos de endereço, %d pinos rgb e %d blocos indicam uma altura com %d, " "não %d" +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "%q e %q contêm pinos duplicados" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "%q contém pinos duplicados" @@ -91,12 +105,7 @@ msgstr "%q falha: %d" msgid "%q in use" msgstr "%q em uso" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "O índice %q está fora do intervalo" @@ -104,14 +113,34 @@ msgstr "O índice %q está fora do intervalo" msgid "%q indices must be integers, not %s" msgstr "Os índices %q devem ser inteiros, e não %s" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "o comprimento %q deve ser %d-%d" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "o comprimento %q deve ser >=1" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "o %q deve ser %d-%d" @@ -128,14 +157,10 @@ msgstr "%q deve ser <= %d" msgid "%q must be >= %d" msgstr "o %q deve ser >= %d" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "%q deve ser >= 0" -#: 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 "%q deve ser >= 1" @@ -144,14 +169,9 @@ msgstr "%q deve ser >= 1" msgid "%q must be a string" msgstr "%q deve ser uma string" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "%q deve ser uma tupla de comprimento 2" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" -msgstr "%q deve estar entre %d e %d" +#: py/argcheck.c +msgid "%q must be an int" +msgstr "" #: py/argcheck.c msgid "%q must be of type %q" @@ -169,7 +189,11 @@ msgstr "%q deve ser a potência de 2" msgid "%q out of bounds" msgstr "%q 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/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q fora do alcance" @@ -178,10 +202,6 @@ msgstr "%q fora do alcance" msgid "%q pin invalid" msgstr "%q pino inválido" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%q deve ser um int" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "%q com um relatório com ID de 0 deve ter comprimento 1" @@ -348,10 +368,6 @@ msgstr "'yield a partir' de dentro da função async" msgid "'yield' outside function" msgstr "função externa 'yield'" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "(x,y) é obrigatório o uso de números inteiros" - #: py/compile.c msgid "*x must be assignment target" msgstr "*x deve ser o destino da atribuição" @@ -387,10 +403,6 @@ msgstr "O ADC2 está sendo usado pelo WiFi" msgid "Address must be %d bytes long" msgstr "O endereço deve ter %d bytes de comprimento" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "O tipo do endereço está fora do alcance" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "Todos os periféricos CAN estão em uso" @@ -481,25 +493,6 @@ msgstr "Já está em execução" msgid "Already scanning for wifi networks" msgstr "Já está em busca das redes de wifi" -#: ports/cxd56/common-hal/analogio/AnalogIn.c -msgid "AnalogIn not supported on given pin" -msgstr "O AnalogIn não é compatível no pino informado" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "Funcionalidade AnalogOut não suportada" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -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" -msgstr "Saída analógica não suportada no pino fornecido" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "Um outro PWMAudioOut já está ativo" @@ -574,11 +567,6 @@ msgstr "" "O clock de bits e a seleção de palavras devem compartilhar uma unidade de " "clock" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "A profundidade dos bits deve ser de 1 até 6 inclusive, porém não %d" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "A profundidade de bits deve ser o múltiplo de 8." @@ -622,11 +610,6 @@ msgstr "O buffer + desvio é muito pequeno %d %d %d" msgid "Buffer elements must be 4 bytes long or less" msgstr "Os elementos do buffer devem ter 4 bytes de comprimento ou menos" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "Buffer de tamanho incorreto. Deve ser %d bytes." - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "O buffer não é um bytearray." @@ -636,7 +619,6 @@ msgstr "O buffer não é um bytearray." msgid "Buffer is too small" msgstr "O buffer é muito pequeno" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -651,10 +633,6 @@ msgstr "O comprimento do Buffer deve ser um múltiplo de 512" msgid "Buffer must be a multiple of 512 bytes" msgstr "O buffer deve ser um múltiplo de 512 bytes" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "O comprimento do buffer deve ter pelo menos 1" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -676,10 +654,6 @@ msgstr "O pino bus %d já está em uso" msgid "Byte buffer must be 16 bytes." msgstr "O buffer deve ter 16 bytes." -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "Os bytes devem estar entre 0 e 255." - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "Os blocos CBC devem ter múltiplos de 16 bytes" @@ -696,6 +670,10 @@ msgstr "CRC ou checksum inválido" msgid "Call super().__init__() before accessing native object." msgstr "Chame super().__init__() antes de acessar o objeto nativo." +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "O alarme só pode acontecer no RTC IO a partir do deep sleep." @@ -748,18 +726,10 @@ 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 "Não é possível emitir os dois canais no mesmo pino" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "Não é possível obter (pull) nos pinos somente de entrada." -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "Não é possível ler sem o pino MISO." - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "Não é possível gravar em um arquivo" @@ -771,9 +741,8 @@ msgstr "Não é possível montar '/' quando estiver visível pelo 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." +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." #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -793,22 +762,21 @@ msgid "Cannot subclass slice" msgstr "Não é possível subclassificar a fatia" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." -msgstr "Não é possível transferir sem os pinos MOSI e MISO." +msgid "Cannot transfer without MOSI and MISO pins" +msgstr "" #: shared-bindings/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" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge, only level" +msgstr "" + +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge. Only level." msgstr "Não é possível acordar (wake) no pino edge. Nível apenas." -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." -msgstr "Não é possível fazer a escrita sem um pino MOSI." - #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" msgstr "Escrita CharacteristicBuffer não informada" @@ -821,10 +789,6 @@ msgstr "O núcleo principal do CircuitPython falhou feio. Ops!\n" msgid "CircuitPython was unable to allocate the heap." msgstr "O CircuitPython não conseguiu alocar o heap." -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "Inicialização do pino de Clock falhou." - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "Clock se estendeu por tempo demais" @@ -833,11 +797,6 @@ msgstr "Clock se estendeu por tempo demais" msgid "Clock unit in use" msgstr "Unidade de Clock em uso" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -msgid "Command must be an int between 0 and 255" -msgstr "O comando deve ser um int entre 0 e 255" - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -849,35 +808,6 @@ msgstr "" msgid "Corrupt .mpy file" msgstr "Arquivo .mpy corrompido" -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Could not initialize Camera" -msgstr "Não foi possível inicializar a Câmera" - -#: ports/cxd56/common-hal/gnss/GNSS.c -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 "Não foi possível inicializar o SDCard" - -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/espressif/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 -msgid "Could not re-init channel" -msgstr "Não foi possível reiniciar o canal" - -#: 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/pwmio/PWMOut.c -msgid "Could not restart PWM" -msgstr "Não foi possível reiniciar o PWM" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "Não foi possível recuperar o clock" @@ -898,20 +828,6 @@ msgstr "Não foi possível iniciar a interrupção, RX ocupado" msgid "Couldn't allocate decoder" msgstr "Não foi possível alocar o decodificador" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate first buffer" -msgstr "Não pôde alocar primeiro buffer" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate input buffer" -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 -msgid "Couldn't allocate second buffer" -msgstr "Não pôde alocar segundo buffer" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "Falha no HardFault_Handler." @@ -959,10 +875,6 @@ msgstr "A capacidade do destino é menor que destination_length." msgid "Device in use" msgstr "Dispositivo em uso" -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -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." @@ -1018,11 +930,6 @@ msgstr "Esperado um" msgid "Expected an alarm" msgstr "Um alarme era esperado" -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "Tupla esperada com comprimento %d, obteve %d" - #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." @@ -1049,22 +956,6 @@ msgstr "Falha ao enviar comando." msgid "Failed to acquire mutex, err 0x%04x" 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 -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -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/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/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/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "Houve uma falha na alocação da memória do Wifi" @@ -1134,11 +1025,6 @@ msgstr "" msgid "Format not supported" msgstr "O formato não é suportado" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" -msgstr "O Framebuffer requer %d bytes" - #: ports/mimxrt10xx/common-hal/microcontroller/Processor.c msgid "" "Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" @@ -1156,6 +1042,10 @@ msgstr "" msgid "Function requires lock" msgstr "A função requer bloqueio" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "Falha Genérica" @@ -1183,17 +1073,13 @@ 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 "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" msgstr "Operação I/O no arquivo fechado" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "Erro de inicialização do I2C" +msgid "I2C init error" +msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c msgid "I2C peripheral in use" @@ -1308,75 +1194,33 @@ msgstr "Erro interno" msgid "Internal error #%d" msgstr "Erro interno #%d" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: py/argcheck.c msgid "Invalid %q" msgstr "%q Inválido" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c 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/canio/CAN.c -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Invalid %q pin selection" -msgstr "Seleção inválida dos pinos %q" - #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "Valor inválido da unidade ADC" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "AuthMode inválido" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "Parâmetro BLE inválido" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "Arquivo BMP inválido" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "BSSID Inválido" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "O pino DAC informado é inválido" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "Endereço MAC inválido" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "O arquivo MIDI é inválido" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "Frequência PWM inválida" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "Pino inválido" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "Argumento inválido" @@ -1384,42 +1228,11 @@ msgstr "Argumento inválido" msgid "Invalid bits per value" msgstr "Os valores por bits são inválidos" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "O tamanho do buffer é inválido" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "A cadeia de bytes é inválida" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "O período de captura é inválido. O intervalo válido é: 1 - 500" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "A contagem do canal é inválido" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "data_count %d inválido" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "data_pins[%d] inválido" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "Direção inválida." - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "Arquivo inválido" - #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Tamanho do pedaço de formato inválido" @@ -1428,78 +1241,14 @@ msgstr "Tamanho do pedaço de formato inválido" msgid "Invalid memory access." msgstr "O acesso da memória é inválido." -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "Modo inválido" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "Endereço MAC multicast inválido" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "Número inválido de bits" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "Fase Inválida" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "Pino inválido" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "Pino inválido para canal esquerdo" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -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/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/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "Pinos inválidos" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "Polaridade inválida" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "Propriedades inválidas" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "O modo de execução é inválido." - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "O Security_mode é inválido" - #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "Tamanho inválido" @@ -1512,23 +1261,6 @@ msgstr "Soquete inválido para o TLS" msgid "Invalid state" msgstr "Estado inválido" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "A voz é inválida" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "A contagem da voz é inválida" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "Aqruivo de ondas inválido" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -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 "A chave deve ter 16, 24 ou 32 bytes de comprimento" @@ -1542,25 +1274,17 @@ msgid "LHS of keyword arg must be an id" msgstr "O LHS da palavra-chave arg deve ser um ID" #: shared-module/displayio/Group.c -msgid "Layer already in a group." -msgstr "A camada já existe em um grupo." +msgid "Layer already in a group" +msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." -msgstr "A camada deve ser uma subclasse Group ou TileGrid." +msgid "Layer must be a Group or TileGrid subclass" +msgstr "" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "Endereço MAC inválido" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "A inicialização do pino MISO falhou." - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "Inicialização do pino MOSI falhou." - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "O mapeamento deve ser uma tupla" @@ -1570,10 +1294,6 @@ msgstr "O mapeamento deve ser uma tupla" 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 "As mensagens estão limitadas a 8 bytes" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "O atraso na inicialização do microfone deve estar entre 0,0 e 1,0" @@ -1587,10 +1307,14 @@ msgstr "O tamanho dos dados é incompatível" msgid "Mismatched swap flag" msgstr "Sinalizador de troca incompatível" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "O pino MISO ou MOSI está ausente" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1626,11 +1350,6 @@ msgstr "Faltando first_set_pin. A instrução %d define os pinos(s)" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "Falta o jmp_pin. A instrução %d salta no pino" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "Mais de %d reportam ids não compatíveis" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "Deve ser uma subclasse %q." @@ -1691,15 +1410,23 @@ msgid "No I2C device at address: 0x%x" msgstr "Não há nenhum dispositivo I2C no endereço: 0x%x" #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "Nenhum pino MISO" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Nenhum pino MOSI" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1738,16 +1465,6 @@ msgstr "Não há GCLKs livre" msgid "No hardware random available" msgstr "Nenhum hardware aleatório está disponível" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "Sem suporte de hardware no pino de clock" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "Nenhum suporte de hardware no pino" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "Sem entrada no programa" @@ -1899,10 +1616,13 @@ msgid "Only one address is allowed" msgstr "Apenas um endereço é permitido" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "Apenas um alarme alarm.time pode ser definido." @@ -1934,11 +1654,6 @@ msgstr "Sem soquetes" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "Os elementos Out-buffer devem ter um comprimento de <= 4 bytes" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "O buffer de saída deve ter ao menos %d bytes" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "A superamostragem deve ser um múltiplo de 8." @@ -1947,13 +1662,6 @@ msgstr "A superamostragem deve ser um múltiplo de 8." msgid "PDMIn not available" msgstr "O PDMIn não está disponível" -#: 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/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." @@ -1961,6 +1669,10 @@ msgstr "" "A frequência do PWM não pode ser gravada quando variable_frequency for False " "na construção." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" +msgstr "" + #: ports/raspberrypi/common-hal/countio/Counter.c msgid "PWM slice already in use" msgstr "A fatia do PWM já está em uso" @@ -1977,29 +1689,14 @@ msgstr "O periférico está em uso" msgid "Permission denied" msgstr "Permissão negada" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "O pinto não pode acordar do deep sleep" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "A contagem dos pinos deve ser com pelo menos 1" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "A contagem dos pinos é muito grande" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "O pino não tem recursos de ADC" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2074,18 +1771,10 @@ msgstr "O programa faz IN sem carregar o ISR" msgid "Program does OUT without loading OSR" msgstr "O programa faz OUT sem carregar o OSR" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "O programa deve conter pelo menos uma instrução com 16 bits." - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "O tamanho do programa é inválido" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "O programa é muito grande" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "O Pull não foi usado quando a direção for gerada." @@ -2107,30 +1796,20 @@ msgstr "Erro DeInit RNG" msgid "RNG Init Error" msgstr "Houve um erro na inicialização do RNG" -#: ports/nrf/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" -msgstr "Ainda não há suporte para o RS485 neste dispositivo" +#: 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 "RS485" +msgstr "" #: ports/espressif/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/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "A calibração RTC não é suportada nesta placa" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "O RTC não é suportado nesta placa" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/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 Ainda não é compatível neste dispositivo" - #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" msgstr "Houve um erro na geração do número aleatório" @@ -2180,6 +1859,10 @@ msgstr "Rodando em modo seguro! O código salvo não está em execução.\n" msgid "SD card CSD format not supported" msgstr "O formato CSD do Cartão SD não é compatível" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2190,30 +1873,21 @@ msgstr "Erro SDIO GetCardInfo %d" msgid "SDIO Init Error %d" msgstr "Erro SDIO Init %d" -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "Houve um erro na inicialização SPI" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "Houve um erro na reinicialização SPI" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "A configuração SPI falhou" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "O periférico SPI está em uso" -#: shared-bindings/audiomixer/Mixer.c -msgid "Sample rate must be positive" -msgstr "A taxa de amostragem deve ser positiva" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" -msgstr "Taxa de amostragem muito alta. Deve ser menor que %d" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" +msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c msgid "Scale dimensions must divide by 3" @@ -2233,15 +1907,6 @@ 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/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "A definição da contagem dos pinos deve estar entre 1 e 5" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "" -"A definição da contagem dos pinos do conjunto lateral deve estar entre 1 e 5" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "O tamanho não é suportado" @@ -2277,10 +1942,6 @@ msgstr "Especifique exatamente um do data0 ou do data_pins" msgid "Splitting with sub-captures" msgstr "Divisão com sub-capturas" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "O tamanho da pilha deve ser pelo menos 256" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "O estéreo à esquerda deve estar no canal PWM A" @@ -2377,10 +2038,6 @@ msgstr "A altura do bloco deve dividir exatamente com a altura do bitmap" msgid "Tile index out of bounds" msgstr "O índice do bloco está fora dos limites" -#: shared-bindings/displayio/TileGrid.c -msgid "Tile value out of bounds" -msgstr "O valor do bloco está fora dos limites" - #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" msgstr "A largura do bloco deve dividir exatamente com a largura do bitmap" @@ -2402,6 +2059,9 @@ 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 "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Muitos canais na amostra." @@ -2434,24 +2094,21 @@ msgid "Tuple or struct_time argument required" msgstr "O argumento de tupla ou struct_time é necessário" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "Houve um erro na alocação do Buffer UART" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" +msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "Houve um erro da não inicialização do UART" +msgid "UART re-init" +msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "Houve um erro na inicialização do UART" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "Houve um erro na reinicialização do UART" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" -msgstr "Houve um erro na gravação UART" +msgid "UART write" +msgstr "" #: shared-module/usb_hid/Device.c msgid "USB busy" @@ -2590,12 +2247,6 @@ 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/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "Taxa de transmissão não suportada" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "Espaço de cor não compatível" @@ -2679,10 +2330,6 @@ msgstr "" "\n" "Para listar os módulos existente digite `help(\"modules\")`.\n" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" -msgstr "A senha do Wi-Fi deve ter entre 8 e 63 caracteres" - #: main.c msgid "Woken up by alarm.\n" msgstr "Foi despertado através do alarme.\n" @@ -2837,10 +2484,6 @@ msgstr "os tamanhos do bitmap devem coincidir" msgid "bits must be 32 or less" msgstr "bits deve ser 32 ou menos" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "os bits devem estar na faixa entre 5 a 9" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample deve ser 8 ou 16" @@ -2878,11 +2521,6 @@ msgstr "o buffer é pequeno demais para os bytes requisitados" 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/espressif/common-hal/busio/UART.c -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 "o comprimento dos bytes não é um múltiplo do tamanho do item" @@ -2891,7 +2529,7 @@ msgstr "o comprimento dos bytes não é um múltiplo do tamanho do item" 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/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "Calibração está fora do intervalo" @@ -2899,13 +2537,10 @@ msgstr "Calibração está fora do intervalo" msgid "calibration is read only" msgstr "Calibração é somente leitura" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "Valor de calibração fora do intervalo +/- 127" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" -msgstr "pode ser registrado apenas numa principal" +msgid "can only have one parent" +msgstr "" #: py/emitinlinethumb.c msgid "can only have up to 4 parameters to Thumb assembly" @@ -3079,6 +2714,10 @@ msgstr "Não é possível obter de forma inequívoca a escala do sizeof" msgid "casting" msgstr "fundição" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "o buffer dos caracteres é muito pequeno" @@ -3091,10 +2730,6 @@ msgstr "o arg chr() está fora do intervalo(0x110000)" msgid "chr() arg not in range(256)" msgstr "o arg chr() está fora do intervalo(256)" -#: shared-module/vectorio/Circle.c -msgid "circle can only be registered in one parent" -msgstr "o círculo só pode ser registrado em um pai" - #: shared-bindings/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "O ponto do clipe deve ser uma tupla (x, y)" @@ -3524,6 +3159,10 @@ 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" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "os valores iniciais devem ser iteráveis" @@ -3778,10 +3417,6 @@ msgstr "erro de domínio matemático" msgid "matrix is not positive definite" msgstr "a matriz não é definitiva positiva" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "max_connections deve estar entre 0 e 10" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3789,10 +3424,6 @@ msgstr "max_connections deve estar entre 0 e 10" 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 "max_length deve ser >= 0" - #: extmod/ulab/code/ndarray.c msgid "maximum number of dimensions is 4" msgstr "O número máximo de dimensões são 4" @@ -4170,10 +3801,6 @@ msgstr "o pixel_shader deve ser displayio.Palette ou displayio.ColorConverter" msgid "poll on file not available on win32" msgstr "a sondagem no arquivo não está disponível no win32" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "o polígono só pode ser registrado em um pai" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop a partir de um PulseIn vazio" @@ -4220,14 +3847,6 @@ msgstr "pressionando o botão esquerdo durante a inicialização\n" msgid "pull masks conflict with direction masks" msgstr "puxe as máscaras em conflito com as máscaras de direção" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "O pull_threshold deve ser entre 1 e 32" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "O pull_threshold deve ser entre 1 e 32" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "estouro de fila" @@ -4400,10 +4019,6 @@ msgstr "start_x deve ser um int" msgid "step must be non-zero" msgstr "o passo deve ser diferente de zero" -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "o stop deve ser 1 ou 2" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "stop não está acessível a partir do início" @@ -4452,10 +4067,6 @@ msgstr "houve um erro de sintaxe no descritor uctypes" msgid "threshold must be in the range 0-65536" msgstr "Limite deve estar no alcance de 0-65536" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "o bloco deve ser maior que zero" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() leva uma sequência com 9" @@ -4475,10 +4086,6 @@ msgstr "o tempo limite deve ser entre 0.0 a 100.0 segundos" msgid "timeout must be < 655.35 secs" msgstr "o tempo limite deve ser < 655.35 seg" -#: shared-bindings/_bleio/CharacteristicBuffer.c -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 "o tempo limite na espera pelo cartão v1" @@ -4487,6 +4094,10 @@ msgstr "o tempo limite na espera pelo cartão v1" msgid "timeout waiting for v2 card" msgstr "o tempo limite na espera pelo cartão v2" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +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" @@ -4678,13 +4289,7 @@ msgstr "o watchdog não foi inicializado" msgid "watchdog timeout must be greater than 0" msgstr "o tempo limite do watchdog deve ser maior que 0" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "a largura deve ser entre 2 a 8 (inclusive), não %d" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "a largura deve ser maior que zero" @@ -4756,6 +4361,356 @@ 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 must be a tuple of length 2" +#~ msgstr "%q deve ser uma tupla de comprimento 2" + +#~ msgid "%q must be between %d and %d" +#~ msgstr "%q deve estar entre %d e %d" + +#~ msgid "%q should be an int" +#~ msgstr "%q deve ser um int" + +#~ msgid "(x,y) integers required" +#~ msgstr "(x,y) é obrigatório o uso de números inteiros" + +#~ msgid "Address type out of range" +#~ msgstr "O tipo do endereço está fora do alcance" + +#~ msgid "AnalogIn not supported on given pin" +#~ msgstr "O AnalogIn não é compatível no pino informado" + +#~ msgid "AnalogOut functionality not supported" +#~ msgstr "Funcionalidade AnalogOut não suportada" + +#~ msgid "AnalogOut is only 16 bits. Value must be less than 65536." +#~ msgstr "O AnalogOut é de apenas 16 bits. O valor deve ser menor que 65536." + +#~ msgid "AnalogOut not supported on given pin" +#~ msgstr "Saída analógica não suportada no pino fornecido" + +#, c-format +#~ msgid "Bit depth must be from 1 to 6 inclusive, not %d" +#~ msgstr "A profundidade dos bits deve ser de 1 até 6 inclusive, porém não %d" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "Buffer de tamanho incorreto. Deve ser %d bytes." + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "O comprimento do buffer deve ter pelo menos 1" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "Os bytes devem estar entre 0 e 255." + +#~ msgid "Cannot output both channels on the same pin" +#~ msgstr "Não é possível emitir os dois canais no mesmo pino" + +#~ msgid "Cannot read without MISO pin." +#~ msgstr "Não é possível ler sem o pino MISO." + +#~ 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." + +#~ msgid "Cannot transfer without MOSI and MISO pins." +#~ msgstr "Não é possível transferir sem os pinos MOSI e MISO." + +#~ msgid "Cannot write without MOSI pin." +#~ msgstr "Não é possível fazer a escrita sem um pino MOSI." + +#~ msgid "Clock pin init failed." +#~ msgstr "Inicialização do pino de Clock falhou." + +#~ msgid "Command must be an int between 0 and 255" +#~ msgstr "O comando deve ser um int entre 0 e 255" + +#~ msgid "Could not initialize Camera" +#~ msgstr "Não foi possível inicializar a Câmera" + +#~ msgid "Could not initialize GNSS" +#~ msgstr "Não foi possível inicializar o GNSS" + +#~ msgid "Could not initialize SDCard" +#~ msgstr "Não foi possível inicializar o SDCard" + +#~ msgid "Could not initialize UART" +#~ msgstr "Não foi possível inicializar o UART" + +#~ msgid "Could not re-init channel" +#~ msgstr "Não foi possível reiniciar o canal" + +#~ msgid "Could not re-init timer" +#~ msgstr "Não foi possível reiniciar o temporizador" + +#~ msgid "Could not restart PWM" +#~ msgstr "Não foi possível reiniciar o PWM" + +#~ msgid "Couldn't allocate first buffer" +#~ msgstr "Não pôde alocar primeiro buffer" + +#~ msgid "Couldn't allocate input buffer" +#~ msgstr "Não foi possível alocar o buffer de entrada" + +#~ msgid "Couldn't allocate second buffer" +#~ msgstr "Não pôde alocar segundo buffer" + +#~ msgid "DigitalInOut not supported on given pin" +#~ msgstr "O DigitalInOut não é compatível em um determinado pino" + +#, c-format +#~ msgid "Expected tuple of length %d, got %d" +#~ msgstr "Tupla esperada com comprimento %d, obteve %d" + +#~ msgid "Failed to allocate RX buffer" +#~ msgstr "Falha ao alocar buffer RX" + +#, c-format +#~ msgid "Failed to allocate RX buffer of %d bytes" +#~ msgstr "Falha ao alocar buffer RX de %d bytes" + +#, c-format +#~ msgid "Framebuffer requires %d bytes" +#~ msgstr "O Framebuffer requer %d bytes" + +#~ msgid "Hostname must be between 1 and 253 characters" +#~ msgstr "O nome do host deve ter entre 1 e 253 caracteres" + +#~ msgid "I2C Init Error" +#~ msgstr "Erro de inicialização do I2C" + +#~ msgid "Invalid %q pin selection" +#~ msgstr "Seleção inválida dos pinos %q" + +#~ msgid "Invalid AuthMode" +#~ msgstr "AuthMode inválido" + +#~ msgid "Invalid BMP file" +#~ msgstr "Arquivo BMP inválido" + +#~ msgid "Invalid DAC pin supplied" +#~ msgstr "O pino DAC informado é inválido" + +#~ msgid "Invalid MIDI file" +#~ msgstr "O arquivo MIDI é inválido" + +#~ msgid "Invalid PWM frequency" +#~ msgstr "Frequência PWM inválida" + +#~ msgid "Invalid Pin" +#~ msgstr "Pino inválido" + +#~ msgid "Invalid buffer size" +#~ msgstr "O tamanho do buffer é inválido" + +#~ msgid "Invalid byteorder string" +#~ msgstr "A cadeia de bytes é inválida" + +#~ msgid "Invalid capture period. Valid range: 1 - 500" +#~ msgstr "O período de captura é inválido. O intervalo válido é: 1 - 500" + +#~ msgid "Invalid channel count" +#~ msgstr "A contagem do canal é inválido" + +#, c-format +#~ msgid "Invalid data_count %d" +#~ msgstr "data_count %d inválido" + +#~ msgid "Invalid direction." +#~ msgstr "Direção inválida." + +#~ msgid "Invalid file" +#~ msgstr "Arquivo inválido" + +#~ msgid "Invalid mode" +#~ msgstr "Modo inválido" + +#~ msgid "Invalid number of bits" +#~ msgstr "Número inválido de bits" + +#~ msgid "Invalid phase" +#~ msgstr "Fase Inválida" + +#~ msgid "Invalid pin" +#~ msgstr "Pino inválido" + +#~ msgid "Invalid pin for left channel" +#~ msgstr "Pino inválido para canal esquerdo" + +#~ msgid "Invalid pin for right channel" +#~ msgstr "Pino inválido para canal direito" + +#~ msgid "Invalid polarity" +#~ msgstr "Polaridade inválida" + +#~ msgid "Invalid properties" +#~ msgstr "Propriedades inválidas" + +#~ msgid "Invalid run mode." +#~ msgstr "O modo de execução é inválido." + +#~ msgid "Invalid security_mode" +#~ msgstr "O Security_mode é inválido" + +#~ msgid "Invalid voice" +#~ msgstr "A voz é inválida" + +#~ msgid "Invalid voice count" +#~ msgstr "A contagem da voz é inválida" + +#~ msgid "Invalid wave file" +#~ msgstr "Aqruivo de ondas inválido" + +#~ msgid "Invalid word/bit length" +#~ msgstr "O comprimento do bit/palavra são inválidos" + +#~ msgid "Layer already in a group." +#~ msgstr "A camada já existe em um grupo." + +#~ msgid "Layer must be a Group or TileGrid subclass." +#~ msgstr "A camada deve ser uma subclasse Group ou TileGrid." + +#~ msgid "MISO pin init failed." +#~ msgstr "A inicialização do pino MISO falhou." + +#~ msgid "MOSI pin init failed." +#~ msgstr "Inicialização do pino MOSI falhou." + +#~ msgid "Messages limited to 8 bytes" +#~ msgstr "As mensagens estão limitadas a 8 bytes" + +#, c-format +#~ msgid "More than %d report ids not supported" +#~ msgstr "Mais de %d reportam ids não compatíveis" + +#~ msgid "No hardware support on clk pin" +#~ msgstr "Sem suporte de hardware no pino de clock" + +#~ msgid "No hardware support on pin" +#~ msgstr "Nenhum suporte de hardware no pino" + +#, c-format +#~ msgid "Output buffer must be at least %d bytes" +#~ msgstr "O buffer de saída deve ter ao menos %d bytes" + +#~ 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)" + +#~ msgid "Pin count must be at least 1" +#~ msgstr "A contagem dos pinos deve ser com pelo menos 1" + +#~ msgid "Pin does not have ADC capabilities" +#~ msgstr "O pino não tem recursos de ADC" + +#~ msgid "Program must contain at least one 16-bit instruction." +#~ msgstr "O programa deve conter pelo menos uma instrução com 16 bits." + +#~ msgid "Program too large" +#~ msgstr "O programa é muito grande" + +#~ msgid "RS485 Not yet supported on this device" +#~ msgstr "Ainda não há suporte para o RS485 neste dispositivo" + +#~ msgid "RTC calibration is not supported on this board" +#~ msgstr "A calibração RTC não é suportada nesta placa" + +#~ msgid "RTS/CTS/RS485 Not yet supported on this device" +#~ msgstr "RTS/CTS/RS485 Ainda não é compatível neste dispositivo" + +#~ msgid "SPI Init Error" +#~ msgstr "Houve um erro na inicialização SPI" + +#~ msgid "SPI Re-initialization error" +#~ msgstr "Houve um erro na reinicialização SPI" + +#~ msgid "Sample rate must be positive" +#~ msgstr "A taxa de amostragem deve ser positiva" + +#, c-format +#~ msgid "Sample rate too high. It must be less than %d" +#~ msgstr "Taxa de amostragem muito alta. Deve ser menor que %d" + +#~ msgid "Set pin count must be between 1 and 5" +#~ msgstr "A definição da contagem dos pinos deve estar entre 1 e 5" + +#~ msgid "Side set pin count must be between 1 and 5" +#~ msgstr "" +#~ "A definição da contagem dos pinos do conjunto lateral deve estar entre 1 " +#~ "e 5" + +#~ msgid "Stack size must be at least 256" +#~ msgstr "O tamanho da pilha deve ser pelo menos 256" + +#~ msgid "Tile value out of bounds" +#~ msgstr "O valor do bloco está fora dos limites" + +#~ msgid "UART Buffer allocation error" +#~ msgstr "Houve um erro na alocação do Buffer UART" + +#~ msgid "UART De-init error" +#~ msgstr "Houve um erro da não inicialização do UART" + +#~ msgid "UART Init Error" +#~ msgstr "Houve um erro na inicialização do UART" + +#~ msgid "UART Re-init error" +#~ msgstr "Houve um erro na reinicialização do UART" + +#~ msgid "UART write error" +#~ msgstr "Houve um erro na gravação UART" + +#~ msgid "Unsupported baudrate" +#~ msgstr "Taxa de transmissão não suportada" + +#~ msgid "WiFi password must be between 8 and 63 characters" +#~ msgstr "A senha do Wi-Fi deve ter entre 8 e 63 caracteres" + +#~ msgid "bits must be in range 5 to 9" +#~ msgstr "os bits devem estar na faixa entre 5 a 9" + +#~ msgid "bytes > 8 bits not supported" +#~ msgstr "bytes > 8 bits não suportado" + +#~ msgid "calibration value out of range +/-127" +#~ msgstr "Valor de calibração fora do intervalo +/- 127" + +#~ msgid "can only be registered in one parent" +#~ msgstr "pode ser registrado apenas numa principal" + +#~ msgid "circle can only be registered in one parent" +#~ msgstr "o círculo só pode ser registrado em um pai" + +#~ msgid "max_connections must be between 0 and 10" +#~ msgstr "max_connections deve estar entre 0 e 10" + +#~ msgid "max_length must be >= 0" +#~ msgstr "max_length deve ser >= 0" + +#~ msgid "polygon can only be registered in one parent" +#~ msgstr "o polígono só pode ser registrado em um pai" + +#~ msgid "pull_threshold must be between 1 and 32" +#~ msgstr "O pull_threshold deve ser entre 1 e 32" + +#~ msgid "push_threshold must be between 1 and 32" +#~ msgstr "O pull_threshold deve ser entre 1 e 32" + +#~ msgid "stop must be 1 or 2" +#~ msgstr "o stop deve ser 1 ou 2" + +#~ msgid "tile must be greater than zero" +#~ msgstr "o bloco deve ser maior que zero" + +#~ msgid "timeout must be >= 0.0" +#~ msgstr "o tempo limite deve ser >= 0,0" + +#, c-format +#~ msgid "width must be from 2 to 8 (inclusive), not %d" +#~ msgstr "a largura deve ser entre 2 a 8 (inclusive), não %d" + #~ msgid "Unsupported operation" #~ msgstr "Operação não suportada" diff --git a/locale/ru.po b/locale/ru.po index 9b8778f71b..7e6422b554 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -74,10 +74,24 @@ msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "%d адресные пины, %d rgb пины и %d плитки указывают высоту %d а не %d" +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "%q и %q содержат пины-дупликаты" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "%q содержит пины-дупликаты" @@ -90,12 +104,7 @@ msgstr "%q сбой: %d" msgid "%q in use" msgstr "%q используется" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "Индекс %q вне диапазона" @@ -103,14 +112,34 @@ msgstr "Индекс %q вне диапазона" msgid "%q indices must be integers, not %s" msgstr "Индексы %q должны быть целыми числами, а не %s" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "Длинна %q должна быть %d-%d" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "Длинна %q должна быть >= 1" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "%q должен быть %d-%d" @@ -127,14 +156,10 @@ msgstr "%q должен быть <= %d" msgid "%q must be >= %d" msgstr "%q должен быть >= %d" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "%q должен быть >= 0" -#: 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 "%q должен быть >= 1" @@ -143,14 +168,9 @@ msgstr "%q должен быть >= 1" msgid "%q must be a string" msgstr "%q должен быть строкой" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "%q должен быть кортежем длинной 2" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" -msgstr "%q должен быть между %d и %d" +#: py/argcheck.c +msgid "%q must be an int" +msgstr "" #: py/argcheck.c msgid "%q must be of type %q" @@ -168,7 +188,11 @@ msgstr "%q должен быть во 2-й степени" msgid "%q out of bounds" msgstr "%q за пределом" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q вне диапазона" @@ -177,10 +201,6 @@ msgstr "%q вне диапазона" msgid "%q pin invalid" msgstr "Пин %q не допустим" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%q должен быть int" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "%q с идентификатором отчёта 0 должен иметь длину 1" @@ -343,10 +363,6 @@ msgstr "'yield from' внутри асинхронной функции" msgid "'yield' outside function" msgstr "'yield' вне функции" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "Требуются целые числа (x,y)" - #: py/compile.c msgid "*x must be assignment target" msgstr "*x должно быть целью назначения" @@ -382,10 +398,6 @@ msgstr "ADC2 используется WiFi" msgid "Address must be %d bytes long" msgstr "Адрес должен быть длиной %d байт" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "Тип адреса вне диапазона" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "Все периферийные устройства CAN уже используются" @@ -476,25 +488,6 @@ msgstr "Уже запущен" msgid "Already scanning for wifi networks" msgstr "Поиск сетей wifi уже происходит" -#: ports/cxd56/common-hal/analogio/AnalogIn.c -msgid "AnalogIn not supported on given pin" -msgstr "AnalogIn не поддерживается на данном пине" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "Функциональность AnalogOut не поддерживается" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "AnalogOut имеет только 16 бит. Значение должно быть меньше 65536." - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "AnalogOut не поддерживается на данном пине" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "Другой PWMAudioOut уже активен" @@ -570,11 +563,6 @@ msgstr "" "Битовый тактовый генератор и выбор слова должны использовать один источник " "тактирования" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "Битовая глубина должна быть от 1 до 6 включительно, а не %d" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "Битовая глубина должна быть кратна 8." @@ -616,11 +604,6 @@ msgstr "Буфер + сдвиг слишком малы %d %d %d" msgid "Buffer elements must be 4 bytes long or less" msgstr "Элементы буфера должны иметь длину не более 4 байт" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "Неправильный размер буфера. Должен быть %d байт." - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "Буфер не является байтовым массивом (bytearray)." @@ -630,7 +613,6 @@ msgstr "Буфер не является байтовым массивом (byte msgid "Buffer is too small" msgstr "Буфер слишком мал" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -645,10 +627,6 @@ msgstr "Размер буфера должен быть кратен 512" msgid "Buffer must be a multiple of 512 bytes" msgstr "Буфер должен быть кратен 512" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "Буфер должен быть размером не менее 1" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -670,10 +648,6 @@ msgstr "Пин шины %d уже используется" msgid "Byte buffer must be 16 bytes." msgstr "Буфер байтов должен быть размером 16 байтам." -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "Bytes должен быть в диапазоне от 0 до 255." - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "Блоки CBC должны быть кратны 16 байтам" @@ -690,6 +664,10 @@ msgstr "CRC или контрольная сумма неправильная" msgid "Call super().__init__() before accessing native object." msgstr "Вызовите super().__init__() перед обращением к родному объекту." +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "Сигнал из глубокого сна может подаваться только на пине RTC IO." @@ -743,19 +721,11 @@ msgstr "" "Невозможно иметь ответы сканирования для расширенных, подключаемых " "объявлений (advertisements)." -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Cannot output both channels on the same pin" -msgstr "Невозможно вывести оба канала на один пин" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" "Невозможно установить подтяжку на пине, предназначенном только для ввода." -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "Считывание невозможно без пина MISO." - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "Невозможно записать в файл" @@ -767,8 +737,8 @@ 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 "Невозможно перезагрузится в загрузчик так как он отсутствует." +msgid "Cannot reset into bootloader because no bootloader is present" +msgstr "" #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -788,22 +758,21 @@ msgid "Cannot subclass slice" msgstr "Срез субкласса невозможен" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." -msgstr "Передача данных невозможна без пинов MOSI и MISO." +msgid "Cannot transfer without MOSI and MISO pins" +msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "Невозможно изменить частоту на таймере, который уже используется" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge, only level" +msgstr "" + +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge. Only level." msgstr "Невозможно проснуться по спаду/росту на пине. Только по уровню." -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." -msgstr "Запись невозможна без пина MOSI." - #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" msgstr "Запись в CharacteristicBuffer не предусмотрена" @@ -816,10 +785,6 @@ msgstr "Код ядра CircuitPython сильно крашнулся. Упс!\n msgid "CircuitPython was unable to allocate the heap." msgstr "CircuitPython не смог выделить heap." -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "Не удалось инициализировать пин Clock." - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "Длинна такта слишком велика" @@ -828,11 +793,6 @@ msgstr "Длинна такта слишком велика" msgid "Clock unit in use" msgstr "Источник тактирования уже используется" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -msgid "Command must be an int between 0 and 255" -msgstr "Команда должна быть целым числом (int) от 0 до 255" - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -845,35 +805,6 @@ msgstr "" msgid "Corrupt .mpy file" msgstr "Файл .mpy поврежден" -#: 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" - -#: ports/cxd56/common-hal/sdioio/SDCard.c -msgid "Could not initialize SDCard" -msgstr "Не удалось инициализировать SD карту" - -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "Не удалось инициализировать UART" - -#: 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 "Не удалось перезапустить ШИМ" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "Не удалось извлечь тактирование" @@ -894,20 +825,6 @@ msgstr "Не удалось запустить прерывание, RX заня 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 "Крашнулся в HardFault_Handler." @@ -957,10 +874,6 @@ msgstr "Емкость destination меньше, чем destination_length." msgid "Device in use" msgstr "Устройство используется" -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -msgstr "DigitalInOut не поддерживается на данном пине" - #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." @@ -1016,11 +929,6 @@ msgstr "Ожидалось(ся) %q" msgid "Expected an alarm" msgstr "Ожидался сигнал" -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "Ожидался кортеж длины %d, получен %d" - #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." @@ -1047,22 +955,6 @@ msgstr "Не удалось отправить команду." msgid "Failed to acquire mutex, err 0x%04x" msgstr "Не удалось получить mutex, ошибка 0x%04x" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -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/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -#, c-format -msgid "Failed to allocate RX buffer of %d bytes" -msgstr "Не удалось выделить буфер RX размером %d байт" - #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "Не удалось выделить память Wifi" @@ -1133,11 +1025,6 @@ msgstr "" msgid "Format not supported" msgstr "Формат не поддерживается" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" -msgstr "Фреймбуфер требует %d байт" - #: ports/mimxrt10xx/common-hal/microcontroller/Processor.c msgid "" "Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" @@ -1154,6 +1041,10 @@ msgstr "" msgid "Function requires lock" msgstr "Функция требует блокировки" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "Общий сбой" @@ -1181,17 +1072,13 @@ msgstr "Оборудование занято, попробуйте исполь msgid "Hardware in use, try alternative pins" msgstr "Оборудование используется, попробуйте использовать другие пины" -#: shared-bindings/wifi/Radio.c -msgid "Hostname must be between 1 and 253 characters" -msgstr "Имя хоста должно содержать от 1 до 253 символов" - #: 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 "Ошибка инициализации I2C" +msgid "I2C init error" +msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c msgid "I2C peripheral in use" @@ -1305,75 +1192,33 @@ msgstr "Внутренняя ошибка" msgid "Internal error #%d" msgstr "Внутренняя ошибка #%d" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: py/argcheck.c msgid "Invalid %q" msgstr "Недопустимый %q" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c 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/canio/CAN.c -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Invalid %q pin selection" -msgstr "Неверный выбор пина %q" - #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "Недопустимое значение единицы АЦП" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "Недопустимый AuthMode" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "Недопустимый параметр BLE" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "Неправилный файл BMP" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "Неверный BSSID" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "Передан неверный пин ЦАП" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "Неверный MAC-адрес" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "Неверный MIDI-файл" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "Недопустимая частота ШИМ" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "Неверный пин" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "Недопустимый аргумент" @@ -1381,42 +1226,11 @@ msgstr "Недопустимый аргумент" msgid "Invalid bits per value" msgstr "Недопустимое бит-на-значение" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "Неверный размер буфера" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "Недействительная строка byteorder" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "Неверный период захвата. Допустимый диапазон: 1 - 500" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "Недействительное количество каналов" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "Недействительный data_count %d" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "Неверный data_pins[%d]" -#: 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 "Неверный размер блока формата" @@ -1425,78 +1239,14 @@ msgstr "Неверный размер блока формата" msgid "Invalid memory access." msgstr "Неправильный доступ к памяти." -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "Неверный MAC-адрес multicast" -#: 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 -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.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/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" 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 "Неверный security_mode" - #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "Неверный размер" @@ -1509,23 +1259,6 @@ msgstr "Неверный сокет для TLS" msgid "Invalid state" msgstr "Неверное состояние" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "Неверный voice" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "Неверный счетчик voice" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "Неверный wave-файл" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "Недопустимая длина слова/бита" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "Ключ должен быть длинной 16, 24 или 32 байта" @@ -1539,25 +1272,17 @@ msgid "LHS of keyword arg must be an id" msgstr "LHS ключевого слова arg должен быть идентификатором(id)" #: shared-module/displayio/Group.c -msgid "Layer already in a group." -msgstr "Слой уже в группе." +msgid "Layer already in a group" +msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." -msgstr "Слой должен быть группой (Group) или субклассом TileGrid." +msgid "Layer must be a Group or TileGrid subclass" +msgstr "" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "MAC адрес был недействительным" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "Не удалось инициализировать пин MISO." - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "Не удалось инициализировать пин MOSI." - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "" @@ -1567,10 +1292,6 @@ msgstr "" msgid "Maximum x value when mirrored is %d" msgstr "Максимальное значение x при зеркальном отображении - %d" -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "Сообщения ограничены 8 байтами" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Задержка включения микрофона должна быть в диапазоне от 0.0 до 1.0" @@ -1584,10 +1305,14 @@ msgstr "" msgid "Mismatched swap flag" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "Отсутствует пин MISO или MOSI" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1624,11 +1349,6 @@ msgstr "Отсутствует first_set_pin. Инструкция %d устан msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "Отсутствует jmp_pin. Инструкция %d перепрыгивает на пин" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "Не поддерживается более %d идентификаторов отчетов (report ids)" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "Должен быть субклассом %q." @@ -1689,15 +1409,23 @@ msgid "No I2C device at address: 0x%x" msgstr "" #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "Нет пина MISO" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Нет пина MOSI" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1736,16 +1464,6 @@ msgstr "Свободные GCLK отсутствуют" msgid "No hardware random available" msgstr "Отсутствует аппаратный генератор случайных чисел" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "Отсутствует аппаратная поддержка пина clk" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "Отсутствует аппаратная поддержка на пине" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "Нет in в программе" @@ -1895,10 +1613,13 @@ msgid "Only one address is allowed" msgstr "" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "" @@ -1930,11 +1651,6 @@ msgstr "" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "" @@ -1945,12 +1661,11 @@ msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +"PWM frequency not writable when variable_frequency is False on construction." msgstr "" -#: shared-bindings/pwmio/PWMOut.c -msgid "" -"PWM frequency not writable when variable_frequency is False on construction." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" msgstr "" #: ports/raspberrypi/common-hal/countio/Counter.c @@ -1969,29 +1684,14 @@ msgstr "" msgid "Permission denied" msgstr "" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "Пин не может вывести из глубокого сна" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "Количество пинов должно быть не менее 1" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "Слишком большое количество пинов" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "Пин не имеет возможности АЦП" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2063,18 +1763,10 @@ msgstr "" msgid "Program does OUT without loading OSR" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "" - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -2096,8 +1788,9 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" +#: 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 "RS485" msgstr "" #: ports/espressif/common-hal/busio/UART.c @@ -2105,21 +1798,10 @@ msgstr "" msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "" - #: shared-bindings/alarm/time/TimeAlarm.c 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/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 "" @@ -2169,6 +1851,10 @@ msgstr "" msgid "SD card CSD format not supported" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2179,29 +1865,20 @@ msgstr "" 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 "" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" 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" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c @@ -2222,14 +1899,6 @@ msgstr "" msgid "Server side context cannot have hostname" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "Число Set пинов должно быть от 1 до 5" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "" @@ -2265,10 +1934,6 @@ msgstr "Укажите точно один из data0 или data_pins" msgid "Splitting with sub-captures" msgstr "" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "" @@ -2356,10 +2021,6 @@ msgstr "" 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 "" @@ -2379,6 +2040,9 @@ msgid "To exit, please reset the board without " msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample" +msgstr "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -2411,23 +2075,20 @@ msgid "Tuple or struct_time argument required" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" +msgid "UART re-init" 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" +msgid "UART write" msgstr "" #: shared-module/usb_hid/Device.c @@ -2564,12 +2225,6 @@ msgid "" "declined or ignored." msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "" @@ -2644,10 +2299,6 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" -msgstr "" - #: main.c msgid "Woken up by alarm.\n" msgstr "" @@ -2800,10 +2451,6 @@ msgstr "" msgid "bits must be 32 or less" msgstr "" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -2841,11 +2488,6 @@ msgstr "" msgid "byteorder is not a string" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/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 "" @@ -2854,7 +2496,7 @@ msgstr "" msgid "bytes value out of range" msgstr "" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "" @@ -2862,12 +2504,9 @@ msgstr "" msgid "calibration is read only" msgstr "" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" +msgid "can only have one parent" msgstr "" #: py/emitinlinethumb.c @@ -3038,6 +2677,10 @@ msgstr "" msgid "casting" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "" @@ -3050,10 +2693,6 @@ msgstr "" 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/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "" @@ -3478,6 +3117,10 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "" @@ -3728,10 +3371,6 @@ msgstr "" msgid "matrix is not positive definite" msgstr "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3739,10 +3378,6 @@ 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 "" - #: extmod/ulab/code/ndarray.c msgid "maximum number of dimensions is 4" msgstr "" @@ -4113,10 +3748,6 @@ msgstr "" msgid "poll on file not available on win32" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" @@ -4163,14 +3794,6 @@ msgstr "" msgid "pull masks conflict with direction masks" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "" @@ -4341,10 +3964,6 @@ msgstr "" 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 "" @@ -4393,10 +4012,6 @@ msgstr "" msgid "threshold must be in the range 0-65536" msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "" @@ -4416,10 +4031,6 @@ msgstr "" msgid "timeout must be < 655.35 secs" 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 "" @@ -4428,6 +4039,10 @@ msgstr "" msgid "timeout waiting for v2 card" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "" @@ -4619,13 +4234,7 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" @@ -4697,6 +4306,238 @@ msgstr "zi должно быть типа float" msgid "zi must be of shape (n_section, 2)" msgstr "zi должен иметь форму (n_section, 2)" +#~ msgid "%q must be a tuple of length 2" +#~ msgstr "%q должен быть кортежем длинной 2" + +#~ msgid "%q must be between %d and %d" +#~ msgstr "%q должен быть между %d и %d" + +#~ msgid "%q should be an int" +#~ msgstr "%q должен быть int" + +#~ msgid "(x,y) integers required" +#~ msgstr "Требуются целые числа (x,y)" + +#~ msgid "Address type out of range" +#~ msgstr "Тип адреса вне диапазона" + +#~ msgid "AnalogIn not supported on given pin" +#~ msgstr "AnalogIn не поддерживается на данном пине" + +#~ msgid "AnalogOut functionality not supported" +#~ msgstr "Функциональность AnalogOut не поддерживается" + +#~ msgid "AnalogOut is only 16 bits. Value must be less than 65536." +#~ msgstr "AnalogOut имеет только 16 бит. Значение должно быть меньше 65536." + +#~ msgid "AnalogOut not supported on given pin" +#~ msgstr "AnalogOut не поддерживается на данном пине" + +#, c-format +#~ msgid "Bit depth must be from 1 to 6 inclusive, not %d" +#~ msgstr "Битовая глубина должна быть от 1 до 6 включительно, а не %d" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "Неправильный размер буфера. Должен быть %d байт." + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "Буфер должен быть размером не менее 1" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "Bytes должен быть в диапазоне от 0 до 255." + +#~ msgid "Cannot output both channels on the same pin" +#~ msgstr "Невозможно вывести оба канала на один пин" + +#~ msgid "Cannot read without MISO pin." +#~ msgstr "Считывание невозможно без пина MISO." + +#~ msgid "Cannot reset into bootloader because no bootloader is present." +#~ msgstr "Невозможно перезагрузится в загрузчик так как он отсутствует." + +#~ msgid "Cannot transfer without MOSI and MISO pins." +#~ msgstr "Передача данных невозможна без пинов MOSI и MISO." + +#~ msgid "Cannot write without MOSI pin." +#~ msgstr "Запись невозможна без пина MOSI." + +#~ msgid "Clock pin init failed." +#~ msgstr "Не удалось инициализировать пин Clock." + +#~ msgid "Command must be an int between 0 and 255" +#~ msgstr "Команда должна быть целым числом (int) от 0 до 255" + +#~ msgid "Could not initialize Camera" +#~ msgstr "Не удалось инициализировать камеру" + +#~ msgid "Could not initialize GNSS" +#~ msgstr "Не удалось инициализировать GNSS" + +#~ msgid "Could not initialize SDCard" +#~ msgstr "Не удалось инициализировать SD карту" + +#~ msgid "Could not initialize UART" +#~ msgstr "Не удалось инициализировать UART" + +#~ msgid "Could not re-init channel" +#~ msgstr "Не удалось повторно инициализировать канал" + +#~ msgid "Could not re-init timer" +#~ msgstr "Не удалось повторно инициализировать таймер" + +#~ msgid "Could not restart PWM" +#~ msgstr "Не удалось перезапустить ШИМ" + +#~ msgid "Couldn't allocate first buffer" +#~ msgstr "Не удалось выделить первый буфер" + +#~ msgid "Couldn't allocate input buffer" +#~ msgstr "Не удалось выделить входной буфер" + +#~ msgid "Couldn't allocate second buffer" +#~ msgstr "Не удалось выделить второй буфер" + +#~ msgid "DigitalInOut not supported on given pin" +#~ msgstr "DigitalInOut не поддерживается на данном пине" + +#, c-format +#~ msgid "Expected tuple of length %d, got %d" +#~ msgstr "Ожидался кортеж длины %d, получен %d" + +#~ msgid "Failed to allocate RX buffer" +#~ msgstr "Не удалось выделить буфер RX" + +#, c-format +#~ msgid "Failed to allocate RX buffer of %d bytes" +#~ msgstr "Не удалось выделить буфер RX размером %d байт" + +#, c-format +#~ msgid "Framebuffer requires %d bytes" +#~ msgstr "Фреймбуфер требует %d байт" + +#~ msgid "Hostname must be between 1 and 253 characters" +#~ msgstr "Имя хоста должно содержать от 1 до 253 символов" + +#~ msgid "I2C Init Error" +#~ msgstr "Ошибка инициализации I2C" + +#~ msgid "Invalid %q pin selection" +#~ msgstr "Неверный выбор пина %q" + +#~ msgid "Invalid AuthMode" +#~ msgstr "Недопустимый AuthMode" + +#~ msgid "Invalid BMP file" +#~ msgstr "Неправилный файл BMP" + +#~ msgid "Invalid DAC pin supplied" +#~ msgstr "Передан неверный пин ЦАП" + +#~ msgid "Invalid MIDI file" +#~ msgstr "Неверный MIDI-файл" + +#~ msgid "Invalid PWM frequency" +#~ msgstr "Недопустимая частота ШИМ" + +#~ msgid "Invalid Pin" +#~ msgstr "Неверный пин" + +#~ msgid "Invalid buffer size" +#~ msgstr "Неверный размер буфера" + +#~ msgid "Invalid byteorder string" +#~ msgstr "Недействительная строка byteorder" + +#~ msgid "Invalid capture period. Valid range: 1 - 500" +#~ msgstr "Неверный период захвата. Допустимый диапазон: 1 - 500" + +#~ msgid "Invalid channel count" +#~ msgstr "Недействительное количество каналов" + +#, c-format +#~ msgid "Invalid data_count %d" +#~ msgstr "Недействительный data_count %d" + +#~ msgid "Invalid direction." +#~ msgstr "Неверное направление." + +#~ msgid "Invalid file" +#~ msgstr "Неверный файл" + +#~ msgid "Invalid number of bits" +#~ msgstr "Неверное количество бит" + +#~ msgid "Invalid phase" +#~ msgstr "Неверная фаза" + +#~ msgid "Invalid pin" +#~ msgstr "Недопустимый пин" + +#~ msgid "Invalid pin for left channel" +#~ msgstr "Недопустимый пин для левого канала" + +#~ msgid "Invalid pin for right channel" +#~ msgstr "Недопустимый пин для правого канала" + +#~ msgid "Invalid polarity" +#~ msgstr "Неправильная полярность" + +#~ msgid "Invalid properties" +#~ msgstr "Недопустимые свойства" + +#~ msgid "Invalid run mode." +#~ msgstr "Неверный режим работы." + +#~ msgid "Invalid security_mode" +#~ msgstr "Неверный security_mode" + +#~ msgid "Invalid voice" +#~ msgstr "Неверный voice" + +#~ msgid "Invalid voice count" +#~ msgstr "Неверный счетчик voice" + +#~ msgid "Invalid wave file" +#~ msgstr "Неверный wave-файл" + +#~ msgid "Invalid word/bit length" +#~ msgstr "Недопустимая длина слова/бита" + +#~ msgid "Layer already in a group." +#~ msgstr "Слой уже в группе." + +#~ msgid "Layer must be a Group or TileGrid subclass." +#~ msgstr "Слой должен быть группой (Group) или субклассом TileGrid." + +#~ msgid "MISO pin init failed." +#~ msgstr "Не удалось инициализировать пин MISO." + +#~ msgid "MOSI pin init failed." +#~ msgstr "Не удалось инициализировать пин MOSI." + +#~ msgid "Messages limited to 8 bytes" +#~ msgstr "Сообщения ограничены 8 байтами" + +#, c-format +#~ msgid "More than %d report ids not supported" +#~ msgstr "Не поддерживается более %d идентификаторов отчетов (report ids)" + +#~ msgid "No hardware support on clk pin" +#~ msgstr "Отсутствует аппаратная поддержка пина clk" + +#~ msgid "No hardware support on pin" +#~ msgstr "Отсутствует аппаратная поддержка на пине" + +#~ msgid "Pin count must be at least 1" +#~ msgstr "Количество пинов должно быть не менее 1" + +#~ msgid "Pin does not have ADC capabilities" +#~ msgstr "Пин не имеет возможности АЦП" + +#~ msgid "Set pin count must be between 1 and 5" +#~ msgstr "Число Set пинов должно быть от 1 до 5" + #~ msgid "" #~ "\n" #~ "Code stopped by auto-reload.\n" diff --git a/locale/sv.po b/locale/sv.po index 80a5d6cb27..7703cbbda3 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -74,10 +74,24 @@ msgid "" msgstr "" "%d adresspinnar, %d rgb-pinnar och %d brickor anger en höjd på %d, inte %d" +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "%q och %q innehåller duplicerade pinnar" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "%q innehåller dubblettstift" @@ -90,12 +104,7 @@ msgstr "%q-fel: %d" msgid "%q in use" msgstr "%q används redan" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "Index %q ligger utanför intervallet" @@ -103,14 +112,34 @@ msgstr "Index %q ligger utanför intervallet" msgid "%q indices must be integers, not %s" msgstr "Indexet %q måste vara ett heltal, inte %s" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "längden på %q måste vara %d-%d" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "längden på %q måste vara >= 1" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "%q måste vara %d-%d" @@ -127,14 +156,10 @@ msgstr "%q måste vara <= %d" msgid "%q must be >= %d" msgstr "%q måste vara >= %d" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "%q måste vara >= 0" -#: 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 "%q måste vara >= 1" @@ -143,14 +168,9 @@ msgstr "%q måste vara >= 1" msgid "%q must be a string" msgstr "%q måste vara en sträng" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "%q måste vara en tuple av längd 2" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" -msgstr "%q måste vara mellan %d och %d" +#: py/argcheck.c +msgid "%q must be an int" +msgstr "" #: py/argcheck.c msgid "%q must be of type %q" @@ -168,7 +188,11 @@ msgstr "%q måste vara en potens av 2" msgid "%q out of bounds" msgstr "%q ä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/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q utanför intervallet" @@ -177,10 +201,6 @@ msgstr "%q utanför intervallet" msgid "%q pin invalid" msgstr "Pinne %q ogiltig" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%q ska vara en int" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "%q med report-ID 0 måste ha längd 1" @@ -343,10 +363,6 @@ msgstr "'yield from' i async-funktion" msgid "'yield' outside function" msgstr "'yield' utanför funktion" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "(x,y) heltal krävs" - #: py/compile.c msgid "*x must be assignment target" msgstr "*x måste vara mål för tilldelning" @@ -382,10 +398,6 @@ msgstr "ADC2 används av WiFi" msgid "Address must be %d bytes long" msgstr "Adressen måste vara %d byte lång" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "Adresstyp utanför intervallet" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "All I2C-kringutrustning används" @@ -476,25 +488,6 @@ msgstr "Kör redan" msgid "Already scanning for wifi networks" msgstr "Skannar redan efter wifi-nätverk" -#: ports/cxd56/common-hal/analogio/AnalogIn.c -msgid "AnalogIn not supported on given pin" -msgstr "AnalogIn stöds inte på angiven pinne" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "AnalogOut-funktionalitet stöds inte" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "AnalogOut hanterar bara 16 bitar. Värdet måste vara mindre än 65536." - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "AnalogOut stöds inte på angiven pinne" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "En annan PWMAudioOut är redan aktiv" @@ -566,11 +559,6 @@ msgstr "Bitklocka och word select måste vara sekventiella pinnar" msgid "Bit clock and word select must share a clock unit" msgstr "Bitklocka och ordval måste dela en klockenhet" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "Bitdjup måste vara inom 1 till 6, inte %d" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "Bitdjup måste vara multipel av 8." @@ -612,11 +600,6 @@ msgstr "Buffert + offset för liten %d %d %d" msgid "Buffer elements must be 4 bytes long or less" msgstr "Buffertelement måste vara fyra byte långa eller mindre" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "Buffert har felaktig storlek. Ska vara %d byte." - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "Buffert är inte en bytearray." @@ -626,7 +609,6 @@ msgstr "Buffert är inte en bytearray." msgid "Buffer is too small" msgstr "Bufferten är för liten" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -641,10 +623,6 @@ msgstr "Buffertlängd måste vara en multipel av 512" msgid "Buffer must be a multiple of 512 bytes" msgstr "Bufferten måste vara en multipel av 512 byte" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "Bufferten måste ha minst längd 1" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -666,10 +644,6 @@ msgstr "Busspinne %d används redan" msgid "Byte buffer must be 16 bytes." msgstr "Byte-buffert måste vara 16 byte." -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "Bytes måste vara mellan 0 och 255." - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "CBC-block måste vara multiplar om 16 byte" @@ -686,6 +660,10 @@ msgstr "CRC eller checksumma var ogiltig" msgid "Call super().__init__() before accessing native object." msgstr "Anropa super().__init__() innan du använder det ursprungliga objektet." +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "Kan bara larma på RTC-IO från djupsömn." @@ -735,18 +713,10 @@ msgid "Cannot have scan responses for extended, connectable advertisements." msgstr "" "Det går inte att ha skanningssvar för utökade, anslutningsbara aviseringar." -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Cannot output both channels on the same pin" -msgstr "Det går inte att mata ut båda kanalerna på samma pinne" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "Kan bara använda pull på pinne för input." -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "Kan inte läsa utan MISO-pinne." - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "Det går inte att spela in till en fil" @@ -758,9 +728,8 @@ msgstr "Det går inte att montera om '/' när den är synlig via 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." +msgid "Cannot reset into bootloader because no bootloader is present" msgstr "" -"Det går inte att återställa till bootloader eftersom bootloader saknas." #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -780,22 +749,21 @@ msgid "Cannot subclass slice" msgstr "Det går inte att subklassa slice" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." -msgstr "Kan inte överföra utan MOSI- och MISO-pinnar." +msgid "Cannot transfer without MOSI and MISO pins" +msgstr "" #: shared-bindings/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" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge, only level" +msgstr "" + +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge. Only level." msgstr "Kan inte vakna på nivåskift, enbart nivå." -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." -msgstr "Kan inte skriva utan MOSI-pinne." - #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" msgstr "Skrivning för CharacteristicBuffer är inte tillhandahållen" @@ -808,10 +776,6 @@ msgstr "CircuitPython kärnkod kraschade hårt. Hoppsan!\n" msgid "CircuitPython was unable to allocate the heap." msgstr "CircuitPython kunde inte allokera heap." -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "Initiering av klockpinne misslyckades." - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "Klockförlängning för lång" @@ -820,11 +784,6 @@ msgstr "Klockförlängning för lång" msgid "Clock unit in use" msgstr "Klockenhet används" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -msgid "Command must be an int between 0 and 255" -msgstr "Kommandot måste vara en int mellan 0 och 255" - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -837,35 +796,6 @@ msgstr "" msgid "Corrupt .mpy file" msgstr "Skadad .mpy-fil" -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Could not initialize Camera" -msgstr "Kunde inte initiera Camera" - -#: ports/cxd56/common-hal/gnss/GNSS.c -msgid "Could not initialize GNSS" -msgstr "Kan inte initiera GNSS" - -#: ports/cxd56/common-hal/sdioio/SDCard.c -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/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "Det gick inte att initiera UART" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init channel" -msgstr "Det gick inte att återinitiera kanalen" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init timer" -msgstr "Det gick inte att återinitiera timern" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not restart PWM" -msgstr "Det gick inte att starta om PWM" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "Kunde inte hämta klocka" @@ -886,20 +816,6 @@ msgstr "Det gick inte att starta avbrott, RX upptagen" msgid "Couldn't allocate decoder" msgstr "Det gick inte att allokera avkodaren" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate first buffer" -msgstr "Det gick inte att allokera den första bufferten" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate input buffer" -msgstr "Det gick inte att allokera indatabufferten" - -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate second buffer" -msgstr "Det gick inte att allokera den andra bufferten" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "Krasch in i HardFault_Handler." @@ -947,10 +863,6 @@ msgstr "Målkapaciteten är mindre än destination_length." msgid "Device in use" msgstr "Enheten används redan" -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -msgstr "DigitalInOut stöds inte på given pinne" - #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." @@ -1006,11 +918,6 @@ msgstr "Förväntade %q" msgid "Expected an alarm" msgstr "Förväntade ett larm" -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "Förväntad tupel med längd %d, fick %d" - #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." @@ -1037,22 +944,6 @@ msgstr "Det gick inte att skicka kommandot." msgid "Failed to acquire mutex, err 0x%04x" msgstr "Det gick inte att förvärva mutex, fel 0x%04x" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -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/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/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/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "Det gick inte att allokera WiFi-minne" @@ -1121,11 +1012,6 @@ msgstr "För RGB-färgrymder måste indatabitmappen ha 16 bitar per pixel" msgid "Format not supported" msgstr "Formatet stöds inte" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" -msgstr "Framebuffer kräver %d byte" - #: ports/mimxrt10xx/common-hal/microcontroller/Processor.c msgid "" "Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" @@ -1142,6 +1028,10 @@ msgstr "Frekvensen måste matcha befintlig PWMOut med den här timern" msgid "Function requires lock" msgstr "Funktionen kräver lås" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "Allmänt fel" @@ -1169,17 +1059,13 @@ 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 "Hostname måste vara mellan 1 och 253 tecken" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "I/O-operation på stängd fil" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "I2C init-fel" +msgid "I2C init error" +msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c msgid "I2C peripheral in use" @@ -1290,75 +1176,33 @@ msgstr "Internt fel" msgid "Internal error #%d" msgstr "Internt fel #%d" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: py/argcheck.c msgid "Invalid %q" msgstr "Ogiltig %q" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c 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/canio/CAN.c -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Invalid %q pin selection" -msgstr "Ogiltigt val av %q pinne" - #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "Ogiltigt ADC-enhetsvärde" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "Ogiltig AuthMode" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "Ogiltig BLE-parameter" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "Ogiltig BMP-fil" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "Ogiltig BSSID" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "Ogiltig DAC-pinne angiven" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "Ogiltig MAC-adress" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "Ogiltig MIDI-fil" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "Ogiltig PWM-frekvens" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "Ogiltig pinne" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "Ogiltigt argument" @@ -1366,42 +1210,11 @@ msgstr "Ogiltigt argument" msgid "Invalid bits per value" msgstr "Ogiltigt värde för bitar per värde" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "Ogiltig buffertstorlek" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "Ogiltig byteorder-sträng" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "Ogiltig inspelningsperiod. Giltigt intervall: 1 - 500" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "Ogiltigt kanalantal" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "Ogiltig data_count %d" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "Ogiltig data_pins[%d]" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "Ogiltig riktning." - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "Felaktig fil" - #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Ogiltig formatsegmentstorlek" @@ -1410,78 +1223,14 @@ msgstr "Ogiltig formatsegmentstorlek" msgid "Invalid memory access." msgstr "Ogiltig minnesåtkomst." -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "Ogiltigt läge" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "Ogiltig MAC-adress för multicast" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "Ogiltigt antal bitar" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "Ogiltig fas" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "Ogiltig pinne" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "Ogiltig pinne för vänster kanal" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -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/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/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "Ogiltiga pinnar" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "Ogiltig polaritet" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "Ogiltiga egenskaper" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "Ogiltigt körläge." - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "Ogiltigt säkerhetsläge" - #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "Ogiltig storlek" @@ -1494,23 +1243,6 @@ msgstr "Ogiltig socket för TLS" msgid "Invalid state" msgstr "Ogiltigt tillstånd" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "Ogiltig kanal" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "Ogiltigt kanalantal" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "Ogiltig wave-fil" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "Ogiltig word-/bitlängd" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "Nyckeln måste vara 16, 24 eller 32 byte lång" @@ -1524,25 +1256,17 @@ msgid "LHS of keyword arg must be an id" msgstr "LHS av keword arg måste vara ett id" #: shared-module/displayio/Group.c -msgid "Layer already in a group." -msgstr "Lagret finns redan i en grupp." +msgid "Layer already in a group" +msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." -msgstr "Layer måste vara en subklass av Group eller TileGrid." +msgid "Layer must be a Group or TileGrid subclass" +msgstr "" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "MAC-adressen var ogiltig" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "init för MISO-pinne misslyckades." - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "init för MOSI-pinne misslyckades." - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "Mappning måste vara en tuple" @@ -1552,10 +1276,6 @@ msgstr "Mappning måste vara en tuple" 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 "Meddelanden begränsad till 8 byte" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" @@ -1570,10 +1290,14 @@ msgstr "Datastorlek matchar inte" msgid "Mismatched swap flag" msgstr "Felaktig swapflagga" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "MISO- eller MOSI-pinne saknas" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1609,11 +1333,6 @@ msgstr "Saknad first_set_pin. Instruktion %d sätter pinnar" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "Saknar jmp_pin. Instruktion %d hoppar på pin" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "Fler än %d rapport-id stöds inte" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "Måste vara en %q-subklass." @@ -1674,15 +1393,23 @@ msgid "No I2C device at address: 0x%x" msgstr "Ingen I2C-enhet på adress: 0x%x" #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "Ingen MISO-pinne" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Ingen MOSI-pinne" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1721,16 +1448,6 @@ msgstr "Inga fria GCLK: er" msgid "No hardware random available" msgstr "Ingen hårdvaru-random tillgänglig" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "Inget hårdvarustöd på clk-pinne" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "Inget hårdvarustöd på pinne" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "Inget in i programmet" @@ -1880,10 +1597,13 @@ msgid "Only one address is allowed" msgstr "Endast en adress är tillåten" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "Endast ett alarm.time kan ställas in." @@ -1915,11 +1635,6 @@ msgstr "Slut på sockets" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "Element i utbuffer måste vara <= 4 byte långa" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "Utdatabuffert måste vara minst %d byte" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Översampling måste vara multipel av 8." @@ -1928,11 +1643,6 @@ msgstr "Översampling måste vara multipel av 8." msgid "PDMIn not available" msgstr "PDMIn inte tillgänglig" -#: 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/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." @@ -1940,6 +1650,10 @@ msgstr "" "PWM-frekvensen är inte skrivbar när variable_frequency är falsk vid " "skapandet." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" +msgstr "" + #: ports/raspberrypi/common-hal/countio/Counter.c msgid "PWM slice already in use" msgstr "PWM-segment används redan" @@ -1956,29 +1670,14 @@ msgstr "Periferi i bruk" msgid "Permission denied" msgstr "Åtkomst nekad" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "Pinnen kan inte väcka från djup sömn" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "Antalet pinnar måste vara minst 1" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "Antal pinnar för stort" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "Pinnen har inte ADC-funktionalitet" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2050,18 +1749,10 @@ msgstr "Program gör IN utan att ladda ISR" msgid "Program does OUT without loading OSR" msgstr "Program gör OUT utan att läsa in OSR" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "Programmet måste innehålla minst en 16-bitars instruktion." - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "Programstorlek ogiltig" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "Programmet är för stort" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Pull används inte när riktningen är output." @@ -2083,30 +1774,20 @@ msgstr "RNG DeInit-fel" msgid "RNG Init Error" msgstr "RNG Init-fel" -#: ports/nrf/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" -msgstr "RS485 stöds ännu inte på den här enheten" +#: 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 "RS485" +msgstr "" #: ports/espressif/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/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "RTC-kalibrering stöds inte av detta kort" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "RTC stöds inte av detta kort" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/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 Stöds ännu inte på den här enheten" - #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" msgstr "Fel vid generering av slumptal" @@ -2156,6 +1837,10 @@ msgstr "Kör i säkert läge! Sparad kod körs inte.\n" msgid "SD card CSD format not supported" msgstr "SD-kort CSD-format stöds inte" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2166,30 +1851,21 @@ msgstr "SDIO GetCardInfo-fel %d" msgid "SDIO Init Error %d" msgstr "SDIO Init-fel %d" -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "SPI Init-fel" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "SPI reinitialiseringsfel" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "SPI-konfigurationen misslyckades" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "SPI-enhet används redan" -#: shared-bindings/audiomixer/Mixer.c -msgid "Sample rate must be positive" -msgstr "Samplingsfrekvensen måste vara positiv" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" -msgstr "Samplingsfrekvensen är för hög. Den måste vara mindre än %d" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" +msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c msgid "Scale dimensions must divide by 3" @@ -2209,14 +1885,6 @@ msgstr "Serializern används redan" msgid "Server side context cannot have hostname" msgstr "Serversidans kontext kan inte ha värdnamn" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "Inställt antal pinnar måste vara mellan 1 och 5" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "Sido-setets antal pinnar måste vara mellan 1 och 5" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "Storleken stöds inte" @@ -2252,10 +1920,6 @@ msgstr "Ange en av data0 eller data_pins" msgid "Splitting with sub-captures" msgstr "Splitting med sub-captures" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "Stackstorleken måste vara minst 256" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "Vänster stereokanal måste använda PWM kanal A" @@ -2351,10 +2015,6 @@ msgstr "Tile-höjden måste vara jämnt delbar med höjd på bitmap" msgid "Tile index out of bounds" msgstr "Tile-index utanför gräns" -#: shared-bindings/displayio/TileGrid.c -msgid "Tile value out of bounds" -msgstr "Tile-värde utanför intervall" - #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" msgstr "Tile-bredd måste vara jämnt delbar med bredd på bitmap" @@ -2374,6 +2034,9 @@ msgid "To exit, please reset the board without " 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" +msgstr "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "För många kanaler i sampling." @@ -2406,24 +2069,21 @@ msgid "Tuple or struct_time argument required" msgstr "Tuple- eller struct_time-argument krävs" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "UART-buffertallokeringsfel" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" +msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "UART deinit-fel" +msgid "UART re-init" +msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "UART Init-fel" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "UART reinit-fel" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" -msgstr "UART skrivfel" +msgid "UART write" +msgstr "" #: shared-module/usb_hid/Device.c msgid "USB busy" @@ -2561,12 +2221,6 @@ msgstr "" "Ospecificerat problem. Kan vara att parningen på den andra enheten avvisades " "eller ignorerades." -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "Baudrate stöd inte" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "Färgrymd stöds inte" @@ -2647,10 +2301,6 @@ msgstr "" "\n" "För att lista inbyggda moduler skriver du `help(\"modules\")`.\n" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" -msgstr "WiFi-lösenord måste vara mellan 8 och 63 tecken" - #: main.c msgid "Woken up by alarm.\n" msgstr "Vaknade av larm.\n" @@ -2805,10 +2455,6 @@ msgstr "bitmappsstorlekar måste matcha" msgid "bits must be 32 or less" msgstr "bits måste vara 32 eller färre" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "bits måste mellan 5 och 9" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample måste vara 8 eller 16" @@ -2846,11 +2492,6 @@ msgstr "buffert för liten för begärd längd" msgid "byteorder is not a string" msgstr "byteorder är inte en sträng" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -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 "bytelängd inte en multipel av storlek" @@ -2859,7 +2500,7 @@ msgstr "bytelängd inte en multipel av storlek" msgid "bytes value out of range" msgstr "bytevärde utanför intervallet" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "kalibrering är utanför intervallet" @@ -2867,13 +2508,10 @@ msgstr "kalibrering är utanför intervallet" msgid "calibration is read only" msgstr "kalibrering är skrivskyddad" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "kalibreringsvärde utanför intervallet +/- 127" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" -msgstr "kan endast registreras med en förälder" +msgid "can only have one parent" +msgstr "" #: py/emitinlinethumb.c msgid "can only have up to 4 parameters to Thumb assembly" @@ -3045,6 +2683,10 @@ msgstr "Kan inte entydigt få sizeof scalar" msgid "casting" msgstr "casting inte implementerad" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "teckenbuffert för liten" @@ -3057,10 +2699,6 @@ msgstr "chr() arg är inte i intervallet(0x110000)" msgid "chr() arg not in range(256)" msgstr "chr() arg är inte i intervallet(256)" -#: shared-module/vectorio/Circle.c -msgid "circle can only be registered in one parent" -msgstr "circle kan endast registreras i en förälder" - #: shared-bindings/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "klipppunkten måste vara en tuple (x,y)" @@ -3488,6 +3126,10 @@ 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" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "initialvärden måste vara iterable" @@ -3741,10 +3383,6 @@ msgstr "matematikdomänfel" msgid "matrix is not positive definite" msgstr "matrisen är inte positiv bestämd" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "max_connections måste vara mellan 0 och 10" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3752,10 +3390,6 @@ msgstr "max_connections måste vara mellan 0 och 10" 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 "max_length måste vara >= 0" - #: extmod/ulab/code/ndarray.c msgid "maximum number of dimensions is 4" msgstr "maximalt antal dimensioner är 4" @@ -4127,10 +3761,6 @@ msgstr "" msgid "poll on file not available on win32" msgstr "filbevakning är inte tillgänglig på win32" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "polygon kan endast registreras i en förälder" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop från en tom PulseIn" @@ -4177,14 +3807,6 @@ msgstr "håll ner vänster knapp vid start\n" msgid "pull masks conflict with direction masks" msgstr "pull-mask är i konflikt med riktnings-mask" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "pull_threshold måste vara mellan 1 och 32" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "push_threshold måste vara mellan 1 och 32" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "köstorlek överskreds" @@ -4357,10 +3979,6 @@ msgstr "start_x ska vara en int" msgid "step must be non-zero" msgstr "step måste vara icke-noll" -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "stop måste vara 1 eller 2" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "stop kan inte nås från start" @@ -4409,10 +4027,6 @@ msgstr "syntaxfel i uctypes deskriptor" msgid "threshold must be in the range 0-65536" msgstr "tröskelvärdet måste ligga i intervallet 0-65536" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "tile måste vara större än noll" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() kräver en 9-sekvens" @@ -4432,10 +4046,6 @@ msgstr "timeout måste vara 0.0-100.0 sekunder" msgid "timeout must be < 655.35 secs" msgstr "timeout måste vara < 655,35 sekunder" -#: shared-bindings/_bleio/CharacteristicBuffer.c -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 "timeout för v1-kort" @@ -4444,6 +4054,10 @@ msgstr "timeout för v1-kort" msgid "timeout waiting for v2 card" msgstr "timeout för v2-kort" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +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\"" @@ -4635,13 +4249,7 @@ msgstr "watchdog är inte initierad" msgid "watchdog timeout must be greater than 0" msgstr "watchdog timeout måste vara större än 0" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "width måste vara mellan 2 och 8, inte %d" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "width måste vara större än noll" @@ -4713,6 +4321,352 @@ 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 must be a tuple of length 2" +#~ msgstr "%q måste vara en tuple av längd 2" + +#~ msgid "%q must be between %d and %d" +#~ msgstr "%q måste vara mellan %d och %d" + +#~ msgid "%q should be an int" +#~ msgstr "%q ska vara en int" + +#~ msgid "(x,y) integers required" +#~ msgstr "(x,y) heltal krävs" + +#~ msgid "Address type out of range" +#~ msgstr "Adresstyp utanför intervallet" + +#~ msgid "AnalogIn not supported on given pin" +#~ msgstr "AnalogIn stöds inte på angiven pinne" + +#~ msgid "AnalogOut functionality not supported" +#~ msgstr "AnalogOut-funktionalitet stöds inte" + +#~ msgid "AnalogOut is only 16 bits. Value must be less than 65536." +#~ msgstr "" +#~ "AnalogOut hanterar bara 16 bitar. Värdet måste vara mindre än 65536." + +#~ msgid "AnalogOut not supported on given pin" +#~ msgstr "AnalogOut stöds inte på angiven pinne" + +#, c-format +#~ msgid "Bit depth must be from 1 to 6 inclusive, not %d" +#~ msgstr "Bitdjup måste vara inom 1 till 6, inte %d" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "Buffert har felaktig storlek. Ska vara %d byte." + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "Bufferten måste ha minst längd 1" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "Bytes måste vara mellan 0 och 255." + +#~ msgid "Cannot output both channels on the same pin" +#~ msgstr "Det går inte att mata ut båda kanalerna på samma pinne" + +#~ msgid "Cannot read without MISO pin." +#~ msgstr "Kan inte läsa utan MISO-pinne." + +#~ msgid "Cannot reset into bootloader because no bootloader is present." +#~ msgstr "" +#~ "Det går inte att återställa till bootloader eftersom bootloader saknas." + +#~ msgid "Cannot transfer without MOSI and MISO pins." +#~ msgstr "Kan inte överföra utan MOSI- och MISO-pinnar." + +#~ msgid "Cannot write without MOSI pin." +#~ msgstr "Kan inte skriva utan MOSI-pinne." + +#~ msgid "Clock pin init failed." +#~ msgstr "Initiering av klockpinne misslyckades." + +#~ msgid "Command must be an int between 0 and 255" +#~ msgstr "Kommandot måste vara en int mellan 0 och 255" + +#~ msgid "Could not initialize Camera" +#~ msgstr "Kunde inte initiera Camera" + +#~ msgid "Could not initialize GNSS" +#~ msgstr "Kan inte initiera GNSS" + +#~ msgid "Could not initialize SDCard" +#~ msgstr "Kan inte initiera SD-kort" + +#~ msgid "Could not initialize UART" +#~ msgstr "Det gick inte att initiera UART" + +#~ msgid "Could not re-init channel" +#~ msgstr "Det gick inte att återinitiera kanalen" + +#~ msgid "Could not re-init timer" +#~ msgstr "Det gick inte att återinitiera timern" + +#~ msgid "Could not restart PWM" +#~ msgstr "Det gick inte att starta om PWM" + +#~ msgid "Couldn't allocate first buffer" +#~ msgstr "Det gick inte att allokera den första bufferten" + +#~ msgid "Couldn't allocate input buffer" +#~ msgstr "Det gick inte att allokera indatabufferten" + +#~ msgid "Couldn't allocate second buffer" +#~ msgstr "Det gick inte att allokera den andra bufferten" + +#~ msgid "DigitalInOut not supported on given pin" +#~ msgstr "DigitalInOut stöds inte på given pinne" + +#, c-format +#~ msgid "Expected tuple of length %d, got %d" +#~ msgstr "Förväntad tupel med längd %d, fick %d" + +#~ msgid "Failed to allocate RX buffer" +#~ msgstr "Det gick inte att tilldela RX-buffert" + +#, c-format +#~ msgid "Failed to allocate RX buffer of %d bytes" +#~ msgstr "Det gick inte att allokera RX-bufferten på %d byte" + +#, c-format +#~ msgid "Framebuffer requires %d bytes" +#~ msgstr "Framebuffer kräver %d byte" + +#~ msgid "Hostname must be between 1 and 253 characters" +#~ msgstr "Hostname måste vara mellan 1 och 253 tecken" + +#~ msgid "I2C Init Error" +#~ msgstr "I2C init-fel" + +#~ msgid "Invalid %q pin selection" +#~ msgstr "Ogiltigt val av %q pinne" + +#~ msgid "Invalid AuthMode" +#~ msgstr "Ogiltig AuthMode" + +#~ msgid "Invalid BMP file" +#~ msgstr "Ogiltig BMP-fil" + +#~ msgid "Invalid DAC pin supplied" +#~ msgstr "Ogiltig DAC-pinne angiven" + +#~ msgid "Invalid MIDI file" +#~ msgstr "Ogiltig MIDI-fil" + +#~ msgid "Invalid PWM frequency" +#~ msgstr "Ogiltig PWM-frekvens" + +#~ msgid "Invalid Pin" +#~ msgstr "Ogiltig pinne" + +#~ msgid "Invalid buffer size" +#~ msgstr "Ogiltig buffertstorlek" + +#~ msgid "Invalid byteorder string" +#~ msgstr "Ogiltig byteorder-sträng" + +#~ msgid "Invalid capture period. Valid range: 1 - 500" +#~ msgstr "Ogiltig inspelningsperiod. Giltigt intervall: 1 - 500" + +#~ msgid "Invalid channel count" +#~ msgstr "Ogiltigt kanalantal" + +#, c-format +#~ msgid "Invalid data_count %d" +#~ msgstr "Ogiltig data_count %d" + +#~ msgid "Invalid direction." +#~ msgstr "Ogiltig riktning." + +#~ msgid "Invalid file" +#~ msgstr "Felaktig fil" + +#~ msgid "Invalid mode" +#~ msgstr "Ogiltigt läge" + +#~ msgid "Invalid number of bits" +#~ msgstr "Ogiltigt antal bitar" + +#~ msgid "Invalid phase" +#~ msgstr "Ogiltig fas" + +#~ msgid "Invalid pin" +#~ msgstr "Ogiltig pinne" + +#~ msgid "Invalid pin for left channel" +#~ msgstr "Ogiltig pinne för vänster kanal" + +#~ msgid "Invalid pin for right channel" +#~ msgstr "Ogiltig pinne för höger kanal" + +#~ msgid "Invalid polarity" +#~ msgstr "Ogiltig polaritet" + +#~ msgid "Invalid properties" +#~ msgstr "Ogiltiga egenskaper" + +#~ msgid "Invalid run mode." +#~ msgstr "Ogiltigt körläge." + +#~ msgid "Invalid security_mode" +#~ msgstr "Ogiltigt säkerhetsläge" + +#~ msgid "Invalid voice" +#~ msgstr "Ogiltig kanal" + +#~ msgid "Invalid voice count" +#~ msgstr "Ogiltigt kanalantal" + +#~ msgid "Invalid wave file" +#~ msgstr "Ogiltig wave-fil" + +#~ msgid "Invalid word/bit length" +#~ msgstr "Ogiltig word-/bitlängd" + +#~ msgid "Layer already in a group." +#~ msgstr "Lagret finns redan i en grupp." + +#~ msgid "Layer must be a Group or TileGrid subclass." +#~ msgstr "Layer måste vara en subklass av Group eller TileGrid." + +#~ msgid "MISO pin init failed." +#~ msgstr "init för MISO-pinne misslyckades." + +#~ msgid "MOSI pin init failed." +#~ msgstr "init för MOSI-pinne misslyckades." + +#~ msgid "Messages limited to 8 bytes" +#~ msgstr "Meddelanden begränsad till 8 byte" + +#, c-format +#~ msgid "More than %d report ids not supported" +#~ msgstr "Fler än %d rapport-id stöds inte" + +#~ msgid "No hardware support on clk pin" +#~ msgstr "Inget hårdvarustöd på clk-pinne" + +#~ msgid "No hardware support on pin" +#~ msgstr "Inget hårdvarustöd på pinne" + +#, c-format +#~ msgid "Output buffer must be at least %d bytes" +#~ msgstr "Utdatabuffert måste vara minst %d byte" + +#~ 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)" + +#~ msgid "Pin count must be at least 1" +#~ msgstr "Antalet pinnar måste vara minst 1" + +#~ msgid "Pin does not have ADC capabilities" +#~ msgstr "Pinnen har inte ADC-funktionalitet" + +#~ msgid "Program must contain at least one 16-bit instruction." +#~ msgstr "Programmet måste innehålla minst en 16-bitars instruktion." + +#~ msgid "Program too large" +#~ msgstr "Programmet är för stort" + +#~ msgid "RS485 Not yet supported on this device" +#~ msgstr "RS485 stöds ännu inte på den här enheten" + +#~ msgid "RTC calibration is not supported on this board" +#~ msgstr "RTC-kalibrering stöds inte av detta kort" + +#~ msgid "RTS/CTS/RS485 Not yet supported on this device" +#~ msgstr "RTS/CTS/RS485 Stöds ännu inte på den här enheten" + +#~ msgid "SPI Init Error" +#~ msgstr "SPI Init-fel" + +#~ msgid "SPI Re-initialization error" +#~ msgstr "SPI reinitialiseringsfel" + +#~ msgid "Sample rate must be positive" +#~ msgstr "Samplingsfrekvensen måste vara positiv" + +#, c-format +#~ msgid "Sample rate too high. It must be less than %d" +#~ msgstr "Samplingsfrekvensen är för hög. Den måste vara mindre än %d" + +#~ msgid "Set pin count must be between 1 and 5" +#~ msgstr "Inställt antal pinnar måste vara mellan 1 och 5" + +#~ msgid "Side set pin count must be between 1 and 5" +#~ msgstr "Sido-setets antal pinnar måste vara mellan 1 och 5" + +#~ msgid "Stack size must be at least 256" +#~ msgstr "Stackstorleken måste vara minst 256" + +#~ msgid "Tile value out of bounds" +#~ msgstr "Tile-värde utanför intervall" + +#~ msgid "UART Buffer allocation error" +#~ msgstr "UART-buffertallokeringsfel" + +#~ msgid "UART De-init error" +#~ msgstr "UART deinit-fel" + +#~ msgid "UART Init Error" +#~ msgstr "UART Init-fel" + +#~ msgid "UART Re-init error" +#~ msgstr "UART reinit-fel" + +#~ msgid "UART write error" +#~ msgstr "UART skrivfel" + +#~ msgid "Unsupported baudrate" +#~ msgstr "Baudrate stöd inte" + +#~ msgid "WiFi password must be between 8 and 63 characters" +#~ msgstr "WiFi-lösenord måste vara mellan 8 och 63 tecken" + +#~ msgid "bits must be in range 5 to 9" +#~ msgstr "bits måste mellan 5 och 9" + +#~ msgid "bytes > 8 bits not supported" +#~ msgstr "bytes> 8 bitar stöds inte" + +#~ msgid "calibration value out of range +/-127" +#~ msgstr "kalibreringsvärde utanför intervallet +/- 127" + +#~ msgid "can only be registered in one parent" +#~ msgstr "kan endast registreras med en förälder" + +#~ msgid "circle can only be registered in one parent" +#~ msgstr "circle kan endast registreras i en förälder" + +#~ msgid "max_connections must be between 0 and 10" +#~ msgstr "max_connections måste vara mellan 0 och 10" + +#~ msgid "max_length must be >= 0" +#~ msgstr "max_length måste vara >= 0" + +#~ msgid "polygon can only be registered in one parent" +#~ msgstr "polygon kan endast registreras i en förälder" + +#~ msgid "pull_threshold must be between 1 and 32" +#~ msgstr "pull_threshold måste vara mellan 1 och 32" + +#~ msgid "push_threshold must be between 1 and 32" +#~ msgstr "push_threshold måste vara mellan 1 och 32" + +#~ msgid "stop must be 1 or 2" +#~ msgstr "stop måste vara 1 eller 2" + +#~ msgid "tile must be greater than zero" +#~ msgstr "tile måste vara större än noll" + +#~ msgid "timeout must be >= 0.0" +#~ msgstr "timeout måste vara >= 0.0" + +#, c-format +#~ msgid "width must be from 2 to 8 (inclusive), not %d" +#~ msgstr "width måste vara mellan 2 och 8, inte %d" + #~ msgid "Unsupported operation" #~ msgstr "Åtgärd som inte stöds" diff --git a/locale/tr.po b/locale/tr.po index c64c90b204..b1a3058c2d 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -78,10 +78,24 @@ msgstr "" "%d adres pinleri, %d RGB pinleri ve %d döşemeleri %d'nin yüksekliği " "gösterir, %d'nin değil" +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "%q ve %q yinelenen pinler içeriyor" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "%q yinelenen pinler içeriyor" @@ -94,12 +108,7 @@ msgstr "%q hata: %d" msgid "%q in use" msgstr "%q kullanımda" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "%q indeksi aralık dışında" @@ -107,14 +116,34 @@ msgstr "%q indeksi aralık dışında" msgid "%q indices must be integers, not %s" msgstr "%q indeksleri integer olmalı, %s değil" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "%q boyutları %d-%d olmalıdır" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "%q boyutu >=1 olmalıdır" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "%q, %d-%d olmalıdır" @@ -131,14 +160,10 @@ msgstr "%q <= %d olmalıdır" msgid "%q must be >= %d" msgstr "%q >= %d olmalıdır" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "%q >= 0 olmalıdır" -#: 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 "%q >= 1 olmalıdır" @@ -147,14 +172,9 @@ msgstr "%q >= 1 olmalıdır" msgid "%q must be a string" msgstr "%q bir string olmalıdır" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "%q, boyutu 2 olan bir tuple olmalıdır" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" -msgstr "%q, %d ile %d arasında olmalıdır" +#: py/argcheck.c +msgid "%q must be an int" +msgstr "" #: py/argcheck.c msgid "%q must be of type %q" @@ -172,7 +192,11 @@ msgstr "%q, 2'nin kuvveti olmalıdır" msgid "%q out of bounds" msgstr "%q sınırların dışında" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q aralık dışında" @@ -181,10 +205,6 @@ msgstr "%q aralık dışında" msgid "%q pin invalid" msgstr "%q pini geçersiz" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%q bir int olmalıdır" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "Rapor kimliği 0 olan %q, 1 uzunluğunda olmalıdır" @@ -349,10 +369,6 @@ msgstr "asenkron fonksiyon içinde 'yield from'" msgid "'yield' outside function" msgstr "fonksiyon dışında 'yield'" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "(x, y) integerları gereklidir" - #: py/compile.c msgid "*x must be assignment target" msgstr "" @@ -388,10 +404,6 @@ msgstr "ADC2, WiFi tarafından kullanılmaktadır" msgid "Address must be %d bytes long" msgstr "Adres %d byte uzunluğunda olmalıdır" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "Adres tipi beklenen aralığın dışında" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "Tüm CAN çevre birimleri kullanımda" @@ -482,25 +494,6 @@ msgstr "Halihazırda çalışıyor" msgid "Already scanning for wifi networks" msgstr "Halihazırda wifi ağları için tarama yapılıyor" -#: ports/cxd56/common-hal/analogio/AnalogIn.c -msgid "AnalogIn not supported on given pin" -msgstr "Verilen pin için AnalogIn desteklenmemektedir" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "AnalogOut işlevi desteklenmemektedir" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "AnalogOut yalnızca 16 bitlik. Değer 65536'dan küçük olmalıdır." - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "Verilen pin için AnalogOut desteklenmemektedir" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "Başka bir PWMAudioOut zaten aktif durumda" @@ -572,11 +565,6 @@ msgstr "" msgid "Bit clock and word select must share a clock unit" msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "Bit derinliği 1-6 aralığında olmalı, %d değil" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "Bit derinliği 8'in katı olacak şekilde olmalı." @@ -619,11 +607,6 @@ msgstr "" msgid "Buffer elements must be 4 bytes long or less" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "Geçersiz arabellek boyutu. %d kadar olmalı" - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "Arabellek bayt dizisi değil" @@ -633,7 +616,6 @@ msgstr "Arabellek bayt dizisi değil" msgid "Buffer is too small" msgstr "Arabellek çok küçük" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -648,10 +630,6 @@ msgstr "Arabellek boyutu 512'nin katı olmalı" msgid "Buffer must be a multiple of 512 bytes" msgstr "" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "Arabellek boyutu en az 1 olmalı" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -673,10 +651,6 @@ msgstr "Veriyolu pini %d kullanımda" msgid "Byte buffer must be 16 bytes." msgstr "" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "Baytlar 0-255 aralığında olmalı" - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "CBC blokları 16 baytın katları şeklinde olmalı" @@ -693,6 +667,10 @@ msgstr "" msgid "Call super().__init__() before accessing native object." msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" @@ -740,18 +718,10 @@ msgstr "" 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 "" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only 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 "" @@ -763,7 +733,7 @@ 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." +msgid "Cannot reset into bootloader because no bootloader is present" msgstr "" #: ports/espressif/common-hal/socketpool/Socket.c @@ -784,20 +754,19 @@ msgid "Cannot subclass slice" msgstr "" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." +msgid "Cannot transfer without MOSI and MISO pins" msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c -msgid "Cannot wake on pin edge. Only level." +msgid "Cannot wake on pin edge, only level" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge. Only level." msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -812,10 +781,6 @@ msgstr "" msgid "CircuitPython was unable to allocate the heap." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "" - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "" @@ -824,11 +789,6 @@ msgstr "" msgid "Clock unit in use" msgstr "" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/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 " @@ -839,35 +799,6 @@ msgstr "" msgid "Corrupt .mpy file" 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 "" - -#: 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 -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -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 "" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "" @@ -888,20 +819,6 @@ msgstr "" 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 "" @@ -949,10 +866,6 @@ msgstr "" 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." @@ -1008,11 +921,6 @@ msgstr "" msgid "Expected an alarm" msgstr "" -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "" - #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." @@ -1039,22 +947,6 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/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/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/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/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "" @@ -1123,11 +1015,6 @@ msgstr "" msgid "Format not supported" msgstr "" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" -msgstr "" - #: ports/mimxrt10xx/common-hal/microcontroller/Processor.c msgid "" "Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" @@ -1142,6 +1029,10 @@ msgstr "" msgid "Function requires lock" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1169,16 +1060,12 @@ 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 "" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" +msgid "I2C init error" msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c @@ -1286,75 +1173,33 @@ msgstr "" msgid "Internal error #%d" msgstr "" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: py/argcheck.c msgid "Invalid %q" msgstr "" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.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/canio/CAN.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 "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "" @@ -1362,42 +1207,11 @@ msgstr "" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" 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 "" @@ -1406,78 +1220,14 @@ msgstr "" msgid "Invalid memory access." msgstr "" -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" 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 -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.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/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" 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 "" - #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" @@ -1490,23 +1240,6 @@ msgstr "" msgid "Invalid state" 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/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "" @@ -1520,25 +1253,17 @@ msgid "LHS of keyword arg must be an id" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer already in a group." +msgid "Layer already in a group" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." +msgid "Layer must be a Group or TileGrid subclass" msgstr "" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "" - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "" - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "" @@ -1548,10 +1273,6 @@ msgstr "" msgid "Maximum x value when mirrored is %d" msgstr "" -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" @@ -1565,10 +1286,14 @@ msgstr "" msgid "Mismatched swap flag" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1604,11 +1329,6 @@ msgstr "" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" @@ -1669,15 +1389,23 @@ msgid "No I2C device at address: 0x%x" msgstr "" #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1716,16 +1444,6 @@ msgstr "" 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/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "" @@ -1870,10 +1588,13 @@ msgid "Only one address is allowed" msgstr "" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "" @@ -1905,11 +1626,6 @@ msgstr "" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "" @@ -1920,12 +1636,11 @@ msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +"PWM frequency not writable when variable_frequency is False on construction." msgstr "" -#: shared-bindings/pwmio/PWMOut.c -msgid "" -"PWM frequency not writable when variable_frequency is False on construction." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" msgstr "" #: ports/raspberrypi/common-hal/countio/Counter.c @@ -1944,29 +1659,14 @@ msgstr "" msgid "Permission denied" msgstr "" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2036,18 +1736,10 @@ msgstr "" msgid "Program does OUT without loading OSR" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "" - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -2069,8 +1761,9 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" +#: 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 "RS485" msgstr "" #: ports/espressif/common-hal/busio/UART.c @@ -2078,21 +1771,10 @@ msgstr "" msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "" - #: shared-bindings/alarm/time/TimeAlarm.c 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/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 "" @@ -2142,6 +1824,10 @@ msgstr "" msgid "SD card CSD format not supported" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2152,29 +1838,20 @@ msgstr "" 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 "" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" 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" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c @@ -2195,14 +1872,6 @@ msgstr "" msgid "Server side context cannot have hostname" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "" @@ -2238,10 +1907,6 @@ msgstr "" msgid "Splitting with sub-captures" msgstr "" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "" @@ -2327,10 +1992,6 @@ msgstr "" 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 "" @@ -2350,6 +2011,9 @@ msgid "To exit, please reset the board without " msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample" +msgstr "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -2382,23 +2046,20 @@ msgid "Tuple or struct_time argument required" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" +msgid "UART re-init" 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" +msgid "UART write" msgstr "" #: shared-module/usb_hid/Device.c @@ -2535,12 +2196,6 @@ msgid "" "declined or ignored." msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "" @@ -2615,10 +2270,6 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" -msgstr "" - #: main.c msgid "Woken up by alarm.\n" msgstr "" @@ -2771,10 +2422,6 @@ msgstr "" msgid "bits must be 32 or less" msgstr "" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -2812,11 +2459,6 @@ msgstr "" msgid "byteorder is not a string" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/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 "" @@ -2825,7 +2467,7 @@ msgstr "" msgid "bytes value out of range" msgstr "" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "" @@ -2833,12 +2475,9 @@ msgstr "" msgid "calibration is read only" msgstr "" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" +msgid "can only have one parent" msgstr "" #: py/emitinlinethumb.c @@ -3009,6 +2648,10 @@ msgstr "" msgid "casting" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "" @@ -3021,10 +2664,6 @@ msgstr "" 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/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "" @@ -3449,6 +3088,10 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "" @@ -3699,10 +3342,6 @@ msgstr "" msgid "matrix is not positive definite" msgstr "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3710,10 +3349,6 @@ 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 "" - #: extmod/ulab/code/ndarray.c msgid "maximum number of dimensions is 4" msgstr "" @@ -4084,10 +3719,6 @@ msgstr "" msgid "poll on file not available on win32" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" @@ -4134,14 +3765,6 @@ msgstr "" msgid "pull masks conflict with direction masks" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "" @@ -4312,10 +3935,6 @@ msgstr "" 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 "" @@ -4364,10 +3983,6 @@ msgstr "" msgid "threshold must be in the range 0-65536" msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "" @@ -4387,10 +4002,6 @@ msgstr "" msgid "timeout must be < 655.35 secs" 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 "" @@ -4399,6 +4010,10 @@ msgstr "" msgid "timeout waiting for v2 card" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "" @@ -4590,13 +4205,7 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" @@ -4668,6 +4277,47 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "%q must be a tuple of length 2" +#~ msgstr "%q, boyutu 2 olan bir tuple olmalıdır" + +#~ msgid "%q must be between %d and %d" +#~ msgstr "%q, %d ile %d arasında olmalıdır" + +#~ msgid "%q should be an int" +#~ msgstr "%q bir int olmalıdır" + +#~ msgid "(x,y) integers required" +#~ msgstr "(x, y) integerları gereklidir" + +#~ msgid "Address type out of range" +#~ msgstr "Adres tipi beklenen aralığın dışında" + +#~ msgid "AnalogIn not supported on given pin" +#~ msgstr "Verilen pin için AnalogIn desteklenmemektedir" + +#~ msgid "AnalogOut functionality not supported" +#~ msgstr "AnalogOut işlevi desteklenmemektedir" + +#~ msgid "AnalogOut is only 16 bits. Value must be less than 65536." +#~ msgstr "AnalogOut yalnızca 16 bitlik. Değer 65536'dan küçük olmalıdır." + +#~ msgid "AnalogOut not supported on given pin" +#~ msgstr "Verilen pin için AnalogOut desteklenmemektedir" + +#, c-format +#~ msgid "Bit depth must be from 1 to 6 inclusive, not %d" +#~ msgstr "Bit derinliği 1-6 aralığında olmalı, %d değil" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "Geçersiz arabellek boyutu. %d kadar olmalı" + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "Arabellek boyutu en az 1 olmalı" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "Baytlar 0-255 aralığında olmalı" + #~ msgid "" #~ "\n" #~ "Code stopped by auto-reload.\n" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 5e1b146532..adecfd334e 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -77,10 +77,24 @@ msgstr "" "%d de zhǐ yǐn jiǎo, %d rgb yǐn jiǎo hé %d qiē piàn biǎo shì %d de gāo dù, ér " "bù shì %d" +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "%q hé %q bāo hán chóng fù yǐn jiǎo" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "%q bāo hán chóng fù de yǐn jiǎo" @@ -93,12 +107,7 @@ msgstr "%q Shībài: %d" msgid "%q in use" msgstr "%q zhèngzài bèi shǐyòng" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.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" @@ -106,14 +115,34 @@ msgstr "%q suǒyǐn chāochū fànwéi" msgid "%q indices must be integers, not %s" msgstr "%q suǒyǐn bìxū shì zhěngshù, ér bùshì %s" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "%q cháng dù bì xū wéi %d-%d" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "%q cháng dù bì xū >= 1" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "%q bì xū wéi %d-%d" @@ -130,14 +159,10 @@ msgstr "%q bì xū <= %d" msgid "%q must be >= %d" msgstr "%q bì xū >= %d" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "%q Bìxū > = 0" -#: 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 "%q bìxū >= 1" @@ -146,14 +171,9 @@ msgstr "%q bìxū >= 1" msgid "%q must be a string" msgstr "%q bì xū shì yí gè zì fú chuàn" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "%q bìxū shì chángdù wèi 2 de yuánzǔ" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" -msgstr "%q bì xū zài %d hé %d zhī jiān" +#: py/argcheck.c +msgid "%q must be an int" +msgstr "" #: py/argcheck.c msgid "%q must be of type %q" @@ -171,7 +191,11 @@ msgstr "%q bì xū shì 2 de zhěng shù cì fāng" msgid "%q out of bounds" msgstr "%q chāo chū jiè xiàn" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q chāochū fànwéi" @@ -180,10 +204,6 @@ msgstr "%q chāochū fànwéi" msgid "%q pin invalid" msgstr "%q yǐn jiǎo wúxiào" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%q yīnggāi shì yīgè zhěngshù (int)" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "bào gào ID shì 0 de %q bì xū cháng dù wéi 1" @@ -346,10 +366,6 @@ msgstr "Yìbù hánshù zhōng cúnzài 'yield from'" msgid "'yield' outside function" msgstr "'yield' wèiyú hánshù zhīwài" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "xūyào zhěngshù (x,y)" - #: py/compile.c msgid "*x must be assignment target" msgstr "*x bìxū shì bèi fùzhí de duìxiàng" @@ -385,10 +401,6 @@ msgstr "ADC2 zhèngzài bèi WiFi shǐ yòng" msgid "Address must be %d bytes long" msgstr "dìzhǐ chángdù bìxū shì %d zìjié" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "Dìzhǐ lèixíng chāochū fànwéi" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "suǒyǒu CAN wàishè dōu zài shǐyòng zhōng" @@ -480,25 +492,6 @@ msgstr "yǐjīng zài yùnxíng" msgid "Already scanning for wifi networks" msgstr "yǐjīng zài sǎomiáo WIFI wǎngluò" -#: ports/cxd56/common-hal/analogio/AnalogIn.c -msgid "AnalogIn not supported on given pin" -msgstr "gěidìng de yǐnjiǎo bù zhīchí AnalogIn" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "Bù zhīchí AnalogOut gōngnéng" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "AnalogOut jǐn wèi 16 wèi. Zhí bìxū xiǎoyú 65536." - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "zhǐdìng de yǐn jiǎo bù zhīchí AnalogOut" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "lìng yí gè PWMAudioOut yǐ jīng zài gōngzuò" @@ -572,11 +565,6 @@ msgstr "wèi shí zhōng hé dān cí xuǎn zé bì xū shì shùn xù yǐn jiǎ msgid "Bit clock and word select must share a clock unit" msgstr "Bǐtè shízhōng hé dānzì xuǎnzé bìxū gòngxiǎng shízhōng dānwèi" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "wèi shēndù bìxū shì 1 dào 6, ér búshì %d" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "wèi shēndù bìxū shì 8 de zhěngshùbèi." @@ -619,11 +607,6 @@ msgstr "huǎnchōngqū yǔ piānyíliàng de hé tài xiǎo %d %d %d" msgid "Buffer elements must be 4 bytes long or less" msgstr "huǎnchōngqū de yuánsù bìxū wéi 4 zìjié cháng huò gèngshǎo" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "Huǎnchōng qū dàxiǎo bù zhèngquè. Yīnggāi shì %d zì jié." - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "Huǎnchōng qū bùshì bytearray." @@ -633,7 +616,6 @@ msgstr "Huǎnchōng qū bùshì bytearray." msgid "Buffer is too small" msgstr "Huǎnchōng qū tài xiǎo" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -648,10 +630,6 @@ msgstr "Huǎnchōngqū chángdù bìxū wéi 512 de bèishù" msgid "Buffer must be a multiple of 512 bytes" msgstr "Huǎnchōngqū bìxū shì 512 zìjié de bèishù" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "Huǎnchōng qū bìxū zhìshǎo chángdù wéi 1" - #: shared-bindings/_bleio/PacketBuffer.c #, fuzzy, c-format msgid "Buffer too short by %d bytes" @@ -673,10 +651,6 @@ msgstr "Zǒngxiàn yǐnjiǎo %d yǐjīng zài shǐyòng zhōng" msgid "Byte buffer must be 16 bytes." msgstr "Zìjié huǎnchōng qū bìxū shì 16 zìjié." -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -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 "CBC kuài bìxū shì 16 zìjié de bèishù" @@ -693,6 +667,10 @@ msgstr "CRC huò jiàoyàn hé wúxiào" msgid "Call super().__init__() before accessing native object." msgstr "Zài fǎngwèn yuánshēn dùixiàng zhīqián diàoyòng super().__init__()." +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c #, fuzzy msgid "Can only alarm on RTC IO from deep sleep." @@ -745,18 +723,10 @@ msgstr "Wúfǎ huòqǔ wēndù" msgid "Cannot have scan responses for extended, connectable advertisements." msgstr "Nín wúfǎ sǎomiáo kuòzhǎn de, kě liánjiē de guǎnggào." -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Cannot output both channels on the same pin" -msgstr "Wúfǎ shūchū tóng yīgè yǐn jiǎo shàng de liǎng gè píndào" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "wú fǎ lā dòng jǐn shū rù yǐn jiǎo." -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "Wúfǎ dòu qǔ méiyǒu MISO de yǐn jiǎo." - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "Wúfǎ jìlù dào wénjiàn" @@ -768,8 +738,8 @@ msgstr "tōng guò USB kě jiàn shí wú fǎ chóng xīn ān zhuāng '/'." #: 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 "Wúfǎ chóng zhì wèi bootloader, yīnwèi méiyǒu bootloader cúnzài." +msgid "Cannot reset into bootloader because no bootloader is present" +msgstr "" #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -789,22 +759,21 @@ msgid "Cannot subclass slice" msgstr "Wúfǎ zi fēnlèi" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." -msgstr "Méiyǒu MOSI/MISO jiù wúfǎ zhuǎnyí." +msgid "Cannot transfer without MOSI and MISO pins" +msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "Wúfǎ gēnggǎi yǐ zài shǐyòng de jìshí qì shàng de pínlǜ" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge, only level" +msgstr "" + +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge. Only level." msgstr "wú fǎ zài yǐn jiǎo biān yuán huàn xǐng. jǐn jí bié." -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." -msgstr "Wúfǎ xiě rù MOSI de yǐn jiǎo." - #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" msgstr "Wèi tígōng zìfú huǎncún xiě rù" @@ -817,10 +786,6 @@ msgstr "CircuitPython de héxīn chūxiàn gùzhàng. Āiyā!\n" msgid "CircuitPython was unable to allocate the heap." msgstr "CircuitPython wúfǎ fēnpèi duī." -#: 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." - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "Shízhōng shēnzhǎn tài zhǎng" @@ -829,11 +794,6 @@ msgstr "Shízhōng shēnzhǎn tài zhǎng" msgid "Clock unit in use" msgstr "Shǐyòng shízhōng dānwèi" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -msgid "Command must be an int between 0 and 255" -msgstr "Mìnglìng bìxū shì 0 dào 255 zhī jiān de int" - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -844,35 +804,6 @@ msgstr "Liánjiē yǐ duàn kāi, wúfǎ zài shǐyòng. Chuàngjiàn yīgè xī msgid "Corrupt .mpy file" msgstr "Fǔbài de .mpy wénjiàn" -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Could not initialize Camera" -msgstr "Wúfǎ chūshǐhuà xiàngjī" - -#: ports/cxd56/common-hal/gnss/GNSS.c -msgid "Could not initialize GNSS" -msgstr "wú fǎ chū shǐ huà GNSS" - -#: ports/cxd56/common-hal/sdioio/SDCard.c -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/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "Wúfǎ chūshǐhuà UART" - -#: 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/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/pwmio/PWMOut.c -msgid "Could not restart PWM" -msgstr "Wúfǎ chóngqǐ PWM" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "Wúfǎ huòqǔ shízhōng" @@ -893,20 +824,6 @@ msgstr "Wúfǎ qǐdòng zhōngduàn,RX máng" msgid "Couldn't allocate decoder" msgstr "Zhǎo bù dào jiěmǎ qì" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate first buffer" -msgstr "Wúfǎ fēnpèi dì yī gè huǎnchōng qū" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate input buffer" -msgstr "Wúfǎ fēnpèi shūrù huǎnchōng qū" - -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate second buffer" -msgstr "Wúfǎ fēnpèi dì èr gè huǎnchōng qū" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "Zhuìhuǐ. Shūrù HardFault_Handler." @@ -955,10 +872,6 @@ msgstr "Mùbiāo róngliàng xiǎoyú mùdì de_chángdù." msgid "Device in use" msgstr "Zhèngzài shǐyòng de shèbèi" -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -msgstr "Gěi dìng de yǐn jiǎo bù zhīchí DigitalInOut" - #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." @@ -1014,11 +927,6 @@ msgstr "Yùqí %q" msgid "Expected an alarm" msgstr "yù qī yǒu jǐng bào" -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "Qīwàng de chángdù wèi %d de yuán zǔ, dédào %d" - #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." @@ -1045,22 +953,6 @@ msgstr "Fāsòng mìnglìng shībài." msgid "Failed to acquire mutex, err 0x%04x" msgstr "Wúfǎ huòdé mutex, err 0x%04x" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -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/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/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/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "Wúfǎ fēnpèi Wifi nèicún" @@ -1132,11 +1024,6 @@ msgstr "" msgid "Format not supported" msgstr "Bù zhīyuán géshì" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" -msgstr "zhēn huǎn chōng qū xū yào %d zì jié" - #: ports/mimxrt10xx/common-hal/microcontroller/Processor.c msgid "" "Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" @@ -1152,6 +1039,10 @@ msgstr "Pínlǜ bìxū yǔ shǐyòng cǐ jìshí qì de xiàn yǒu PWMOut xiāng msgid "Function requires lock" msgstr "Hánshù xūyào suǒdìng" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "tōng yòng gù zhàng" @@ -1179,17 +1070,13 @@ 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 "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" msgstr "Wénjiàn shàng de I/ O cāozuò" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "I2C chūshǐhuà cuòwù" +msgid "I2C init error" +msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c msgid "I2C peripheral in use" @@ -1303,75 +1190,33 @@ msgstr "nèi bù cuò wù" msgid "Internal error #%d" msgstr "nèi bù cuò wù #%d" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: py/argcheck.c msgid "Invalid %q" msgstr "wú xiào %q" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c 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/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é" - #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "Wúxiào de ADC dānwèi zhí" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "wú xiào AuthMode" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "wú xiào BLE cān shù" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "Wúxiào de BMP wénjiàn" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "Wúxiào de BSSID" -#: ports/espressif/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" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "wú xiào de MAC dì zhǐ" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "wú xiào de MIDI wén jiàn" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "Wúxiào de PWM pínlǜ" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "wú xiào yǐn jiǎo" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "Wúxiào de cānshù" @@ -1379,42 +1224,11 @@ msgstr "Wúxiào de cānshù" msgid "Invalid bits per value" msgstr "Měi gè zhí de wèi wúxiào" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "Wúxiào de huǎnchōng qū dàxiǎo" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "Wúxiào de zì jié shùnxù zìfú chuàn" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "Wúxiào de bǔhuò zhōuqí. Yǒuxiào fànwéi: 1-500" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "Wúxiào de tōngdào jìshù" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "wú xiào data_count %d" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "wú xiào data_pins[%d]" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "Wúxiào de fāngxiàng." - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "Wúxiào de wénjiàn" - #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Géshì kuài dàxiǎo wúxiào" @@ -1423,78 +1237,14 @@ msgstr "Géshì kuài dàxiǎo wúxiào" msgid "Invalid memory access." msgstr "Wúxiào de nèicún fǎngwèn." -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "wú xiào mó shì" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "wú xiào de duō bō MAC dì zhǐ" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "Wèi shù wúxiào" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -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 -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "Wúxiào de yǐn jiǎo" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "Zuǒ tōngdào de yǐn jiǎo wúxiào" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -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/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/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "Wúxiào de yǐn jiǎo" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "Wúxiào liǎng jí zhí" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "Wúxiào de shǔxìng" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "Wúxiào de yùnxíng móshì." - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "Ānquán móshì wúxiào" - #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "dà xiǎo wú xiào" @@ -1507,23 +1257,6 @@ msgstr "TLS de chā zuò wú xiào" msgid "Invalid state" msgstr "wú xiào zhuàng tài" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "Yǔyīn wúxiào" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "Wúxiào de yǔyīn jìshù" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "Wúxiào de làng làngcháo wénjiàn" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -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 "mì yào bì xū wéi 16, 24 huò 32 zì jié cháng" @@ -1537,25 +1270,17 @@ msgid "LHS of keyword arg must be an id" msgstr "Guānjiàn zì arg de LHS bìxū shì id" #: shared-module/displayio/Group.c -msgid "Layer already in a group." -msgstr "Tú céng yǐjīng zài yīgè zǔ zhōng." +msgid "Layer already in a group" +msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." -msgstr "Layer bìxū shì Group huò TileGrid zi lèi." +msgid "Layer must be a Group or TileGrid subclass" +msgstr "" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "MAC dì zhǐ wú xiào" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "MISO yǐn jiǎo chūshǐhuà shībài." - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "MOSI yǐn jiǎo shūrù shībài." - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "yìng shè bì xū shì yuán zǔ" @@ -1565,10 +1290,6 @@ msgstr "yìng shè bì xū shì yuán zǔ" 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 "Yóujiàn xiànzhì wèi 8 gè zì jié" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Màikèfēng qǐdòng yánchí bìxū zài 0.0 Dào 1.0 De fànwéi nèi" @@ -1582,10 +1303,14 @@ msgstr "" msgid "Mismatched swap flag" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "Quēshǎo MISO huò MOSI yǐn jiǎo" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1622,11 +1347,6 @@ msgstr "quē shǎo dì yī zǔ yǐn jiǎo. zhǐ lìng %d shè zhì yǐn jiǎo" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "shī zōng de jmp_pin. zhǐ lìng %d zài yǐn jiǎo shàng tiào yuè" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "chāo guò %d bào gào bù zhī chí de ID" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "Bìxū shì %q zi lèi." @@ -1687,15 +1407,23 @@ msgid "No I2C device at address: 0x%x" msgstr "dì zhǐ: 0x%x shí méi yǒu I2C qì jiàn" #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "Méiyǒu MISO yǐn jiǎo" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Méiyǒu MOSI yǐn jiǎo" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1734,16 +1462,6 @@ msgstr "Méiyǒu miǎnfèi de GCLKs" msgid "No hardware random available" msgstr "Méiyǒu kěyòng de yìngjiàn suíjī" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "Shízhōng yǐn jiǎo wú yìngjiàn zhīchí" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "Méiyǒu zài yǐn jiǎo shàng de yìngjiàn zhīchí" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "chéng xù zhōng méi yǒu" @@ -1893,10 +1611,13 @@ msgid "Only one address is allowed" msgstr "zhǐ yǔn xǔ yí gè dì zhǐ" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "zhǐ néng shè zhì yí gè bào jǐng." @@ -1928,11 +1649,6 @@ msgstr "tào jiē zì wài" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "huǎn chōng wài yuán sù bì xū <= 4 zì jié cháng" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "shū chū huǎn chōng qū bì xū zhì shǎo wéi %d zì jié" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Guò cǎiyàng bìxū shì 8 de bèishù." @@ -1941,17 +1657,15 @@ msgstr "Guò cǎiyàng bìxū shì 8 de bèishù." msgid "PDMIn not available" msgstr "PDMIn bù kě yòng" -#: 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/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ě." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" +msgstr "" + #: ports/raspberrypi/common-hal/countio/Counter.c msgid "PWM slice already in use" msgstr "yǐ jīng zài shǐ yòng de PWM qiē piàn" @@ -1968,29 +1682,14 @@ msgstr "shǐ yòng zhōng de wài shè" msgid "Permission denied" msgstr "Quánxiàn bèi jùjué" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "yǐn jiǎo wú fǎ cóng shēn dù shuì mián zhōng huàn xǐng" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "yǐn jiǎo jì shù bì xū zhì shǎo wéi 1" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "yǐn jiǎo jì shù tài dà" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "Pin méiyǒu ADC nénglì" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2062,18 +1761,10 @@ msgstr "chéng xù zài bù jiā zǎi ISR de qíng kuàng xià wán chéng" msgid "Program does OUT without loading OSR" msgstr "chéng xù zài bù jiā zǎi Osr de qíng kuàng xià zhí xíng OUT" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "chéng xù bì xū zhì shǎo bāo hán yí gè 16 wèi zhǐ lìng ." - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "chéng xù dà xiǎo wú xiào" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "chéng xù tài dà" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Fāngxiàng shūchū shí Pull méiyǒu shǐyòng." @@ -2095,30 +1786,20 @@ msgstr "RNG qǔxiāo chūshǐhuà cuòwù" msgid "RNG Init Error" msgstr "RNG chūshǐhuà cuòwù" -#: ports/nrf/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" -msgstr "RS485 cǐ shè bèi shàng bù zhī chí" +#: 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 "RS485" +msgstr "" #: ports/espressif/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/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/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" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "Cǐ bǎn bù zhīchí RTC" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/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 gāi shèbèi shàng bù zhīchí" - #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" msgstr "Suíjī shù shēngchéng cuòwù" @@ -2168,6 +1849,10 @@ msgstr "Zài ānquán móshì xià yùnxíng! Bù yùnxíng yǐ bǎocún de dài msgid "SD card CSD format not supported" msgstr "Bù zhīchí SD kǎ CSD géshì" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2178,30 +1863,21 @@ msgstr "SDIO GetCardInfo Cuòwù %d" msgid "SDIO Init Error %d" msgstr "SDIO Init Cuòwù %d" -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "SPI chūshǐhuà cuòwù" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "SPI chóngxīn chūshǐhuà cuòwù" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "SPI pèi zhì shī bài" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "SPI wài shè zhèng zài shǐ yòng zhōng" -#: shared-bindings/audiomixer/Mixer.c -msgid "Sample rate must be positive" -msgstr "Cǎiyàng lǜ bìxū wèi zhèng shù" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" -msgstr "Cǎiyàng lǜ tài gāo. Tā bìxū xiǎoyú %d" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" +msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c msgid "Scale dimensions must divide by 3" @@ -2221,14 +1897,6 @@ msgstr "Xùliè huà yǐjīng shǐyòngguò" msgid "Server side context cannot have hostname" msgstr "Fúwùqì duān shàngxiàwén bùnéng jùyǒu zhǔjī míng" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "shè zhì yǐn jiǎo shù bì xū jiè yú 1 hé 5 zhī jiān" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "cè miàn shè zhì yǐn jiǎo shù bì xū jiè yú 1 hé 5 zhī jiān" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "bù zhī chí dà xiǎo" @@ -2264,10 +1932,6 @@ msgstr "zhǐ dìng data0 huò data_pins zhōng de yí gè" msgid "Splitting with sub-captures" msgstr "Yǔ zi bǔhuò fēnliè" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "Duīzhàn dàxiǎo bìxū zhìshǎo 256" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "lì tǐ shēng zuǒ bì xū shì zài PWM tōng dào A" @@ -2362,10 +2026,6 @@ msgstr "Píng pū gāodù bìxū huàfēn wèi tú gāodù" msgid "Tile index out of bounds" msgstr "Píng pū zhǐshù chāochū fànwéi" -#: shared-bindings/displayio/TileGrid.c -msgid "Tile value out of bounds" -msgstr "Píng pū zhí chāochū fànwéi" - #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" msgstr "Píng pū kuāndù bìxū huàfēn wèi tú kuāndù" @@ -2385,6 +2045,9 @@ 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 "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Chōuyàng zhōng de píndào tài duō." @@ -2417,24 +2080,21 @@ msgid "Tuple or struct_time argument required" msgstr "Xūyào Tuple huò struct_time cānshù" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "UART huǎnchōng qū fēnpèi cuòwù" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" +msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "UART qǔxiāo chūshǐhuà cuòwù" +msgid "UART re-init" +msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "UART chūshǐhuà cuòwù" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "UART chóngxīn chūshǐhuà cuòwù" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" -msgstr "UART xiě cuòwù" +msgid "UART write" +msgstr "" #: shared-module/usb_hid/Device.c msgid "USB busy" @@ -2572,12 +2232,6 @@ msgstr "" "Wèi zhǐdìng de wèntí. Kěnéng shì qítā shèbèi shàng de pèiduì tíshì bèi jùjué " "huò hūlüè." -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "Bù zhīchí de baudrate" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "bú zhī chí de sè cǎi kōng jiān" @@ -2658,10 +2312,6 @@ msgstr "" "\n" "liè chū nèi zhì mó kuài jiàn rù `help(\"modules\")`.\n" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" -msgstr "WiFi mìmǎ bìxū jiè yú 8 dào 63 gè zìfú zhī jiān" - #: main.c msgid "Woken up by alarm.\n" msgstr "bèi jǐng bào chǎo xǐng.\n" @@ -2816,10 +2466,6 @@ msgstr "wèi tú dà xiǎo bì xū pǐ pèi" msgid "bits must be 32 or less" msgstr "wèi bì xū shì 32 huò gèng shǎo" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "wèi bì xū zài fàn wéi nèi 5 zhì 9" - #: 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" @@ -2857,11 +2503,6 @@ msgstr "huǎn chōng qū tài xiǎo, duì yú qǐng qiú de zì jié" msgid "byteorder is not a string" msgstr "byteorder bùshì zìfú chuàn" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -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 "zì jié chángdù, bùshì xiàngmù dàxiǎo de bèishù" @@ -2870,7 +2511,7 @@ msgstr "zì jié chángdù, bùshì xiàngmù dàxiǎo de bèishù" 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/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "jiàozhǔn fànwéi chāochū fànwéi" @@ -2878,13 +2519,10 @@ msgstr "jiàozhǔn fànwéi chāochū fànwéi" msgid "calibration is read only" msgstr "jiàozhǔn zhǐ dú dào" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "jiàozhǔn zhí chāochū fànwéi +/-127" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" -msgstr "zhǐ néng zài yí gè jiā zhǎng zhōng zhù cè" +msgid "can only have one parent" +msgstr "" #: py/emitinlinethumb.c msgid "can only have up to 4 parameters to Thumb assembly" @@ -3055,6 +2693,10 @@ msgstr "bù néng háo bù hán hu de dé dào dà xiǎo de lín" msgid "casting" msgstr "tóuyǐng" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "zìfú huǎnchōng qū tài xiǎo" @@ -3067,10 +2709,6 @@ msgstr "chr() cān shǔ bùzài fànwéi (0x110000)" msgid "chr() arg not in range(256)" 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 "quānzi zhǐ néng zài yī wèi jiāzhǎng zhōng zhùcè" - #: shared-bindings/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "jiá dian bì xū shì (x,y) kuài" @@ -3500,6 +3138,10 @@ msgstr "suǒyǐn bìxū shì zhěngshù" msgid "indices must be integers, slices, or Boolean lists" msgstr "suǒyǐn bìxū shì zhěngshù, qiēpiàn huò bù'ěr zhí lièbiǎo" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "chūshǐ zhí bìxū shì kě diédài de" @@ -3751,10 +3393,6 @@ msgstr "shùxué yù cuòwù" msgid "matrix is not positive definite" msgstr "jǔzhèn bùshì zhèngdìng de" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "max_connections bì xū jiè yú 0 hé 10 zhī jiān" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3762,10 +3400,6 @@ msgstr "max_connections bì xū jiè yú 0 hé 10 zhī jiān" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "dāng fixed_length de zhí wéi %s shí, max_length bì xū wéi 0-%d" -#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c -msgid "max_length must be >= 0" -msgstr "zuì dà cháng dù bì xū >= 0" - #: extmod/ulab/code/ndarray.c msgid "maximum number of dimensions is 4" msgstr "zuì dà chǐ cùn shù wéi 4" @@ -4136,10 +3770,6 @@ msgstr "pixel_shader bìxū shì displayio.Palette huò displayio.ColorConverter msgid "poll on file not available on win32" msgstr "zài win32 shàng bù tí gōng wén jiàn tóu piào" -#: shared-module/vectorio/Polygon.c -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/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "cóng kōng mài chōng tán chū" @@ -4186,14 +3816,6 @@ msgstr "qǐ dòng shí àn xià zuǒ àn niǔ\n" msgid "pull masks conflict with direction masks" msgstr "lā kǒu zhào yǔ fāng xiàng miàn mó chōng tū" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "lā lì yù zhí bì xū jiè yú 1 hé 32 zhī jiān" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "tuī sòng yù zhí bì xū jiè yú 1 hé 32 zhī jiān" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "duìliè yìchū" @@ -4369,10 +3991,6 @@ msgstr "kāishǐ_x yīnggāi shì yīgè zhěngshù" msgid "step must be non-zero" msgstr "bùzhòu bìxū shìfēi líng" -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "tíngzhǐ bìxū wèi 1 huò 2" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "tíngzhǐ wúfǎ cóng kāishǐ zhōng zhǎodào" @@ -4421,10 +4039,6 @@ msgstr "uctypes miáoshù fú zhōng de yǔfǎ cuòwù" msgid "threshold must be in the range 0-65536" msgstr "yùzhí bìxū zài fànwéi 0-65536" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "cí tiē bì xū dà yú líng" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() xūyào 9 xùliè" @@ -4444,10 +4058,6 @@ msgstr "Chāo shí shíjiān bìxū wèi 0.0 Dào 100.0 Miǎo" msgid "timeout must be < 655.35 secs" msgstr "chāo shí bì xū < 655.35 miǎo" -#: shared-bindings/_bleio/CharacteristicBuffer.c -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 "děngdài v1 kǎ chāoshí" @@ -4456,6 +4066,10 @@ msgstr "děngdài v1 kǎ chāoshí" msgid "timeout waiting for v2 card" msgstr "děngdài v2 kǎ chāoshí" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +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" @@ -4647,13 +4261,7 @@ msgstr "wèi chū shǐ huà jiān shì qì" msgid "watchdog timeout must be greater than 0" msgstr "kān mén gǒu chāoshí bìxū dàyú 0" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "kuān dù bì xū cóng 2 dào 8 ( hán ), ér bù shì %d" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "kuāndù bìxū dàyú líng" @@ -4725,6 +4333,352 @@ msgstr "zi bìxū wèi fú diǎn xíng" msgid "zi must be of shape (n_section, 2)" msgstr "zi bìxū jùyǒu xíngzhuàng (n_section,2)" +#~ msgid "%q must be a tuple of length 2" +#~ msgstr "%q bìxū shì chángdù wèi 2 de yuánzǔ" + +#~ msgid "%q must be between %d and %d" +#~ msgstr "%q bì xū zài %d hé %d zhī jiān" + +#~ msgid "%q should be an int" +#~ msgstr "%q yīnggāi shì yīgè zhěngshù (int)" + +#~ msgid "(x,y) integers required" +#~ msgstr "xūyào zhěngshù (x,y)" + +#~ msgid "Address type out of range" +#~ msgstr "Dìzhǐ lèixíng chāochū fànwéi" + +#~ msgid "AnalogIn not supported on given pin" +#~ msgstr "gěidìng de yǐnjiǎo bù zhīchí AnalogIn" + +#~ msgid "AnalogOut functionality not supported" +#~ msgstr "Bù zhīchí AnalogOut gōngnéng" + +#~ msgid "AnalogOut is only 16 bits. Value must be less than 65536." +#~ msgstr "AnalogOut jǐn wèi 16 wèi. Zhí bìxū xiǎoyú 65536." + +#~ msgid "AnalogOut not supported on given pin" +#~ msgstr "zhǐdìng de yǐn jiǎo bù zhīchí AnalogOut" + +#, c-format +#~ msgid "Bit depth must be from 1 to 6 inclusive, not %d" +#~ msgstr "wèi shēndù bìxū shì 1 dào 6, ér búshì %d" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "Huǎnchōng qū dàxiǎo bù zhèngquè. Yīnggāi shì %d zì jié." + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "Huǎnchōng qū bìxū zhìshǎo chángdù wéi 1" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "Zìjié bìxū jiè yú 0 dào 255 zhījiān." + +#~ msgid "Cannot output both channels on the same pin" +#~ msgstr "Wúfǎ shūchū tóng yīgè yǐn jiǎo shàng de liǎng gè píndào" + +#~ msgid "Cannot read without MISO pin." +#~ msgstr "Wúfǎ dòu qǔ méiyǒu MISO de yǐn jiǎo." + +#~ msgid "Cannot reset into bootloader because no bootloader is present." +#~ msgstr "Wúfǎ chóng zhì wèi bootloader, yīnwèi méiyǒu bootloader cúnzài." + +#~ msgid "Cannot transfer without MOSI and MISO pins." +#~ msgstr "Méiyǒu MOSI/MISO jiù wúfǎ zhuǎnyí." + +#~ msgid "Cannot write without MOSI pin." +#~ msgstr "Wúfǎ xiě rù MOSI de yǐn jiǎo." + +#~ msgid "Clock pin init failed." +#~ msgstr "Shízhōng de yǐn jiǎo chūshǐhuà shībài." + +#~ msgid "Command must be an int between 0 and 255" +#~ msgstr "Mìnglìng bìxū shì 0 dào 255 zhī jiān de int" + +#~ msgid "Could not initialize Camera" +#~ msgstr "Wúfǎ chūshǐhuà xiàngjī" + +#~ msgid "Could not initialize GNSS" +#~ msgstr "wú fǎ chū shǐ huà GNSS" + +#~ msgid "Could not initialize SDCard" +#~ msgstr "wú fǎ chū shǐ huà SDCard" + +#~ msgid "Could not initialize UART" +#~ msgstr "Wúfǎ chūshǐhuà UART" + +#~ msgid "Could not re-init channel" +#~ msgstr "Wúfǎ chóngxīn chūshǐhuà píndào" + +#~ msgid "Could not re-init timer" +#~ msgstr "Wúfǎ chóngxīn qǐdòng jìshí qì" + +#~ msgid "Could not restart PWM" +#~ msgstr "Wúfǎ chóngqǐ PWM" + +#~ msgid "Couldn't allocate first buffer" +#~ msgstr "Wúfǎ fēnpèi dì yī gè huǎnchōng qū" + +#~ msgid "Couldn't allocate input buffer" +#~ msgstr "Wúfǎ fēnpèi shūrù huǎnchōng qū" + +#~ msgid "Couldn't allocate second buffer" +#~ msgstr "Wúfǎ fēnpèi dì èr gè huǎnchōng qū" + +#~ msgid "DigitalInOut not supported on given pin" +#~ msgstr "Gěi dìng de yǐn jiǎo bù zhīchí DigitalInOut" + +#, c-format +#~ msgid "Expected tuple of length %d, got %d" +#~ msgstr "Qīwàng de chángdù wèi %d de yuán zǔ, dédào %d" + +#~ msgid "Failed to allocate RX buffer" +#~ msgstr "Fēnpèi RX huǎnchōng shībài" + +#, 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" + +#, c-format +#~ msgid "Framebuffer requires %d bytes" +#~ msgstr "zhēn huǎn chōng qū xū yào %d zì jié" + +#~ msgid "Hostname must be between 1 and 253 characters" +#~ msgstr "zhǔ jī míng bì xū jiè yú 1 hé 253 gè zì fú zhī jiān" + +#~ msgid "I2C Init Error" +#~ msgstr "I2C chūshǐhuà cuòwù" + +#~ msgid "Invalid %q pin selection" +#~ msgstr "wú xiào %q yǐn jiǎo xuǎn zé" + +#~ msgid "Invalid AuthMode" +#~ msgstr "wú xiào AuthMode" + +#~ msgid "Invalid BMP file" +#~ 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" + +#~ msgid "Invalid MIDI file" +#~ msgstr "wú xiào de MIDI wén jiàn" + +#~ msgid "Invalid PWM frequency" +#~ msgstr "Wúxiào de PWM pínlǜ" + +#~ msgid "Invalid Pin" +#~ msgstr "wú xiào yǐn jiǎo" + +#~ msgid "Invalid buffer size" +#~ msgstr "Wúxiào de huǎnchōng qū dàxiǎo" + +#~ msgid "Invalid byteorder string" +#~ msgstr "Wúxiào de zì jié shùnxù zìfú chuàn" + +#~ msgid "Invalid capture period. Valid range: 1 - 500" +#~ msgstr "Wúxiào de bǔhuò zhōuqí. Yǒuxiào fànwéi: 1-500" + +#~ msgid "Invalid channel count" +#~ msgstr "Wúxiào de tōngdào jìshù" + +#, c-format +#~ msgid "Invalid data_count %d" +#~ msgstr "wú xiào data_count %d" + +#~ msgid "Invalid direction." +#~ msgstr "Wúxiào de fāngxiàng." + +#~ msgid "Invalid file" +#~ msgstr "Wúxiào de wénjiàn" + +#~ msgid "Invalid mode" +#~ msgstr "wú xiào mó shì" + +#~ msgid "Invalid number of bits" +#~ msgstr "Wèi shù wúxiào" + +#~ msgid "Invalid phase" +#~ msgstr "Jiēduàn wúxiào" + +#~ msgid "Invalid pin" +#~ msgstr "Wúxiào de yǐn jiǎo" + +#~ msgid "Invalid pin for left channel" +#~ msgstr "Zuǒ tōngdào de yǐn jiǎo wúxiào" + +#~ msgid "Invalid pin for right channel" +#~ msgstr "Yòuxián tōngdào yǐn jiǎo wúxiào" + +#~ msgid "Invalid polarity" +#~ msgstr "Wúxiào liǎng jí zhí" + +#~ msgid "Invalid properties" +#~ msgstr "Wúxiào de shǔxìng" + +#~ msgid "Invalid run mode." +#~ msgstr "Wúxiào de yùnxíng móshì." + +#~ msgid "Invalid security_mode" +#~ msgstr "Ānquán móshì wúxiào" + +#~ msgid "Invalid voice" +#~ msgstr "Yǔyīn wúxiào" + +#~ msgid "Invalid voice count" +#~ msgstr "Wúxiào de yǔyīn jìshù" + +#~ msgid "Invalid wave file" +#~ msgstr "Wúxiào de làng làngcháo wénjiàn" + +#~ msgid "Invalid word/bit length" +#~ msgstr "Wúxiào de zì/wèi chángdù" + +#~ msgid "Layer already in a group." +#~ msgstr "Tú céng yǐjīng zài yīgè zǔ zhōng." + +#~ msgid "Layer must be a Group or TileGrid subclass." +#~ msgstr "Layer bìxū shì Group huò TileGrid zi lèi." + +#~ msgid "MISO pin init failed." +#~ msgstr "MISO yǐn jiǎo chūshǐhuà shībài." + +#~ msgid "MOSI pin init failed." +#~ msgstr "MOSI yǐn jiǎo shūrù shībài." + +#~ msgid "Messages limited to 8 bytes" +#~ msgstr "Yóujiàn xiànzhì wèi 8 gè zì jié" + +#, c-format +#~ msgid "More than %d report ids not supported" +#~ msgstr "chāo guò %d bào gào bù zhī chí de ID" + +#~ msgid "No hardware support on clk pin" +#~ msgstr "Shízhōng yǐn jiǎo wú yìngjiàn zhīchí" + +#~ msgid "No hardware support on pin" +#~ msgstr "Méiyǒu zài yǐn jiǎo shàng de yìngjiàn zhīchí" + +#, c-format +#~ msgid "Output buffer must be at least %d bytes" +#~ msgstr "shū chū huǎn chōng qū bì xū zhì shǎo wéi %d zì jié" + +#~ 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ǜ)" + +#~ msgid "Pin count must be at least 1" +#~ msgstr "yǐn jiǎo jì shù bì xū zhì shǎo wéi 1" + +#~ msgid "Pin does not have ADC capabilities" +#~ msgstr "Pin méiyǒu ADC nénglì" + +#~ msgid "Program must contain at least one 16-bit instruction." +#~ msgstr "chéng xù bì xū zhì shǎo bāo hán yí gè 16 wèi zhǐ lìng ." + +#~ msgid "Program too large" +#~ msgstr "chéng xù tài dà" + +#~ msgid "RS485 Not yet supported on this device" +#~ msgstr "RS485 cǐ shè bèi shàng bù zhī chí" + +#~ msgid "RTC calibration is not supported on this board" +#~ msgstr "Cǐ bǎn bù zhīchí RTC jiàozhǔn" + +#~ msgid "RTS/CTS/RS485 Not yet supported on this device" +#~ msgstr "RTS/CTS/RS485 gāi shèbèi shàng bù zhīchí" + +#~ msgid "SPI Init Error" +#~ msgstr "SPI chūshǐhuà cuòwù" + +#~ msgid "SPI Re-initialization error" +#~ msgstr "SPI chóngxīn chūshǐhuà cuòwù" + +#~ msgid "Sample rate must be positive" +#~ msgstr "Cǎiyàng lǜ bìxū wèi zhèng shù" + +#, c-format +#~ msgid "Sample rate too high. It must be less than %d" +#~ msgstr "Cǎiyàng lǜ tài gāo. Tā bìxū xiǎoyú %d" + +#~ msgid "Set pin count must be between 1 and 5" +#~ msgstr "shè zhì yǐn jiǎo shù bì xū jiè yú 1 hé 5 zhī jiān" + +#~ msgid "Side set pin count must be between 1 and 5" +#~ msgstr "cè miàn shè zhì yǐn jiǎo shù bì xū jiè yú 1 hé 5 zhī jiān" + +#~ msgid "Stack size must be at least 256" +#~ msgstr "Duīzhàn dàxiǎo bìxū zhìshǎo 256" + +#~ msgid "Tile value out of bounds" +#~ msgstr "Píng pū zhí chāochū fànwéi" + +#~ msgid "UART Buffer allocation error" +#~ msgstr "UART huǎnchōng qū fēnpèi cuòwù" + +#~ msgid "UART De-init error" +#~ msgstr "UART qǔxiāo chūshǐhuà cuòwù" + +#~ msgid "UART Init Error" +#~ msgstr "UART chūshǐhuà cuòwù" + +#~ msgid "UART Re-init error" +#~ msgstr "UART chóngxīn chūshǐhuà cuòwù" + +#~ msgid "UART write error" +#~ msgstr "UART xiě cuòwù" + +#~ msgid "Unsupported baudrate" +#~ msgstr "Bù zhīchí de baudrate" + +#~ msgid "WiFi password must be between 8 and 63 characters" +#~ msgstr "WiFi mìmǎ bìxū jiè yú 8 dào 63 gè zìfú zhī jiān" + +#~ msgid "bits must be in range 5 to 9" +#~ msgstr "wèi bì xū zài fàn wéi nèi 5 zhì 9" + +#~ msgid "bytes > 8 bits not supported" +#~ msgstr "zì jié > 8 wèi" + +#~ msgid "calibration value out of range +/-127" +#~ msgstr "jiàozhǔn zhí chāochū fànwéi +/-127" + +#~ msgid "can only be registered in one parent" +#~ msgstr "zhǐ néng zài yí gè jiā zhǎng zhōng zhù cè" + +#~ msgid "circle can only be registered in one parent" +#~ msgstr "quānzi zhǐ néng zài yī wèi jiāzhǎng zhōng zhùcè" + +#~ msgid "max_connections must be between 0 and 10" +#~ msgstr "max_connections bì xū jiè yú 0 hé 10 zhī jiān" + +#~ msgid "max_length must be >= 0" +#~ msgstr "zuì dà cháng dù bì xū >= 0" + +#~ 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è" + +#~ msgid "pull_threshold must be between 1 and 32" +#~ msgstr "lā lì yù zhí bì xū jiè yú 1 hé 32 zhī jiān" + +#~ msgid "push_threshold must be between 1 and 32" +#~ msgstr "tuī sòng yù zhí bì xū jiè yú 1 hé 32 zhī jiān" + +#~ msgid "stop must be 1 or 2" +#~ msgstr "tíngzhǐ bìxū wèi 1 huò 2" + +#~ msgid "tile must be greater than zero" +#~ msgstr "cí tiē bì xū dà yú líng" + +#~ msgid "timeout must be >= 0.0" +#~ msgstr "chāoshí bìxū shì >= 0.0" + +#, c-format +#~ msgid "width must be from 2 to 8 (inclusive), not %d" +#~ msgstr "kuān dù bì xū cóng 2 dào 8 ( hán ), ér bù shì %d" + #~ msgid "Unsupported operation" #~ msgstr "Bù zhīchí de cāozuò" From e852b28bb234fa8a0af5cb8720a5dca540d4f66c Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 20 May 2022 17:52:35 -0400 Subject: [PATCH 115/246] update pico-sdk to 1.3.1 --- ports/raspberrypi/sdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/raspberrypi/sdk b/ports/raspberrypi/sdk index 2062372d20..426e46126b 160000 --- a/ports/raspberrypi/sdk +++ b/ports/raspberrypi/sdk @@ -1 +1 @@ -Subproject commit 2062372d203b372849d573f252cf7c6dc2800c0a +Subproject commit 426e46126b5a1efaea4544cdb71ab81b61983034 From 3e47d24fb9ad544c2af33e04a365808412afd38b Mon Sep 17 00:00:00 2001 From: dahanzimin <353767514@qq.com> Date: Sat, 21 May 2022 10:52:14 +0800 Subject: [PATCH 116/246] Update submodule and create tag --- ports/espressif/boards/mixgo_ce_udisk/cp_lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/boards/mixgo_ce_udisk/cp_lib b/ports/espressif/boards/mixgo_ce_udisk/cp_lib index d6bb0f58f6..8b6cd888b2 160000 --- a/ports/espressif/boards/mixgo_ce_udisk/cp_lib +++ b/ports/espressif/boards/mixgo_ce_udisk/cp_lib @@ -1 +1 @@ -Subproject commit d6bb0f58f62983f11e771c5ec91c934eb6ff2b82 +Subproject commit 8b6cd888b264abaf8f9b1904b09b01313b273bb2 From 199e2ef2fcc46007ee64d7e66817f80ab72b0cc5 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sat, 21 May 2022 00:04:53 -0400 Subject: [PATCH 117/246] Turn on f-strings for all builds --- py/circuitpy_mpconfig.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 03dca0321c..1c4430525e 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -213,7 +213,7 @@ typedef long mp_off_t; #define MICROPY_CPYTHON_COMPAT (CIRCUITPY_FULL_BUILD) #endif #define MICROPY_PY_BUILTINS_POW3 (CIRCUITPY_BUILTINS_POW3) -#define MICROPY_PY_FSTRINGS (MICROPY_CPYTHON_COMPAT) +#define MICROPY_PY_FSTRINGS (1) #define MICROPY_MODULE_WEAK_LINKS (0) #define MICROPY_PY_ALL_SPECIAL_METHODS (CIRCUITPY_FULL_BUILD) #ifndef MICROPY_PY_BUILTINS_COMPLEX From 338e14d9d4ecb736ebcf7f621323f7c6e7e944e3 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sat, 21 May 2022 08:52:40 -0400 Subject: [PATCH 118/246] shrink arduino_mkr1300 --- ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk index c3d75202bf..abbdbe87ef 100644 --- a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk @@ -9,3 +9,5 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 + +CIRCUITPY_RAINBOWIO = 0 From 6b04b7efc839e07e17c1bfce8b98826aa680a1d2 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Sat, 21 May 2022 12:09:23 -0500 Subject: [PATCH 119/246] display brightness pwm 500hz frequency --- shared-module/displayio/Display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index 255cd49e06..5fab660268 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -116,7 +116,7 @@ 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_PWMIO) - pwmout_result_t result = common_hal_pwmio_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, 500, false); if (result != PWMOUT_OK) { self->backlight_inout.base.type = &digitalio_digitalinout_type; common_hal_digitalio_digitalinout_construct(&self->backlight_inout, backlight_pin); From 9fe57d27e43f07d77b1ffbf3a09d23de34d94021 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Sat, 21 May 2022 13:06:41 +0000 Subject: [PATCH 120/246] Translated using Weblate (Swedish) Currently translated at 100.0% (982 of 982 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 70 ++++++++++++++++++++++++++-------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 7703cbbda3..c7388049fa 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-05-14 12:35+0000\n" +"PO-Revision-Date: 2022-05-22 00:18+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -82,7 +82,7 @@ msgstr "" #: ports/raspberrypi/common-hal/analogio/AnalogOut.c #: ports/raspberrypi/common-hal/rtc/RTC.c msgid "%q" -msgstr "" +msgstr "%q" #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" @@ -90,7 +90,7 @@ msgstr "%q och %q innehåller duplicerade pinnar" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "%q and %q must be different" -msgstr "" +msgstr "%q och %q måste vara olika" #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" @@ -114,11 +114,11 @@ msgstr "Indexet %q måste vara ett heltal, inte %s" #: shared-module/bitbangio/SPI.c msgid "%q init failed" -msgstr "" +msgstr "%q init misslyckades" #: py/argcheck.c msgid "%q length must be %d" -msgstr "" +msgstr "längden på %q måste vara %d" #: py/argcheck.c msgid "%q length must be %d-%d" @@ -126,11 +126,11 @@ msgstr "längden på %q måste vara %d-%d" #: py/argcheck.c msgid "%q length must be <= %d" -msgstr "" +msgstr "längden på %q måste vara <= %d" #: py/argcheck.c msgid "%q length must be >= %d" -msgstr "" +msgstr "längden på %q måste vara >= %d" #: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" @@ -138,7 +138,7 @@ msgstr "längden på %q måste vara >= 1" #: py/argcheck.c msgid "%q must be %d" -msgstr "" +msgstr "%q måste vara %d" #: py/argcheck.c msgid "%q must be %d-%d" @@ -170,7 +170,7 @@ msgstr "%q måste vara en sträng" #: py/argcheck.c msgid "%q must be an int" -msgstr "" +msgstr "%q måste vara en int" #: py/argcheck.c msgid "%q must be of type %q" @@ -662,7 +662,7 @@ msgstr "Anropa super().__init__() innan du använder det ursprungliga objektet." #: ports/cxd56/common-hal/camera/Camera.c msgid "Camera init" -msgstr "" +msgstr "Kamera init" #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." @@ -729,7 +729,7 @@ msgstr "Det går inte att montera om '/' när den är synlig via 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 "Kan inte återställa till bootloader eftersom ingen bootloader finns" #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -750,7 +750,7 @@ msgstr "Det går inte att subklassa slice" #: shared-module/bitbangio/SPI.c msgid "Cannot transfer without MOSI and MISO pins" -msgstr "" +msgstr "Det går inte att överföra utan MOSI- och MISO-pinnar" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" @@ -758,7 +758,7 @@ msgstr "Det går inte att ändra frekvensen på en timer som redan används" #: ports/nrf/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge, only level" -msgstr "" +msgstr "Kan inte vakna på pin edge, bara nivå" #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge. Only level." @@ -1030,7 +1030,7 @@ msgstr "Funktionen kräver lås" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "GNSS init" -msgstr "" +msgstr "GNSS start" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" @@ -1065,7 +1065,7 @@ msgstr "I/O-operation på stängd fil" #: ports/stm/common-hal/busio/I2C.c msgid "I2C init error" -msgstr "" +msgstr "I2C-initieringsfel" #: ports/raspberrypi/common-hal/busio/I2C.c msgid "I2C peripheral in use" @@ -1257,11 +1257,11 @@ msgstr "LHS av keword arg måste vara ett id" #: shared-module/displayio/Group.c msgid "Layer already in a group" -msgstr "" +msgstr "Layer är redan med i en grupp" #: shared-module/displayio/Group.c msgid "Layer must be a Group or TileGrid subclass" -msgstr "" +msgstr "Layer måste vara en underklass av Group eller TileGrid" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" @@ -1296,7 +1296,7 @@ msgstr "MISO- eller MOSI-pinne saknas" #: ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI pin" -msgstr "" +msgstr "Saknad MISO- eller MOSI-pinne" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format @@ -1399,7 +1399,7 @@ msgstr "Ingen MISO-pinne" #: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c msgid "No MISO pin" -msgstr "" +msgstr "Ingen MISO-pinne" #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1408,7 +1408,7 @@ msgstr "Ingen MOSI-pinne" #: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c msgid "No MOSI pin" -msgstr "" +msgstr "Ingen MOSI-pinne" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c @@ -1600,7 +1600,7 @@ msgstr "Endast en adress är tillåten" #: ports/nrf/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set" -msgstr "" +msgstr "Endast ett alarm.time-larm kan ställas in" #: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c @@ -1652,7 +1652,7 @@ msgstr "" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "PWM restart" -msgstr "" +msgstr "PWM omstart" #: ports/raspberrypi/common-hal/countio/Counter.c msgid "PWM slice already in use" @@ -1777,7 +1777,7 @@ msgstr "RNG Init-fel" #: 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 "RS485" -msgstr "" +msgstr "RS485" #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c @@ -1839,7 +1839,7 @@ msgstr "SD-kort CSD-format stöds inte" #: ports/cxd56/common-hal/sdioio/SDCard.c msgid "SDCard init" -msgstr "" +msgstr "SDCard start" #: ports/stm/common-hal/sdioio/SDCard.c #, c-format @@ -1857,7 +1857,7 @@ msgstr "SPI-konfigurationen misslyckades" #: ports/stm/common-hal/busio/SPI.c msgid "SPI init error" -msgstr "" +msgstr "SPI-initieringsfel" #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" @@ -1865,7 +1865,7 @@ msgstr "SPI-enhet används redan" #: ports/stm/common-hal/busio/SPI.c msgid "SPI re-init" -msgstr "" +msgstr "SPI omstart" #: shared-bindings/is31fl3741/FrameBuffer.c msgid "Scale dimensions must divide by 3" @@ -2035,7 +2035,7 @@ 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" -msgstr "" +msgstr "För många kanaler i urvalet" #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." @@ -2070,20 +2070,20 @@ msgstr "Tuple- eller struct_time-argument krävs" #: ports/stm/common-hal/busio/UART.c msgid "UART de-init" -msgstr "" +msgstr "UART omstart" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "UART init" -msgstr "" +msgstr "UART start" #: ports/stm/common-hal/busio/UART.c msgid "UART re-init" -msgstr "" +msgstr "UART omstart" #: ports/stm/common-hal/busio/UART.c msgid "UART write" -msgstr "" +msgstr "UART-skrivning" #: shared-module/usb_hid/Device.c msgid "USB busy" @@ -2511,7 +2511,7 @@ msgstr "kalibrering är skrivskyddad" #: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c msgid "can only have one parent" -msgstr "" +msgstr "kan bara ha en förälder" #: py/emitinlinethumb.c msgid "can only have up to 4 parameters to Thumb assembly" @@ -2685,7 +2685,7 @@ msgstr "casting inte implementerad" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "channel re-init" -msgstr "" +msgstr "kanal återstart" #: shared-bindings/_stage/Text.c msgid "chars buffer too small" @@ -3128,7 +3128,7 @@ msgstr "index måste vara heltal, slices, eller Boolean-listor" #: ports/espressif/common-hal/busio/I2C.c msgid "init I2C" -msgstr "" +msgstr "I2C start" #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" @@ -4056,7 +4056,7 @@ msgstr "timeout för v2-kort" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "timer re-init" -msgstr "" +msgstr "timer omstart" #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" From 39de1c952b878d75657b65212609fa62191b067f Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sat, 21 May 2022 19:14:34 +0000 Subject: [PATCH 121/246] Translated using Weblate (English (United Kingdom)) Currently translated at 89.5% (879 of 982 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/en_GB/ --- locale/en_GB.po | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/locale/en_GB.po b/locale/en_GB.po index 21480626d3..4b24bce857 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -7,15 +7,15 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2021-09-21 03:37+0000\n" -"Last-Translator: James Carr \n" +"PO-Revision-Date: 2022-05-22 00:18+0000\n" +"Last-Translator: Dan Halbert \n" "Language-Team: none\n" "Language: en_GB\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.9-dev\n" +"X-Generator: Weblate 4.13-dev\n" #: main.c msgid "" @@ -26,10 +26,13 @@ msgstr "" "Code done running.\n" #: main.c +#, fuzzy msgid "" "\n" "Code stopped by auto-reload. Reloading soon.\n" msgstr "" +"\n" +"Code stopped by auto-reload. Reloading soon.\n" #: supervisor/shared/safe_mode.c msgid "" From 1e8f371d2b0fb761a5fa167ad7db4b160eb6927d Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Sun, 22 May 2022 02:18:21 +0200 Subject: [PATCH 122/246] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 4 ++++ locale/cs.po | 4 ++++ locale/de_DE.po | 4 ++++ locale/el.po | 4 ++++ locale/en_GB.po | 4 ++++ locale/es.po | 4 ++++ locale/fil.po | 4 ++++ locale/fr.po | 4 ++++ locale/hi.po | 4 ++++ locale/it_IT.po | 4 ++++ locale/ja.po | 4 ++++ locale/ko.po | 4 ++++ locale/nl.po | 4 ++++ locale/pl.po | 4 ++++ locale/pt_BR.po | 4 ++++ locale/ru.po | 4 ++++ locale/sv.po | 4 ++++ locale/tr.po | 4 ++++ locale/zh_Latn_pinyin.po | 4 ++++ 19 files changed, 76 insertions(+) diff --git a/locale/ID.po b/locale/ID.po index be10475e61..5860b0f544 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -943,6 +943,10 @@ msgstr "Gagal mengirim perintah." msgid "Failed to acquire mutex, err 0x%04x" msgstr "Gagal memperoleh mutex, err 0x%04x" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "" + #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index ce3fc2a7bc..d15b61c9eb 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -937,6 +937,10 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "" + #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 73e28062e5..db4b9304c1 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -948,6 +948,10 @@ msgstr "Kommando nicht gesendet." msgid "Failed to acquire mutex, err 0x%04x" msgstr "Mutex konnte nicht akquiriert werden. Status: 0x%04x" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "" + #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "Zuweisung des Wifi Speichers ist fehlgeschlagen" diff --git a/locale/el.po b/locale/el.po index d4229b5592..0460f2a146 100644 --- a/locale/el.po +++ b/locale/el.po @@ -930,6 +930,10 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "" + #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "" diff --git a/locale/en_GB.po b/locale/en_GB.po index 4b24bce857..618d38f484 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -944,6 +944,10 @@ msgstr "Failed sending command." msgid "Failed to acquire mutex, err 0x%04x" msgstr "Failed to acquire mutex, err 0x%04x" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "" + #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "Failed to allocate WiFi memory" diff --git a/locale/es.po b/locale/es.po index 22a2910295..fd67f869ff 100644 --- a/locale/es.po +++ b/locale/es.po @@ -951,6 +951,10 @@ msgstr "Fallo enviando comando." msgid "Failed to acquire mutex, err 0x%04x" msgstr "No se puede adquirir el mutex, error 0x%04x" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "" + #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "Fallo al tomar memoria Wifi" diff --git a/locale/fil.po b/locale/fil.po index ebbb837db1..b81a0ac156 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -941,6 +941,10 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "Nabigo sa pag kuha ng mutex, status: 0x%08lX" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "" + #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index ce6c65ce25..15b05ca98a 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -956,6 +956,10 @@ msgstr "Échec de l'envoi de la commande." msgid "Failed to acquire mutex, err 0x%04x" msgstr "Echec de l'obtention de mutex, err 0x%04x" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "" + #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "Impossible d’allouer la mémoire pour Wifi" diff --git a/locale/hi.po b/locale/hi.po index b3367cf365..ca6f580adc 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -930,6 +930,10 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "" + #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 779b284b35..187f9648f9 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -946,6 +946,10 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "Impossibile acquisire il mutex, err 0x%04x" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "" + #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "" diff --git a/locale/ja.po b/locale/ja.po index 7aff0c1fc8..32d0336334 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -939,6 +939,10 @@ msgstr "コマンド送信に失敗" msgid "Failed to acquire mutex, err 0x%04x" msgstr "ミューテックスの取得に失敗。エラー 0x%04x" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "" + #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "Wi-Fiのメモリの確保に失敗" diff --git a/locale/ko.po b/locale/ko.po index a59b12702a..10b930ca12 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -933,6 +933,10 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "" + #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index f862d7f4f2..58e5c4a676 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -938,6 +938,10 @@ msgstr "Commando verzenden mislukt." msgid "Failed to acquire mutex, err 0x%04x" msgstr "Fout tijdens verkrijgen mutex, err 0x%04x" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "" + #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "Kon WiFi geheugen niet toewijzen" diff --git a/locale/pl.po b/locale/pl.po index 5e44013409..03357dfb91 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -939,6 +939,10 @@ msgstr "Nie udało się wysłać polecenia." msgid "Failed to acquire mutex, err 0x%04x" msgstr "Nie udało się uzyskać blokady, błąd 0x%04x" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "" + #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index b29c0a79eb..997c5415ff 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -956,6 +956,10 @@ msgstr "Falha ao enviar comando." msgid "Failed to acquire mutex, err 0x%04x" msgstr "Houve uma falha na aquisição do mutex, err 0x%04x" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "" + #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "Houve uma falha na alocação da memória do Wifi" diff --git a/locale/ru.po b/locale/ru.po index 7e6422b554..06a3702a48 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -955,6 +955,10 @@ msgstr "Не удалось отправить команду." msgid "Failed to acquire mutex, err 0x%04x" msgstr "Не удалось получить mutex, ошибка 0x%04x" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "" + #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "Не удалось выделить память Wifi" diff --git a/locale/sv.po b/locale/sv.po index c7388049fa..b7d1747cf3 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -944,6 +944,10 @@ msgstr "Det gick inte att skicka kommandot." msgid "Failed to acquire mutex, err 0x%04x" msgstr "Det gick inte att förvärva mutex, fel 0x%04x" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "" + #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "Det gick inte att allokera WiFi-minne" diff --git a/locale/tr.po b/locale/tr.po index b1a3058c2d..b0b7afaae2 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -947,6 +947,10 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "" + #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index adecfd334e..224d766066 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -953,6 +953,10 @@ msgstr "Fāsòng mìnglìng shībài." msgid "Failed to acquire mutex, err 0x%04x" msgstr "Wúfǎ huòdé mutex, err 0x%04x" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "" + #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "Wúfǎ fēnpèi Wifi nèicún" From b62799a798e21c1e7b56a8d38b97c0c4c240c929 Mon Sep 17 00:00:00 2001 From: dahanzimin <353767514@qq.com> Date: Sun, 22 May 2022 10:42:56 +0800 Subject: [PATCH 123/246] Add mixgo_ ce_ Serial function, repair sdkconfig --- .../espressif/boards/mixgo_ce_serial/board.c | 70 +++++++++++++++++++ .../boards/mixgo_ce_serial/mpconfigboard.h | 32 +++++++++ .../boards/mixgo_ce_serial/mpconfigboard.mk | 23 ++++++ ports/espressif/boards/mixgo_ce_serial/pins.c | 50 +++++++++++++ .../boards/mixgo_ce_serial/sdkconfig | 6 ++ .../espressif/boards/mixgo_ce_udisk/sdkconfig | 6 ++ 6 files changed, 187 insertions(+) create mode 100644 ports/espressif/boards/mixgo_ce_serial/board.c create mode 100644 ports/espressif/boards/mixgo_ce_serial/mpconfigboard.h create mode 100644 ports/espressif/boards/mixgo_ce_serial/mpconfigboard.mk create mode 100644 ports/espressif/boards/mixgo_ce_serial/pins.c create mode 100644 ports/espressif/boards/mixgo_ce_serial/sdkconfig diff --git a/ports/espressif/boards/mixgo_ce_serial/board.c b/ports/espressif/boards/mixgo_ce_serial/board.c new file mode 100644 index 0000000000..fb05794ca5 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_serial/board.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 "supervisor/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" + +#include "lib/oofatfs/ff.h" +#include "extmod/vfs_fat.h" +#include "py/mpstate.h" + +void board_init(void) { + // Debug UART + #ifdef DEBUG + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); + #endif /* DEBUG */ + + mp_import_stat_t stat_b = mp_import_stat("boot.py"); + if (stat_b != MP_IMPORT_STAT_FILE){ + FATFS *fatfs = &((fs_user_mount_t *) MP_STATE_VM(vfs_mount_table)->obj)->fatfs; + FIL fs; + UINT char_written = 0; + const byte buffer[] = "#Serial port upload mode\nimport storage\nstorage.remount(\"/\", False)\nstorage.disable_usb_drive()\n"; + // Create or modify existing boot.py file + f_open(fatfs, &fs, "/boot.py", FA_WRITE | FA_CREATE_ALWAYS); + f_write(&fs, buffer, sizeof(buffer) - 1, &char_written); + f_close(&fs); + //Delete code.Py, use main.py + mp_import_stat_t stat_c = mp_import_stat("code.py"); + if (stat_c == MP_IMPORT_STAT_FILE){ + f_unlink(fatfs,"/code.py"); + } + } + +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} + +void board_deinit(void) { +} diff --git a/ports/espressif/boards/mixgo_ce_serial/mpconfigboard.h b/ports/espressif/boards/mixgo_ce_serial/mpconfigboard.h new file mode 100644 index 0000000000..187687c8f5 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_serial/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 "MixGo CE" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO45) diff --git a/ports/espressif/boards/mixgo_ce_serial/mpconfigboard.mk b/ports/espressif/boards/mixgo_ce_serial/mpconfigboard.mk new file mode 100644 index 0000000000..1db0638936 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_serial/mpconfigboard.mk @@ -0,0 +1,23 @@ +USB_VID = 0x303A +USB_PID = 0x80FC +USB_PRODUCT = "MixGo CE" +USB_MANUFACTURER = "Espressif" + +IDF_TARGET = esp32s2 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE=dio +CIRCUITPY_ESP_FLASH_FREQ=40m +CIRCUITPY_ESP_FLASH_SIZE=4MB + +CIRCUITPY_MODULE=wroom + +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel +FROZEN_MPY_DIRS += boards/mixgo_ce_udisk/cp_lib/mixgoce_lib diff --git a/ports/espressif/boards/mixgo_ce_serial/pins.c b/ports/espressif/boards/mixgo_ce_serial/pins.c new file mode 100644 index 0000000000..ca4eb12bf7 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_serial/pins.c @@ -0,0 +1,50 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_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_GPIO45) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/mixgo_ce_serial/sdkconfig b/ports/espressif/boards/mixgo_ce_serial/sdkconfig new file mode 100644 index 0000000000..5b9c86dcc3 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_serial/sdkconfig @@ -0,0 +1,6 @@ +# CONFIG_ESP32S2_SPIRAM_SUPPORT is not set +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="espressif" +# end of LWIP diff --git a/ports/espressif/boards/mixgo_ce_udisk/sdkconfig b/ports/espressif/boards/mixgo_ce_udisk/sdkconfig index e69de29bb2..5b9c86dcc3 100644 --- a/ports/espressif/boards/mixgo_ce_udisk/sdkconfig +++ b/ports/espressif/boards/mixgo_ce_udisk/sdkconfig @@ -0,0 +1,6 @@ +# CONFIG_ESP32S2_SPIRAM_SUPPORT is not set +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="espressif" +# end of LWIP From 37e376631adf4f06c6ec1338bb8f9d15ee97cf64 Mon Sep 17 00:00:00 2001 From: dahanzimin <353767514@qq.com> Date: Sun, 22 May 2022 11:22:58 +0800 Subject: [PATCH 124/246] Fix format issues --- ports/espressif/boards/mixgo_ce_serial/board.c | 12 ++++++------ .../boards/mixgo_ce_serial/mpconfigboard.mk | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ports/espressif/boards/mixgo_ce_serial/board.c b/ports/espressif/boards/mixgo_ce_serial/board.c index fb05794ca5..6f26842269 100644 --- a/ports/espressif/boards/mixgo_ce_serial/board.c +++ b/ports/espressif/boards/mixgo_ce_serial/board.c @@ -39,9 +39,9 @@ void board_init(void) { common_hal_never_reset_pin(&pin_GPIO44); #endif /* DEBUG */ - mp_import_stat_t stat_b = mp_import_stat("boot.py"); - if (stat_b != MP_IMPORT_STAT_FILE){ - FATFS *fatfs = &((fs_user_mount_t *) MP_STATE_VM(vfs_mount_table)->obj)->fatfs; + mp_import_stat_t stat_b = mp_import_stat("boot.py"); + if (stat_b != MP_IMPORT_STAT_FILE) { + FATFS *fatfs = &((fs_user_mount_t *)MP_STATE_VM(vfs_mount_table)->obj)->fatfs; FIL fs; UINT char_written = 0; const byte buffer[] = "#Serial port upload mode\nimport storage\nstorage.remount(\"/\", False)\nstorage.disable_usb_drive()\n"; @@ -49,13 +49,13 @@ void board_init(void) { f_open(fatfs, &fs, "/boot.py", FA_WRITE | FA_CREATE_ALWAYS); f_write(&fs, buffer, sizeof(buffer) - 1, &char_written); f_close(&fs); - //Delete code.Py, use main.py + // Delete code.Py, use main.py mp_import_stat_t stat_c = mp_import_stat("code.py"); - if (stat_c == MP_IMPORT_STAT_FILE){ + if (stat_c == MP_IMPORT_STAT_FILE) { f_unlink(fatfs,"/code.py"); } } - + } bool board_requests_safe_mode(void) { diff --git a/ports/espressif/boards/mixgo_ce_serial/mpconfigboard.mk b/ports/espressif/boards/mixgo_ce_serial/mpconfigboard.mk index 1db0638936..4dde6b40a5 100644 --- a/ports/espressif/boards/mixgo_ce_serial/mpconfigboard.mk +++ b/ports/espressif/boards/mixgo_ce_serial/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x303A -USB_PID = 0x80FC +USB_PID = 0x80FD USB_PRODUCT = "MixGo CE" USB_MANUFACTURER = "Espressif" From e5a5ffb9b0959908e30053db84ea5f4b7bb54fb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E6=B1=89=E5=AD=90=E6=B0=91?= <48112196+dahanzimin@users.noreply.github.com> Date: Sun, 22 May 2022 11:37:39 +0800 Subject: [PATCH 125/246] Update board.c --- ports/espressif/boards/mixgo_ce_serial/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/boards/mixgo_ce_serial/board.c b/ports/espressif/boards/mixgo_ce_serial/board.c index 6f26842269..e07fe5cfd7 100644 --- a/ports/espressif/boards/mixgo_ce_serial/board.c +++ b/ports/espressif/boards/mixgo_ce_serial/board.c @@ -38,7 +38,7 @@ void board_init(void) { common_hal_never_reset_pin(&pin_GPIO43); common_hal_never_reset_pin(&pin_GPIO44); #endif /* DEBUG */ - + mp_import_stat_t stat_b = mp_import_stat("boot.py"); if (stat_b != MP_IMPORT_STAT_FILE) { FATFS *fatfs = &((fs_user_mount_t *)MP_STATE_VM(vfs_mount_table)->obj)->fatfs; From d2d3b27822d5773302f2e1cd28de8b231becb5ea Mon Sep 17 00:00:00 2001 From: arturo182 Date: Sun, 22 May 2022 15:17:13 +0200 Subject: [PATCH 126/246] Add a Round Carrier board file to the RP2040 Stamp build --- .../stamp_round_carrier_board.py | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 ports/raspberrypi/boards/solderparty_rp2040_stamp/stamp_round_carrier_board.py diff --git a/ports/raspberrypi/boards/solderparty_rp2040_stamp/stamp_round_carrier_board.py b/ports/raspberrypi/boards/solderparty_rp2040_stamp/stamp_round_carrier_board.py new file mode 100644 index 0000000000..43ce598460 --- /dev/null +++ b/ports/raspberrypi/boards/solderparty_rp2040_stamp/stamp_round_carrier_board.py @@ -0,0 +1,68 @@ +from board import * +import busio + + +_SPI = None +_UART = None +_I2C = None + + +D0 = GP0 +SDA = D0 +D1 = GP1 +SCL = D1 +D8 = GP8 +CIPO = D8 +MISO = D8 +D9 = GP9 +CS = D9 +D10 = GP10 +SCK = D10 +D11 = GP11 +COPI = D11 +MOSI = D11 +D14 = GP14 +D15 = GP15 +D16 = GP16 +TX = D16 +D17 = GP17 +RX = D17 +D26 = GP26 +A0 = D26 +D27 = GP27 +A1 = D27 +D28 = GP28 +A2 = D28 +D29 = GP29 +A3 = D29 +D24 = GP24 +NEOPIXEL = D24 +D25 = GP25 +LED = D25 + + +def SPI(): + global _SPI + + if not _SPI: + _SPI = busio.SPI(SCK, COPI, CIPO) + + return _SPI + + +def UART(): + global _UART + + if not _UART: + _UART = busio.UART(TX, RX) + + return _UART + + +def I2C(): + global _I2C + + if not _I2C: + _I2C = busio.I2C(SCL, SDA) + + return _I2C From 893fc66d167df7bd74dd6fc19ea5427cb74a4b0d Mon Sep 17 00:00:00 2001 From: Michael Wisslead Date: Tue, 3 May 2022 04:00:58 +0000 Subject: [PATCH 127/246] Use common_hal_rp2pio_statemachine_construct for PulseIn --- .../raspberrypi/common-hal/pulseio/PulseIn.c | 42 ++++++++----------- 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/ports/raspberrypi/common-hal/pulseio/PulseIn.c b/ports/raspberrypi/common-hal/pulseio/PulseIn.c index 71633fcef7..557cb090c7 100644 --- a/ports/raspberrypi/common-hal/pulseio/PulseIn.c +++ b/ports/raspberrypi/common-hal/pulseio/PulseIn.c @@ -40,7 +40,7 @@ #define MAX_PULSE 65535 #define MIN_PULSE 10 -uint16_t pulsein_program[] = { +static const uint16_t pulsein_program[] = { 0x4001, // 1: in pins, 1 }; @@ -57,29 +57,23 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self, self->start = 0; self->len = 0; - bool ok = rp2pio_statemachine_construct(&self->state_machine, - pulsein_program, sizeof(pulsein_program) / sizeof(pulsein_program[0]), - 1000000, - NULL, 0, - NULL, 0, - pin, 1, - 0,0, - NULL, 0, - NULL, 0, - 1, 0, - NULL, // jump pin - 1 << self->pin, false, true, - false, 8, false, // TX, unused - false, - true, 32, true, // RX auto-push every 32 bits - false, // claim pins - false, // Not user-interruptible. - false, // No sideset enable - 0, -1); // wrap settings - - if (!ok) { - mp_raise_RuntimeError(translate("All state machines in use")); - } + common_hal_rp2pio_statemachine_construct(&self->state_machine, + pulsein_program, MP_ARRAY_SIZE(pulsein_program), + 1000000, // frequency + NULL, 0, // init, init_len + NULL, 0, 0, 0, // first out pin, # out pins, initial_out_pin_state + pin, 1, 0, 0, // first in pin, # in pins + NULL, 0, 0, 0, // first set pin + NULL, 0, 0, 0, // first sideset pin + false, // No sideset enable + NULL, PULL_NONE, // jump pin, jmp_pull + 0, // wait gpio pins + true, // exclusive pin usage + false, 8, false, // TX, setting we don't use + false, // wait for TX stall + true, 32, true, // RX auto pull every 32 bits. shift left to output msb first + false, // Not user-interruptible. + 0, -1); // wrap settings pio_sm_set_enabled(self->state_machine.pio,self->state_machine.state_machine, false); pio_sm_clear_fifos(self->state_machine.pio,self->state_machine.state_machine); From 2b0518233b3312845ee99b7b93a218f277154aed Mon Sep 17 00:00:00 2001 From: Michael Wisslead Date: Wed, 18 May 2022 17:34:25 +0000 Subject: [PATCH 128/246] rp2040 PulseIn improvements --- .../raspberrypi/common-hal/pulseio/PulseIn.c | 55 ++++--------------- .../raspberrypi/common-hal/pulseio/PulseIn.h | 2 +- 2 files changed, 11 insertions(+), 46 deletions(-) diff --git a/ports/raspberrypi/common-hal/pulseio/PulseIn.c b/ports/raspberrypi/common-hal/pulseio/PulseIn.c index 557cb090c7..d30ef79b5f 100644 --- a/ports/raspberrypi/common-hal/pulseio/PulseIn.c +++ b/ports/raspberrypi/common-hal/pulseio/PulseIn.c @@ -38,7 +38,7 @@ #define NO_PIN 0xff #define MAX_PULSE 65535 -#define MIN_PULSE 10 +#define MIN_PULSE 0 static const uint16_t pulsein_program[] = { 0x4001, // 1: in pins, 1 @@ -75,24 +75,11 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self, false, // Not user-interruptible. 0, -1); // wrap settings - pio_sm_set_enabled(self->state_machine.pio,self->state_machine.state_machine, false); - pio_sm_clear_fifos(self->state_machine.pio,self->state_machine.state_machine); - self->last_level = self->idle_state; - self->level_count = 0; - self->buf_index = 0; + common_hal_pulseio_pulsein_pause(self); - pio_sm_set_in_pins(self->state_machine.pio,self->state_machine.state_machine,pin->number); common_hal_rp2pio_statemachine_set_interrupt_handler(&(self->state_machine),&common_hal_pulseio_pulsein_interrupt,self,PIO_IRQ0_INTE_SM0_RXNEMPTY_BITS); - // exec a set pindirs to 0 for input - pio_sm_exec(self->state_machine.pio,self->state_machine.state_machine,0xe080); - // exec the appropriate wait for pin - if (self->idle_state == true) { - pio_sm_exec(self->state_machine.pio,self->state_machine.state_machine,0x2020); - } else { - pio_sm_exec(self->state_machine.pio,self->state_machine.state_machine,0x20a0); - } - pio_sm_set_enabled(self->state_machine.pio, self->state_machine.state_machine, true); + common_hal_pulseio_pulsein_resume(self, 0); } bool common_hal_pulseio_pulsein_deinited(pulseio_pulsein_obj_t *self) { @@ -113,9 +100,10 @@ void common_hal_pulseio_pulsein_deinit(pulseio_pulsein_obj_t *self) { void common_hal_pulseio_pulsein_pause(pulseio_pulsein_obj_t *self) { pio_sm_restart(self->state_machine.pio, self->state_machine.state_machine); pio_sm_set_enabled(self->state_machine.pio, self->state_machine.state_machine, false); + pio_sm_clear_fifos(self->state_machine.pio,self->state_machine.state_machine); self->last_level = self->idle_state; self->level_count = 0; - self->buf_index = 0; + self->paused = true; } void common_hal_pulseio_pulsein_interrupt(void *self_in) { pulseio_pulsein_obj_t *self = self_in; @@ -134,7 +122,7 @@ void common_hal_pulseio_pulsein_interrupt(void *self_in) { } else { uint32_t result = self->level_count; self->last_level = level; - self->level_count = 0; + self->level_count = 1; // Pulses that are longer than MAX_PULSE will return MAX_PULSE if (result > MAX_PULSE) { result = MAX_PULSE; @@ -148,28 +136,15 @@ void common_hal_pulseio_pulsein_interrupt(void *self_in) { } else { self->start = (self->start + 1) % self->maxlen; } - if (self->buf_index < self->maxlen) { - self->buf_index++; - } else { - self->start = 0; - self->buf_index = 0; - } } } } } - -// check for a pulse thats too long (MAX_PULSE us) or maxlen reached, and reset - if ((self->level_count > MAX_PULSE) || (self->buf_index >= self->maxlen)) { - pio_sm_set_enabled(self->state_machine.pio, self->state_machine.state_machine, false); - pio_sm_init(self->state_machine.pio, self->state_machine.state_machine, self->state_machine.offset, &self->state_machine.sm_config); - pio_sm_restart(self->state_machine.pio,self->state_machine.state_machine); - pio_sm_set_enabled(self->state_machine.pio, self->state_machine.state_machine, true); - self->buf_index = 0; - } } void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t *self, uint16_t trigger_duration) { + + common_hal_pulseio_pulsein_pause(self); // Send the trigger pulse. if (trigger_duration > 0) { gpio_set_function(self->pin,GPIO_FUNC_SIO); @@ -177,11 +152,8 @@ void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t *self, gpio_put(self->pin, !self->idle_state); common_hal_mcu_delay_us((uint32_t)trigger_duration); gpio_set_function(self->pin,GPIO_FUNC_PIO0); - common_hal_mcu_delay_us(125); } - // Reconfigure the pin for PIO - gpio_set_function(self->pin, GPIO_FUNC_PIO0); // exec a wait for the selected pin to change state if (self->idle_state == true) { pio_sm_exec(self->state_machine.pio,self->state_machine.state_machine,0x2020); @@ -189,12 +161,11 @@ void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t *self, pio_sm_exec(self->state_machine.pio,self->state_machine.state_machine,0x20a0); } pio_sm_set_enabled(self->state_machine.pio, self->state_machine.state_machine, true); + self->paused = false; } void common_hal_pulseio_pulsein_clear(pulseio_pulsein_obj_t *self) { - self->start = 0; self->len = 0; - self->buf_index = 0; } uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t *self) { @@ -204,12 +175,6 @@ uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t *self) { uint16_t value = self->buffer[self->start]; self->start = (self->start + 1) % self->maxlen; self->len--; - // if we are empty reset buffer pointer and counters - if (self->len == 0) { - self->start = 0; - self->buf_index = 0; - self->level_count = 0; - } return value; } @@ -222,7 +187,7 @@ uint16_t common_hal_pulseio_pulsein_get_len(pulseio_pulsein_obj_t *self) { } bool common_hal_pulseio_pulsein_get_paused(pulseio_pulsein_obj_t *self) { - return true; + return self->paused; } uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t *self, diff --git a/ports/raspberrypi/common-hal/pulseio/PulseIn.h b/ports/raspberrypi/common-hal/pulseio/PulseIn.h index f2c4fc0d06..8694f75e62 100644 --- a/ports/raspberrypi/common-hal/pulseio/PulseIn.h +++ b/ports/raspberrypi/common-hal/pulseio/PulseIn.h @@ -37,13 +37,13 @@ typedef struct { mp_obj_base_t base; uint8_t pin; bool idle_state; + bool paused; uint16_t maxlen; uint16_t *buffer; volatile bool last_level; volatile uint32_t level_count; volatile uint16_t len; volatile uint16_t start; - volatile uint16_t buf_index; rp2pio_statemachine_obj_t state_machine; } pulseio_pulsein_obj_t; From 6454c5895b9f665d7f7ddf60155e7a6e2fe41660 Mon Sep 17 00:00:00 2001 From: dahanzimin <353767514@qq.com> Date: Mon, 23 May 2022 11:19:11 +0800 Subject: [PATCH 129/246] Repair import and stock in under the frozen / directory --- .gitmodules | 4 ++-- .../boards/mixgo_ce_udisk/cp_lib => frozen/mixgo_cp_lib | 0 ports/espressif/boards/mixgo_ce_serial/mpconfigboard.mk | 2 +- ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename ports/espressif/boards/mixgo_ce_udisk/cp_lib => frozen/mixgo_cp_lib (100%) diff --git a/.gitmodules b/.gitmodules index 542f15d327..0edcdec653 100644 --- a/.gitmodules +++ b/.gitmodules @@ -289,6 +289,6 @@ [submodule "frozen/pew-pewpew-lcd"] path = frozen/pew-pewpew-lcd url = https://github.com/pypewpew/pew-pewpew-lcd.git -[submodule "ports/espressif/boards/mixgo_ce_udisk/cp_lib"] - path = ports/espressif/boards/mixgo_ce_udisk/cp_lib +[submodule "frozen/mixgo_cp_lib"] + path = frozen/mixgo_cp_lib url = https://github.com/dahanzimin/circuitpython_lib.git diff --git a/ports/espressif/boards/mixgo_ce_udisk/cp_lib b/frozen/mixgo_cp_lib similarity index 100% rename from ports/espressif/boards/mixgo_ce_udisk/cp_lib rename to frozen/mixgo_cp_lib diff --git a/ports/espressif/boards/mixgo_ce_serial/mpconfigboard.mk b/ports/espressif/boards/mixgo_ce_serial/mpconfigboard.mk index 4dde6b40a5..860f611354 100644 --- a/ports/espressif/boards/mixgo_ce_serial/mpconfigboard.mk +++ b/ports/espressif/boards/mixgo_ce_serial/mpconfigboard.mk @@ -20,4 +20,4 @@ CIRCUITPY_MODULE=wroom FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel -FROZEN_MPY_DIRS += boards/mixgo_ce_udisk/cp_lib/mixgoce_lib +FROZEN_MPY_DIRS += $(TOP)/frozen/mixgo_cp_lib/mixgoce_lib diff --git a/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk b/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk index 5d201ba73d..7e6646225f 100644 --- a/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk +++ b/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk @@ -20,4 +20,4 @@ CIRCUITPY_MODULE=wroom FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel -FROZEN_MPY_DIRS += boards/$(BOARD)/cp_lib/mixgoce_lib +FROZEN_MPY_DIRS += $(TOP)/frozen/mixgo_cp_lib/mixgoce_lib From af80d54c3861457297bf5b58d9c48b17fc54a262 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Sun, 22 May 2022 13:53:43 +0000 Subject: [PATCH 130/246] Translated using Weblate (Swedish) Currently translated at 100.0% (983 of 983 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index b7d1747cf3..aafbc0ab75 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-05-22 00:18+0000\n" +"PO-Revision-Date: 2022-05-23 14:18+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -946,7 +946,7 @@ msgstr "Det gick inte att förvärva mutex, fel 0x%04x" #: shared-module/rgbmatrix/RGBMatrix.c msgid "Failed to allocate %q buffer" -msgstr "" +msgstr "Det gick inte att allokera buffert för %q" #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" From 4a155712957d684b74d207dcf2368d1cec0f8255 Mon Sep 17 00:00:00 2001 From: Tyler Crumpton Date: Mon, 23 May 2022 13:03:03 -0500 Subject: [PATCH 131/246] Fix a minor namespace issue in the countio example --- 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 19141245e1..79ac3e75da 100644 --- a/shared-bindings/countio/Counter.c +++ b/shared-bindings/countio/Counter.c @@ -30,7 +30,7 @@ //| import countio //| //| # Count rising edges only. -//| pin_counter = countio.Counter(board.D1, edge=Edge.RISE) +//| pin_counter = countio.Counter(board.D1, edge=countio.Edge.RISE) //| # Reset the count after 100 counts. //| while True: //| if pin_counter.count >= 100: From 22cada10fa214fcf396d0279620a029067186160 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 23 May 2022 11:29:30 -0700 Subject: [PATCH 132/246] Fix 64bit builds --- shared-module/dotenv/__init__.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shared-module/dotenv/__init__.c b/shared-module/dotenv/__init__.c index 3efec3c346..a7d0f9ba0d 100644 --- a/shared-module/dotenv/__init__.c +++ b/shared-module/dotenv/__init__.c @@ -35,7 +35,7 @@ STATIC uint8_t consume_spaces(FIL *active_file) { uint8_t character = ' '; - size_t quantity_read = 1; + UINT quantity_read = 1; while (unichar_isspace(character) && quantity_read > 0) { f_read(active_file, &character, 1, &quantity_read); } @@ -46,7 +46,7 @@ STATIC uint8_t consume_spaces(FIL *active_file) { // key. File pointer is left after the = after the key. STATIC bool key_matches(FIL *active_file, const char *key) { uint8_t character = ' '; - size_t quantity_read = 1; + UINT quantity_read = 1; character = consume_spaces(active_file); bool quoted = false; if (character == '\'') { @@ -90,7 +90,7 @@ STATIC bool key_matches(FIL *active_file, const char *key) { STATIC bool next_line(FIL *active_file) { uint8_t character = ' '; - size_t quantity_read = 1; + UINT quantity_read = 1; bool quoted = false; bool escaped = false; // Track comments because they last until the end of the line. @@ -117,7 +117,7 @@ STATIC bool next_line(FIL *active_file) { STATIC mp_int_t read_value(FIL *active_file, char *value, size_t value_len) { uint8_t character = ' '; - size_t quantity_read = 1; + UINT quantity_read = 1; // Consume spaces before = character = consume_spaces(active_file); if (character != '=') { From 3179db4ef4f423c77f2170034dcd3a1544b8336c Mon Sep 17 00:00:00 2001 From: Neradoc Date: Wed, 4 May 2022 01:49:51 +0200 Subject: [PATCH 133/246] move frozen adafruit_circuitplayground to express subdirectory --- .../boards/circuitplayground_express/mpconfigboard.mk | 2 +- .../boards/circuitplayground_express_crickit/mpconfigboard.mk | 2 +- .../boards/circuitplayground_express_displayio/mpconfigboard.mk | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk index 5311cdc1d4..b64fd2033d 100644 --- a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk @@ -19,7 +19,7 @@ CIRCUITPY_COUNTIO = 1 CIRCUITPY_BUSDEVICE = 1 # Include these Python libraries in firmware. -FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground/frozen_cpx FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LIS3DH FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk index 4d749d2134..975d892b9a 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk @@ -18,7 +18,7 @@ CIRCUITPY_KEYPAD = 0 CIRCUITPY_ONEWIREIO = 0 # Include these Python libraries in firmware. -FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground/frozen_cpx FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Crickit FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LIS3DH FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Motor diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk index 0ae0c58b42..4338fe3e1e 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk @@ -24,7 +24,7 @@ CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_PARALLELDISPLAY = 0 # Include these Python libraries in firmware. -FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground/frozen_cpx FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LIS3DH FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Thermistor From 2aea5ed7429b7788ba1a8300be29c76f23fb8c58 Mon Sep 17 00:00:00 2001 From: Neradoc Date: Mon, 23 May 2022 22:12:40 +0200 Subject: [PATCH 134/246] update adafruit_circuitplayground to last release with frozen dir --- frozen/Adafruit_CircuitPython_CircuitPlayground | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frozen/Adafruit_CircuitPython_CircuitPlayground b/frozen/Adafruit_CircuitPython_CircuitPlayground index f82d3ef195..54b2fa03d8 160000 --- a/frozen/Adafruit_CircuitPython_CircuitPlayground +++ b/frozen/Adafruit_CircuitPython_CircuitPlayground @@ -1 +1 @@ -Subproject commit f82d3ef195256aa71d274a34ea25f760d7e651d1 +Subproject commit 54b2fa03d8af80562b77460841e63d47f12eee43 From bb4beb3fab66209d0dae47452282d18f3b1037f2 Mon Sep 17 00:00:00 2001 From: lady ada Date: Mon, 23 May 2022 23:57:35 -0400 Subject: [PATCH 135/246] add esp32s3 tft --- .../adafruit_feather_esp32s3_tft/board.c | 154 ++++++++++++++++++ .../mpconfigboard.h | 45 +++++ .../mpconfigboard.mk | 20 +++ .../adafruit_feather_esp32s3_tft/pins.c | 78 +++++++++ .../adafruit_feather_esp32s3_tft/sdkconfig | 47 ++++++ 5 files changed, 344 insertions(+) create mode 100644 ports/espressif/boards/adafruit_feather_esp32s3_tft/board.c create mode 100644 ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.h create mode 100644 ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk create mode 100644 ports/espressif/boards/adafruit_feather_esp32s3_tft/pins.c create mode 100644 ports/espressif/boards/adafruit_feather_esp32s3_tft/sdkconfig diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_tft/board.c b/ports/espressif/boards/adafruit_feather_esp32s3_tft/board.c new file mode 100644 index 0000000000..46f1fbd31c --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_esp32s3_tft/board.c @@ -0,0 +1,154 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/busio/SPI.h" +#include "shared-bindings/displayio/FourWire.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-module/displayio/__init__.h" +#include "shared-module/displayio/mipi_constants.h" +#include "shared-bindings/board/__init__.h" + +displayio_fourwire_obj_t board_display_obj; + +#define DELAY 0x80 + +// display init sequence according to LilyGO example app +uint8_t display_init_sequence[] = { + // sw reset + 0x01, 0 | DELAY, 150, + // sleep out + 0x11, 0 | DELAY, 255, + // normal display mode on + 0x13, 0, + // display and color format settings + 0x36, 1, 0x68, + 0xB6, 2, 0x0A, 0x82, + 0x3A, 1 | DELAY, 0x55, 10, + // ST7789V frame rate setting + 0xB2, 5, 0x0C, 0x0C, 0x00, 0x33, 0x33, + // voltages: VGH / VGL + 0xB7, 1, 0x35, + // ST7789V power setting + 0xBB, 1, 0x28, + 0xC0, 1, 0x0C, + 0xC2, 2, 0x01, 0xFF, + 0xC3, 1, 0x10, + 0xC4, 1, 0x20, + 0xC6, 1, 0x0F, + 0xD0, 2, 0xA4, 0xA1, + // ST7789V gamma setting + 0xE0, 14, 0xD0, 0x00, 0x02, 0x07, 0x0A, 0x28, 0x32, 0x44, 0x42, 0x06, 0x0E, 0x12, 0x14, 0x17, + 0xE1, 14, 0xD0, 0x00, 0x02, 0x07, 0x0A, 0x28, 0x31, 0x54, 0x47, 0x0E, 0x1C, 0x17, 0x1B, 0x1E, + 0x21, 0, + // display on + 0x29, 0 | DELAY, 255, +}; + + +void board_init(void) { + // THIS SHOULD BE HANDLED BY espressif_board_reset_pin_number(), but it is not working. + // TEMPORARY FIX UNTIL IT'S DIAGNOSED. + common_hal_never_reset_pin(&pin_GPIO21); + gpio_set_direction(21, GPIO_MODE_DEF_OUTPUT); + gpio_set_level(21, true); + + busio_spi_obj_t *spi = common_hal_board_create_spi(0); + displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus; + bus->base.type = &displayio_fourwire_type; + + common_hal_displayio_fourwire_construct( + bus, + spi, + &pin_GPIO39, // DC + &pin_GPIO7, // CS + &pin_GPIO40, // RST + 40000000, // baudrate + 0, // polarity + 0 // phase + ); + displayio_display_obj_t *display = &displays[0].display; + display->base.type = &displayio_display_type; + + // workaround as board_init() is called before reset_port() in main.c + pwmout_reset(); + + common_hal_displayio_display_construct( + display, + bus, + 240, // width (after rotation) + 135, // height (after rotation) + 40, // column start + 53, // row start + 0, // 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 + display_init_sequence, + sizeof(display_init_sequence), + &pin_GPIO45, // backlight pin + NO_BRIGHTNESS_COMMAND, + 1.0f, // brightness (ignored) + false, // auto_brightness + false, // single_byte_bounds + false, // data_as_commands + true, // auto_refresh + 60, // native_frames_per_second + true, // backlight_on_high + false // SH1107_addressing + ); + + common_hal_never_reset_pin(&pin_GPIO45); // backlight pin +} + +bool board_requests_safe_mode(void) { + return false; +} + +bool espressif_board_reset_pin_number(gpio_num_t pin_number) { + // Override the I2C/TFT power pin reset to prevent resetting the display. + if (pin_number == 21) { + // Turn on TFT and I2C + gpio_set_direction(21, GPIO_MODE_DEF_OUTPUT); + gpio_set_level(21, true); + return true; + } + return false; +} + +void reset_board(void) { +} + +void board_deinit(void) { + // TODO: Should we turn off the display when asleep? +} diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.h b/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.h new file mode 100644 index 0000000000..f2bf81d3d2 --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_esp32s3_tft/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 "Adafruit Feather ESP32-S3 TFT" +#define MICROPY_HW_MCU_NAME "ESP32S3" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO33) +#define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO34) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO41) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO42) + +#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_GPIO2) +#define DEFAULT_UART_BUS_TX (&pin_GPIO1) + +#define DOUBLE_TAP_PIN (&pin_GPIO38) diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk new file mode 100644 index 0000000000..b3c68b3b62 --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk @@ -0,0 +1,20 @@ +USB_VID = 0x239A +USB_PID = 0x811E + +USB_PRODUCT = "Feather ESP32-S3 TFT" +USB_MANUFACTURER = "Adafruit" + +IDF_TARGET = esp32s3 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE=dio +CIRCUITPY_ESP_FLASH_FREQ=40m +CIRCUITPY_ESP_FLASH_SIZE=4MB + +CIRCUITPY_MODULE=wroom diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_tft/pins.c b/ports/espressif/boards/adafruit_feather_esp32s3_tft/pins.c new file mode 100644 index 0000000000..fb2f898a18 --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_esp32s3_tft/pins.c @@ -0,0 +1,78 @@ +#include "shared-bindings/board/__init__.h" + +#include "shared-module/displayio/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO14) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO15) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO16) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_GPIO34) }, + + { MP_ROM_QSTR(MP_QSTR_TFT_I2C_POWER), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO35) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO37) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_D41), MP_ROM_PTR(&pin_GPIO41) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_D42), MP_ROM_PTR(&pin_GPIO42) }, + + { MP_ROM_QSTR(MP_QSTR_TFT_CS), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_TFT_DC), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_TFT_RESET), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_TFT_BACKLIGHT), MP_ROM_PTR(&pin_GPIO45) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_BOOT0), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, + + { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display)} +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_tft/sdkconfig b/ports/espressif/boards/adafruit_feather_esp32s3_tft/sdkconfig new file mode 100644 index 0000000000..9a05ab0205 --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_esp32s3_tft/sdkconfig @@ -0,0 +1,47 @@ +# +# Component config +# +# +# ESP32S3-Specific +# +CONFIG_ESP32S3_SPIRAM_SUPPORT=y +# +# SPI RAM config +# +CONFIG_SPIRAM_MODE_QUAD=y +# CONFIG_SPIRAM_MODE_OCT is not set +CONFIG_SPIRAM_TYPE_AUTO=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +CONFIG_SPIRAM_SIZE=2097152 +# +# PSRAM Clock and CS IO for ESP32S3 +# +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +CONFIG_DEFAULT_PSRAM_CS_IO=26 +# end of PSRAM Clock and CS IO for ESP32S3 + +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_SPEED_120M is not set +CONFIG_SPIRAM_SPEED_80M=y +# CONFIG_SPIRAM_SPEED_40M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# end of SPI RAM config + +# end of ESP32S3-Specific + +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="espressif-esp32s3" +# end of LWIP + +# end of Component config From d47662c4487ee388f8e47a283c2b7db7d60239fe Mon Sep 17 00:00:00 2001 From: KurtE Date: Mon, 23 May 2022 17:29:46 -0700 Subject: [PATCH 136/246] Teensy Builds retain Filesystem Changed a few things in the link step that satisfies the teensy loader apps, both the teensy.exe as well as the teensy_loader_cli such that when you program the board again it should retain the file sytem that is stored in the upper area of the Flash --- .../boards/sparkfun_teensy_micromod/flash_config.c | 6 ++++-- ports/mimxrt10xx/boards/teensy40/flash_config.c | 6 ++++-- ports/mimxrt10xx/boards/teensy41/flash_config.c | 6 ++++-- ports/mimxrt10xx/linking/common.ld | 3 ++- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/flash_config.c b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/flash_config.c index 09886dece6..e0f5a5bd7d 100644 --- a/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/flash_config.c +++ b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/flash_config.c @@ -15,7 +15,7 @@ __attribute__((section(".boot_hdr.ivt"))) * IVT Data *************************************/ const ivt image_vector_table = { - IVT_HEADER, /* IVT Header */ + 0x432000D1, /* Teensy bootloader looks for this value*/ IMAGE_ENTRY_ADDRESS, /* Image Entry Function */ IVT_RSVD, /* Reserved = 0 */ (uint32_t)DCD_ADDRESS, /* Address where DCD information is stored */ @@ -25,13 +25,15 @@ const ivt image_vector_table = { IVT_RSVD /* Reserved = 0 */ }; +extern unsigned long _flashimagelen; + __attribute__((section(".boot_hdr.boot_data"))) /************************************* * Boot Data *************************************/ const BOOT_DATA_T boot_data = { FLASH_BASE, /* boot start location */ - FLASH_SIZE, /* size */ + (uint32_t)&_flashimagelen, /* actual size of image */ PLUGIN_FLAG, /* Plugin flag*/ 0xFFFFFFFF /* empty - extra data word */ }; diff --git a/ports/mimxrt10xx/boards/teensy40/flash_config.c b/ports/mimxrt10xx/boards/teensy40/flash_config.c index 3f4ab0271d..d878124b40 100644 --- a/ports/mimxrt10xx/boards/teensy40/flash_config.c +++ b/ports/mimxrt10xx/boards/teensy40/flash_config.c @@ -15,7 +15,7 @@ __attribute__((section(".boot_hdr.ivt"))) * IVT Data *************************************/ const ivt image_vector_table = { - IVT_HEADER, /* IVT Header */ + 0x432000D1, /* Teensy bootloader looks for this value*/ IMAGE_ENTRY_ADDRESS, /* Image Entry Function */ IVT_RSVD, /* Reserved = 0 */ (uint32_t)DCD_ADDRESS, /* Address where DCD information is stored */ @@ -25,13 +25,15 @@ const ivt image_vector_table = { IVT_RSVD /* Reserved = 0 */ }; +extern unsigned long _flashimagelen; + __attribute__((section(".boot_hdr.boot_data"))) /************************************* * Boot Data *************************************/ const BOOT_DATA_T boot_data = { FLASH_BASE, /* boot start location */ - FLASH_SIZE, /* size */ + (uint32_t)&_flashimagelen, /* actual size of image */ PLUGIN_FLAG, /* Plugin flag*/ 0xFFFFFFFF /* empty - extra data word */ }; diff --git a/ports/mimxrt10xx/boards/teensy41/flash_config.c b/ports/mimxrt10xx/boards/teensy41/flash_config.c index 09886dece6..e0f5a5bd7d 100644 --- a/ports/mimxrt10xx/boards/teensy41/flash_config.c +++ b/ports/mimxrt10xx/boards/teensy41/flash_config.c @@ -15,7 +15,7 @@ __attribute__((section(".boot_hdr.ivt"))) * IVT Data *************************************/ const ivt image_vector_table = { - IVT_HEADER, /* IVT Header */ + 0x432000D1, /* Teensy bootloader looks for this value*/ IMAGE_ENTRY_ADDRESS, /* Image Entry Function */ IVT_RSVD, /* Reserved = 0 */ (uint32_t)DCD_ADDRESS, /* Address where DCD information is stored */ @@ -25,13 +25,15 @@ const ivt image_vector_table = { IVT_RSVD /* Reserved = 0 */ }; +extern unsigned long _flashimagelen; + __attribute__((section(".boot_hdr.boot_data"))) /************************************* * Boot Data *************************************/ const BOOT_DATA_T boot_data = { FLASH_BASE, /* boot start location */ - FLASH_SIZE, /* size */ + (uint32_t)&_flashimagelen, /* actual size of image */ PLUGIN_FLAG, /* Plugin flag*/ 0xFFFFFFFF /* empty - extra data word */ }; diff --git a/ports/mimxrt10xx/linking/common.ld b/ports/mimxrt10xx/linking/common.ld index 44e8d537c4..b6f1acc8d0 100644 --- a/ports/mimxrt10xx/linking/common.ld +++ b/ports/mimxrt10xx/linking/common.ld @@ -74,7 +74,6 @@ SECTIONS _etext = .; /* define a global symbol at end of code */ __etext = .; /* define a global symbol at end of code */ } > FLASH_FIRMWARE - _ld_filesystem_start = ORIGIN(FLASH_FATFS); _ld_filesystem_end = _ld_filesystem_start + LENGTH(FLASH_FATFS); @@ -127,6 +126,8 @@ SECTIONS _ld_dtcm_data_flash_copy = LOADADDR(.dtcm_data); _ld_dtcm_data_size = SIZEOF(.dtcm_data); + _flashimagelen = _ld_dtcm_data_flash_copy + _ld_dtcm_data_size - flash_config_location; + .dtcm_bss : { . = ALIGN(4); From 9439ce04bda11592d5860d9a624c0c28e527b649 Mon Sep 17 00:00:00 2001 From: lady ada Date: Tue, 24 May 2022 11:28:55 -0400 Subject: [PATCH 137/246] try to remove some space? --- .../boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk index b3c68b3b62..75107eac1b 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk @@ -6,6 +6,10 @@ USB_MANUFACTURER = "Adafruit" IDF_TARGET = esp32s3 + +CIRCUITPY_AUDIOCORE = 0 +CIRCUITPY_PULSEIO = 0 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ From eefba1664411a374ba1b970ba0c1954cb2de2085 Mon Sep 17 00:00:00 2001 From: Paint Your Dragon Date: Tue, 24 May 2022 08:40:51 -0700 Subject: [PATCH 138/246] Correctly scale analog reading per issue #4794 --- ports/atmel-samd/common-hal/analogio/AnalogIn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/common-hal/analogio/AnalogIn.c b/ports/atmel-samd/common-hal/analogio/AnalogIn.c index 4140324a1c..e6db95b358 100644 --- a/ports/atmel-samd/common-hal/analogio/AnalogIn.c +++ b/ports/atmel-samd/common-hal/analogio/AnalogIn.c @@ -123,8 +123,8 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { adc_sync_read_channel(&adc, self->channel, ((uint8_t *)&value), 2); adc_sync_deinit(&adc); - // Shift the value to be 16 bit. - return value << 4; + // Stretch 12-bit ADC reading to 16-bit range + return (value << 4) | (value >> 8); } float common_hal_analogio_analogin_get_reference_voltage(analogio_analogin_obj_t *self) { From e9b9f0b13facd16a7cff56450811a8ef4159d25c Mon Sep 17 00:00:00 2001 From: Paint Your Dragon Date: Tue, 24 May 2022 08:42:00 -0700 Subject: [PATCH 139/246] Correctly scale analog reading per issue #4794 --- ports/stm/common-hal/analogio/AnalogIn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/stm/common-hal/analogio/AnalogIn.c b/ports/stm/common-hal/analogio/AnalogIn.c index 3079816e01..9ec93ccc84 100644 --- a/ports/stm/common-hal/analogio/AnalogIn.c +++ b/ports/stm/common-hal/analogio/AnalogIn.c @@ -204,8 +204,8 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { uint16_t value = (uint16_t)HAL_ADC_GetValue(&AdcHandle); HAL_ADC_Stop(&AdcHandle); - // // Shift the value to be 16 bit. - return value << 4; + // Stretch 12-bit ADC reading to 16-bit range + return (value << 4) | (value >> 8); } float common_hal_analogio_analogin_get_reference_voltage(analogio_analogin_obj_t *self) { From 44b31b098e1264d50201137c135766fd65efa1fd Mon Sep 17 00:00:00 2001 From: Paint Your Dragon Date: Tue, 24 May 2022 08:44:09 -0700 Subject: [PATCH 140/246] Correctly scale analog reading per issue #4794 --- ports/mimxrt10xx/common-hal/analogio/AnalogIn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/mimxrt10xx/common-hal/analogio/AnalogIn.c b/ports/mimxrt10xx/common-hal/analogio/AnalogIn.c index 3f3147971f..ac0b0b8300 100644 --- a/ports/mimxrt10xx/common-hal/analogio/AnalogIn.c +++ b/ports/mimxrt10xx/common-hal/analogio/AnalogIn.c @@ -81,8 +81,8 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { } - // Shift the value to be 16 bit - return ADC_GetChannelConversionValue(self->pin->adc, ADC_CHANNEL_GROUP) << 4; + // Stretch 12-bit ADC reading to 16 bits via 24-bit interim result + return (ADC_GetChannelConversionValue(self->pin->adc, ADC_CHANNEL_GROUP) * 0x1001) >> 8; } float common_hal_analogio_analogin_get_reference_voltage(analogio_analogin_obj_t *self) { From 5ef1f2dd5a9c223592aab5a147b54058232b652b Mon Sep 17 00:00:00 2001 From: Paint Your Dragon Date: Tue, 24 May 2022 08:45:14 -0700 Subject: [PATCH 141/246] Correctly scale analog reading per issue #4794 --- ports/nrf/common-hal/analogio/AnalogIn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/nrf/common-hal/analogio/AnalogIn.c b/ports/nrf/common-hal/analogio/AnalogIn.c index 8498e20f29..347426af99 100644 --- a/ports/nrf/common-hal/analogio/AnalogIn.c +++ b/ports/nrf/common-hal/analogio/AnalogIn.c @@ -125,8 +125,8 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { value = 0; } - // Map value to from 14 to 16 bits - return value << 2; + // Stretch 14-bit ADC reading to 16-bit range + return (value << 2) | (value >> 12); } float common_hal_analogio_analogin_get_reference_voltage(analogio_analogin_obj_t *self) { From e22de975b3de56429ddea132d27178f54f88ea56 Mon Sep 17 00:00:00 2001 From: lady ada Date: Tue, 24 May 2022 11:46:03 -0400 Subject: [PATCH 142/246] try just bitbangio remove --- .../boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk index 75107eac1b..7fa81dd40e 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk @@ -7,8 +7,9 @@ USB_MANUFACTURER = "Adafruit" IDF_TARGET = esp32s3 -CIRCUITPY_AUDIOCORE = 0 -CIRCUITPY_PULSEIO = 0 +#CIRCUITPY_AUDIOCORE = 0 +#CIRCUITPY_PULSEIO = 0 +CIRCUITPY_BITBANGIO = 0 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ From c3f58193ca746c148c4688b93ca855265f9b02ce Mon Sep 17 00:00:00 2001 From: Paint Your Dragon Date: Tue, 24 May 2022 08:46:39 -0700 Subject: [PATCH 143/246] Correctly scale analog reading per issue #4794 --- ports/raspberrypi/common-hal/analogio/AnalogIn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/raspberrypi/common-hal/analogio/AnalogIn.c b/ports/raspberrypi/common-hal/analogio/AnalogIn.c index 4b82ab687a..d164d9a18b 100644 --- a/ports/raspberrypi/common-hal/analogio/AnalogIn.c +++ b/ports/raspberrypi/common-hal/analogio/AnalogIn.c @@ -65,8 +65,8 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { adc_select_input(self->pin->number - ADC_FIRST_PIN_NUMBER); uint16_t value = adc_read(); - // Map value to from 12 to 16 bits - return value << 4; + // Stretch 12-bit ADC reading to 16-bit range + return (value << 4) | (value >> 8); } float common_hal_analogio_analogin_get_reference_voltage(analogio_analogin_obj_t *self) { From 92fa02effa957d80969f36459cb947371f33b436 Mon Sep 17 00:00:00 2001 From: Paint Your Dragon Date: Tue, 24 May 2022 08:49:05 -0700 Subject: [PATCH 144/246] Change 12- to 16-bit scaling to match other ports Result is identical, implementation just resembles other ports instead of being all 1337 about it. --- ports/mimxrt10xx/common-hal/analogio/AnalogIn.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ports/mimxrt10xx/common-hal/analogio/AnalogIn.c b/ports/mimxrt10xx/common-hal/analogio/AnalogIn.c index ac0b0b8300..f5d2e7f42e 100644 --- a/ports/mimxrt10xx/common-hal/analogio/AnalogIn.c +++ b/ports/mimxrt10xx/common-hal/analogio/AnalogIn.c @@ -81,8 +81,10 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { } - // Stretch 12-bit ADC reading to 16 bits via 24-bit interim result - return (ADC_GetChannelConversionValue(self->pin->adc, ADC_CHANNEL_GROUP) * 0x1001) >> 8; + uint16_t value = ADC_GetChannelConversionValue(self->pin->adc, ADC_CHANNEL_GROUP); + + // Stretch 12-bit ADC reading to 16-bit range + return (value << 4) | (value >> 8); } float common_hal_analogio_analogin_get_reference_voltage(analogio_analogin_obj_t *self) { From 74c92ffe9ec1a81176d882f8823154ae88bd09fb Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 20 May 2022 23:22:04 -0400 Subject: [PATCH 145/246] Remove busio.OneWire and bitbangio.OneWire --- docs/redirects.txt | 3 +-- ports/atmel-samd/tools/gen_pin_name_table.py | 4 ++-- shared-bindings/bitbangio/__init__.c | 4 ---- shared-bindings/busio/__init__.c | 6 ------ 4 files changed, 3 insertions(+), 14 deletions(-) diff --git a/docs/redirects.txt b/docs/redirects.txt index 248a042e7a..e548a821f9 100644 --- a/docs/redirects.txt +++ b/docs/redirects.txt @@ -45,12 +45,10 @@ 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 @@ -101,6 +99,7 @@ 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/onewireio/OneWire.rst shared-bindings/onewireio/#onewireio.OneWire 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 diff --git a/ports/atmel-samd/tools/gen_pin_name_table.py b/ports/atmel-samd/tools/gen_pin_name_table.py index a78144d400..3eb0fbdbb3 100644 --- a/ports/atmel-samd/tools/gen_pin_name_table.py +++ b/ports/atmel-samd/tools/gen_pin_name_table.py @@ -164,11 +164,10 @@ capabilities = { "AnalogOut": ["PA02"], }, "audioio": {"AudioOut": ["PA02"]}, - "bitbangio": {"I2C": ALL_BUT_USB, "OneWire": ALL_BUT_USB, "SPI": ALL_BUT_USB}, + "bitbangio": {"I2C": ALL_BUT_USB, "SPI": ALL_BUT_USB}, "busio": { "I2C - SDA": ["PA00", "PB08", "PA08", "PA12", "PA16", "PA22", "PB02"], # SERCOM pad 0 "I2C - SCL": ["PA01", "PB09", "PA09", "PA13", "PA17", "PA23", "PB03"], # SERCOM pad 1 - "OneWire": ALL_BUT_USB, "SPI - MISO": [ "PA00", "PA01", @@ -299,6 +298,7 @@ capabilities = { ], # pad 0 or 2 }, "digitalio": {"DigitalInOut": ALL_BUT_USB}, + "onewireio": {"OneWire": ALL_BUT_USB}, "pulseio": { "PulseIn": ALL_BUT_USB, "PWMOut": [ diff --git a/shared-bindings/bitbangio/__init__.c b/shared-bindings/bitbangio/__init__.c index 57348a3c1e..43117db494 100644 --- a/shared-bindings/bitbangio/__init__.c +++ b/shared-bindings/bitbangio/__init__.c @@ -34,7 +34,6 @@ #include "shared-bindings/bitbangio/__init__.h" #include "shared-bindings/bitbangio/I2C.h" -#include "shared-bindings/onewireio/OneWire.h" #include "shared-bindings/bitbangio/SPI.h" #include "py/runtime.h" @@ -72,9 +71,6 @@ STATIC const mp_rom_map_elem_t bitbangio_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_bitbangio) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&bitbangio_i2c_type) }, - #if CIRCUITPY_ONEWIREIO - { MP_ROM_QSTR(MP_QSTR_OneWire), MP_ROM_PTR(&onewireio_onewire_type) }, - #endif { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&bitbangio_spi_type) }, }; diff --git a/shared-bindings/busio/__init__.c b/shared-bindings/busio/__init__.c index 38bbfaf6ef..969c10e938 100644 --- a/shared-bindings/busio/__init__.c +++ b/shared-bindings/busio/__init__.c @@ -34,9 +34,6 @@ #include "shared-bindings/busio/I2C.h" #include "shared-bindings/busio/SPI.h" #include "shared-bindings/busio/UART.h" -#if CIRCUITPY_ONEWIREIO -#include "shared-bindings/onewireio/OneWire.h" -#endif #include "py/runtime.h" @@ -87,9 +84,6 @@ STATIC const mp_rom_map_elem_t busio_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_busio) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&busio_i2c_type) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&busio_spi_type) }, - #if CIRCUITPY_ONEWIREIO - { MP_ROM_QSTR(MP_QSTR_OneWire), MP_ROM_PTR(&onewireio_onewire_type) }, - #endif { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&busio_uart_type) }, }; From 335c93c04416544550517b7da64c70470aa858c9 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 24 May 2022 12:34:08 -0400 Subject: [PATCH 146/246] restore rainbowio to small builds --- ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk | 2 -- ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk | 1 - ports/atmel-samd/boards/sensebox_mcu/mpconfigboard.mk | 1 - 4 files changed, 7 deletions(-) diff --git a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk index abbdbe87ef..c3d75202bf 100644 --- a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk @@ -9,5 +9,3 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 - -CIRCUITPY_RAINBOWIO = 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 38b1e96d6b..895c027ee5 100644 --- a/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk @@ -9,6 +9,3 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 - -# This board has many pins, and we have to remove something else to make room. -CIRCUITPY_RAINBOWIO = 0 diff --git a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk index 5d0734f69d..f1c3631dcb 100644 --- a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk @@ -11,4 +11,3 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 CIRCUITPY_ONEWIREIO = 0 -CIRCUITPY_RAINBOWIO = 0 diff --git a/ports/atmel-samd/boards/sensebox_mcu/mpconfigboard.mk b/ports/atmel-samd/boards/sensebox_mcu/mpconfigboard.mk index ea14f63ad9..0fc15cb321 100644 --- a/ports/atmel-samd/boards/sensebox_mcu/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sensebox_mcu/mpconfigboard.mk @@ -12,5 +12,4 @@ CIRCUITPY_FULL_BUILD = 0 # There are many pin definitions on this board; it doesn't quite fit on very large translations. CIRCUITPY_ONEWIREIO = 0 -CIRCUITPY_RAINBOWIO = 0 CIRCUITPY_USB_MIDI = 0 From 99d7d0d8bb75b8c1877a282ee2577025f1f0303b Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 24 May 2022 14:59:34 -0400 Subject: [PATCH 147/246] Disable ulab for ESP32-S3 TFT --- .../boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk index 7fa81dd40e..aed663c250 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk @@ -6,10 +6,8 @@ USB_MANUFACTURER = "Adafruit" IDF_TARGET = esp32s3 - -#CIRCUITPY_AUDIOCORE = 0 -#CIRCUITPY_PULSEIO = 0 -CIRCUITPY_BITBANGIO = 0 +# Make room for build +CIRCUITPY_ULAB = 0 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ From c0152e7dab9678a8e98ecc599d189e36a17a22dd Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Thu, 21 Oct 2021 20:52:51 +0200 Subject: [PATCH 148/246] Remove gamepadshift module Everything should be using the keypad module instead. Note: there are several boards that still had gamepadshift enabled. I did not contact their authors to make sure they already switched to keypad in their code and documentation. We should probably wait with merging this for their go ahead. --- docs/porting.rst | 2 - docs/redirects.txt | 4 - .../boards/openbook_m4/mpconfigboard.mk | 2 +- .../boards/pybadge/mpconfigboard.mk | 2 +- .../boards/pygamer/mpconfigboard.mk | 2 +- ports/atmel-samd/supervisor/port.c | 6 - ports/mimxrt10xx/supervisor/port.c | 6 - ports/stm/boards/swan_r5/mpconfigboard.mk | 2 - py/circuitpy_defns.mk | 5 - py/circuitpy_mpconfig.h | 9 -- py/circuitpy_mpconfig.mk | 3 - shared-bindings/gamepadshift/GamePadShift.c | 123 ------------------ shared-bindings/gamepadshift/GamePadShift.h | 42 ------ shared-bindings/gamepadshift/__init__.c | 51 -------- shared-bindings/gamepadshift/__init__.h | 31 ----- shared-module/gamepadshift/GamePadShift.c | 52 -------- shared-module/gamepadshift/GamePadShift.h | 43 ------ shared-module/gamepadshift/__init__.c | 57 -------- shared-module/gamepadshift/__init__.h | 33 ----- supervisor/shared/tick.c | 12 +- 20 files changed, 5 insertions(+), 482 deletions(-) delete mode 100644 shared-bindings/gamepadshift/GamePadShift.c delete mode 100644 shared-bindings/gamepadshift/GamePadShift.h delete mode 100644 shared-bindings/gamepadshift/__init__.c delete mode 100644 shared-bindings/gamepadshift/__init__.h delete mode 100644 shared-module/gamepadshift/GamePadShift.c delete mode 100644 shared-module/gamepadshift/GamePadShift.h delete mode 100644 shared-module/gamepadshift/__init__.c delete mode 100644 shared-module/gamepadshift/__init__.h diff --git a/docs/porting.rst b/docs/porting.rst index 013c367291..07a2b1e9c4 100644 --- a/docs/porting.rst +++ b/docs/porting.rst @@ -79,8 +79,6 @@ as a natural "TODO" list. An example minimal build list is shown below: # any port once their prerequisites in common-hal are complete. # Requires DigitalIO: CIRCUITPY_BITBANGIO = 0 - # Requires DigitalIO - CIRCUITPY_GAMEPADSHIFT = 0 # Requires neopixel_write or SPI (dotstar) CIRCUITPY_PIXELBUF = 0 # Requires OS diff --git a/docs/redirects.txt b/docs/redirects.txt index 248a042e7a..2f72e672a8 100644 --- a/docs/redirects.txt +++ b/docs/redirects.txt @@ -82,10 +82,6 @@ shared-bindings/framebufferio/FramebufferDisplay.rst shared-bindings/framebuffer 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/ diff --git a/ports/atmel-samd/boards/openbook_m4/mpconfigboard.mk b/ports/atmel-samd/boards/openbook_m4/mpconfigboard.mk index 85b2dd4205..c46ed6a9fd 100644 --- a/ports/atmel-samd/boards/openbook_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/openbook_m4/mpconfigboard.mk @@ -10,4 +10,4 @@ QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICES = GD25Q16C LONGINT_IMPL = MPZ -CIRCUITPY_GAMEPADSHIFT = 1 +CIRCUITPY_KEYPAD = 1 diff --git a/ports/atmel-samd/boards/pybadge/mpconfigboard.mk b/ports/atmel-samd/boards/pybadge/mpconfigboard.mk index bbee2ee9a1..fd002609b1 100644 --- a/ports/atmel-samd/boards/pybadge/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pybadge/mpconfigboard.mk @@ -12,8 +12,8 @@ LONGINT_IMPL = MPZ CIRCUITPY_AESIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 -CIRCUITPY_GAMEPADSHIFT = 1 CIRCUITPY_GIFIO = 0 +CIRCUITPY_KEYPAD = 1 CIRCUITPY_STAGE = 1 FROZEN_MPY_DIRS += $(TOP)/frozen/circuitpython-stage/pybadge diff --git a/ports/atmel-samd/boards/pygamer/mpconfigboard.mk b/ports/atmel-samd/boards/pygamer/mpconfigboard.mk index 26c3fe9d9b..7446c241db 100644 --- a/ports/atmel-samd/boards/pygamer/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pygamer/mpconfigboard.mk @@ -12,8 +12,8 @@ LONGINT_IMPL = MPZ CIRCUITPY_AESIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 -CIRCUITPY_GAMEPADSHIFT = 1 CIRCUITPY_GIFIO = 0 +CIRCUITPY_KEYPAD = 1 CIRCUITPY_STAGE = 1 FROZEN_MPY_DIRS += $(TOP)/frozen/circuitpython-stage/pygamer diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 885d23c726..424acece78 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -122,9 +122,6 @@ #include "tusb.h" -#if CIRCUITPY_GAMEPADSHIFT -#include "shared-module/gamepadshift/__init__.h" -#endif #if CIRCUITPY_PEW #include "common-hal/_pew/PewPew.h" #endif @@ -428,9 +425,6 @@ void reset_port(void) { reset_gclks(); - #if CIRCUITPY_GAMEPADSHIFT - gamepadshift_reset(); - #endif #if CIRCUITPY_PEW pew_reset(); #endif diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index 38ecfd5c18..fbf0e8a9d8 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -46,9 +46,6 @@ #include "supervisor/background_callback.h" -#if CIRCUITPY_GAMEPADSHIFT -#include "shared-module/gamepadshift/__init__.h" -#endif #if CIRCUITPY_PEW #include "shared-module/_pew/PewPew.h" #endif @@ -294,9 +291,6 @@ void reset_port(void) { rtc_reset(); #endif - #if CIRCUITPY_GAMEPADSHIFT - gamepadshift_reset(); - #endif #if CIRCUITPY_PEW pew_reset(); #endif diff --git a/ports/stm/boards/swan_r5/mpconfigboard.mk b/ports/stm/boards/swan_r5/mpconfigboard.mk index 24b73e332d..b33636309e 100644 --- a/ports/stm/boards/swan_r5/mpconfigboard.mk +++ b/ports/stm/boards/swan_r5/mpconfigboard.mk @@ -49,8 +49,6 @@ CIRCUITPY_DISPLAYIO = 0 # any port once their prerequisites in common-hal are complete. # Requires DigitalIO: CIRCUITPY_BITBANGIO = 1 -# Requires DigitalIO -CIRCUITPY_GAMEPADSHIFT = 1 # Requires neopixel_write or SPI (dotstar) CIRCUITPY_PIXELBUF = 0 # Requires OS diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 0ae3341b3a..c177a9ff89 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -181,9 +181,6 @@ ifeq ($(CIRCUITPY_FUTURE),1) SRC_PATTERNS += __future__/% endif -ifeq ($(CIRCUITPY_GAMEPADSHIFT),1) -SRC_PATTERNS += gamepadshift/% -endif ifeq ($(CIRCUITPY_GETPASS),1) SRC_PATTERNS += getpass/% endif @@ -553,8 +550,6 @@ SRC_SHARED_MODULE_ALL = \ fontio/__init__.c \ framebufferio/FramebufferDisplay.c \ framebufferio/__init__.c \ - gamepadshift/GamePadShift.c \ - gamepadshift/__init__.c \ getpass/__init__.c \ gifio/__init__.c \ gifio/GifWriter.c \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index ec9274464b..bcfa72077b 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -311,14 +311,6 @@ typedef long mp_off_t; #define CIRCUITPY_DISPLAY_AREA_BUFFER_SIZE (0) #endif -#if CIRCUITPY_GAMEPADSHIFT -// Scan gamepad every 32ms -#define CIRCUITPY_GAMEPAD_TICKS 0x1f -#define GAMEPAD_ROOT_POINTERS mp_obj_t gamepad_singleton; -#else -#define GAMEPAD_ROOT_POINTERS -#endif - #if CIRCUITPY_KEYPAD #define KEYPAD_ROOT_POINTERS mp_obj_t keypad_scanners_linked_list; #else @@ -419,7 +411,6 @@ struct _supervisor_allocation_node; #define CIRCUITPY_COMMON_ROOT_POINTERS \ FLASH_ROOT_POINTERS \ KEYPAD_ROOT_POINTERS \ - GAMEPAD_ROOT_POINTERS \ BOARD_UART_ROOT_POINTER \ WIFI_MONITOR_ROOT_POINTERS \ MEMORYMONITOR_ROOT_POINTERS \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 661829de26..c2a12440ae 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -222,9 +222,6 @@ CFLAGS += -DCIRCUITPY_FREQUENCYIO=$(CIRCUITPY_FREQUENCYIO) CIRCUITPY_FUTURE ?= 1 CFLAGS += -DCIRCUITPY_FUTURE=$(CIRCUITPY_FUTURE) -CIRCUITPY_GAMEPADSHIFT ?= 0 -CFLAGS += -DCIRCUITPY_GAMEPADSHIFT=$(CIRCUITPY_GAMEPADSHIFT) - CIRCUITPY_GETPASS ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_GETPASS=$(CIRCUITPY_GETPASS) diff --git a/shared-bindings/gamepadshift/GamePadShift.c b/shared-bindings/gamepadshift/GamePadShift.c deleted file mode 100644 index 1c43eeac7b..0000000000 --- a/shared-bindings/gamepadshift/GamePadShift.c +++ /dev/null @@ -1,123 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Radomir Dopieralski for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION 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 "py/gc.h" -#include "py/mpstate.h" -#include "shared-bindings/gamepadshift/GamePadShift.h" -#include "shared-bindings/gamepadshift/__init__.h" -#include "supervisor/shared/translate.h" -#include "supervisor/shared/tick.h" - -//| class GamePadShift: -//| """Scan buttons for presses through a shift register""" -//| -//| 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`` -//| objects connected to the shift register controlling the buttons. -//| -//| The button presses are accumulated, until the ``get_pressed`` method -//| is called, at which point the button state is cleared, and the new -//| button presses start to be recorded. -//| -//| Only one `gamepadshift.GamePadShift` may be used at a time.""" -//| ... -//| -STATIC mp_obj_t gamepadshift_make_new(const mp_obj_type_t *type, size_t n_args, - size_t n_kw, const mp_obj_t *all_args) { - - enum { ARG_clock, ARG_data, ARG_latch }; - static const mp_arg_t allowed_args[] = { - { MP_QSTR_clock, MP_ARG_REQUIRED | MP_ARG_OBJ}, - { MP_QSTR_data, MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_latch, MP_ARG_REQUIRED | MP_ARG_OBJ}, - }; - mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; - mp_arg_parse_all_kw_array(n_args, n_kw, all_args, MP_ARRAY_SIZE(allowed_args), - allowed_args, args); - - digitalio_digitalinout_obj_t *clock_pin = assert_digitalinout(args[ARG_clock].u_obj); - digitalio_digitalinout_obj_t *data_pin = assert_digitalinout(args[ARG_data].u_obj); - digitalio_digitalinout_obj_t *latch_pin = assert_digitalinout(args[ARG_latch].u_obj); - - gamepadshift_obj_t *gamepad_singleton = MP_STATE_VM(gamepad_singleton); - if (!gamepad_singleton || - !mp_obj_is_type(MP_OBJ_FROM_PTR(gamepad_singleton), - &gamepadshift_type)) { - gamepad_singleton = m_new_ll_obj(gamepadshift_obj_t); - gamepad_singleton->base.type = &gamepadshift_type; - if (!MP_STATE_VM(gamepad_singleton)) { - supervisor_enable_tick(); - } - MP_STATE_VM(gamepad_singleton) = gamepad_singleton; - } - common_hal_gamepadshift_gamepadshift_init(gamepad_singleton, clock_pin, data_pin, latch_pin); - return MP_OBJ_FROM_PTR(gamepad_singleton); -} - -//| 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, -//| which have been pressed (or held down) since the last call to this -//| function set to 1, and the remaining bits set to 0. Then it clears -//| the button state, so that new button presses (or buttons that are -//| held down) can be recorded for the next call.""" -//| ... -//| -STATIC mp_obj_t gamepadshift_get_pressed(mp_obj_t self_in) { - gamepadshift_obj_t *gamepad_singleton = MP_STATE_VM(gamepad_singleton); - mp_obj_t pressed = MP_OBJ_NEW_SMALL_INT(gamepad_singleton->pressed); - gamepad_singleton->pressed = gamepad_singleton->last; - return pressed; -} -MP_DEFINE_CONST_FUN_OBJ_1(gamepadshift_get_pressed_obj, gamepadshift_get_pressed); - -//| def deinit(self) -> None: -//| """Disable button scanning.""" -//| ... -//| -STATIC mp_obj_t gamepadshift_deinit(mp_obj_t self_in) { - common_hal_gamepadshift_gamepadshift_deinit(self_in); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_1(gamepadshift_deinit_obj, gamepadshift_deinit); - - -STATIC const mp_rom_map_elem_t gamepadshift_locals_dict_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR_get_pressed), MP_ROM_PTR(&gamepadshift_get_pressed_obj)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&gamepadshift_deinit_obj)}, -}; -STATIC MP_DEFINE_CONST_DICT(gamepadshift_locals_dict, gamepadshift_locals_dict_table); -const mp_obj_type_t gamepadshift_type = { - { &mp_type_type }, - .name = MP_QSTR_GamePadShift, - .make_new = gamepadshift_make_new, - .locals_dict = (mp_obj_dict_t *)&gamepadshift_locals_dict, -}; diff --git a/shared-bindings/gamepadshift/GamePadShift.h b/shared-bindings/gamepadshift/GamePadShift.h deleted file mode 100644 index 8856e133ac..0000000000 --- a/shared-bindings/gamepadshift/GamePadShift.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Radomir Dopieralski for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION 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_GAMEPADSHIFT_GAMEPADSHIFT_H -#define MICROPY_INCLUDED_SHARED_BINDINGS_GAMEPADSHIFT_GAMEPADSHIFT_H - -#include "shared-module/gamepadshift/GamePadShift.h" - -extern const mp_obj_type_t gamepadshift_type; - -void common_hal_gamepadshift_gamepadshift_init(gamepadshift_obj_t *gamepadshift, - digitalio_digitalinout_obj_t *clock_pin, - digitalio_digitalinout_obj_t *data_pin, - digitalio_digitalinout_obj_t *latch_pin); - -void common_hal_gamepadshift_gamepadshift_deinit(gamepadshift_obj_t *gamepadshift); - -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_GAMEPADSHIFT_GAMEPADSHIFT_H diff --git a/shared-bindings/gamepadshift/__init__.c b/shared-bindings/gamepadshift/__init__.c deleted file mode 100644 index 816fd8d7b0..0000000000 --- a/shared-bindings/gamepadshift/__init__.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Radomir Dopieralski for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION 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/gamepadshift/GamePadShift.h" -#include "shared-bindings/digitalio/DigitalInOut.h" -#include "shared-bindings/util.h" - -//| """Tracks button presses read through a shift register. -//| -//| .. note:: `gamepadshift` is deprecated in CircuitPython 7.0.0 and will be removed in 8.0.0. -//| Use `keypad` instead. -//| """ -//| -STATIC const mp_rom_map_elem_t gamepadshift_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_gamepadshift) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_GamePadShift), MP_ROM_PTR(&gamepadshift_type)}, -}; - -STATIC MP_DEFINE_CONST_DICT(gamepadshift_module_globals, gamepadshift_module_globals_table); - -const mp_obj_module_t gamepadshift_module = { - .base = { &mp_type_module }, - .globals = (mp_obj_dict_t *)&gamepadshift_module_globals, -}; - -MP_REGISTER_MODULE(MP_QSTR_gamepadshift, gamepadshift_module, CIRCUITPY_GAMEPADSHIFT); diff --git a/shared-bindings/gamepadshift/__init__.h b/shared-bindings/gamepadshift/__init__.h deleted file mode 100644 index 4b4be756a6..0000000000 --- a/shared-bindings/gamepadshift/__init__.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Radomir Dopieralski for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION 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_GAMEPADSHIFT___INIT___H -#define MICROPY_INCLUDED_SHARED_BINDINGS_GAMEPADSHIFT___INIT___H - -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_GAMEPADSHIFT___INIT___H diff --git a/shared-module/gamepadshift/GamePadShift.c b/shared-module/gamepadshift/GamePadShift.c deleted file mode 100644 index 0fb7d1e8d3..0000000000 --- a/shared-module/gamepadshift/GamePadShift.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Radomir Dopieralski for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION 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/mpstate.h" -#include "shared-bindings/digitalio/DigitalInOut.h" -#include "shared-bindings/gamepadshift/GamePadShift.h" -#include "shared-module/gamepadshift/GamePadShift.h" -#include "supervisor/shared/tick.h" - -void common_hal_gamepadshift_gamepadshift_init(gamepadshift_obj_t *gamepadshift, - digitalio_digitalinout_obj_t *clock_pin, - digitalio_digitalinout_obj_t *data_pin, - digitalio_digitalinout_obj_t *latch_pin) { - common_hal_digitalio_digitalinout_switch_to_input(data_pin, PULL_NONE); - gamepadshift->data_pin = data_pin; - common_hal_digitalio_digitalinout_switch_to_output(clock_pin, 0, - DRIVE_MODE_PUSH_PULL); - gamepadshift->clock_pin = clock_pin; - common_hal_digitalio_digitalinout_switch_to_output(latch_pin, 1, - DRIVE_MODE_PUSH_PULL); - gamepadshift->latch_pin = latch_pin; - - gamepadshift->last = 0; -} - -void common_hal_gamepadshift_gamepadshift_deinit(gamepadshift_obj_t *gamepadshift) { - MP_STATE_VM(gamepad_singleton) = NULL; - supervisor_disable_tick(); -} diff --git a/shared-module/gamepadshift/GamePadShift.h b/shared-module/gamepadshift/GamePadShift.h deleted file mode 100644 index 53aef50986..0000000000 --- a/shared-module/gamepadshift/GamePadShift.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Radomir Dopieralski for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION 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_GAMEPADSHIFT_GAMEPADSHIFT_H -#define MICROPY_INCLUDED_GAMEPADSHIFT_GAMEPADSHIFT_H - -#include - -#include "shared-bindings/digitalio/DigitalInOut.h" - -typedef struct { - mp_obj_base_t base; - digitalio_digitalinout_obj_t *data_pin; - digitalio_digitalinout_obj_t *clock_pin; - digitalio_digitalinout_obj_t *latch_pin; - volatile uint8_t pressed; - volatile uint8_t last; -} gamepadshift_obj_t; - -#endif // MICROPY_INCLUDED_GAMEPADSHIFT_GAMEPADSHIFT_H diff --git a/shared-module/gamepadshift/__init__.c b/shared-module/gamepadshift/__init__.c deleted file mode 100644 index eadd3034f6..0000000000 --- a/shared-module/gamepadshift/__init__.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 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/gamepadshift/__init__.h" - -#include "py/mpstate.h" -#include "shared-bindings/gamepadshift/GamePadShift.h" - -void gamepadshift_tick(void) { - void *singleton = MP_STATE_VM(gamepad_singleton); - if (singleton == NULL || !mp_obj_is_type(MP_OBJ_FROM_PTR(singleton), &gamepadshift_type)) { - return; - } - - gamepadshift_obj_t *self = MP_OBJ_TO_PTR(singleton); - uint8_t current = 0; - uint8_t bit = 1; - common_hal_digitalio_digitalinout_set_value(self->latch_pin, 1); - for (int i = 0; i < 8; ++i) { - common_hal_digitalio_digitalinout_set_value(self->clock_pin, 0); - if (common_hal_digitalio_digitalinout_get_value(self->data_pin)) { - current |= bit; - } - common_hal_digitalio_digitalinout_set_value(self->clock_pin, 1); - bit <<= 1; - } - common_hal_digitalio_digitalinout_set_value(self->latch_pin, 0); - self->pressed |= self->last & current; - self->last = current; -} - -void gamepadshift_reset(void) { - MP_STATE_VM(gamepad_singleton) = NULL; -} diff --git a/shared-module/gamepadshift/__init__.h b/shared-module/gamepadshift/__init__.h deleted file mode 100644 index 225db73361..0000000000 --- a/shared-module/gamepadshift/__init__.h +++ /dev/null @@ -1,33 +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_GAMEPADSHIFT___INIT___H -#define MICROPY_INCLUDED_GAMEPADSHIFT___INIT___H - -void gamepadshift_tick(void); -void gamepadshift_reset(void); - -#endif // MICROPY_INCLUDED_GAMEPADSHIFT___INIT___H diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index 104083fb20..9e54254123 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -44,10 +44,6 @@ #include "shared-module/displayio/__init__.h" #endif -#if CIRCUITPY_GAMEPADSHIFT -#include "shared-module/gamepadshift/__init__.h" -#endif - #if CIRCUITPY_KEYPAD #include "shared-module/keypad/__init__.h" #endif @@ -102,12 +98,8 @@ void supervisor_tick(void) { filesystem_tick(); #endif - #ifdef CIRCUITPY_GAMEPAD_TICKS - if (!(port_get_raw_ticks(NULL) & CIRCUITPY_GAMEPAD_TICKS)) { - #if CIRCUITPY_GAMEPADSHIFT - gamepadshift_tick(); - #endif - } + #ifdef CIRCUITPY_AUTORELOAD_DELAY_MS + autoreload_tick(); #endif #if CIRCUITPY_KEYPAD From 4e467b7f34af7b4150b090f4f8eae1f8297981ef Mon Sep 17 00:00:00 2001 From: Luqmanul Hakim Zulkifli <49841356+mlhakimz@users.noreply.github.com> Date: Wed, 25 May 2022 09:46:20 +0800 Subject: [PATCH 149/246] Add Cytron Maker Zero SAMD21 --- .../boards/cytron_maker_zero_samd21/board.c | 42 ++++++++++++++++ .../cytron_maker_zero_samd21/mpconfigboard.h | 27 ++++++++++ .../cytron_maker_zero_samd21/mpconfigboard.mk | 11 +++++ .../boards/cytron_maker_zero_samd21/pins.c | 49 +++++++++++++++++++ 4 files changed, 129 insertions(+) create mode 100644 ports/atmel-samd/boards/cytron_maker_zero_samd21/board.c create mode 100644 ports/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/cytron_maker_zero_samd21/pins.c diff --git a/ports/atmel-samd/boards/cytron_maker_zero_samd21/board.c b/ports/atmel-samd/boards/cytron_maker_zero_samd21/board.c new file mode 100644 index 0000000000..e0a7487bd2 --- /dev/null +++ b/ports/atmel-samd/boards/cytron_maker_zero_samd21/board.c @@ -0,0 +1,42 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" +#include "mpconfigboard.h" +#include "hal/include/hal_gpio.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} + +void board_deinit(void) { +} diff --git a/ports/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.h b/ports/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.h new file mode 100644 index 0000000000..7e0d96f0fe --- /dev/null +++ b/ports/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.h @@ -0,0 +1,27 @@ +#define MICROPY_HW_BOARD_NAME "Cytron Maker Zero SAMD21" +#define MICROPY_HW_MCU_NAME "samd21g18" + +#define MICROPY_HW_LED_TX &pin_PA27 +#define MICROPY_HW_LED_RX &pin_PB03 + +#define DEFAULT_I2C_BUS_SCL (&pin_PA23) +#define DEFAULT_I2C_BUS_SDA (&pin_PA22) + +#define DEFAULT_SPI_BUS_SCK (&pin_PB11) +#define DEFAULT_SPI_BUS_MOSI (&pin_PB10) +#define DEFAULT_SPI_BUS_MISO (&pin_PA12) + +#define DEFAULT_UART_BUS_RX (&pin_PA11) +#define DEFAULT_UART_BUS_TX (&pin_PA10) + +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 + +// Connected to a crystal +#define IGNORE_PIN_PA00 1 +#define IGNORE_PIN_PA01 1 + +// SWD-only +#define IGNORE_PIN_PA30 1 +#define IGNORE_PIN_PA31 1 diff --git a/ports/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.mk b/ports/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.mk new file mode 100644 index 0000000000..9466ce571a --- /dev/null +++ b/ports/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.mk @@ -0,0 +1,11 @@ +USB_VID = 0x04D8 +USB_PID = 0xE799 +USB_PRODUCT = "Maker Zero SAMD21" +USB_MANUFACTURER = "Cytron" + +CHIP_VARIANT = SAMD21G18A +CHIP_FAMILY = samd21 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = NONE +CIRCUITPY_FULL_BUILD = 0 diff --git a/ports/atmel-samd/boards/cytron_maker_zero_samd21/pins.c b/ports/atmel-samd/boards/cytron_maker_zero_samd21/pins.c new file mode 100644 index 0000000000..90279da115 --- /dev/null +++ b/ports/atmel-samd/boards/cytron_maker_zero_samd21/pins.c @@ -0,0 +1,49 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PB02) }, + + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA11) }, + { 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_D2), 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) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) }, + { 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_LED), MP_ROM_PTR(&pin_PA17) }, + + { MP_ROM_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_PA13) }, + { MP_ROM_QSTR(MP_QSTR_ATN), MP_ROM_PTR(&pin_PA13) }, + + { MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_PA23) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA23) }, + { 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_MISO), MP_ROM_PTR(&pin_PA12) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From 9649d80ea3f1b70cddc69f9d454dba9af6358a23 Mon Sep 17 00:00:00 2001 From: Luqmanul Hakim Zulkifli <49841356+mlhakimz@users.noreply.github.com> Date: Wed, 25 May 2022 10:03:34 +0800 Subject: [PATCH 150/246] Delete pins.c --- .../boards/cytron_maker_zero_samd21/pins.c | 49 ------------------- 1 file changed, 49 deletions(-) delete mode 100644 ports/atmel-samd/boards/cytron_maker_zero_samd21/pins.c diff --git a/ports/atmel-samd/boards/cytron_maker_zero_samd21/pins.c b/ports/atmel-samd/boards/cytron_maker_zero_samd21/pins.c deleted file mode 100644 index 90279da115..0000000000 --- a/ports/atmel-samd/boards/cytron_maker_zero_samd21/pins.c +++ /dev/null @@ -1,49 +0,0 @@ -#include "shared-bindings/board/__init__.h" - -STATIC const mp_rom_map_elem_t board_module_globals_table[] = { - CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS - - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB08) }, - { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PB09) }, - { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PB02) }, - - { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA11) }, - { 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_D2), 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) }, - { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) }, - { 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_LED), MP_ROM_PTR(&pin_PA17) }, - - { MP_ROM_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_PA13) }, - { MP_ROM_QSTR(MP_QSTR_ATN), MP_ROM_PTR(&pin_PA13) }, - - { MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_PA22) }, - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA22) }, - { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_PA23) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA23) }, - { 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_MISO), MP_ROM_PTR(&pin_PA12) }, - - { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, - { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, - { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, -}; -MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From 8806f5b5d85cbb5d8734556d5ec3eb6360ee63f5 Mon Sep 17 00:00:00 2001 From: Luqmanul Hakim Zulkifli <49841356+mlhakimz@users.noreply.github.com> Date: Wed, 25 May 2022 10:03:45 +0800 Subject: [PATCH 151/246] Delete mpconfigboard.mk --- .../boards/cytron_maker_zero_samd21/mpconfigboard.mk | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 ports/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.mk diff --git a/ports/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.mk b/ports/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.mk deleted file mode 100644 index 9466ce571a..0000000000 --- a/ports/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.mk +++ /dev/null @@ -1,11 +0,0 @@ -USB_VID = 0x04D8 -USB_PID = 0xE799 -USB_PRODUCT = "Maker Zero SAMD21" -USB_MANUFACTURER = "Cytron" - -CHIP_VARIANT = SAMD21G18A -CHIP_FAMILY = samd21 - -INTERNAL_FLASH_FILESYSTEM = 1 -LONGINT_IMPL = NONE -CIRCUITPY_FULL_BUILD = 0 From 5453b331f7ac63c173445b919ef91acb65b7fe63 Mon Sep 17 00:00:00 2001 From: Luqmanul Hakim Zulkifli <49841356+mlhakimz@users.noreply.github.com> Date: Wed, 25 May 2022 10:03:53 +0800 Subject: [PATCH 152/246] Delete mpconfigboard.h --- .../cytron_maker_zero_samd21/mpconfigboard.h | 27 ------------------- 1 file changed, 27 deletions(-) delete mode 100644 ports/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.h diff --git a/ports/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.h b/ports/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.h deleted file mode 100644 index 7e0d96f0fe..0000000000 --- a/ports/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.h +++ /dev/null @@ -1,27 +0,0 @@ -#define MICROPY_HW_BOARD_NAME "Cytron Maker Zero SAMD21" -#define MICROPY_HW_MCU_NAME "samd21g18" - -#define MICROPY_HW_LED_TX &pin_PA27 -#define MICROPY_HW_LED_RX &pin_PB03 - -#define DEFAULT_I2C_BUS_SCL (&pin_PA23) -#define DEFAULT_I2C_BUS_SDA (&pin_PA22) - -#define DEFAULT_SPI_BUS_SCK (&pin_PB11) -#define DEFAULT_SPI_BUS_MOSI (&pin_PB10) -#define DEFAULT_SPI_BUS_MISO (&pin_PA12) - -#define DEFAULT_UART_BUS_RX (&pin_PA11) -#define DEFAULT_UART_BUS_TX (&pin_PA10) - -// USB is always used internally so skip the pin objects for it. -#define IGNORE_PIN_PA24 1 -#define IGNORE_PIN_PA25 1 - -// Connected to a crystal -#define IGNORE_PIN_PA00 1 -#define IGNORE_PIN_PA01 1 - -// SWD-only -#define IGNORE_PIN_PA30 1 -#define IGNORE_PIN_PA31 1 From 6fa552e257f050cb3ba7411e2634f0e892d7908b Mon Sep 17 00:00:00 2001 From: Luqmanul Hakim Zulkifli <49841356+mlhakimz@users.noreply.github.com> Date: Wed, 25 May 2022 10:04:06 +0800 Subject: [PATCH 153/246] Delete board.c --- .../boards/cytron_maker_zero_samd21/board.c | 42 ------------------- 1 file changed, 42 deletions(-) delete mode 100644 ports/atmel-samd/boards/cytron_maker_zero_samd21/board.c diff --git a/ports/atmel-samd/boards/cytron_maker_zero_samd21/board.c b/ports/atmel-samd/boards/cytron_maker_zero_samd21/board.c deleted file mode 100644 index e0a7487bd2..0000000000 --- a/ports/atmel-samd/boards/cytron_maker_zero_samd21/board.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "supervisor/board.h" -#include "mpconfigboard.h" -#include "hal/include/hal_gpio.h" - -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} From 9385f793dca96e402c971989375cbe421e85a2c6 Mon Sep 17 00:00:00 2001 From: Luqmanul Hakim Zulkifli <49841356+mlhakimz@users.noreply.github.com> Date: Wed, 25 May 2022 10:07:33 +0800 Subject: [PATCH 154/246] Add Cytron Maker Zero SAMD21 --- .../boards/cytron_maker_zero_samd21/board.c | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 ports/atmel-samd/boards/cytron_maker_zero_samd21/board.c diff --git a/ports/atmel-samd/boards/cytron_maker_zero_samd21/board.c b/ports/atmel-samd/boards/cytron_maker_zero_samd21/board.c new file mode 100644 index 0000000000..e0a7487bd2 --- /dev/null +++ b/ports/atmel-samd/boards/cytron_maker_zero_samd21/board.c @@ -0,0 +1,42 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" +#include "mpconfigboard.h" +#include "hal/include/hal_gpio.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} + +void board_deinit(void) { +} From 46f4fcc42f27a5f0bf1960767c0de248b3879eba Mon Sep 17 00:00:00 2001 From: Luqmanul Hakim Zulkifli <49841356+mlhakimz@users.noreply.github.com> Date: Wed, 25 May 2022 10:08:17 +0800 Subject: [PATCH 155/246] Add Cytron Maker Zero SAMD21 --- .../boards/cytron_maker_zero_samd21/pins.c | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 ports/atmel-samd/boards/cytron_maker_zero_samd21/pins.c diff --git a/ports/atmel-samd/boards/cytron_maker_zero_samd21/pins.c b/ports/atmel-samd/boards/cytron_maker_zero_samd21/pins.c new file mode 100644 index 0000000000..90279da115 --- /dev/null +++ b/ports/atmel-samd/boards/cytron_maker_zero_samd21/pins.c @@ -0,0 +1,49 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PB02) }, + + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA11) }, + { 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_D2), 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) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) }, + { 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_LED), MP_ROM_PTR(&pin_PA17) }, + + { MP_ROM_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_PA13) }, + { MP_ROM_QSTR(MP_QSTR_ATN), MP_ROM_PTR(&pin_PA13) }, + + { MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_PA23) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA23) }, + { 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_MISO), MP_ROM_PTR(&pin_PA12) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From 0b9996783905adf4275d0a91e78a9ed39dbee73a Mon Sep 17 00:00:00 2001 From: Luqmanul Hakim Zulkifli <49841356+mlhakimz@users.noreply.github.com> Date: Wed, 25 May 2022 10:08:58 +0800 Subject: [PATCH 156/246] Add Cytron Maker Zero SAMD21 --- .../boards/cytron_maker_zero_samd21/mpconfigboard.mk | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 ports/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.mk diff --git a/ports/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.mk b/ports/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.mk new file mode 100644 index 0000000000..9466ce571a --- /dev/null +++ b/ports/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.mk @@ -0,0 +1,11 @@ +USB_VID = 0x04D8 +USB_PID = 0xE799 +USB_PRODUCT = "Maker Zero SAMD21" +USB_MANUFACTURER = "Cytron" + +CHIP_VARIANT = SAMD21G18A +CHIP_FAMILY = samd21 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = NONE +CIRCUITPY_FULL_BUILD = 0 From 9ed71f0c0945ecdfc7f49919ab4168a48b08cd94 Mon Sep 17 00:00:00 2001 From: Luqmanul Hakim Zulkifli <49841356+mlhakimz@users.noreply.github.com> Date: Wed, 25 May 2022 10:09:30 +0800 Subject: [PATCH 157/246] Add Cytron Maker Zero SAMD21 --- .../cytron_maker_zero_samd21/mpconfigboard.h | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 ports/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.h diff --git a/ports/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.h b/ports/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.h new file mode 100644 index 0000000000..7e0d96f0fe --- /dev/null +++ b/ports/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.h @@ -0,0 +1,27 @@ +#define MICROPY_HW_BOARD_NAME "Cytron Maker Zero SAMD21" +#define MICROPY_HW_MCU_NAME "samd21g18" + +#define MICROPY_HW_LED_TX &pin_PA27 +#define MICROPY_HW_LED_RX &pin_PB03 + +#define DEFAULT_I2C_BUS_SCL (&pin_PA23) +#define DEFAULT_I2C_BUS_SDA (&pin_PA22) + +#define DEFAULT_SPI_BUS_SCK (&pin_PB11) +#define DEFAULT_SPI_BUS_MOSI (&pin_PB10) +#define DEFAULT_SPI_BUS_MISO (&pin_PA12) + +#define DEFAULT_UART_BUS_RX (&pin_PA11) +#define DEFAULT_UART_BUS_TX (&pin_PA10) + +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 + +// Connected to a crystal +#define IGNORE_PIN_PA00 1 +#define IGNORE_PIN_PA01 1 + +// SWD-only +#define IGNORE_PIN_PA30 1 +#define IGNORE_PIN_PA31 1 From b143314b222a900292aaffe3f79cf6c3b46fec4a Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 24 May 2022 22:32:17 -0400 Subject: [PATCH 158/246] Espressif: fix allocation of multiple Incremental Encoders --- ports/espressif/common-hal/countio/Counter.c | 4 +- .../common-hal/frequencyio/FrequencyIn.c | 4 +- .../common-hal/rotaryio/IncrementalEncoder.c | 44 +++++++++---------- ports/espressif/peripherals/pcnt.c | 44 ++++++++++--------- ports/espressif/peripherals/pcnt.h | 4 +- 5 files changed, 49 insertions(+), 51 deletions(-) diff --git a/ports/espressif/common-hal/countio/Counter.c b/ports/espressif/common-hal/countio/Counter.c index d18196051f..4203356d12 100644 --- a/ports/espressif/common-hal/countio/Counter.c +++ b/ports/espressif/common-hal/countio/Counter.c @@ -36,7 +36,7 @@ void common_hal_countio_counter_construct(countio_counter_obj_t *self, claim_pin(pin); // Prepare configuration for the PCNT unit - const pcnt_config_t pcnt_config = { + pcnt_config_t pcnt_config = { // Set PCNT input signal and control GPIOs .pulse_gpio_num = pin->number, .ctrl_gpio_num = PCNT_PIN_NOT_USED, @@ -48,7 +48,7 @@ void common_hal_countio_counter_construct(countio_counter_obj_t *self, }; // Initialize PCNT unit - const int8_t 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")); } diff --git a/ports/espressif/common-hal/frequencyio/FrequencyIn.c b/ports/espressif/common-hal/frequencyio/FrequencyIn.c index e4d65c95bd..a6bef57f10 100644 --- a/ports/espressif/common-hal/frequencyio/FrequencyIn.c +++ b/ports/espressif/common-hal/frequencyio/FrequencyIn.c @@ -69,7 +69,7 @@ static void IRAM_ATTR timer_interrupt_handler(void *self_in) { static void init_pcnt(frequencyio_frequencyin_obj_t *self) { // Prepare configuration for the PCNT unit - const pcnt_config_t pcnt_config = { + pcnt_config_t pcnt_config = { // Set PCNT input signal and control GPIOs .pulse_gpio_num = self->pin, .ctrl_gpio_num = PCNT_PIN_NOT_USED, @@ -83,7 +83,7 @@ static void init_pcnt(frequencyio_frequencyin_obj_t *self) { }; // initialize PCNT - const int8_t 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")); } diff --git a/ports/espressif/common-hal/rotaryio/IncrementalEncoder.c b/ports/espressif/common-hal/rotaryio/IncrementalEncoder.c index 15e7fc4b8f..07b97cf9a3 100644 --- a/ports/espressif/common-hal/rotaryio/IncrementalEncoder.c +++ b/ports/espressif/common-hal/rotaryio/IncrementalEncoder.c @@ -36,45 +36,41 @@ void common_hal_rotaryio_incrementalencoder_construct(rotaryio_incrementalencode claim_pin(pin_b); // Prepare configuration for the PCNT unit - pcnt_config_t pcnt_config = { + pcnt_config_t pcnt_config_channel_0 = { // Set PCNT input signal and control GPIOs .pulse_gpio_num = pin_a->number, .ctrl_gpio_num = pin_b->number, .channel = PCNT_CHANNEL_0, // 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 + .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 - const int8_t unit = peripherals_pcnt_get_unit(pcnt_config); + // Allocate and initialize PCNT unit, CHANNEL_0. + const int8_t unit = peripherals_pcnt_init(&pcnt_config_channel_0); if (unit == -1) { mp_raise_RuntimeError(translate("All PCNT units in use")); } - pcnt_unit_config(&pcnt_config); + pcnt_config_t pcnt_config_channel_1 = { + // Set PCNT input signal and control GPIOs + .pulse_gpio_num = pin_b->number, // Pins are reversed from above + .ctrl_gpio_num = pin_a->number, + .channel = PCNT_CHANNEL_1, + // 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_KEEP, // Keep the primary counter mode if low + .hctrl_mode = PCNT_MODE_REVERSE, // Reverse counting direction if high + .unit = unit, + }; - pcnt_config.pulse_gpio_num = pin_b->number; // What was control is now signal - pcnt_config.ctrl_gpio_num = pin_a->number; // What was signal is now control - pcnt_config.channel = PCNT_CHANNEL_1; - // What to do on the positive / negative edge of pulse input? - pcnt_config.pos_mode = PCNT_COUNT_DEC; // Count up on the positive edge - pcnt_config.neg_mode = PCNT_COUNT_INC; // Keep the counter value on the negative edge - // What to do when control input is low or high? - pcnt_config.lctrl_mode = PCNT_MODE_KEEP; // Keep the primary counter mode if low - pcnt_config.hctrl_mode = PCNT_MODE_REVERSE; // Reverse counting direction if high - - pcnt_unit_config(&pcnt_config); - - // 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); + // Reinitalize same unit, CHANNEL_1 with different parameters. + peripherals_pcnt_reinit(&pcnt_config_channel_1); self->pin_a = pin_a->number; self->pin_b = pin_b->number; diff --git a/ports/espressif/peripherals/pcnt.c b/ports/espressif/peripherals/pcnt.c index d1b85fbb13..fa8a3e05d1 100644 --- a/ports/espressif/peripherals/pcnt.c +++ b/ports/espressif/peripherals/pcnt.c @@ -29,48 +29,50 @@ #define PCNT_UNIT_ACTIVE 1 #define PCNT_UNIT_INACTIVE 0 -static uint8_t pcnt_unit_state[4]; +static uint8_t pcnt_unit_state[PCNT_UNIT_MAX]; void peripherals_pcnt_reset(void) { - for (uint8_t i = 0; i <= 3; i++) { + for (uint8_t i = 0; i < PCNT_UNIT_MAX; i++) { pcnt_unit_state[i] = PCNT_UNIT_INACTIVE; } } -int peripherals_pcnt_get_unit(pcnt_config_t pcnt_config) { +static int peripherals_pcnt_get_unit(pcnt_config_t *pcnt_config) { // Look for available pcnt unit - for (uint8_t i = 0; i <= 3; i++) { + for (uint8_t i = 0; i < PCNT_UNIT_MAX; i++) { if (pcnt_unit_state[i] == PCNT_UNIT_INACTIVE) { - pcnt_config.unit = (pcnt_unit_t)i; + pcnt_config->unit = (pcnt_unit_t)i; pcnt_unit_state[i] = PCNT_UNIT_ACTIVE; - break; - } else if (i == 3) { - return -1; + return i; } } - return pcnt_config.unit; + return -1; } -int peripherals_pcnt_init(pcnt_config_t pcnt_config) { - // Look for available pcnt unit +void peripherals_pcnt_reinit(pcnt_config_t *pcnt_config) { + // Reinitialize a pcnt unit that has already been allocated. + // Initialize PCNT unit + pcnt_unit_config(pcnt_config); + + // 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); +} + +int peripherals_pcnt_init(pcnt_config_t *pcnt_config) { const int8_t unit = peripherals_pcnt_get_unit(pcnt_config); if (unit == -1) { return -1; } - // Initialize PCNT unit - pcnt_unit_config(&pcnt_config); + peripherals_pcnt_reinit(pcnt_config); - // 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); - - return pcnt_config.unit; + return pcnt_config->unit; } void peripherals_pcnt_deinit(pcnt_unit_t *unit) { diff --git a/ports/espressif/peripherals/pcnt.h b/ports/espressif/peripherals/pcnt.h index c73c41a232..d34d971601 100644 --- a/ports/espressif/peripherals/pcnt.h +++ b/ports/espressif/peripherals/pcnt.h @@ -30,8 +30,8 @@ #include "driver/pcnt.h" #include "soc/pcnt_struct.h" -extern int peripherals_pcnt_init(pcnt_config_t pcnt_config); -extern int peripherals_pcnt_get_unit(pcnt_config_t pcnt_config); +extern int peripherals_pcnt_init(pcnt_config_t *pcnt_config); +extern void peripherals_pcnt_reinit(pcnt_config_t *pcnt_config); extern void peripherals_pcnt_deinit(pcnt_unit_t *unit); extern void peripherals_pcnt_reset(void); From 06dd1ffbce68b8d06a4c17e69017a3bd78107c3f Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Wed, 25 May 2022 11:18:08 +0200 Subject: [PATCH 159/246] Update supervisor/shared/tick.c Co-authored-by: Dan Halbert --- supervisor/shared/tick.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index 9e54254123..429ca35d60 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -98,9 +98,6 @@ void supervisor_tick(void) { filesystem_tick(); #endif - #ifdef CIRCUITPY_AUTORELOAD_DELAY_MS - autoreload_tick(); - #endif #if CIRCUITPY_KEYPAD keypad_tick(); From 8630ecbebac70441a8bd55522d64e36e6f77ec2e Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Tue, 24 May 2022 11:05:20 +0000 Subject: [PATCH 160/246] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (983 of 983 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 71 +++++++++++++++++++++++++------------------------ 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 997c5415ff..56c8a4737b 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-05-14 12:35+0000\n" +"PO-Revision-Date: 2022-05-25 11:17+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -83,7 +83,7 @@ msgstr "" #: ports/raspberrypi/common-hal/analogio/AnalogOut.c #: ports/raspberrypi/common-hal/rtc/RTC.c msgid "%q" -msgstr "" +msgstr "%q" #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" @@ -91,7 +91,7 @@ msgstr "%q e %q contêm pinos duplicados" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "%q and %q must be different" -msgstr "" +msgstr "%q e %q devem ser diferentes" #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" @@ -115,11 +115,11 @@ msgstr "Os índices %q devem ser inteiros, e não %s" #: shared-module/bitbangio/SPI.c msgid "%q init failed" -msgstr "" +msgstr "a inicialização do %q falhou" #: py/argcheck.c msgid "%q length must be %d" -msgstr "" +msgstr "O comprimento de %q deve ser %d" #: py/argcheck.c msgid "%q length must be %d-%d" @@ -127,11 +127,11 @@ msgstr "o comprimento %q deve ser %d-%d" #: py/argcheck.c msgid "%q length must be <= %d" -msgstr "" +msgstr "o comprimento de %q deve ser <= %d" #: py/argcheck.c msgid "%q length must be >= %d" -msgstr "" +msgstr "o comprimento de %q deve ser >= %d" #: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" @@ -139,7 +139,7 @@ msgstr "o comprimento %q deve ser >=1" #: py/argcheck.c msgid "%q must be %d" -msgstr "" +msgstr "%q deve ser %d" #: py/argcheck.c msgid "%q must be %d-%d" @@ -171,7 +171,7 @@ msgstr "%q deve ser uma string" #: py/argcheck.c msgid "%q must be an int" -msgstr "" +msgstr "%q deve ser um inteiro" #: py/argcheck.c msgid "%q must be of type %q" @@ -672,7 +672,7 @@ msgstr "Chame super().__init__() antes de acessar o objeto nativo." #: ports/cxd56/common-hal/camera/Camera.c msgid "Camera init" -msgstr "" +msgstr "Inicialização da câmera" #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." @@ -743,6 +743,7 @@ msgstr "Não é possível montar '/' quando estiver visível pelo USB." #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c msgid "Cannot reset into bootloader because no bootloader is present" msgstr "" +"Não é possível redefinir no bootloader pois nenhum bootloader está presente" #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -763,7 +764,7 @@ msgstr "Não é possível subclassificar a fatia" #: shared-module/bitbangio/SPI.c msgid "Cannot transfer without MOSI and MISO pins" -msgstr "" +msgstr "Não é possível transferir sem os pinos MOSI e MISO" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" @@ -771,7 +772,7 @@ msgstr "Não é possível variar a frequência em um timer que já esteja em uso #: ports/nrf/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge, only level" -msgstr "" +msgstr "Não é possível acordar na borda do pino, nível apenas" #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge. Only level." @@ -958,7 +959,7 @@ msgstr "Houve uma falha na aquisição do mutex, err 0x%04x" #: shared-module/rgbmatrix/RGBMatrix.c msgid "Failed to allocate %q buffer" -msgstr "" +msgstr "Houve uma falha ao alocar o buffer %q" #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" @@ -1048,7 +1049,7 @@ msgstr "A função requer bloqueio" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "GNSS init" -msgstr "" +msgstr "Inicialização do GNSS" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" @@ -1083,7 +1084,7 @@ 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" #: ports/raspberrypi/common-hal/busio/I2C.c msgid "I2C peripheral in use" @@ -1279,11 +1280,11 @@ msgstr "O LHS da palavra-chave arg deve ser um ID" #: shared-module/displayio/Group.c msgid "Layer already in a group" -msgstr "" +msgstr "Camada já está num 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" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" @@ -1317,7 +1318,7 @@ msgstr "O pino MISO ou MOSI está ausente" #: ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI pin" -msgstr "" +msgstr "Falta o pino MISO ou o MOSI" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format @@ -1420,7 +1421,7 @@ msgstr "Nenhum pino MISO" #: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c msgid "No MISO pin" -msgstr "" +msgstr "Nenhum pino MISO" #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1429,7 +1430,7 @@ msgstr "Nenhum pino MOSI" #: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c msgid "No MOSI pin" -msgstr "" +msgstr "Nenhum pino MOSI" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c @@ -1623,7 +1624,7 @@ msgstr "Apenas um endereço é permitido" #: ports/nrf/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set" -msgstr "" +msgstr "Apenas um alarme alarm.time pode ser definido" #: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c @@ -1675,7 +1676,7 @@ msgstr "" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "PWM restart" -msgstr "" +msgstr "Reinício do PWM" #: ports/raspberrypi/common-hal/countio/Counter.c msgid "PWM slice already in use" @@ -1803,7 +1804,7 @@ msgstr "Houve um erro na inicialização do RNG" #: 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 "RS485" -msgstr "" +msgstr "RS485" #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c @@ -1865,7 +1866,7 @@ msgstr "O formato CSD do Cartão SD não é compatível" #: ports/cxd56/common-hal/sdioio/SDCard.c msgid "SDCard init" -msgstr "" +msgstr "Inicialização do cartão SD" #: ports/stm/common-hal/sdioio/SDCard.c #, c-format @@ -1883,7 +1884,7 @@ msgstr "A configuração SPI falhou" #: ports/stm/common-hal/busio/SPI.c msgid "SPI init error" -msgstr "" +msgstr "Erro de inicialização do SPI" #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" @@ -1891,7 +1892,7 @@ msgstr "O periférico SPI está em uso" #: ports/stm/common-hal/busio/SPI.c msgid "SPI re-init" -msgstr "" +msgstr "Reinicialização do SPI" #: shared-bindings/is31fl3741/FrameBuffer.c msgid "Scale dimensions must divide by 3" @@ -2064,7 +2065,7 @@ msgstr "Para sair, por favor, reinicie a placa sem " #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample" -msgstr "" +msgstr "Muitos canais na amostra" #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." @@ -2099,20 +2100,20 @@ msgstr "O argumento de tupla ou struct_time é necessário" #: ports/stm/common-hal/busio/UART.c msgid "UART de-init" -msgstr "" +msgstr "descontinuar o início UART" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "UART init" -msgstr "" +msgstr "inicialização do UART" #: ports/stm/common-hal/busio/UART.c msgid "UART re-init" -msgstr "" +msgstr "Reinicialização do UART" #: ports/stm/common-hal/busio/UART.c msgid "UART write" -msgstr "" +msgstr "Escrita UART" #: shared-module/usb_hid/Device.c msgid "USB busy" @@ -2544,7 +2545,7 @@ msgstr "Calibração é somente leitura" #: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c msgid "can only have one parent" -msgstr "" +msgstr "pode ter apenas um principal" #: py/emitinlinethumb.c msgid "can only have up to 4 parameters to Thumb assembly" @@ -2720,7 +2721,7 @@ msgstr "fundição" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "channel re-init" -msgstr "" +msgstr "reinício do canal" #: shared-bindings/_stage/Text.c msgid "chars buffer too small" @@ -3165,7 +3166,7 @@ msgstr "os índices devem ser números inteiros, fatias ou listas booleanas" #: ports/espressif/common-hal/busio/I2C.c msgid "init I2C" -msgstr "" +msgstr "inicialização do I2C" #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" @@ -4100,7 +4101,7 @@ msgstr "o tempo limite na espera pelo cartão v2" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "timer re-init" -msgstr "" +msgstr "reinicialização do temporizador" #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" From aef5bc40fbc114c814854374763c1a70b8db667a Mon Sep 17 00:00:00 2001 From: Luqmanul Hakim Zulkifli <49841356+mlhakimz@users.noreply.github.com> Date: Thu, 26 May 2022 00:13:27 +0800 Subject: [PATCH 161/246] Deleted white spaces --- ports/atmel-samd/boards/cytron_maker_zero_samd21/pins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/cytron_maker_zero_samd21/pins.c b/ports/atmel-samd/boards/cytron_maker_zero_samd21/pins.c index 90279da115..4bb0f48467 100644 --- a/ports/atmel-samd/boards/cytron_maker_zero_samd21/pins.c +++ b/ports/atmel-samd/boards/cytron_maker_zero_samd21/pins.c @@ -30,7 +30,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA17) }, { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA17) }, - + { MP_ROM_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_PA13) }, { MP_ROM_QSTR(MP_QSTR_ATN), MP_ROM_PTR(&pin_PA13) }, From b607631ae16bedafc5a35739dec181ceaf73b245 Mon Sep 17 00:00:00 2001 From: Matthew McGowan Date: Wed, 25 May 2022 14:18:37 -0700 Subject: [PATCH 162/246] feat(swan_r5): UF2 support, with UF2 family IDs assigned to stm32 chipsets. --- ports/stm/Makefile | 4 ++-- ports/stm/boards/swan_r5/mpconfigboard.mk | 1 + ports/stm/mpconfigport.mk | 5 +++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ports/stm/Makefile b/ports/stm/Makefile index 48b0000a65..5eeff2c80a 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -302,11 +302,11 @@ $(BUILD)/firmware.hex: $(BUILD)/firmware.elf $(BUILD)/firmware.uf2: $(BUILD)/firmware.hex $(ECHO) "Create $@" - $(PYTHON) $(TOP)/tools/uf2/utils/uf2conv.py -f 0x57755a57 -b $(BOOTLOADER_OFFSET) -c -o "$(BUILD)/firmware.uf2" $^ + $(PYTHON) $(TOP)/tools/uf2/utils/uf2conv.py -f $(UF2_FAMILY_ID) -b $(BOOTLOADER_OFFSET) -c -o "$(BUILD)/firmware.uf2" $^ flash: $(BUILD)/firmware.bin $(ECHO) "Writing $< to the board" - dfu-util -a 0 --dfuse-address 0x08000000 -D $(BUILD)/firmware.bin + dfu-util -a 0 --dfuse-address $(BOOTLOADER_OFFSET) -D $(BUILD)/firmware.bin include $(TOP)/py/mkrules.mk diff --git a/ports/stm/boards/swan_r5/mpconfigboard.mk b/ports/stm/boards/swan_r5/mpconfigboard.mk index b33636309e..a451b3d18f 100644 --- a/ports/stm/boards/swan_r5/mpconfigboard.mk +++ b/ports/stm/boards/swan_r5/mpconfigboard.mk @@ -14,6 +14,7 @@ LD_DEFAULT = boards/STM32L4R5_default.ld # UF2 boot option LD_BOOT = boards/STM32L4R5_boot.ld UF2_OFFSET = 0x8010000 +UF2_BOOTLOADER ?= 1 # Turn all of the below off while trying to get the thing to run # These modules are implemented in ports//common-hal: diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index ba383d41d2..b9f6c2df65 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -8,6 +8,7 @@ ifeq ($(MCU_VARIANT),$(filter $(MCU_VARIANT),STM32F405xx STM32F407xx)) CIRCUITPY_SDIOIO ?= 1 # Number of USB endpoint pairs. USB_NUM_ENDPOINT_PAIRS = 4 + UF2_FAMILY_ID ?= 0x6d0922fa endif ifeq ($(MCU_SERIES),F4) @@ -25,6 +26,7 @@ ifeq ($(MCU_SERIES),F4) CIRCUITPY_ROTARYIO ?= 0 CIRCUITPY_RTC ?= 0 USB_NUM_ENDPOINT_PAIRS = 4 + UF2_FAMILY_ID ?= 0x57755a57 endif ifeq ($(MCU_SERIES),H7) @@ -43,6 +45,7 @@ ifeq ($(MCU_SERIES),H7) CIRCUITPY_RTC ?= 0 USB_NUM_ENDPOINT_PAIRS = 9 + UF2_FAMILY_ID ?= 0x6db66082 endif ifeq ($(MCU_SERIES),F7) @@ -59,6 +62,7 @@ ifeq ($(MCU_SERIES),F7) CIRCUITPY_RTC ?= 0 USB_NUM_ENDPOINT_PAIRS = 6 + UF2_FAMILY_ID ?= 0x53b80f00 endif ifeq ($(MCU_SERIES),L4) @@ -77,6 +81,7 @@ ifeq ($(MCU_SERIES),L4) # This slide deck https://www.st.com/content/ccc/resource/training/technical/product_training/98/89/c8/6c/3e/e9/49/79/STM32L4_Peripheral_USB.pdf/files/STM32L4_Peripheral_USB.pdf/jcr:content/translations/en.STM32L4_Peripheral_USB.pdf # cites 16 endpoints, 8 endpoint pairs, while section 3.39 of the L4R5 datasheet states 6 endpoint pairs. USB_NUM_ENDPOINT_PAIRS = 6 + UF2_FAMILY_ID ?= 0x00ff6919 endif CIRCUITPY_PARALLELDISPLAY := 0 From 5bbaa3b7323dc867b10d1c3d5fdc31e8332612e9 Mon Sep 17 00:00:00 2001 From: Matthew McGowan Date: Wed, 25 May 2022 14:19:35 -0700 Subject: [PATCH 163/246] feat(swan_r5): the upper 1MB of flash (bank 2) is made available for the filesystem --- ports/stm/boards/STM32L4R5_boot.ld | 2 +- ports/stm/boards/STM32L4R5_default.ld | 2 +- ports/stm/supervisor/internal_flash.c | 11 +++++------ ports/stm/supervisor/internal_flash.h | 6 +++--- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/ports/stm/boards/STM32L4R5_boot.ld b/ports/stm/boards/STM32L4R5_boot.ld index 16204205e6..ab34b281a8 100644 --- a/ports/stm/boards/STM32L4R5_boot.ld +++ b/ports/stm/boards/STM32L4R5_boot.ld @@ -8,7 +8,7 @@ MEMORY FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K /* entire flash */ FLASH_ISR (rx) : ORIGIN = 0x08010000, LENGTH = 4K /* ISR vector. Kind of wasteful. */ FLASH_FIRMWARE (rx) : ORIGIN = 0x08011000, LENGTH = 1024K-128K-64K-4K /* For now, limit to 1MB so that bank switching is still possible. */ - FLASH_FS (rw) : ORIGIN = 0x080e0000, LENGTH = 128K + FLASH_FS (rw) : ORIGIN = 0x08100000, LENGTH = 1024K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 640K } diff --git a/ports/stm/boards/STM32L4R5_default.ld b/ports/stm/boards/STM32L4R5_default.ld index 1f6e04f6be..1bffcee04e 100644 --- a/ports/stm/boards/STM32L4R5_default.ld +++ b/ports/stm/boards/STM32L4R5_default.ld @@ -8,7 +8,7 @@ MEMORY FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K /* entire flash */ FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 4K /* ISR vector. Kind of wasteful. */ FLASH_FIRMWARE (rx) : ORIGIN = 0x08001000, LENGTH = 1024K-128K-4K /* For now, limit to 1MB so that bank switching is still possible. */ - FLASH_FS (rw) : ORIGIN = 0x080e0000, LENGTH = 128K + FLASH_FS (rw) : ORIGIN = 0x08100000, LENGTH = 1024K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 640K } diff --git a/ports/stm/supervisor/internal_flash.c b/ports/stm/supervisor/internal_flash.c index 8d8ca2e0e1..cd693d0c66 100644 --- a/ports/stm/supervisor/internal_flash.c +++ b/ports/stm/supervisor/internal_flash.c @@ -95,12 +95,8 @@ STATIC const flash_layout_t flash_layout[] = { STATIC uint8_t _flash_cache[0x20000] __attribute__((aligned(4))); #elif defined(STM32L4) -// todo - the L4 devices can have different flash sizes and different page sizes -// depending upon the dual bank configuration -// This is hardcoded for the Swan R5. When support for other devices is needed more conditionals will be required -// to differentiate. STATIC const flash_layout_t flash_layout[] = { - { 0x08000000, 0x1000, 256 }, + { 0x08100000, 0x1000, 256 }, }; STATIC uint8_t _flash_cache[0x1000] __attribute__((aligned(4))); @@ -174,6 +170,9 @@ uint32_t flash_get_sector_info(uint32_t addr, uint32_t *start_addr, uint32_t *si } void supervisor_flash_init(void) { + #ifdef STM32L4 + // todo - check that the device is in dual bank mode + #endif } uint32_t supervisor_flash_get_block_size(void) { @@ -202,7 +201,7 @@ void port_internal_flash_flush(void) { FLASH_EraseInitTypeDef EraseInitStruct = {}; #if CPY_STM32L4 EraseInitStruct.TypeErase = TYPEERASE_PAGES; - EraseInitStruct.Banks = FLASH_BANK_1; + EraseInitStruct.Banks = FLASH_BANK_2; // filesystem stored in upper 1MB of flash in dual bank mode #else EraseInitStruct.TypeErase = TYPEERASE_SECTORS; EraseInitStruct.VoltageRange = VOLTAGE_RANGE_3; // voltage range needs to be 2.7V to 3.6V diff --git a/ports/stm/supervisor/internal_flash.h b/ports/stm/supervisor/internal_flash.h index 421ee63267..98c55d30e8 100644 --- a/ports/stm/supervisor/internal_flash.h +++ b/ports/stm/supervisor/internal_flash.h @@ -97,9 +97,9 @@ #endif #ifdef STM32L4R5xx -#define STM32_FLASH_SIZE 0x100000 // 1MB // for now just use the first bank -#define INTERNAL_FLASH_FILESYSTEM_SIZE 0x20000 // 128KiB -#define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x080e0000 +#define STM32_FLASH_SIZE 0x200000 // 2MB +#define INTERNAL_FLASH_FILESYSTEM_SIZE 0x100000 // 1024KiB +#define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08100000 #endif #define INTERNAL_FLASH_FILESYSTEM_NUM_BLOCKS (INTERNAL_FLASH_FILESYSTEM_SIZE / FILESYSTEM_BLOCK_SIZE) From 65a5ad09abeed55688c3c188cd0e77e59146c5ff Mon Sep 17 00:00:00 2001 From: Matthew McGowan Date: Wed, 25 May 2022 14:21:03 -0700 Subject: [PATCH 164/246] feat(swan_r5): define an `ext` attribute on the board, which contains attributes for the extended set of castellated pins --- ports/stm/boards/swan_r5/pins.c | 124 ++++++++++++++++++++++++++------ 1 file changed, 103 insertions(+), 21 deletions(-) diff --git a/ports/stm/boards/swan_r5/pins.c b/ports/stm/boards/swan_r5/pins.c index f630d05997..6780795dee 100644 --- a/ports/stm/boards/swan_r5/pins.c +++ b/ports/stm/boards/swan_r5/pins.c @@ -1,14 +1,23 @@ #include "py/objtuple.h" #include "shared-bindings/board/__init__.h" -// Core Feather Pins -STATIC const mp_rom_map_elem_t board_module_globals_table[] = { - CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS +// extended pins +STATIC const mp_rom_map_elem_t board_module_carrier_table[] = { + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PD09) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PD08) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PF15) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PE13) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PE03) }, - { MP_ROM_QSTR(MP_QSTR_ENABLE_3V3), MP_ROM_PTR(&pin_PE04) }, - { MP_ROM_QSTR(MP_QSTR_DISCHARGE_3V3), MP_ROM_PTR(&pin_PE06) }, - { MP_ROM_QSTR(MP_QSTR_DISABLE_DISCHARGING), MP_ROM_TRUE }, - { MP_ROM_QSTR(MP_QSTR_ENABLE_DISCHARGING), MP_ROM_FALSE }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PD01) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB15) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_PD00) }, + + { MP_ROM_QSTR(MP_QSTR_RTS), MP_ROM_PTR(&pin_PG12) }, + { MP_ROM_QSTR(MP_QSTR_CTS), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_RX0), MP_ROM_PTR(&pin_PG08) }, + { MP_ROM_QSTR(MP_QSTR_TX0), MP_ROM_PTR(&pin_PG07) }, { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA03) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA01) }, @@ -16,34 +25,107 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PC01) }, { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PC04) }, { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PC05) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PB01) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PC02) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PE01) }, + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_SCL3), MP_ROM_PTR(&pin_PC00) }, + { MP_ROM_QSTR(MP_QSTR_SDA3), MP_ROM_PTR(&pin_PC09) }, + + { MP_ROM_QSTR(MP_QSTR_RX2), MP_ROM_PTR(&pin_PD06) }, + { MP_ROM_QSTR(MP_QSTR_RTS2), MP_ROM_PTR(&pin_PD04) }, + { MP_ROM_QSTR(MP_QSTR_CTS2), MP_ROM_PTR(&pin_PD03) }, + { MP_ROM_QSTR(MP_QSTR_TX3), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_RX3), MP_ROM_PTR(&pin_PB11) }, + { MP_ROM_QSTR(MP_QSTR_RTS3), MP_ROM_PTR(&pin_PD02) }, + { MP_ROM_QSTR(MP_QSTR_CTS3), MP_ROM_PTR(&pin_PB13) }, + + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PE09) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PE11) }, + { MP_ROM_QSTR(MP_QSTR_SCL2), MP_ROM_PTR(&pin_PF01) }, + { MP_ROM_QSTR(MP_QSTR_SDA2), MP_ROM_PTR(&pin_PF00) }, + + { MP_ROM_QSTR(MP_QSTR_QEN), MP_ROM_PTR(&pin_PD05) }, + { MP_ROM_QSTR(MP_QSTR_QCS), MP_ROM_PTR(&pin_PC11) }, + { MP_ROM_QSTR(MP_QSTR_QCLK), MP_ROM_PTR(&pin_PE10) }, + + { MP_ROM_QSTR(MP_QSTR_EN), MP_ROM_PTR(&pin_PE04) }, + { MP_ROM_QSTR(MP_QSTR_TX2), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PD15) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PF12) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PF13) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_QIO3), MP_ROM_PTR(&pin_PE15) }, + { MP_ROM_QSTR(MP_QSTR_QIO2), MP_ROM_PTR(&pin_PE14) }, + { MP_ROM_QSTR(MP_QSTR_QIO1), MP_ROM_PTR(&pin_PB00) }, + { MP_ROM_QSTR(MP_QSTR_QIO0), MP_ROM_PTR(&pin_PE12) }, + +}; + +MP_DEFINE_CONST_DICT(board_module_carrier, board_module_carrier_table); + +const mp_obj_type_t carrier_type = { + { &mp_type_type }, + .name = MP_QSTR_Ext, + .locals_dict = (mp_obj_dict_t *)&board_module_carrier, +}; + + +// Core Feather Pins +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_ext), MP_ROM_PTR(&carrier_type) }, + + { MP_ROM_QSTR(MP_QSTR_ENABLE_3V3), MP_ROM_PTR(&pin_PE04) }, + { MP_ROM_QSTR(MP_QSTR_DISCHARGE_3V3), MP_ROM_PTR(&pin_PE06) }, + { MP_ROM_QSTR(MP_QSTR_DISABLE_DISCHARGING), MP_ROM_TRUE }, + { MP_ROM_QSTR(MP_QSTR_ENABLE_DISCHARGING), MP_ROM_FALSE }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA03) }, // PWM, ADC + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA01) }, // PWM, ADC + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PC03) }, // ADC + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PC01) }, // ADC + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PC04) }, // ADC + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PC05) }, // ADC + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_PA00) }, { MP_ROM_QSTR(MP_QSTR_BUTTON_USR), MP_ROM_PTR(&pin_PC13) }, { MP_ROM_QSTR(MP_QSTR_SWITCH), MP_ROM_PTR(&pin_PE04) }, - { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_PB02) }, // boot button, but looks like it's wired to GND on the schematic + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_PB02) }, - { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PE11) }, - { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PE09) }, - { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PD15) }, - { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA04) }, // DAC1 output also - { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PE11) }, // PWM + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PE09) }, // PWM + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PD15) }, // PWM + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA04) }, // ADC, DAC1 output also + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA07) }, // ADC, PWM + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA06) }, // ADC, PWM { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PE02) }, - { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA05) }, // DAC1 output also + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA05) }, // ADC, PWM, DAC2 output also - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB07) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB07) }, // PWM + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB06) }, // PWM { MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_PA04) }, // D10 { MP_ROM_QSTR(MP_QSTR_DAC2), MP_ROM_PTR(&pin_PA05) }, // D13 { MP_ROM_QSTR(MP_QSTR_SS), MP_ROM_PTR(&pin_PD00) }, { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PD01) }, - { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB14) }, - { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB15) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB14) }, // PWM? + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB15) }, // PWM? - { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA09) }, - { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA09) }, // ADC, PWM + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA10) }, // PWM { 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 321163da1a3a2bf90b4a50ebb926acba55b50929 Mon Sep 17 00:00:00 2001 From: Matthew McGowan Date: Wed, 25 May 2022 14:22:19 -0700 Subject: [PATCH 165/246] feat(swan_r5): blink the LED on startup. set VUSB_SELECT and DISCHARGE to floating to avoid any potential issues with them being outputs. --- ports/stm/boards/swan_r5/board.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/ports/stm/boards/swan_r5/board.c b/ports/stm/boards/swan_r5/board.c index 5ad6d464bf..36f3946236 100644 --- a/ports/stm/boards/swan_r5/board.c +++ b/ports/stm/boards/swan_r5/board.c @@ -33,14 +33,19 @@ void initialize_discharge_pin(void) { /* Initialize the 3V3 discharge to be OFF and the output power to be ON */ __HAL_RCC_GPIOE_CLK_ENABLE(); + __HAL_RCC_GPIOC_CLK_ENABLE(); + GPIO_InitTypeDef GPIO_InitStruct; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD; + /* Set the DISCHARGE pin and the USB_DETECT pin to FLOAT */ + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_LOW; GPIO_InitStruct.Pin = GPIO_PIN_6; - HAL_GPIO_Init(GPIOE, &GPIO_InitStruct); - HAL_GPIO_WritePin(GPIOE, GPIO_PIN_6, GPIO_PIN_SET); + HAL_GPIO_Init(GPIOE, &GPIO_InitStruct); /* PE6 DISCHRG */ + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); /* PC6 is USB_DETECT */ + + /* Turn on the 3V3 regulator */ GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Speed = GPIO_SPEED_LOW; GPIO_InitStruct.Pin = GPIO_PIN_4; HAL_GPIO_Init(GPIOE, &GPIO_InitStruct); HAL_GPIO_WritePin(GPIOE, GPIO_PIN_4, GPIO_PIN_SET); @@ -53,6 +58,19 @@ void board_init(void) { // Set tick interrupt priority, default HAL value is intentionally invalid // Without this, USB does not function. HAL_InitTick((1UL << __NVIC_PRIO_BITS) - 1UL); + + initialize_discharge_pin(); + + __HAL_RCC_GPIOE_CLK_ENABLE(); + GPIO_InitTypeDef GPIO_InitStruct; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_LOW; + GPIO_InitStruct.Pin = GPIO_PIN_2; + HAL_GPIO_Init(GPIOE, &GPIO_InitStruct); + HAL_GPIO_WritePin(GPIOE, GPIO_PIN_2, GPIO_PIN_SET); + HAL_Delay(50); + HAL_GPIO_WritePin(GPIOE, GPIO_PIN_2, GPIO_PIN_RESET); } bool board_requests_safe_mode(void) { @@ -60,7 +78,6 @@ bool board_requests_safe_mode(void) { } void reset_board(void) { - initialize_discharge_pin(); } void board_deinit(void) { From fb3077ccc246480b59549e35bd52a156944803d7 Mon Sep 17 00:00:00 2001 From: George White Date: Wed, 25 May 2022 21:34:06 +0000 Subject: [PATCH 166/246] Implement UART hardware flow control on SAMD chips --- ports/atmel-samd/common-hal/busio/UART.c | 60 ++++++++++++++++++++++-- ports/atmel-samd/common-hal/busio/UART.h | 2 + 2 files changed, 57 insertions(+), 5 deletions(-) diff --git a/ports/atmel-samd/common-hal/busio/UART.c b/ports/atmel-samd/common-hal/busio/UART.c index 510ce087df..b69d861e37 100644 --- a/ports/atmel-samd/common-hal/busio/UART.c +++ b/ports/atmel-samd/common-hal/busio/UART.c @@ -71,12 +71,16 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, uint8_t rx_pad = 255; // Unset pad uint32_t tx_pinmux = 0; uint8_t tx_pad = 255; // Unset pad + uint32_t rts_pinmux = 0; + uint32_t cts_pinmux = 0; // Set state so the object is deinited to start. self->rx_pin = NO_PIN; self->tx_pin = NO_PIN; + self->rts_pin = NO_PIN; + self->cts_pin = NO_PIN; - if ((rts != NULL) || (cts != NULL) || (rs485_dir != NULL) || (rs485_invert)) { + if ((rs485_dir != NULL) || (rs485_invert)) { mp_raise_NotImplementedError(translate("RS485")); } @@ -84,6 +88,9 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, bool have_tx = tx != NULL; bool have_rx = rx != NULL; + bool have_rts = rts != NULL; + bool have_cts = cts != NULL; + if (!have_tx && !have_rx) { mp_raise_ValueError(translate("tx and rx cannot both be None")); } @@ -122,6 +129,9 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, #endif tx_pinmux = PINMUX(tx->number, (i == 0) ? MUX_C : MUX_D); tx_pad = tx->sercom[i].pad; + if (have_cts) { + cts_pinmux = PINMUX(cts->number, (i == 0) ? MUX_C : MUX_D); + } if (rx == NULL) { sercom = potential_sercom; break; @@ -134,6 +144,9 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, rx->sercom[j].pad != tx_pad) { rx_pinmux = PINMUX(rx->number, (j == 0) ? MUX_C : MUX_D); rx_pad = rx->sercom[j].pad; + if (have_rts) { + rts_pinmux = PINMUX(rts->number, (j == 0) ? MUX_C : MUX_D); + } sercom = sercom_insts[rx->sercom[j].index]; sercom_index = rx->sercom[j].index; break; @@ -193,21 +206,32 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, // 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. + // 0x1: resevered + // 0x2: TX pad 0; RTS: pad 2, CTS: pad 3 + // 0x3: TX pad 0; RTS: pad 2; no CTS // RXPO: // 0x0: RX pad 0 // 0x1: RX pad 1 // 0x2: RX pad 2 // 0x3: RX pad 3 + // Default to TXPO with no RTS/CTS + uint8_t computed_txpo = 0; + // If we have both CTS (with or without RTS), use second pinout + if (have_cts) { + computed_txpo = 2; + } + // If we have RTS only, use the third pinout + if (have_rts && !have_cts) { + computed_txpo = 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.reg |= SERCOM_USART_CTRLA_TXPO(computed_txpo) | SERCOM_USART_CTRLA_RXPO(rx_pad) | (parity == BUSIO_UART_PARITY_NONE ? 0 : SERCOM_USART_CTRLA_FORM(1)); @@ -257,6 +281,26 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, self->rx_pin = NO_PIN; } + if (have_rts) { + gpio_set_pin_direction(rts->number, GPIO_DIRECTION_OUT); + gpio_set_pin_pull_mode(rts->number, GPIO_PULL_OFF); + gpio_set_pin_function(rts->number, rts_pinmux); + self->rts_pin = rts->number; + claim_pin(rts); + } else { + self->rts_pin = NO_PIN; + } + + if (have_cts) { + gpio_set_pin_direction(cts->number, GPIO_DIRECTION_IN); + gpio_set_pin_pull_mode(cts->number, GPIO_PULL_OFF); + gpio_set_pin_function(cts->number, cts_pinmux); + self->cts_pin = cts->number; + claim_pin(cts); + } else { + self->cts_pin = NO_PIN; + } + usart_async_enable(usart_desc_p); } @@ -270,6 +314,8 @@ void common_hal_busio_uart_never_reset(busio_uart_obj_t *self) { never_reset_sercom(hw); never_reset_pin_number(self->rx_pin); never_reset_pin_number(self->tx_pin); + never_reset_pin_number(self->rts_pin); + never_reset_pin_number(self->cts_pin); } } return; @@ -289,8 +335,12 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { usart_async_deinit(usart_desc_p); reset_pin_number(self->rx_pin); reset_pin_number(self->tx_pin); + reset_pin_number(self->rts_pin); + reset_pin_number(self->cts_pin); self->rx_pin = NO_PIN; self->tx_pin = NO_PIN; + self->rts_pin = NO_PIN; + self->cts_pin = NO_PIN; } // Read characters. diff --git a/ports/atmel-samd/common-hal/busio/UART.h b/ports/atmel-samd/common-hal/busio/UART.h index c95fbf1556..b99a16d7db 100644 --- a/ports/atmel-samd/common-hal/busio/UART.h +++ b/ports/atmel-samd/common-hal/busio/UART.h @@ -38,6 +38,8 @@ typedef struct { struct usart_async_descriptor usart_desc; uint8_t rx_pin; uint8_t tx_pin; + int8_t rts_pin; + int8_t cts_pin; uint8_t character_bits; bool rx_error; uint32_t baudrate; From ef3c56816a4df0e463dcb7cbe1a76fdec5397c49 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 25 May 2022 15:54:26 -0700 Subject: [PATCH 167/246] Fix two consecutive matches --- shared-module/dotenv/__init__.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shared-module/dotenv/__init__.c b/shared-module/dotenv/__init__.c index a7d0f9ba0d..bd1973366d 100644 --- a/shared-module/dotenv/__init__.c +++ b/shared-module/dotenv/__init__.c @@ -162,6 +162,10 @@ STATIC mp_int_t read_value(FIL *active_file, char *value, size_t value_len) { } // Unquoted values are ended by a newline or comment. if (!quoted && (character == '\n' || character == '#')) { + if (character == '\n') { + // Rewind one so the next_line can find the \n. + f_lseek(active_file, f_tell(active_file) - 1); + } break; } if (!quoted && unichar_isspace(character)) { From 99b23b96d9f35f5e03b883a18d8db562b579b23d Mon Sep 17 00:00:00 2001 From: George White Date: Thu, 26 May 2022 00:03:46 +0000 Subject: [PATCH 168/246] fix comment typo and mention datasheet --- ports/atmel-samd/common-hal/busio/UART.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/common-hal/busio/UART.c b/ports/atmel-samd/common-hal/busio/UART.c index b69d861e37..71576b5e18 100644 --- a/ports/atmel-samd/common-hal/busio/UART.c +++ b/ports/atmel-samd/common-hal/busio/UART.c @@ -203,10 +203,10 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, // 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. + // Set pads computed for this SERCOM. Refer to the datasheet for details on pads. // TXPO: // 0x0: TX pad 0; no RTS/CTS - // 0x1: resevered + // 0x1: reserved // 0x2: TX pad 0; RTS: pad 2, CTS: pad 3 // 0x3: TX pad 0; RTS: pad 2; no CTS // RXPO: From 8539d6518ebb064b3690ee7c605d7574f6190698 Mon Sep 17 00:00:00 2001 From: George White Date: Thu, 26 May 2022 00:06:00 +0000 Subject: [PATCH 169/246] flip CTS and RTS pinmux to match RX and TX --- ports/atmel-samd/common-hal/busio/UART.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/atmel-samd/common-hal/busio/UART.c b/ports/atmel-samd/common-hal/busio/UART.c index 71576b5e18..ce471f8c1a 100644 --- a/ports/atmel-samd/common-hal/busio/UART.c +++ b/ports/atmel-samd/common-hal/busio/UART.c @@ -129,8 +129,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, #endif tx_pinmux = PINMUX(tx->number, (i == 0) ? MUX_C : MUX_D); tx_pad = tx->sercom[i].pad; - if (have_cts) { - cts_pinmux = PINMUX(cts->number, (i == 0) ? MUX_C : MUX_D); + if (have_rts) { + rts_pinmux = PINMUX(rts->number, (i == 0) ? MUX_C : MUX_D); } if (rx == NULL) { sercom = potential_sercom; @@ -144,8 +144,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, rx->sercom[j].pad != tx_pad) { rx_pinmux = PINMUX(rx->number, (j == 0) ? MUX_C : MUX_D); rx_pad = rx->sercom[j].pad; - if (have_rts) { - rts_pinmux = PINMUX(rts->number, (j == 0) ? MUX_C : MUX_D); + if (have_cts) { + cts_pinmux = PINMUX(cts->number, (j == 0) ? MUX_C : MUX_D); } sercom = sercom_insts[rx->sercom[j].index]; sercom_index = rx->sercom[j].index; From d74193c298b73ff2df5a9ed2e603c885ed728abf Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 26 May 2022 10:58:08 -0400 Subject: [PATCH 170/246] Use -flto and -flto-partition only as needed --- ports/atmel-samd/Makefile | 6 ++++-- ports/nrf/Makefile | 2 +- ports/nrf/boards/bluemicro833/mpconfigboard.mk | 2 +- ports/nrf/boards/microbit_v2/mpconfigboard.mk | 2 +- ports/nrf/boards/pca10100/mpconfigboard.mk | 2 +- ports/nrf/boards/simmel/mpconfigboard.mk | 2 +- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 53ba302376..f0847de2fe 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -124,7 +124,7 @@ $(echo PERIPHERALS_CHIP_FAMILY=$(PERIPHERALS_CHIP_FAMILY)) ifeq ($(DEBUG), 1) CFLAGS += -ggdb3 -Og -Os # You may want to disable -flto if it interferes with debugging. - CFLAGS += -flto -flto-partition=none + CFLAGS += -flto -flto-partition=one # You may want to enable these flags to make setting breakpoints easier. # CFLAGS += -fno-inline -fno-ipa-sra ifeq ($(CHIP_FAMILY), samd21) @@ -147,10 +147,11 @@ 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 + CFLAGS += -flto-partition=one endif ifdef CFLAGS_BOARD @@ -168,6 +169,7 @@ CFLAGS += \ -msoft-float \ -mfloat-abi=soft \ -DSAMD21 + -flto-partition=one endif ifeq ($(CHIP_FAMILY), samd51) CFLAGS += \ diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index 6db2b547c5..c165242b19 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -91,7 +91,7 @@ ifeq ($(DEBUG), 1) else OPTIMIZATION_FLAGS ?= -O2 -fno-inline-functions CFLAGS += -DNDEBUG -ggdb3 - CFLAGS += -flto -flto-partition=none + # If -flto is needed, give it in OPTIMIZATION_FLAGS per board endif ifeq ($(NRF_DEBUG_PRINT), 1) diff --git a/ports/nrf/boards/bluemicro833/mpconfigboard.mk b/ports/nrf/boards/bluemicro833/mpconfigboard.mk index 6c8c7172c1..22ea8df1b9 100644 --- a/ports/nrf/boards/bluemicro833/mpconfigboard.mk +++ b/ports/nrf/boards/bluemicro833/mpconfigboard.mk @@ -50,4 +50,4 @@ SUPEROPT_GC = 0 SUPEROPT_VM = 0 # Override optimization to keep binary small -OPTIMIZATION_FLAGS = -Os +OPTIMIZATION_FLAGS = -Os -flto -flto-partition=one diff --git a/ports/nrf/boards/microbit_v2/mpconfigboard.mk b/ports/nrf/boards/microbit_v2/mpconfigboard.mk index dc47f2be4e..738444c91c 100644 --- a/ports/nrf/boards/microbit_v2/mpconfigboard.mk +++ b/ports/nrf/boards/microbit_v2/mpconfigboard.mk @@ -30,6 +30,6 @@ CIRCUITPY_USB = 0 MICROPY_PY_ASYNC_AWAIT = 0 # Override optimization to keep binary small -OPTIMIZATION_FLAGS = -Os +OPTIMIZATION_FLAGS = -Os -flto -flto-partition=one SUPEROPT_VM = 0 SUPEROPT_GC = 0 diff --git a/ports/nrf/boards/pca10100/mpconfigboard.mk b/ports/nrf/boards/pca10100/mpconfigboard.mk index 95a2dd4d98..7c7bb06c1f 100644 --- a/ports/nrf/boards/pca10100/mpconfigboard.mk +++ b/ports/nrf/boards/pca10100/mpconfigboard.mk @@ -40,4 +40,4 @@ SUPEROPT_GC = 0 SUPEROPT_VM = 0 # Override optimization to keep binary small -OPTIMIZATION_FLAGS = -Os +OPTIMIZATION_FLAGS = -Os -flto -flto-partition=one diff --git a/ports/nrf/boards/simmel/mpconfigboard.mk b/ports/nrf/boards/simmel/mpconfigboard.mk index bdafadceb7..0885462951 100644 --- a/ports/nrf/boards/simmel/mpconfigboard.mk +++ b/ports/nrf/boards/simmel/mpconfigboard.mk @@ -48,6 +48,6 @@ CIRCUITPY_ZLIB = 0 #CIRCUITPY_ENABLE_MPY_NATIVE = 1 # Override optimization to keep binary small -OPTIMIZATION_FLAGS = -Os +OPTIMIZATION_FLAGS = -Os -flto -flto-partition=one SUPEROPT_VM = 0 SUPEROPT_GC = 0 From 95fc7e471368d681755de42792e6873ca686dfeb Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 26 May 2022 11:52:58 -0400 Subject: [PATCH 171/246] harmless change to force all ports to build --- ports/atmel-samd/Makefile | 4 ++-- py/circuitpy_mpconfig.mk | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index f0847de2fe..4bcbb5cf83 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -168,8 +168,8 @@ CFLAGS += \ -mcpu=cortex-m0plus \ -msoft-float \ -mfloat-abi=soft \ - -DSAMD21 - -flto-partition=one + -DSAMD21 \ + -flto-partition=one endif ifeq ($(CHIP_FAMILY), samd51) CFLAGS += \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index aedd96014b..e42f844e34 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -57,8 +57,7 @@ CFLAGS += -DMICROPY_PY_USELECT_SELECT=$(MICROPY_PY_USELECT_SELECT) CIRCUITPY_AESIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_AESIO=$(CIRCUITPY_AESIO) -# TODO: CIRCUITPY_ALARM will gradually be added to -# as many ports as possible +# TODO: CIRCUITPY_ALARM will gradually be added to as many ports as possible # so make this 1 or CIRCUITPY_FULL_BUILD eventually CIRCUITPY_ALARM ?= 0 CFLAGS += -DCIRCUITPY_ALARM=$(CIRCUITPY_ALARM) From ca085150eeca3cdeaea277d95e8e1a5c7e07d176 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 26 May 2022 15:33:04 -0400 Subject: [PATCH 172/246] disable traceback on samd21; re-enable onewireio on Metro m0 --- ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk | 2 -- ports/atmel-samd/mpconfigport.mk | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk index 1914c85990..4e7d799985 100644 --- a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk @@ -9,5 +9,3 @@ CHIP_FAMILY = samd21 SPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C" LONGINT_IMPL = MPZ - -CIRCUITPY_ONEWIREIO = 0 diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index f031386a73..9cd5b39d70 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -45,6 +45,7 @@ CIRCUITPY_RE ?= 0 CIRCUITPY_SDCARDIO ?= 0 CIRCUITPY_SYNTHIO ?= 0 CIRCUITPY_TOUCHIO_USE_NATIVE ?= 1 +CIRCUITPY_TRACEBACK = 0 CIRCUITPY_ULAB = 0 CIRCUITPY_VECTORIO = 0 CIRCUITPY_ZLIB = 0 From 947f564672322b66cbf8e206dc9f772ae9717f9e Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 26 May 2022 13:47:54 -0400 Subject: [PATCH 173/246] tune LTO on nrf --- ports/nrf/Makefile | 9 ++++++++- ports/nrf/boards/bluemicro833/mpconfigboard.mk | 6 ------ ports/nrf/boards/microbit_v2/mpconfigboard.mk | 5 ----- ports/nrf/boards/pca10100/mpconfigboard.mk | 6 ------ ports/nrf/boards/simmel/mpconfigboard.mk | 5 ----- ports/nrf/mpconfigport.mk | 4 ++++ 6 files changed, 12 insertions(+), 23 deletions(-) diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index c165242b19..68bc3cc41c 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -84,6 +84,14 @@ INC += -I../../lib/mp-readline INC += -I../../lib/tinyusb/src INC += -I../../supervisor/shared/usb +ifeq ($(MCU_CHIP),nrf52833) + OPTIMIZATION_FLAGS ?= -Os -flto -flto-partition=one +else + ifeq ($(INTERNAL_FLASH_FILESYSTEM),1) + OPTIMIZATION_FLAGS ?= -Os -flto + endif +endif + #Debugging/Optimization ifeq ($(DEBUG), 1) CFLAGS += -ggdb3 @@ -91,7 +99,6 @@ ifeq ($(DEBUG), 1) else OPTIMIZATION_FLAGS ?= -O2 -fno-inline-functions CFLAGS += -DNDEBUG -ggdb3 - # If -flto is needed, give it in OPTIMIZATION_FLAGS per board endif ifeq ($(NRF_DEBUG_PRINT), 1) diff --git a/ports/nrf/boards/bluemicro833/mpconfigboard.mk b/ports/nrf/boards/bluemicro833/mpconfigboard.mk index 22ea8df1b9..bfefcbf100 100644 --- a/ports/nrf/boards/bluemicro833/mpconfigboard.mk +++ b/ports/nrf/boards/bluemicro833/mpconfigboard.mk @@ -45,9 +45,3 @@ CIRCUITPY_VECTORIO = 0 CIRCUITPY_ZLIB = 0 MICROPY_PY_ASYNC_AWAIT = 0 - -SUPEROPT_GC = 0 -SUPEROPT_VM = 0 - -# Override optimization to keep binary small -OPTIMIZATION_FLAGS = -Os -flto -flto-partition=one diff --git a/ports/nrf/boards/microbit_v2/mpconfigboard.mk b/ports/nrf/boards/microbit_v2/mpconfigboard.mk index 738444c91c..413efda7f7 100644 --- a/ports/nrf/boards/microbit_v2/mpconfigboard.mk +++ b/ports/nrf/boards/microbit_v2/mpconfigboard.mk @@ -28,8 +28,3 @@ CIRCUITPY_ULAB = 0 CIRCUITPY_USB = 0 MICROPY_PY_ASYNC_AWAIT = 0 - -# Override optimization to keep binary small -OPTIMIZATION_FLAGS = -Os -flto -flto-partition=one -SUPEROPT_VM = 0 -SUPEROPT_GC = 0 diff --git a/ports/nrf/boards/pca10100/mpconfigboard.mk b/ports/nrf/boards/pca10100/mpconfigboard.mk index 7c7bb06c1f..553da88963 100644 --- a/ports/nrf/boards/pca10100/mpconfigboard.mk +++ b/ports/nrf/boards/pca10100/mpconfigboard.mk @@ -35,9 +35,3 @@ CIRCUITPY_VECTORIO = 0 CIRCUITPY_ZLIB = 0 MICROPY_PY_ASYNC_AWAIT = 0 - -SUPEROPT_GC = 0 -SUPEROPT_VM = 0 - -# Override optimization to keep binary small -OPTIMIZATION_FLAGS = -Os -flto -flto-partition=one diff --git a/ports/nrf/boards/simmel/mpconfigboard.mk b/ports/nrf/boards/simmel/mpconfigboard.mk index 0885462951..faf9d2d1e3 100644 --- a/ports/nrf/boards/simmel/mpconfigboard.mk +++ b/ports/nrf/boards/simmel/mpconfigboard.mk @@ -46,8 +46,3 @@ CIRCUITPY_ZLIB = 0 # Enable micropython.native #CIRCUITPY_ENABLE_MPY_NATIVE = 1 - -# Override optimization to keep binary small -OPTIMIZATION_FLAGS = -Os -flto -flto-partition=one -SUPEROPT_VM = 0 -SUPEROPT_GC = 0 diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index 1a12c20f2d..6cbbce1846 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -77,6 +77,10 @@ MCU_SERIES = m4 MCU_VARIANT = nrf52 MCU_SUB_VARIANT = nrf52833 +# Need the space +SUPEROPT_GC ?= 0 +SUPEROPT_VM ?= 0 + SD ?= s140 SOFTDEV_VERSION ?= 7.0.1 From c6762538347b8021cd691968702ba64943e13d13 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 26 May 2022 16:44:48 -0700 Subject: [PATCH 174/246] Switch translate() to the header file This allows the compile stage to optimize most of the translate() function away and saves a ton of space (~40k on ESP). *However*, it requires us to wait for the qstr output before we compile the rest of our .o files. (Only qstr.o used to wait.) This isn't as good as the current setup with LTO though. Trinket M0 loses <1k with this setup. So, we should probably conditionalize this along with LTO. --- .../mpconfigboard.mk | 3 --- py/mkrules.mk | 4 ++-- supervisor/shared/translate.c | 16 --------------- supervisor/shared/translate.h | 20 ++++++++++++++++++- 4 files changed, 21 insertions(+), 22 deletions(-) diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk index aed663c250..b3c68b3b62 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk @@ -6,9 +6,6 @@ USB_MANUFACTURER = "Adafruit" IDF_TARGET = esp32s3 -# Make room for build -CIRCUITPY_ULAB = 0 - INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/py/mkrules.mk b/py/mkrules.mk index 6bef64fd82..b83a40dc29 100644 --- a/py/mkrules.mk +++ b/py/mkrules.mk @@ -58,7 +58,7 @@ $(Q)$(CXX) $(CXXFLAGS) -c -MD -o $@ $< endef vpath %.c . $(TOP) $(USER_C_MODULES) $(DEVICES_MODULES) -$(BUILD)/%.o: %.c +$(BUILD)/%.o: %.c | $(HEADER_BUILD)/qstrdefs.generated.h $(HEADER_BUILD)/qstrdefs.enum.h $(call compile_c) vpath %.cpp . $(TOP) $(USER_C_MODULES) @@ -89,7 +89,7 @@ $(BUILD)/%.pp: %.c # the right .o's to get recompiled if the generated.h file changes. Adding # an order-only dependency to all of the .o's will cause the generated .h # to get built before we try to compile any of them. -$(OBJ): | $(HEADER_BUILD)/qstrdefs.enum.h $(HEADER_BUILD)/mpversion.h +$(OBJ): | $(HEADER_BUILD)/mpversion.h # The logic for qstr regeneration (applied by makeqstrdefs.py) is: # - if anything in QSTR_GLOBAL_DEPENDENCIES is newer, then process all source files ($^) diff --git a/supervisor/shared/translate.c b/supervisor/shared/translate.c index fefda46006..55cc7d5d1e 100644 --- a/supervisor/shared/translate.c +++ b/supervisor/shared/translate.c @@ -134,19 +134,3 @@ char *decompress(const compressed_string_t *compressed, char *decompressed) { decompressed[length - 1] = '\0'; return decompressed; } - -inline -// gcc10 -flto has issues with this being always_inline for debug builds. -#if CIRCUITPY_DEBUG < 1 -__attribute__((always_inline)) -#endif -const compressed_string_t *translate(const char *original) { - #ifndef NO_QSTR - #define QDEF(id, hash, len, str) - #define TRANSLATION(id, firstbyte, ...) if (strcmp(original, id) == 0) { static const compressed_string_t v = { .data = firstbyte, .tail = { __VA_ARGS__ } }; return &v; } else - #include "genhdr/qstrdefs.generated.h" -#undef TRANSLATION -#undef QDEF - #endif - return NULL; -} diff --git a/supervisor/shared/translate.h b/supervisor/shared/translate.h index da58e1eb78..1963c6fe65 100644 --- a/supervisor/shared/translate.h +++ b/supervisor/shared/translate.h @@ -27,7 +27,9 @@ #ifndef MICROPY_INCLUDED_SUPERVISOR_TRANSLATE_H #define MICROPY_INCLUDED_SUPERVISOR_TRANSLATE_H +#include #include +#include // The format of the compressed data is: // - the size of the uncompressed string in UTF-8 bytes, encoded as a @@ -77,7 +79,7 @@ typedef struct compressed_string { // Return the compressed, translated version of a source string // Usually, due to LTO, this is optimized into a load of a constant // pointer. -const compressed_string_t *translate(const char *c); +// const compressed_string_t *translate(const char *c); void serial_write_compressed(const compressed_string_t *compressed); char *decompress(const compressed_string_t *compressed, char *decompressed); uint16_t decompress_length(const compressed_string_t *compressed); @@ -90,4 +92,20 @@ uint16_t decompress_length(const compressed_string_t *compressed); #define MP_ERROR_TEXT(x) translate(x) #endif +static inline +// gcc10 -flto has issues with this being always_inline for debug builds. +#if CIRCUITPY_DEBUG < 1 +__attribute__((always_inline)) +#endif +const compressed_string_t *translate(const char *original) { + #ifndef NO_QSTR + #define QDEF(id, hash, len, str) + #define TRANSLATION(id, firstbyte, ...) if (strcmp(original, id) == 0) { static const compressed_string_t v = { .data = firstbyte, .tail = { __VA_ARGS__ } }; return &v; } else + #include "genhdr/qstrdefs.generated.h" +#undef TRANSLATION +#undef QDEF + #endif + return NULL; +} + #endif // MICROPY_INCLUDED_SUPERVISOR_TRANSLATE_H From 9d10a3da66cd799b659457ca9785be1a33105dc6 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 27 May 2022 12:59:54 -0700 Subject: [PATCH 175/246] Conditionalize LTO --- devices/ble_hci/common-hal/_bleio/att.c | 1 + extmod/moduasyncio.c | 2 + extmod/modubinascii.c | 2 + extmod/moductypes.c | 2 +- extmod/moduhashlib.c | 2 +- extmod/moduheapq.c | 2 +- extmod/modujson.c | 2 +- extmod/modutimeq.c | 2 +- extmod/moduzlib.c | 2 +- extmod/vfs_fat.c | 2 +- extmod/vfs_posix_file.c | 2 +- main.c | 2 +- ports/atmel-samd/Makefile | 9 +- ports/atmel-samd/common-hal/_pew/PewPew.c | 2 +- .../atmel-samd/common-hal/analogio/AnalogIn.c | 2 +- .../common-hal/analogio/AnalogOut.c | 2 +- .../atmel-samd/common-hal/audiobusio/I2SOut.c | 2 +- .../atmel-samd/common-hal/audiobusio/PDMIn.c | 280 +++++++++--------- .../atmel-samd/common-hal/audioio/AudioOut.c | 2 +- ports/atmel-samd/common-hal/busio/I2C.c | 2 +- ports/atmel-samd/common-hal/busio/SPI.c | 1 + ports/atmel-samd/common-hal/busio/UART.c | 2 +- ports/atmel-samd/common-hal/countio/Counter.c | 2 +- .../common-hal/digitalio/DigitalInOut.c | 2 +- .../common-hal/frequencyio/FrequencyIn.c | 2 +- .../common-hal/microcontroller/Pin.c | 1 + .../common-hal/microcontroller/__init__.c | 2 +- ports/atmel-samd/common-hal/ps2io/Ps2.c | 2 +- ports/atmel-samd/common-hal/pulseio/PulseIn.c | 2 +- .../atmel-samd/common-hal/pulseio/PulseOut.c | 2 +- ports/atmel-samd/common-hal/pwmio/PWMOut.c | 2 +- .../common-hal/rotaryio/IncrementalEncoder.c | 2 +- ports/atmel-samd/common-hal/rtc/RTC.c | 2 +- ports/atmel-samd/common-hal/sdioio/SDCard.c | 2 +- ports/atmel-samd/common-hal/touchio/TouchIn.c | 2 +- ports/atmel-samd/mpconfigport.mk | 8 + .../common-hal/digitalio/DigitalInOut.c | 2 +- ports/broadcom/common-hal/sdioio/SDCard.c | 2 +- ports/espressif/Makefile | 2 - .../espressif/common-hal/analogio/AnalogIn.c | 2 +- .../espressif/common-hal/analogio/AnalogOut.c | 2 +- .../espressif/common-hal/audiobusio/I2SOut.c | 2 +- ports/espressif/common-hal/busio/I2C.c | 2 +- ports/espressif/common-hal/busio/UART.c | 2 +- ports/espressif/common-hal/countio/Counter.c | 2 +- .../common-hal/digitalio/DigitalInOut.c | 2 +- .../common-hal/microcontroller/Processor.c | 2 +- ports/litex/Makefile | 4 +- .../litex/common-hal/digitalio/DigitalInOut.c | 2 +- .../common-hal/microcontroller/Processor.c | 2 +- ports/mimxrt10xx/Makefile | 7 +- .../common-hal/analogio/AnalogOut.c | 2 +- .../common-hal/digitalio/DigitalInOut.c | 2 +- .../common-hal/microcontroller/__init__.c | 2 +- ports/mimxrt10xx/common-hal/pwmio/PWMOut.c | 2 +- ports/mimxrt10xx/common-hal/rtc/RTC.c | 2 +- ports/nrf/Makefile | 8 - ports/nrf/common-hal/analogio/AnalogIn.c | 4 +- ports/nrf/common-hal/analogio/AnalogOut.c | 2 +- ports/nrf/common-hal/audiopwmio/PWMAudioOut.c | 2 +- ports/nrf/common-hal/busio/I2C.c | 2 +- ports/nrf/common-hal/busio/UART.c | 2 +- ports/nrf/common-hal/digitalio/DigitalInOut.c | 2 +- .../common-hal/microcontroller/Processor.c | 3 +- ports/nrf/common-hal/pulseio/PulseOut.c | 2 +- ports/nrf/common-hal/pwmio/PWMOut.c | 2 +- ports/nrf/common-hal/rtc/RTC.c | 2 +- ports/nrf/mpconfigport.mk | 8 + .../bindings/rp2pio/StateMachine.c | 2 +- .../common-hal/analogio/AnalogIn.c | 2 +- .../common-hal/analogio/AnalogOut.c | 2 +- .../common-hal/audiobusio/I2SOut.c | 2 +- .../raspberrypi/common-hal/audiobusio/PDMIn.c | 2 +- .../common-hal/audiopwmio/PWMAudioOut.c | 2 +- .../raspberrypi/common-hal/countio/Counter.c | 2 +- .../common-hal/digitalio/DigitalInOut.c | 2 +- .../common-hal/microcontroller/__init__.c | 2 +- .../raspberrypi/common-hal/pulseio/PulseIn.c | 2 +- .../raspberrypi/common-hal/pulseio/PulseOut.c | 2 +- ports/raspberrypi/common-hal/pwmio/PWMOut.c | 2 +- ports/stm/Makefile | 2 - ports/stm/common-hal/analogio/AnalogIn.c | 2 +- ports/stm/common-hal/analogio/AnalogOut.c | 2 +- ports/stm/common-hal/busio/I2C.c | 2 +- ports/stm/common-hal/busio/SPI.c | 2 +- ports/stm/common-hal/busio/UART.c | 2 +- ports/stm/common-hal/digitalio/DigitalInOut.c | 2 +- .../common-hal/microcontroller/Processor.c | 2 +- ports/stm/common-hal/pulseio/PulseOut.c | 2 +- ports/stm/common-hal/pwmio/PWMOut.c | 2 +- ports/stm/common-hal/sdioio/SDCard.c | 2 +- ports/stm/peripherals/timers.c | 2 +- ports/unix/modffi.c | 2 +- ports/unix/modmachine.c | 2 +- py/argcheck.c | 2 +- py/bc.c | 2 +- py/binary.c | 2 +- py/builtinevex.c | 2 +- py/builtinhelp.c | 2 + py/builtinimport.c | 2 +- py/circuitpy_defns.mk | 13 +- py/compile.c | 10 +- py/enum.c | 2 + py/lexer.c | 2 +- py/makeqstrdata.py | 2 +- py/modbuiltins.c | 2 +- py/modmath.c | 2 +- py/modmicropython.c | 2 +- py/modstruct.c | 2 +- py/modthread.c | 2 +- py/moduerrno.c | 2 +- py/obj.c | 2 +- py/obj.h | 2 +- py/objarray.c | 2 +- py/objcomplex.c | 2 +- py/objdeque.c | 2 +- py/objdict.c | 2 +- py/objexcept.c | 2 +- py/objfloat.c | 2 +- py/objgenerator.c | 2 +- py/objint.c | 2 +- py/objint_longlong.c | 2 +- py/objint_mpz.c | 2 +- py/objlist.c | 2 +- py/objnamedtuple.c | 2 +- py/objobject.c | 2 +- py/objrange.c | 2 +- py/objset.c | 2 +- py/objslice.c | 2 +- py/objstr.c | 2 +- py/objstringio.c | 2 +- py/objstrunicode.c | 2 +- py/objtuple.c | 2 +- py/objtype.c | 2 +- py/parse.c | 2 +- py/parsenum.c | 2 +- py/persistentcode.c | 2 +- py/proto.c | 2 + py/qstr.c | 1 + py/runtime.c | 2 +- py/runtime.h | 2 + py/sequence.c | 2 +- py/stream.c | 2 +- py/vm.c | 1 + runtime.py | 10 + shared-bindings/_pew/PewPew.c | 2 +- shared-bindings/_stage/Layer.c | 2 +- shared-bindings/_stage/Text.c | 2 +- .../i2c_device/I2CDevice.c | 2 +- .../spi_device/SPIDevice.c | 2 +- shared-bindings/alarm/SleepMemory.c | 2 +- shared-bindings/alarm/pin/PinAlarm.c | 2 +- shared-bindings/alarm/time/TimeAlarm.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/SPI.c | 2 +- shared-bindings/busio/I2C.c | 2 +- shared-bindings/busio/SPI.c | 2 +- shared-bindings/busio/UART.c | 2 +- shared-bindings/digitalio/DigitalInOut.c | 2 +- shared-bindings/digitalio/Pull.c | 1 + 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/Shape.c | 2 +- shared-bindings/displayio/TileGrid.c | 2 +- shared-bindings/fontio/BuiltinFont.c | 2 +- .../framebufferio/FramebufferDisplay.c | 2 +- shared-bindings/frequencyio/FrequencyIn.c | 2 +- shared-bindings/math/__init__.c | 2 +- .../memorymonitor/AllocationAlarm.c | 2 +- .../memorymonitor/AllocationSize.c | 2 +- shared-bindings/microcontroller/Pin.c | 2 +- shared-bindings/microcontroller/Processor.c | 2 +- shared-bindings/microcontroller/__init__.c | 2 +- shared-bindings/multiterminal/__init__.c | 2 +- shared-bindings/neopixel_write/__init__.c | 2 +- shared-bindings/nvm/ByteArray.c | 2 +- shared-bindings/os/__init__.c | 1 + shared-bindings/paralleldisplay/ParallelBus.c | 2 +- shared-bindings/ps2io/Ps2.c | 2 +- shared-bindings/pulseio/PulseIn.c | 2 +- shared-bindings/pulseio/PulseOut.c | 2 +- shared-bindings/pwmio/PWMOut.c | 2 +- shared-bindings/random/__init__.c | 2 +- shared-bindings/rtc/RTC.c | 2 +- shared-bindings/sdioio/SDCard.c | 2 +- shared-bindings/storage/__init__.c | 2 +- shared-bindings/struct/__init__.c | 2 +- shared-bindings/supervisor/__init__.c | 2 +- shared-bindings/synthio/MidiTrack.c | 2 +- shared-bindings/terminalio/Terminal.c | 2 +- shared-bindings/time/__init__.c | 2 +- shared-bindings/touchio/TouchIn.c | 2 +- shared-bindings/usb_cdc/Serial.c | 2 +- shared-bindings/usb_cdc/__init__.c | 1 + shared-bindings/usb_hid/Device.c | 1 + shared-bindings/usb_hid/__init__.c | 2 + shared-bindings/usb_midi/PortIn.c | 2 +- shared-bindings/usb_midi/PortOut.c | 2 +- shared-bindings/usb_midi/__init__.c | 1 + shared-bindings/util.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/zlib/__init__.c | 2 +- shared-module/audiocore/WaveFile.c | 2 +- shared-module/audiomp3/MP3Decoder.c | 2 +- shared-module/bitbangio/I2C.c | 2 +- shared-module/bitbangio/SPI.c | 2 +- shared-module/board/__init__.c | 2 +- shared-module/msgpack/__init__.c | 2 +- shared-module/storage/__init__.c | 1 + shared-module/struct/__init__.c | 2 +- shared-module/usb_hid/Device.c | 2 +- shared-module/usb_hid/__init__.c | 1 + shared-module/usb_midi/PortIn.c | 2 +- shared-module/usb_midi/PortOut.c | 2 +- shared-module/usb_midi/__init__.c | 1 + shared/libc/abort_.c | 2 +- shared/netutils/netutils.c | 2 +- supervisor/shared/safe_mode.c | 2 +- .../compressed_string.h} | 29 +- supervisor/shared/{ => translate}/translate.c | 6 +- supervisor/shared/translate/translate.h | 55 ++++ supervisor/shared/translate/translate_impl.h | 52 ++++ supervisor/supervisor.mk | 2 +- 243 files changed, 534 insertions(+), 413 deletions(-) create mode 100644 runtime.py rename supervisor/shared/{translate.h => translate/compressed_string.h} (81%) rename supervisor/shared/{ => translate}/translate.c (97%) create mode 100644 supervisor/shared/translate/translate.h create mode 100644 supervisor/shared/translate/translate_impl.h diff --git a/devices/ble_hci/common-hal/_bleio/att.c b/devices/ble_hci/common-hal/_bleio/att.c index abfe7429f4..f649967ca9 100644 --- a/devices/ble_hci/common-hal/_bleio/att.c +++ b/devices/ble_hci/common-hal/_bleio/att.c @@ -44,6 +44,7 @@ #include "shared-bindings/_bleio/Service.h" #include "shared-bindings/_bleio/UUID.h" #include "supervisor/shared/tick.h" +#include "supervisor/shared/translate/translate.h" STATIC uint16_t max_mtu = BT_ATT_DEFAULT_LE_MTU; // 23 STATIC unsigned long timeout = 5000; diff --git a/extmod/moduasyncio.c b/extmod/moduasyncio.c index 016ffcbc99..c4c4d36ad8 100644 --- a/extmod/moduasyncio.c +++ b/extmod/moduasyncio.c @@ -33,6 +33,8 @@ #include "shared-bindings/supervisor/__init__.h" #endif +#include "supervisor/shared/translate/translate.h" + #if MICROPY_PY_UASYNCIO // Used when task cannot be guaranteed to be non-NULL. diff --git a/extmod/modubinascii.c b/extmod/modubinascii.c index 7157be31fa..5aa9eacefd 100644 --- a/extmod/modubinascii.c +++ b/extmod/modubinascii.c @@ -11,6 +11,8 @@ #include "py/runtime.h" #include "py/binary.h" +#include "supervisor/shared/translate/translate.h" + static void check_not_unicode(const mp_obj_t arg) { #if MICROPY_CPYTHON_COMPAT if (mp_obj_is_str(arg)) { diff --git a/extmod/moductypes.c b/extmod/moductypes.c index 265cbd6d5d..f770ead006 100644 --- a/extmod/moductypes.c +++ b/extmod/moductypes.c @@ -11,7 +11,7 @@ #include "py/objtuple.h" #include "py/binary.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_UCTYPES diff --git a/extmod/moduhashlib.c b/extmod/moduhashlib.c index 741f43c74c..a84254c566 100644 --- a/extmod/moduhashlib.c +++ b/extmod/moduhashlib.c @@ -8,7 +8,7 @@ #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_UHASHLIB diff --git a/extmod/moduheapq.c b/extmod/moduheapq.c index 34867a5838..0200245f86 100644 --- a/extmod/moduheapq.c +++ b/extmod/moduheapq.c @@ -6,7 +6,7 @@ #include "py/objlist.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_UHEAPQ diff --git a/extmod/modujson.c b/extmod/modujson.c index 9a4db7c273..cff02ae95c 100644 --- a/extmod/modujson.c +++ b/extmod/modujson.c @@ -13,7 +13,7 @@ #include "py/runtime.h" #include "py/stream.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_UJSON diff --git a/extmod/modutimeq.c b/extmod/modutimeq.c index 495675ad1d..fcef14ce98 100644 --- a/extmod/modutimeq.c +++ b/extmod/modutimeq.c @@ -10,7 +10,7 @@ #include "py/runtime.h" #include "py/smallint.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_UTIMEQ diff --git a/extmod/moduzlib.c b/extmod/moduzlib.c index b1eeac934b..6a1a2d6111 100644 --- a/extmod/moduzlib.c +++ b/extmod/moduzlib.c @@ -10,7 +10,7 @@ #include "py/stream.h" #include "py/mperrno.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_UZLIB diff --git a/extmod/vfs_fat.c b/extmod/vfs_fat.c index ed5cc6095f..d19a53a9ef 100644 --- a/extmod/vfs_fat.c +++ b/extmod/vfs_fat.c @@ -20,7 +20,7 @@ #include "extmod/vfs_fat.h" #include "shared/timeutils/timeutils.h" #include "supervisor/filesystem.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if FF_MAX_SS == FF_MIN_SS #define SECSIZE(fs) (FF_MIN_SS) diff --git a/extmod/vfs_posix_file.c b/extmod/vfs_posix_file.c index a984ace4a2..94ddbe5f7b 100644 --- a/extmod/vfs_posix_file.c +++ b/extmod/vfs_posix_file.c @@ -8,7 +8,7 @@ #include "py/runtime.h" #include "py/stream.h" #include "extmod/vfs_posix.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if (defined(MICROPY_VFS_POSIX) && MICROPY_VFS_POSIX) || (defined(MICROPY_VFS_POSIX_FILE) && MICROPY_VFS_POSIX_FILE) diff --git a/main.c b/main.c index 17fe8167f2..d2b3edb16a 100644 --- a/main.c +++ b/main.c @@ -58,7 +58,7 @@ #include "supervisor/shared/status_leds.h" #include "supervisor/shared/tick.h" #include "supervisor/shared/traceback.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "supervisor/shared/workflow.h" #include "supervisor/usb.h" #include "supervisor/workflow.h" diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 4bcbb5cf83..281b5efd2f 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -123,8 +123,6 @@ $(echo PERIPHERALS_CHIP_FAMILY=$(PERIPHERALS_CHIP_FAMILY)) #Debugging/Optimization ifeq ($(DEBUG), 1) CFLAGS += -ggdb3 -Og -Os - # You may want to disable -flto if it interferes with debugging. - CFLAGS += -flto -flto-partition=one # You may want to enable these flags to make setting breakpoints easier. # CFLAGS += -fno-inline -fno-ipa-sra ifeq ($(CHIP_FAMILY), samd21) @@ -147,11 +145,8 @@ else CFLAGS += -finline-limit=$(CFLAGS_INLINE_LIMIT) endif - CFLAGS += -flto - ifeq ($(CIRCUITPY_FULL_BUILD),0) CFLAGS += --param inline-unit-growth=15 --param max-inline-insns-auto=20 - CFLAGS += -flto-partition=one endif ifdef CFLAGS_BOARD @@ -168,8 +163,7 @@ CFLAGS += \ -mcpu=cortex-m0plus \ -msoft-float \ -mfloat-abi=soft \ - -DSAMD21 \ - -flto-partition=one + -DSAMD21 endif ifeq ($(CHIP_FAMILY), samd51) CFLAGS += \ @@ -206,7 +200,6 @@ endif CFLAGS += -Wno-stringop-overread -Wno-stringop-overflow 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. diff --git a/ports/atmel-samd/common-hal/_pew/PewPew.c b/ports/atmel-samd/common-hal/_pew/PewPew.c index 40cd52134a..c4d94e3dbd 100644 --- a/ports/atmel-samd/common-hal/_pew/PewPew.c +++ b/ports/atmel-samd/common-hal/_pew/PewPew.c @@ -35,7 +35,7 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/util.h" #include "samd/timers.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "timer_handler.h" diff --git a/ports/atmel-samd/common-hal/analogio/AnalogIn.c b/ports/atmel-samd/common-hal/analogio/AnalogIn.c index e6db95b358..d15be8308a 100644 --- a/ports/atmel-samd/common-hal/analogio/AnalogIn.c +++ b/ports/atmel-samd/common-hal/analogio/AnalogIn.c @@ -37,7 +37,7 @@ #include "samd/adc.h" #include "shared-bindings/analogio/AnalogIn.h" #include "shared-bindings/microcontroller/Pin.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "atmel_start_pins.h" #include "hal/include/hal_adc_sync.h" diff --git a/ports/atmel-samd/common-hal/analogio/AnalogOut.c b/ports/atmel-samd/common-hal/analogio/AnalogOut.c index 2f38fce700..b4d556429c 100644 --- a/ports/atmel-samd/common-hal/analogio/AnalogOut.c +++ b/ports/atmel-samd/common-hal/analogio/AnalogOut.c @@ -33,7 +33,7 @@ #include "shared-bindings/analogio/AnalogOut.h" #include "shared-bindings/audioio/AudioOut.h" #include "shared-bindings/microcontroller/Pin.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "atmel_start_pins.h" #include "hal/include/hal_dac_sync.h" diff --git a/ports/atmel-samd/common-hal/audiobusio/I2SOut.c b/ports/atmel-samd/common-hal/audiobusio/I2SOut.c index eb98cc8d27..447252aace 100644 --- a/ports/atmel-samd/common-hal/audiobusio/I2SOut.c +++ b/ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -40,7 +40,7 @@ #include "shared-bindings/audiobusio/I2SOut.h" #include "shared-bindings/audiocore/RawSample.h" #include "shared-bindings/microcontroller/Pin.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "atmel_start_pins.h" #include "hal/include/hal_gpio.h" diff --git a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c index c3bdd95793..3711ba9c1b 100644 --- a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c +++ b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -37,7 +37,7 @@ #include "shared-bindings/audiobusio/PDMIn.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Pin.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "atmel_start_pins.h" #include "hal/include/hal_gpio.h" @@ -58,11 +58,11 @@ #define MIN_MIC_CLOCK 1000000 #ifdef SAMD21 -#define SERCTRL(name) I2S_SERCTRL_ ## name +#define SERCTRL(name) I2S_SERCTRL_##name #endif #ifdef SAM_D5X_E5X -#define SERCTRL(name) I2S_RXCTRL_ ## name +#define SERCTRL(name) I2S_RXCTRL_##name #endif // Set by interrupt handler when DMA block has finished transferring. @@ -80,102 +80,104 @@ void pdmin_reset(void) { pdmin_dma_block_done = false; pdmin_event_channel = EVSYS_SYNCH_NUM; - while (I2S->SYNCBUSY.reg & I2S_SYNCBUSY_ENABLE) {} + while (I2S->SYNCBUSY.reg & I2S_SYNCBUSY_ENABLE) { + } I2S->INTENCLR.reg = I2S_INTENCLR_MASK; I2S->INTFLAG.reg = I2S_INTFLAG_MASK; I2S->CTRLA.reg &= ~I2S_SYNCBUSY_ENABLE; - while (I2S->SYNCBUSY.reg & I2S_SYNCBUSY_ENABLE) {} + while (I2S->SYNCBUSY.reg & I2S_SYNCBUSY_ENABLE) { + } I2S->CTRLA.reg = I2S_CTRLA_SWRST; } // Caller validates that pins are free. -void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self, - const mcu_pin_obj_t* clock_pin, - const mcu_pin_obj_t* data_pin, - uint32_t sample_rate, - uint8_t bit_depth, - bool mono, - uint8_t oversample) { +void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t *self, + const mcu_pin_obj_t *clock_pin, + const mcu_pin_obj_t *data_pin, + uint32_t sample_rate, + uint8_t bit_depth, + bool mono, + uint8_t oversample) { self->clock_pin = clock_pin; // PA10, PA20 -> SCK0, PB11 -> SCK1 #ifdef SAMD21 - if (clock_pin == &pin_PA10 + if (clock_pin == &pin_PA10 #if defined(PIN_PA20) && !defined(IGNORE_PIN_PA20) - || clock_pin == &pin_PA20 - #endif - ) { - self->clock_unit = 0; - #if defined(PIN_PB11) && !defined(IGNORE_PIN_PB11) - } else if (clock_pin == &pin_PB11) { - self->clock_unit = 1; + || clock_pin == &pin_PA20 #endif + ) { + self->clock_unit = 0; + #if defined(PIN_PB11) && !defined(IGNORE_PIN_PB11) + } else if (clock_pin == &pin_PB11) { + self->clock_unit = 1; + #endif #endif #ifdef SAM_D5X_E5X - if (clock_pin == &pin_PA10 || clock_pin == &pin_PB16) { - self->clock_unit = 0; + if (clock_pin == &pin_PA10 || clock_pin == &pin_PB16) { + self->clock_unit = 0; } else if (clock_pin == &pin_PB12 - #if defined(PIN_PB28) && !defined(IGNORE_PIN_PB28) - || data_pin == &pin_PB28) { - #else - ) { + #if defined(PIN_PB28) && !defined(IGNORE_PIN_PB28) + || data_pin == &pin_PB28) { + #else + ) { #endif - self->clock_unit = 1; + self->clock_unit = 1; #endif - } else { - raise_ValueError_invalid_pin_name(MP_QSTR_clock); - } +} else { + raise_ValueError_invalid_pin_name(MP_QSTR_clock); +} - self->data_pin = data_pin; // PA07, PA19 -> SD0, PA08, PB16 -> SD1 +self->data_pin = data_pin; // PA07, PA19 -> SD0, PA08, PB16 -> SD1 #ifdef SAMD21 - if (false +if (false #if defined(PIN_PA07) && !defined(IGNORE_PIN_PA07) - || data_pin == &pin_PA07 + || data_pin == &pin_PA07 #endif #if defined(PIN_PA19) && !defined(IGNORE_PIN_PA19) - || data_pin == &pin_PA19 + || data_pin == &pin_PA19 #endif - ) { - self->serializer = 0; - } - else if (false + ) { + self->serializer = 0; +} else if (false #if defined(PIN_PA08) && !defined(IGNORE_PIN_PA08) - || data_pin == &pin_PA08 + || data_pin == &pin_PA08 #endif - #if defined (PIN_PB16) && !defined(IGNORE_PIN_PB16) - || data_pin == &pin_PB16 + #if defined(PIN_PB16) && !defined(IGNORE_PIN_PB16) + || data_pin == &pin_PB16 #endif - ) { - self->serializer = 1; + ) { + self->serializer = 1; #endif #ifdef SAM_D5X_E5X - if (data_pin == &pin_PB10 || data_pin == &pin_PA22) { - self->serializer = 1; +if (data_pin == &pin_PB10 || data_pin == &pin_PA22) { + self->serializer = 1; #endif - } else { - raise_ValueError_invalid_pin_name(MP_QSTR_data); - } +}else { + raise_ValueError_invalid_pin_name(MP_QSTR_data); +} - if (!(bit_depth == 16 || bit_depth == 8) || !mono || oversample != OVERSAMPLING) { - mp_raise_NotImplementedError(translate("Only 8 or 16 bit mono with " MP_STRINGIFY(OVERSAMPLING) "x oversampling is supported.")); - } +if (!(bit_depth == 16 || bit_depth == 8) || !mono || oversample != OVERSAMPLING) { + mp_raise_NotImplementedError(translate("Only 8 or 16 bit mono with " MP_STRINGIFY(OVERSAMPLING) "x oversampling is supported.")); +} - turn_on_i2s(); +turn_on_i2s(); - if (I2S->CTRLA.bit.ENABLE == 0) { - I2S->CTRLA.bit.SWRST = 1; - while (I2S->CTRLA.bit.SWRST == 1) {} - } else { - #ifdef SAMD21 - if ((I2S->CTRLA.vec.SEREN & (1 << self->serializer)) != 0) { - mp_raise_RuntimeError(translate("Serializer in use")); - } - #endif - #ifdef SAM_D5X_E5X - if (I2S->CTRLA.bit.RXEN == 1) { - mp_raise_RuntimeError(translate("Serializer in use")); - } - #endif +if (I2S->CTRLA.bit.ENABLE == 0) { + I2S->CTRLA.bit.SWRST = 1; + while (I2S->CTRLA.bit.SWRST == 1) { } +} else { + #ifdef SAMD21 + if ((I2S->CTRLA.vec.SEREN & (1 << self->serializer)) != 0) { + mp_raise_RuntimeError(translate("Serializer in use")); + } + #endif + #ifdef SAM_D5X_E5X + if (I2S->CTRLA.bit.RXEN == 1) { + mp_raise_RuntimeError(translate("Serializer in use")); + } + #endif +} #ifdef SAM_D5X_E5X #define GPIO_I2S_FUNCTION GPIO_PIN_FUNCTION_J #endif @@ -183,69 +185,69 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self, #define GPIO_I2S_FUNCTION GPIO_PIN_FUNCTION_G #endif - uint32_t clock_divisor = (uint32_t) roundf( 48000000.0f / sample_rate / oversample); - float mic_clock_freq = 48000000.0f / clock_divisor; - self->sample_rate = mic_clock_freq / oversample; - if (mic_clock_freq < MIN_MIC_CLOCK || clock_divisor == 0) { - mp_raise_ValueError(translate("sampling rate out of range")); - } - // Find a free GCLK to generate the MCLK signal. - uint8_t gclk = find_free_gclk(clock_divisor); - if (gclk > GCLK_GEN_NUM) { - mp_raise_RuntimeError(translate("Unable to find free GCLK")); - } - self->gclk = gclk; +uint32_t clock_divisor = (uint32_t)roundf(48000000.0f / sample_rate / oversample); +float mic_clock_freq = 48000000.0f / clock_divisor; +self->sample_rate = mic_clock_freq / oversample; +if (mic_clock_freq < MIN_MIC_CLOCK || clock_divisor == 0) { + mp_raise_ValueError(translate("sampling rate out of range")); +} +// Find a free GCLK to generate the MCLK signal. +uint8_t gclk = find_free_gclk(clock_divisor); +if (gclk > GCLK_GEN_NUM) { + mp_raise_RuntimeError(translate("Unable to find free GCLK")); +} +self->gclk = gclk; - enable_clock_generator(self->gclk, CLOCK_48MHZ, clock_divisor); - connect_gclk_to_peripheral(self->gclk, I2S_GCLK_ID_0 + self->clock_unit); +enable_clock_generator(self->gclk, CLOCK_48MHZ, clock_divisor); +connect_gclk_to_peripheral(self->gclk, I2S_GCLK_ID_0 + self->clock_unit); - // Clock unit configuration +// Clock unit configuration - uint32_t clkctrl = I2S_CLKCTRL_MCKSEL_GCLK | - I2S_CLKCTRL_NBSLOTS(2) | - I2S_CLKCTRL_FSWIDTH_SLOT | - I2S_CLKCTRL_SLOTSIZE_16; +uint32_t clkctrl = I2S_CLKCTRL_MCKSEL_GCLK | + I2S_CLKCTRL_NBSLOTS(2) | + I2S_CLKCTRL_FSWIDTH_SLOT | + I2S_CLKCTRL_SLOTSIZE_16; - // Serializer configuration +// Serializer configuration #ifdef SAMD21 - uint32_t serctrl = (self->clock_unit << I2S_SERCTRL_CLKSEL_Pos) | SERCTRL(SERMODE_PDM2) | SERCTRL(DATASIZE_32); +uint32_t serctrl = (self->clock_unit << I2S_SERCTRL_CLKSEL_Pos) | SERCTRL(SERMODE_PDM2) | SERCTRL(DATASIZE_32); #endif #ifdef SAM_D5X_E5X - uint32_t serctrl = (self->clock_unit << I2S_RXCTRL_CLKSEL_Pos) | SERCTRL(SERMODE_PDM2) | SERCTRL(DATASIZE_32); +uint32_t serctrl = (self->clock_unit << I2S_RXCTRL_CLKSEL_Pos) | SERCTRL(SERMODE_PDM2) | SERCTRL(DATASIZE_32); #endif - // Configure the I2S peripheral - i2s_set_enable(false); +// Configure the I2S peripheral +i2s_set_enable(false); - I2S->CLKCTRL[self->clock_unit].reg = clkctrl; +I2S->CLKCTRL[self->clock_unit].reg = clkctrl; #ifdef SAMD21 - I2S->SERCTRL[self->serializer].reg = serctrl; +I2S->SERCTRL[self->serializer].reg = serctrl; #endif #ifdef SAM_D5X_E5X - I2S->RXCTRL.reg = serctrl; +I2S->RXCTRL.reg = serctrl; #endif - i2s_set_enable(true); +i2s_set_enable(true); - // Run the clock all the time. This eliminates startup delay for the microphone, - // which can be 10-100ms. Turn serializer on as needed. - i2s_set_clock_unit_enable(self->clock_unit, true); +// Run the clock all the time. This eliminates startup delay for the microphone, +// which can be 10-100ms. Turn serializer on as needed. +i2s_set_clock_unit_enable(self->clock_unit, true); - claim_pin(clock_pin); - claim_pin(data_pin); +claim_pin(clock_pin); +claim_pin(data_pin); - gpio_set_pin_function(self->clock_pin->number, GPIO_I2S_FUNCTION); - gpio_set_pin_function(self->data_pin->number, GPIO_I2S_FUNCTION); +gpio_set_pin_function(self->clock_pin->number, GPIO_I2S_FUNCTION); +gpio_set_pin_function(self->data_pin->number, GPIO_I2S_FUNCTION); - self->bytes_per_sample = oversample >> 3; - self->bit_depth = bit_depth; +self->bytes_per_sample = oversample >> 3; +self->bit_depth = bit_depth; } -bool common_hal_audiobusio_pdmin_deinited(audiobusio_pdmin_obj_t* self) { +bool common_hal_audiobusio_pdmin_deinited(audiobusio_pdmin_obj_t *self) { return self->clock_pin == NULL; } -void common_hal_audiobusio_pdmin_deinit(audiobusio_pdmin_obj_t* self) { +void common_hal_audiobusio_pdmin_deinit(audiobusio_pdmin_obj_t *self) { if (common_hal_audiobusio_pdmin_deinited(self)) { return; } @@ -264,24 +266,24 @@ void common_hal_audiobusio_pdmin_deinit(audiobusio_pdmin_obj_t* self) { self->data_pin = NULL; } -uint8_t common_hal_audiobusio_pdmin_get_bit_depth(audiobusio_pdmin_obj_t* self) { +uint8_t common_hal_audiobusio_pdmin_get_bit_depth(audiobusio_pdmin_obj_t *self) { return self->bit_depth; } -uint32_t common_hal_audiobusio_pdmin_get_sample_rate(audiobusio_pdmin_obj_t* self) { +uint32_t common_hal_audiobusio_pdmin_get_sample_rate(audiobusio_pdmin_obj_t *self) { return self->sample_rate; } -static void setup_dma(audiobusio_pdmin_obj_t* self, uint32_t length, - DmacDescriptor* descriptor, - DmacDescriptor* second_descriptor, - uint32_t words_per_buffer, uint8_t words_per_sample, - uint32_t* first_buffer, uint32_t* second_buffer) { +static void setup_dma(audiobusio_pdmin_obj_t *self, uint32_t length, + DmacDescriptor *descriptor, + DmacDescriptor *second_descriptor, + uint32_t words_per_buffer, uint8_t words_per_sample, + uint32_t *first_buffer, uint32_t *second_buffer) { descriptor->BTCTRL.reg = DMAC_BTCTRL_VALID | - DMAC_BTCTRL_BLOCKACT_NOACT | - DMAC_BTCTRL_EVOSEL_BLOCK | - DMAC_BTCTRL_DSTINC | - DMAC_BTCTRL_BEATSIZE_WORD; + DMAC_BTCTRL_BLOCKACT_NOACT | + DMAC_BTCTRL_EVOSEL_BLOCK | + DMAC_BTCTRL_DSTINC | + DMAC_BTCTRL_BEATSIZE_WORD; // Block transfer count is the number of beats per block (aka descriptor). // In this case there are two bytes per beat so divide the length by two. @@ -291,7 +293,7 @@ static void setup_dma(audiobusio_pdmin_obj_t* self, uint32_t length, } descriptor->BTCNT.reg = block_transfer_count; - descriptor->DSTADDR.reg = ((uint32_t) first_buffer + sizeof(uint32_t) * block_transfer_count); + descriptor->DSTADDR.reg = ((uint32_t)first_buffer + sizeof(uint32_t) * block_transfer_count); descriptor->DESCADDR.reg = 0; if (length * words_per_sample > words_per_buffer) { descriptor->DESCADDR.reg = ((uint32_t)second_descriptor); @@ -314,7 +316,7 @@ static void setup_dma(audiobusio_pdmin_obj_t* self, uint32_t length, block_transfer_count = length * words_per_sample - words_per_buffer; second_descriptor->DESCADDR.reg = 0; } - second_descriptor->DSTADDR.reg = ((uint32_t) second_buffer + sizeof(uint32_t) * block_transfer_count); + second_descriptor->DSTADDR.reg = ((uint32_t)second_buffer + sizeof(uint32_t) * block_transfer_count); second_descriptor->BTCNT.reg = block_transfer_count; #ifdef SAMD21 @@ -324,10 +326,10 @@ static void setup_dma(audiobusio_pdmin_obj_t* self, uint32_t length, second_descriptor->SRCADDR.reg = (uint32_t)&I2S->RXDATA; #endif second_descriptor->BTCTRL.reg = DMAC_BTCTRL_VALID | - DMAC_BTCTRL_BLOCKACT_NOACT | - DMAC_BTCTRL_EVOSEL_BLOCK | - DMAC_BTCTRL_DSTINC | - DMAC_BTCTRL_BEATSIZE_WORD; + DMAC_BTCTRL_BLOCKACT_NOACT | + DMAC_BTCTRL_EVOSEL_BLOCK | + DMAC_BTCTRL_DSTINC | + DMAC_BTCTRL_BEATSIZE_WORD; } } @@ -341,7 +343,7 @@ static void setup_dma(audiobusio_pdmin_obj_t* self, uint32_t length, // higher sample rate than specified. Then after the audio is // recorded, a more expensive filter non-real-time filter could be // used to down-sample and low-pass. -const uint16_t sinc_filter [OVERSAMPLING] = { +const uint16_t sinc_filter[OVERSAMPLING] = { 0, 2, 9, 21, 39, 63, 94, 132, 179, 236, 302, 379, 467, 565, 674, 792, 920, 1055, 1196, 1341, 1487, 1633, 1776, 1913, @@ -353,26 +355,26 @@ const uint16_t sinc_filter [OVERSAMPLING] = { }; #ifdef SAMD21 -#define REPEAT_16_TIMES(X) do { for(uint8_t j=0; j<4; j++) { X X X X } } while (0) +#define REPEAT_16_TIMES(X) do { for (uint8_t j = 0; j < 4; j++) { X X X X } } while (0) #else -#define REPEAT_16_TIMES(X) do { X X X X X X X X X X X X X X X X } while(0) +#define REPEAT_16_TIMES(X) do { X X X X X X X X X X X X X X X X } while (0) #endif static uint16_t filter_sample(uint32_t pdm_samples[4]) { uint16_t running_sum = 0; const uint16_t *filter_ptr = sinc_filter; - for (uint8_t i = 0; i < OVERSAMPLING/16; i++) { + for (uint8_t i = 0; i < OVERSAMPLING / 16; i++) { // The sample is 16-bits right channel in the upper two bytes and 16-bits left channel // in the lower two bytes. // We just ignore the upper bits uint32_t pdm_sample = pdm_samples[i]; - REPEAT_16_TIMES( { - if (pdm_sample & 0x8000) { - running_sum += *filter_ptr; - } - filter_ptr++; - pdm_sample <<= 1; + REPEAT_16_TIMES({ + if (pdm_sample & 0x8000) { + running_sum += *filter_ptr; } + filter_ptr++; + pdm_sample <<= 1; + } ); } return running_sum; @@ -380,8 +382,8 @@ static uint16_t filter_sample(uint32_t pdm_samples[4]) { // output_buffer may be a byte buffer or a halfword buffer. // output_buffer_length is the number of slots, not the number of bytes. -uint32_t common_hal_audiobusio_pdmin_record_to_buffer(audiobusio_pdmin_obj_t* self, - uint16_t* output_buffer, uint32_t output_buffer_length) { +uint32_t common_hal_audiobusio_pdmin_record_to_buffer(audiobusio_pdmin_obj_t *self, + uint16_t *output_buffer, uint32_t output_buffer_length) { uint8_t dma_channel = dma_allocate_channel(); pdmin_event_channel = find_sync_event_channel_raise(); pdmin_dma_block_done = false; @@ -399,7 +401,7 @@ uint32_t common_hal_audiobusio_pdmin_record_to_buffer(audiobusio_pdmin_obj_t* se COMPILER_ALIGNED(16) DmacDescriptor second_descriptor; setup_dma(self, output_buffer_length, dma_descriptor(dma_channel), &second_descriptor, - words_per_buffer, words_per_sample, first_buffer, second_buffer); + words_per_buffer, words_per_sample, first_buffer, second_buffer); uint8_t trigger_source = I2S_DMAC_ID_RX_0; #ifdef SAMD21 @@ -444,7 +446,7 @@ uint32_t common_hal_audiobusio_pdmin_record_to_buffer(audiobusio_pdmin_obj_t* se // Flip back and forth between processing the first and second buffers. uint32_t *buffer = first_buffer; - DmacDescriptor* descriptor = dma_descriptor(dma_channel); + DmacDescriptor *descriptor = dma_descriptor(dma_channel); if (buffers_processed % 2 == 1) { buffer = second_buffer; descriptor = &second_descriptor; @@ -459,7 +461,7 @@ uint32_t common_hal_audiobusio_pdmin_record_to_buffer(audiobusio_pdmin_obj_t* se uint16_t value = filter_sample(buffer + i * words_per_sample); if (self->bit_depth == 8) { // Truncate to 8 bits. - ((uint8_t*) output_buffer)[values_output] = value >> 8; + ((uint8_t *)output_buffer)[values_output] = value >> 8; } else { output_buffer[values_output] = value; } @@ -471,7 +473,7 @@ uint32_t common_hal_audiobusio_pdmin_record_to_buffer(audiobusio_pdmin_obj_t* se // Compute how many more samples we need, and if the last buffer is the last // set of samples needed, adjust the DMA count to only fetch as necessary. remaining_samples_needed = output_buffer_length - values_output; - if (remaining_samples_needed <= samples_per_buffer*2 && + if (remaining_samples_needed <= samples_per_buffer * 2 && remaining_samples_needed > samples_per_buffer) { // Adjust the DMA settings for the current buffer, which will be processed // after the other buffer, which is now receiving samples via DMA. @@ -484,7 +486,7 @@ uint32_t common_hal_audiobusio_pdmin_record_to_buffer(audiobusio_pdmin_obj_t* se // Set up to receive the last set of samples (don't include the alternate buffer, now in use). uint32_t samples_needed_for_last_buffer = remaining_samples_needed - samples_per_buffer; descriptor->BTCNT.reg = samples_needed_for_last_buffer * words_per_sample; - descriptor->DSTADDR.reg = ((uint32_t) buffer) + descriptor->DSTADDR.reg = ((uint32_t)buffer) + samples_needed_for_last_buffer * words_per_sample * sizeof(buffer[0]); // Break chain to alternate buffer. diff --git a/ports/atmel-samd/common-hal/audioio/AudioOut.c b/ports/atmel-samd/common-hal/audioio/AudioOut.c index 1e1eb80e9c..a565a77042 100644 --- a/ports/atmel-samd/common-hal/audioio/AudioOut.c +++ b/ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -35,7 +35,7 @@ #include "shared-bindings/audioio/AudioOut.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Pin.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "atmel_start_pins.h" #include "hal/include/hal_gpio.h" diff --git a/ports/atmel-samd/common-hal/busio/I2C.c b/ports/atmel-samd/common-hal/busio/I2C.c index c539cc3abc..2ca193c99f 100644 --- a/ports/atmel-samd/common-hal/busio/I2C.c +++ b/ports/atmel-samd/common-hal/busio/I2C.c @@ -35,7 +35,7 @@ #include "samd/sercom.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Pin.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "common-hal/busio/__init__.h" diff --git a/ports/atmel-samd/common-hal/busio/SPI.c b/ports/atmel-samd/common-hal/busio/SPI.c index fde15824c8..3bb0cabf9e 100644 --- a/ports/atmel-samd/common-hal/busio/SPI.c +++ b/ports/atmel-samd/common-hal/busio/SPI.c @@ -33,6 +33,7 @@ #include "peripheral_clk_config.h" #include "supervisor/board.h" +#include "supervisor/shared/translate/translate.h" #include "common-hal/busio/__init__.h" #include "hal/include/hal_gpio.h" diff --git a/ports/atmel-samd/common-hal/busio/UART.c b/ports/atmel-samd/common-hal/busio/UART.c index ce471f8c1a..3a9b628e0b 100644 --- a/ports/atmel-samd/common-hal/busio/UART.c +++ b/ports/atmel-samd/common-hal/busio/UART.c @@ -34,7 +34,7 @@ #include "py/mperrno.h" #include "py/runtime.h" #include "py/stream.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "supervisor/shared/tick.h" #include "hpl_sercom_config.h" diff --git a/ports/atmel-samd/common-hal/countio/Counter.c b/ports/atmel-samd/common-hal/countio/Counter.c index c68b9e18ef..e3694615ab 100644 --- a/ports/atmel-samd/common-hal/countio/Counter.c +++ b/ports/atmel-samd/common-hal/countio/Counter.c @@ -7,7 +7,7 @@ #include "eic_handler.h" #include "samd/external_interrupts.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" void common_hal_countio_counter_construct(countio_counter_obj_t *self, const mcu_pin_obj_t *pin, countio_edge_t edge, digitalio_pull_t pull) { diff --git a/ports/atmel-samd/common-hal/digitalio/DigitalInOut.c b/ports/atmel-samd/common-hal/digitalio/DigitalInOut.c index dee927ce88..8358ac4d87 100644 --- a/ports/atmel-samd/common-hal/digitalio/DigitalInOut.c +++ b/ports/atmel-samd/common-hal/digitalio/DigitalInOut.c @@ -34,7 +34,7 @@ #include "common-hal/microcontroller/Pin.h" #include "shared-bindings/digitalio/DigitalInOut.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" digitalinout_result_t common_hal_digitalio_digitalinout_construct( digitalio_digitalinout_obj_t *self, const mcu_pin_obj_t *pin) { diff --git a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c index 4a6a620603..22200c5d1c 100644 --- a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +++ b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c @@ -48,7 +48,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/time/__init__.h" #include "supervisor/shared/tick.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #ifdef SAMD21 #include "hpl/gclk/hpl_gclk_base.h" diff --git a/ports/atmel-samd/common-hal/microcontroller/Pin.c b/ports/atmel-samd/common-hal/microcontroller/Pin.c index 1460ece59e..b36286e5f2 100644 --- a/ports/atmel-samd/common-hal/microcontroller/Pin.c +++ b/ports/atmel-samd/common-hal/microcontroller/Pin.c @@ -27,6 +27,7 @@ #include "py/runtime.h" #include "shared-bindings/microcontroller/Pin.h" +#include "supervisor/shared/translate/translate.h" #include "atmel_start_pins.h" #include "hal/include/hal_gpio.h" diff --git a/ports/atmel-samd/common-hal/microcontroller/__init__.c b/ports/atmel-samd/common-hal/microcontroller/__init__.c index 6856f4a48b..60b35a2c5c 100644 --- a/ports/atmel-samd/common-hal/microcontroller/__init__.c +++ b/ports/atmel-samd/common-hal/microcontroller/__init__.c @@ -36,7 +36,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/Processor.h" #include "supervisor/shared/safe_mode.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" void common_hal_mcu_delay_us(uint32_t delay) { mp_hal_delay_us(delay); diff --git a/ports/atmel-samd/common-hal/ps2io/Ps2.c b/ports/atmel-samd/common-hal/ps2io/Ps2.c index ad7b110803..43f40aa48e 100644 --- a/ports/atmel-samd/common-hal/ps2io/Ps2.c +++ b/ports/atmel-samd/common-hal/ps2io/Ps2.c @@ -43,7 +43,7 @@ #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/ps2io/Ps2.h" #include "supervisor/port.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #define STATE_IDLE 0 #define STATE_RECV 1 diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.c b/ports/atmel-samd/common-hal/pulseio/PulseIn.c index 8cc455c958..8bf889bed3 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -44,7 +44,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/pulseio/PulseIn.h" #include "supervisor/shared/tick.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "supervisor/port.h" // This timer is shared amongst all PulseIn objects as a higher resolution clock. diff --git a/ports/atmel-samd/common-hal/pulseio/PulseOut.c b/ports/atmel-samd/common-hal/pulseio/PulseOut.c index b0407a1136..dc98e4bd18 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseOut.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseOut.c @@ -36,7 +36,7 @@ #include "py/gc.h" #include "py/runtime.h" #include "shared-bindings/pulseio/PulseOut.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "timer_handler.h" // This timer is shared amongst all PulseOut objects under the assumption that diff --git a/ports/atmel-samd/common-hal/pwmio/PWMOut.c b/ports/atmel-samd/common-hal/pwmio/PWMOut.c index 854e70094f..c6e9e07304 100644 --- a/ports/atmel-samd/common-hal/pwmio/PWMOut.c +++ b/ports/atmel-samd/common-hal/pwmio/PWMOut.c @@ -38,7 +38,7 @@ #include "hal/utils/include/utils_repeat_macro.h" #include "samd/pins.h" #include "samd/timers.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #undef ENABLE diff --git a/ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c b/ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c index 856fe04dbc..d253e0967e 100644 --- a/ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c +++ b/ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -33,7 +33,7 @@ #include "eic_handler.h" #include "samd/external_interrupts.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.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) { diff --git a/ports/atmel-samd/common-hal/rtc/RTC.c b/ports/atmel-samd/common-hal/rtc/RTC.c index 455f176763..0ebb61e11b 100644 --- a/ports/atmel-samd/common-hal/rtc/RTC.c +++ b/ports/atmel-samd/common-hal/rtc/RTC.c @@ -37,7 +37,7 @@ #include "shared-bindings/rtc/__init__.h" #include "shared-bindings/rtc/RTC.h" #include "supervisor/port.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // This is the time in seconds since 2000 that the RTC was started. // TODO: Change the offset to ticks so that it can be a subsecond adjustment. diff --git a/ports/atmel-samd/common-hal/sdioio/SDCard.c b/ports/atmel-samd/common-hal/sdioio/SDCard.c index 10ccb63a55..7ce8a1e1b1 100644 --- a/ports/atmel-samd/common-hal/sdioio/SDCard.c +++ b/ports/atmel-samd/common-hal/sdioio/SDCard.c @@ -32,7 +32,7 @@ #include "shared-bindings/sdioio/SDCard.h" #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "genhdr/sdiodata.h" diff --git a/ports/atmel-samd/common-hal/touchio/TouchIn.c b/ports/atmel-samd/common-hal/touchio/TouchIn.c index 1c0062d52a..c3fae041fb 100644 --- a/ports/atmel-samd/common-hal/touchio/TouchIn.c +++ b/ports/atmel-samd/common-hal/touchio/TouchIn.c @@ -33,7 +33,7 @@ #include "py/mphal.h" #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/touchio/TouchIn.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // Native touchio only exists for SAMD21 #ifdef SAMD21 diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index 9cd5b39d70..38abbb81f6 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -78,6 +78,8 @@ endif SUPEROPT_GC = 0 SUPEROPT_VM = 0 +CIRCUITPY_LTO = one + ifeq ($(CIRCUITPY_FULL_BUILD),0) # On the smallest boards, this saves about 180 bytes. On other boards, it may -increase- space used. CFLAGS_BOARD = -fweb -frename-registers @@ -94,6 +96,12 @@ ifeq ($(CHIP_FAMILY),samd51) # No native touchio on SAMD51. CIRCUITPY_TOUCHIO_USE_NATIVE = 0 +ifeq ($(CIRCUITPY_FULL_BUILD),1) +CIRCUITPY_LTO ?= balanced +else +CIRCUITPY_LTO ?= one +endif + # The ?='s allow overriding in mpconfigboard.mk. diff --git a/ports/broadcom/common-hal/digitalio/DigitalInOut.c b/ports/broadcom/common-hal/digitalio/DigitalInOut.c index 38a7cbb2b8..d8ac3472de 100644 --- a/ports/broadcom/common-hal/digitalio/DigitalInOut.c +++ b/ports/broadcom/common-hal/digitalio/DigitalInOut.c @@ -32,7 +32,7 @@ #include "common-hal/microcontroller/Pin.h" #include "shared-bindings/digitalio/DigitalInOut.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "peripherals/broadcom/gpio.h" diff --git a/ports/broadcom/common-hal/sdioio/SDCard.c b/ports/broadcom/common-hal/sdioio/SDCard.c index 85a84ac213..27b36041de 100644 --- a/ports/broadcom/common-hal/sdioio/SDCard.c +++ b/ports/broadcom/common-hal/sdioio/SDCard.c @@ -35,7 +35,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/__init__.h" #include "supervisor/port.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "peripherals/broadcom/cpu.h" #include "peripherals/broadcom/defines.h" diff --git a/ports/espressif/Makefile b/ports/espressif/Makefile index 96360d06bd..acdf496edb 100644 --- a/ports/espressif/Makefile +++ b/ports/espressif/Makefile @@ -165,8 +165,6 @@ else # RISC-V is larger than xtensa so do -Os for it OPTIMIZATION_FLAGS ?= -Os endif - # TODO: Test with -flto - ### CFLAGS += -flto endif # option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk diff --git a/ports/espressif/common-hal/analogio/AnalogIn.c b/ports/espressif/common-hal/analogio/AnalogIn.c index 4d390e615c..a81a8add22 100644 --- a/ports/espressif/common-hal/analogio/AnalogIn.c +++ b/ports/espressif/common-hal/analogio/AnalogIn.c @@ -28,7 +28,7 @@ #include "shared-bindings/analogio/AnalogIn.h" #include "py/mperrno.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "components/driver/include/driver/adc_common.h" #include "components/esp_adc_cal/include/esp_adc_cal.h" diff --git a/ports/espressif/common-hal/analogio/AnalogOut.c b/ports/espressif/common-hal/analogio/AnalogOut.c index 2bceefc9f7..cc99d4faa1 100644 --- a/ports/espressif/common-hal/analogio/AnalogOut.c +++ b/ports/espressif/common-hal/analogio/AnalogOut.c @@ -33,7 +33,7 @@ #include "shared-bindings/analogio/AnalogOut.h" #include "shared-bindings/microcontroller/Pin.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #ifdef CONFIG_IDF_TARGET_ESP32S2 #include "components/driver/include/driver/dac_common.h" diff --git a/ports/espressif/common-hal/audiobusio/I2SOut.c b/ports/espressif/common-hal/audiobusio/I2SOut.c index 6548f46071..440151e881 100644 --- a/ports/espressif/common-hal/audiobusio/I2SOut.c +++ b/ports/espressif/common-hal/audiobusio/I2SOut.c @@ -42,7 +42,7 @@ #include "shared-bindings/audiobusio/I2SOut.h" #include "shared-bindings/audiocore/RawSample.h" #include "shared-bindings/microcontroller/Pin.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "driver/i2s.h" diff --git a/ports/espressif/common-hal/busio/I2C.c b/ports/espressif/common-hal/busio/I2C.c index 23906fe2d2..92bd4fb157 100644 --- a/ports/espressif/common-hal/busio/I2C.c +++ b/ports/espressif/common-hal/busio/I2C.c @@ -32,7 +32,7 @@ #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Pin.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" 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) { diff --git a/ports/espressif/common-hal/busio/UART.c b/ports/espressif/common-hal/busio/UART.c index 27323fecf4..7322abc8ef 100644 --- a/ports/espressif/common-hal/busio/UART.c +++ b/ports/espressif/common-hal/busio/UART.c @@ -38,7 +38,7 @@ #include "py/runtime.h" #include "py/stream.h" #include "supervisor/port.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "supervisor/shared/tick.h" uint8_t never_reset_uart_mask = 0; diff --git a/ports/espressif/common-hal/countio/Counter.c b/ports/espressif/common-hal/countio/Counter.c index d18196051f..bdfc44522c 100644 --- a/ports/espressif/common-hal/countio/Counter.c +++ b/ports/espressif/common-hal/countio/Counter.c @@ -29,7 +29,7 @@ #include "common-hal/microcontroller/Pin.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" void common_hal_countio_counter_construct(countio_counter_obj_t *self, const mcu_pin_obj_t *pin, countio_edge_t edge, digitalio_pull_t pull) { diff --git a/ports/espressif/common-hal/digitalio/DigitalInOut.c b/ports/espressif/common-hal/digitalio/DigitalInOut.c index 1ab232b29a..a3e8f41147 100644 --- a/ports/espressif/common-hal/digitalio/DigitalInOut.c +++ b/ports/espressif/common-hal/digitalio/DigitalInOut.c @@ -26,7 +26,7 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "components/driver/include/driver/gpio.h" diff --git a/ports/espressif/common-hal/microcontroller/Processor.c b/ports/espressif/common-hal/microcontroller/Processor.c index e4782c30ab..5ceefa411f 100644 --- a/ports/espressif/common-hal/microcontroller/Processor.c +++ b/ports/espressif/common-hal/microcontroller/Processor.c @@ -33,7 +33,7 @@ #include "common-hal/microcontroller/Processor.h" #include "shared-bindings/microcontroller/Processor.h" #include "shared-bindings/microcontroller/ResetReason.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "esp_sleep.h" #include "esp_system.h" diff --git a/ports/litex/Makefile b/ports/litex/Makefile index 6fe9e46bec..6b1e33c8d1 100644 --- a/ports/litex/Makefile +++ b/ports/litex/Makefile @@ -81,8 +81,6 @@ ifeq ($(DEBUG), 1) else CFLAGS += -DNDEBUG -ggdb3 OPTIMIZATION_FLAGS ?= -O2 -fno-inline-functions - # TODO: Test with -flto - ### CFLAGS += -flto endif # option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk @@ -99,7 +97,7 @@ LDFLAGS = $(CFLAGS) -Wl,-nostdlib -Wl,-T,$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -W LIBS := -lgcc -lc -LDFLAGS += -flto -ffreestanding -nostartfiles -Wl,--gc-section -Wl,-Bstatic -Wl,-melf32lriscv -nostartfiles \ +LDFLAGS += -ffreestanding -nostartfiles -Wl,--gc-section -Wl,-Bstatic -Wl,-melf32lriscv -nostartfiles \ -Wl,--no-warn-mismatch \ -Wl,--build-id=none diff --git a/ports/litex/common-hal/digitalio/DigitalInOut.c b/ports/litex/common-hal/digitalio/DigitalInOut.c index 96cc95dfa6..a48d698fcb 100644 --- a/ports/litex/common-hal/digitalio/DigitalInOut.c +++ b/ports/litex/common-hal/digitalio/DigitalInOut.c @@ -27,7 +27,7 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "csr.h" diff --git a/ports/litex/common-hal/microcontroller/Processor.c b/ports/litex/common-hal/microcontroller/Processor.c index ff2f041876..12c3787c79 100644 --- a/ports/litex/common-hal/microcontroller/Processor.c +++ b/ports/litex/common-hal/microcontroller/Processor.c @@ -31,7 +31,7 @@ #include "common-hal/microcontroller/Processor.h" #include "shared-bindings/microcontroller/Processor.h" #include "shared-bindings/microcontroller/ResetReason.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "csr.h" #include "generated/soc.h" diff --git a/ports/mimxrt10xx/Makefile b/ports/mimxrt10xx/Makefile index 4a74b8fce5..4b05c91714 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 -ftree-vrp -DNDEBUG -ffreestanding +CFLAGS += -ftree-vrp -DNDEBUG # 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 @@ -84,12 +84,8 @@ CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_MIMXRT10XX -DCFG_TUD_MIDI_RX_BUFSIZE=512 -DCFG_ # Never set -fno-inline because we use inline to move small functions into routines that must be # in RAM. If inlining is disallowed, then we may end up calling a function in flash when we cannot. ifeq ($(DEBUG), 1) - # 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. CFLAGS += -fno-ipa-sra -else - #CFLAGS += -flto -flto-partition=none endif CFLAGS += $(INC) -ggdb -Wall -Werror -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) -Werror=missing-prototypes @@ -105,7 +101,6 @@ CFLAGS += \ -mfloat-abi=hard \ -mfpu=fpv5-sp-d16 \ -DCPU_$(CHIP_VARIANT) \ - -DDEBUG \ -DIMXRT10XX \ -g3 -Wno-unused-parameter \ -ffunction-sections -fdata-sections -fstack-usage diff --git a/ports/mimxrt10xx/common-hal/analogio/AnalogOut.c b/ports/mimxrt10xx/common-hal/analogio/AnalogOut.c index de807e7e5c..14e1faab09 100644 --- a/ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +++ b/ports/mimxrt10xx/common-hal/analogio/AnalogOut.c @@ -29,7 +29,7 @@ #include "shared-bindings/analogio/AnalogOut.h" #include "shared-bindings/microcontroller/Pin.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" void common_hal_analogio_analogout_construct(analogio_analogout_obj_t *self, const mcu_pin_obj_t *pin) { mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_AnalogOut); diff --git a/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c b/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c index 27753f47dc..dde7b3badd 100644 --- a/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c +++ b/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c @@ -36,7 +36,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/digitalio/DigitalInOut.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #define IOMUXC_SW_MUX_CTL_PAD_MUX_MODE_ALT5 5U diff --git a/ports/mimxrt10xx/common-hal/microcontroller/__init__.c b/ports/mimxrt10xx/common-hal/microcontroller/__init__.c index 3ea454a2b3..8de63061ad 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/__init__.c +++ b/ports/mimxrt10xx/common-hal/microcontroller/__init__.c @@ -37,7 +37,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/Processor.h" #include "supervisor/shared/safe_mode.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #define DBL_TAP_REG SNVS->LPGPR[3] diff --git a/ports/mimxrt10xx/common-hal/pwmio/PWMOut.c b/ports/mimxrt10xx/common-hal/pwmio/PWMOut.c index 29f72e21e4..97892b1095 100644 --- a/ports/mimxrt10xx/common-hal/pwmio/PWMOut.c +++ b/ports/mimxrt10xx/common-hal/pwmio/PWMOut.c @@ -35,7 +35,7 @@ #include "fsl_pwm.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "periph.h" // Debug print support set to zero to enable debug printing diff --git a/ports/mimxrt10xx/common-hal/rtc/RTC.c b/ports/mimxrt10xx/common-hal/rtc/RTC.c index a58b37ae62..7ed65a3499 100644 --- a/ports/mimxrt10xx/common-hal/rtc/RTC.c +++ b/ports/mimxrt10xx/common-hal/rtc/RTC.c @@ -33,7 +33,7 @@ #include "shared-bindings/rtc/__init__.h" #include "shared-bindings/rtc/RTC.h" #include "common-hal/rtc/RTC.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "fsl_snvs_hp.h" diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index 68bc3cc41c..bbe102ffc8 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -84,14 +84,6 @@ INC += -I../../lib/mp-readline INC += -I../../lib/tinyusb/src INC += -I../../supervisor/shared/usb -ifeq ($(MCU_CHIP),nrf52833) - OPTIMIZATION_FLAGS ?= -Os -flto -flto-partition=one -else - ifeq ($(INTERNAL_FLASH_FILESYSTEM),1) - OPTIMIZATION_FLAGS ?= -Os -flto - endif -endif - #Debugging/Optimization ifeq ($(DEBUG), 1) CFLAGS += -ggdb3 diff --git a/ports/nrf/common-hal/analogio/AnalogIn.c b/ports/nrf/common-hal/analogio/AnalogIn.c index 347426af99..b9d4b6a199 100644 --- a/ports/nrf/common-hal/analogio/AnalogIn.c +++ b/ports/nrf/common-hal/analogio/AnalogIn.c @@ -29,7 +29,7 @@ #include "shared-bindings/analogio/AnalogIn.h" #include "shared-bindings/microcontroller/Pin.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "nrf_saadc.h" #include "nrf_gpio.h" @@ -77,7 +77,7 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { // Something else might have used the ADC in a different way, // so we completely re-initialize it. - nrf_saadc_value_t value; + nrf_saadc_value_t value = -1; const nrf_saadc_channel_config_t config = { .resistor_p = NRF_SAADC_RESISTOR_DISABLED, diff --git a/ports/nrf/common-hal/analogio/AnalogOut.c b/ports/nrf/common-hal/analogio/AnalogOut.c index 4efd56795a..38ff935674 100644 --- a/ports/nrf/common-hal/analogio/AnalogOut.c +++ b/ports/nrf/common-hal/analogio/AnalogOut.c @@ -31,7 +31,7 @@ #include "py/mperrno.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" void common_hal_analogio_analogout_construct(analogio_analogout_obj_t *self, const mcu_pin_obj_t *pin) { mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_AnalogOut); diff --git a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c index 6728bf1e44..bc6302cb42 100644 --- a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +++ b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c @@ -37,7 +37,7 @@ #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Pin.h" #include "supervisor/shared/tick.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // TODO: This should be the same size as PWMOut.c:pwms[], but there's no trivial way to accomplish that STATIC audiopwmio_pwmaudioout_obj_t *active_audio[4]; diff --git a/ports/nrf/common-hal/busio/I2C.c b/ports/nrf/common-hal/busio/I2C.c index 6c645a512b..2bd1416f5a 100644 --- a/ports/nrf/common-hal/busio/I2C.c +++ b/ports/nrf/common-hal/busio/I2C.c @@ -32,7 +32,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "py/mperrno.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "nrfx_twim.h" #include "nrfx_spim.h" diff --git a/ports/nrf/common-hal/busio/UART.c b/ports/nrf/common-hal/busio/UART.c index 5c08f50012..04c502a4bd 100644 --- a/ports/nrf/common-hal/busio/UART.c +++ b/ports/nrf/common-hal/busio/UART.c @@ -33,7 +33,7 @@ #include "py/mperrno.h" #include "py/runtime.h" #include "py/stream.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "nrfx_uarte.h" #include "nrf_gpio.h" diff --git a/ports/nrf/common-hal/digitalio/DigitalInOut.c b/ports/nrf/common-hal/digitalio/DigitalInOut.c index b42d7dc704..95e488f3b7 100644 --- a/ports/nrf/common-hal/digitalio/DigitalInOut.c +++ b/ports/nrf/common-hal/digitalio/DigitalInOut.c @@ -26,7 +26,7 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "nrf_gpio.h" diff --git a/ports/nrf/common-hal/microcontroller/Processor.c b/ports/nrf/common-hal/microcontroller/Processor.c index fa2dfad6a4..2fca3a3c0a 100644 --- a/ports/nrf/common-hal/microcontroller/Processor.c +++ b/ports/nrf/common-hal/microcontroller/Processor.c @@ -31,7 +31,6 @@ #include "common-hal/alarm/__init__.h" #include "shared-bindings/microcontroller/ResetReason.h" -#include "supervisor/shared/translate.h" #include "nrfx_saadc.h" #ifdef BLUETOOTH_SD @@ -72,7 +71,7 @@ uint32_t common_hal_mcu_processor_get_frequency(void) { } float common_hal_mcu_processor_get_voltage(void) { - nrf_saadc_value_t value; + nrf_saadc_value_t value = -1; const nrf_saadc_channel_config_t config = { .resistor_p = NRF_SAADC_RESISTOR_DISABLED, diff --git a/ports/nrf/common-hal/pulseio/PulseOut.c b/ports/nrf/common-hal/pulseio/PulseOut.c index 1c3c317a05..2f822b4184 100644 --- a/ports/nrf/common-hal/pulseio/PulseOut.c +++ b/ports/nrf/common-hal/pulseio/PulseOut.c @@ -35,7 +35,7 @@ #include "py/runtime.h" #include "shared-bindings/pulseio/PulseOut.h" #include "shared-bindings/pwmio/PWMOut.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // A single timer is shared amongst all PulseOut objects under the assumption that // the code is single threaded. diff --git a/ports/nrf/common-hal/pwmio/PWMOut.c b/ports/nrf/common-hal/pwmio/PWMOut.c index 619acdfab6..1bd38e7a6e 100644 --- a/ports/nrf/common-hal/pwmio/PWMOut.c +++ b/ports/nrf/common-hal/pwmio/PWMOut.c @@ -30,7 +30,7 @@ #include "py/runtime.h" #include "common-hal/pwmio/PWMOut.h" #include "shared-bindings/pwmio/PWMOut.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "nrf_gpio.h" diff --git a/ports/nrf/common-hal/rtc/RTC.c b/ports/nrf/common-hal/rtc/RTC.c index ecc687b5e9..29d308eccc 100644 --- a/ports/nrf/common-hal/rtc/RTC.c +++ b/ports/nrf/common-hal/rtc/RTC.c @@ -33,7 +33,7 @@ #include "common-hal/rtc/RTC.h" #include "shared-bindings/rtc/RTC.h" #include "supervisor/port.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // This is the time in seconds since 2000 that the RTC was started. __attribute__((section(".uninitialized"))) static uint32_t rtc_offset[3]; diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index 6cbbce1846..4bb4f3dfb4 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -71,6 +71,11 @@ NRF_DEFINES += -DNRF52840_XXAA -DNRF52840 # Defined here because system_nrf52840.c doesn't #include any of our own include files. CFLAGS += -DCONFIG_NFCT_PINS_AS_GPIOS +ifeq ($(INTERNAL_FLASH_FILESYSTEM),1) + OPTIMIZATION_FLAGS ?= -Os + CIRCUITPY_LTO=balanced +endif + else ifeq ($(MCU_CHIP),nrf52833) MCU_SERIES = m4 @@ -87,5 +92,8 @@ SOFTDEV_VERSION ?= 7.0.1 BOOT_SETTING_ADDR = 0x7F000 NRF_DEFINES += -DNRF52833_XXAA -DNRF52833 +OPTIMIZATION_FLAGS ?= -Os + +CIRCUITPY_LTO=one endif endif diff --git a/ports/raspberrypi/bindings/rp2pio/StateMachine.c b/ports/raspberrypi/bindings/rp2pio/StateMachine.c index 2c7efb09d8..1203f4abac 100644 --- a/ports/raspberrypi/bindings/rp2pio/StateMachine.c +++ b/ports/raspberrypi/bindings/rp2pio/StateMachine.c @@ -40,7 +40,7 @@ #include "py/mperrno.h" #include "py/objproperty.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class StateMachine: diff --git a/ports/raspberrypi/common-hal/analogio/AnalogIn.c b/ports/raspberrypi/common-hal/analogio/AnalogIn.c index d164d9a18b..b827068e1a 100644 --- a/ports/raspberrypi/common-hal/analogio/AnalogIn.c +++ b/ports/raspberrypi/common-hal/analogio/AnalogIn.c @@ -28,7 +28,7 @@ #include "shared-bindings/analogio/AnalogIn.h" #include "shared-bindings/microcontroller/Pin.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "src/rp2_common/hardware_adc/include/hardware/adc.h" diff --git a/ports/raspberrypi/common-hal/analogio/AnalogOut.c b/ports/raspberrypi/common-hal/analogio/AnalogOut.c index 4efd56795a..38ff935674 100644 --- a/ports/raspberrypi/common-hal/analogio/AnalogOut.c +++ b/ports/raspberrypi/common-hal/analogio/AnalogOut.c @@ -31,7 +31,7 @@ #include "py/mperrno.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" void common_hal_analogio_analogout_construct(analogio_analogout_obj_t *self, const mcu_pin_obj_t *pin) { mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_AnalogOut); diff --git a/ports/raspberrypi/common-hal/audiobusio/I2SOut.c b/ports/raspberrypi/common-hal/audiobusio/I2SOut.c index 037163472d..7db053a39d 100644 --- a/ports/raspberrypi/common-hal/audiobusio/I2SOut.c +++ b/ports/raspberrypi/common-hal/audiobusio/I2SOut.c @@ -37,7 +37,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-module/audiocore/__init__.h" #include "bindings/rp2pio/StateMachine.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" const uint16_t i2s_program[] = { // ; Load the next set of samples diff --git a/ports/raspberrypi/common-hal/audiobusio/PDMIn.c b/ports/raspberrypi/common-hal/audiobusio/PDMIn.c index 8301f9fde4..c3aadd2bbe 100644 --- a/ports/raspberrypi/common-hal/audiobusio/PDMIn.c +++ b/ports/raspberrypi/common-hal/audiobusio/PDMIn.c @@ -32,7 +32,7 @@ #include "py/runtime.h" #include "shared-bindings/audiobusio/PDMIn.h" #include "shared-bindings/microcontroller/Pin.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "audio_dma.h" diff --git a/ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c b/ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c index 2f09124f4b..8b5c3accec 100644 --- a/ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c +++ b/ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c @@ -39,7 +39,7 @@ #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/Processor.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "src/rp2040/hardware_structs/include/hardware/structs/dma.h" #include "src/rp2_common/hardware_pwm/include/hardware/pwm.h" diff --git a/ports/raspberrypi/common-hal/countio/Counter.c b/ports/raspberrypi/common-hal/countio/Counter.c index 0ae773bdf3..44db126656 100644 --- a/ports/raspberrypi/common-hal/countio/Counter.c +++ b/ports/raspberrypi/common-hal/countio/Counter.c @@ -2,7 +2,7 @@ #include "py/runtime.h" #include "py/mpstate.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "shared-bindings/countio/Edge.h" #include "shared-bindings/digitalio/Pull.h" diff --git a/ports/raspberrypi/common-hal/digitalio/DigitalInOut.c b/ports/raspberrypi/common-hal/digitalio/DigitalInOut.c index a8a5a6b4d9..ef431d8506 100644 --- a/ports/raspberrypi/common-hal/digitalio/DigitalInOut.c +++ b/ports/raspberrypi/common-hal/digitalio/DigitalInOut.c @@ -32,7 +32,7 @@ #include "common-hal/microcontroller/Pin.h" #include "shared-bindings/digitalio/DigitalInOut.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "src/rp2_common/hardware_gpio/include/hardware/gpio.h" diff --git a/ports/raspberrypi/common-hal/microcontroller/__init__.c b/ports/raspberrypi/common-hal/microcontroller/__init__.c index ed68835e71..3b656edc07 100644 --- a/ports/raspberrypi/common-hal/microcontroller/__init__.c +++ b/ports/raspberrypi/common-hal/microcontroller/__init__.c @@ -38,7 +38,7 @@ #include "supervisor/filesystem.h" #include "supervisor/port.h" #include "supervisor/shared/safe_mode.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "src/rp2040/hardware_structs/include/hardware/structs/sio.h" #include "src/rp2_common/hardware_sync/include/hardware/sync.h" diff --git a/ports/raspberrypi/common-hal/pulseio/PulseIn.c b/ports/raspberrypi/common-hal/pulseio/PulseIn.c index 71633fcef7..33e6b0d89c 100644 --- a/ports/raspberrypi/common-hal/pulseio/PulseIn.c +++ b/ports/raspberrypi/common-hal/pulseio/PulseIn.c @@ -32,7 +32,7 @@ #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/pulseio/PulseIn.h" #include "shared-bindings/microcontroller/Pin.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "bindings/rp2pio/StateMachine.h" #include "common-hal/pulseio/PulseIn.h" diff --git a/ports/raspberrypi/common-hal/pulseio/PulseOut.c b/ports/raspberrypi/common-hal/pulseio/PulseOut.c index 7704fdff6f..881e003579 100644 --- a/ports/raspberrypi/common-hal/pulseio/PulseOut.c +++ b/ports/raspberrypi/common-hal/pulseio/PulseOut.c @@ -33,7 +33,7 @@ #include "shared-bindings/pwmio/PWMOut.h" #include "shared-bindings/microcontroller/__init__.h" #include "common-hal/pwmio/PWMOut.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "src/rp2040/hardware_structs/include/hardware/structs/pwm.h" #include "src/rp2_common/hardware_gpio/include/hardware/gpio.h" #include "src/rp2_common/hardware_pwm/include/hardware/pwm.h" diff --git a/ports/raspberrypi/common-hal/pwmio/PWMOut.c b/ports/raspberrypi/common-hal/pwmio/PWMOut.c index 958e848b9f..e6f88f8894 100644 --- a/ports/raspberrypi/common-hal/pwmio/PWMOut.c +++ b/ports/raspberrypi/common-hal/pwmio/PWMOut.c @@ -32,7 +32,7 @@ #include "shared-bindings/pwmio/PWMOut.h" #include "shared-bindings/microcontroller/Processor.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "src/rp2040/hardware_regs/include/hardware/platform_defs.h" #include "src/rp2_common/hardware_clocks/include/hardware/clocks.h" diff --git a/ports/stm/Makefile b/ports/stm/Makefile index 5eeff2c80a..afde51bdc0 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -88,8 +88,6 @@ else CFLAGS += -DNDEBUG OPTIMIZATION_FLAGS ?= -O2 -fno-inline-functions CFLAGS += -ggdb3 - # TODO: Test with -flto - # CFLAGS += -flto endif # to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk diff --git a/ports/stm/common-hal/analogio/AnalogIn.c b/ports/stm/common-hal/analogio/AnalogIn.c index 9ec93ccc84..7bed932c71 100644 --- a/ports/stm/common-hal/analogio/AnalogIn.c +++ b/ports/stm/common-hal/analogio/AnalogIn.c @@ -27,7 +27,7 @@ #include "common-hal/analogio/AnalogIn.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "shared-bindings/microcontroller/Pin.h" diff --git a/ports/stm/common-hal/analogio/AnalogOut.c b/ports/stm/common-hal/analogio/AnalogOut.c index b2cdd50153..3c2860c9ad 100644 --- a/ports/stm/common-hal/analogio/AnalogOut.c +++ b/ports/stm/common-hal/analogio/AnalogOut.c @@ -33,7 +33,7 @@ #include "shared-bindings/analogio/AnalogOut.h" #include "shared-bindings/microcontroller/Pin.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "common-hal/microcontroller/Pin.h" diff --git a/ports/stm/common-hal/busio/I2C.c b/ports/stm/common-hal/busio/I2C.c index 3ff437c803..4faa5ca2ef 100644 --- a/ports/stm/common-hal/busio/I2C.c +++ b/ports/stm/common-hal/busio/I2C.c @@ -31,7 +31,7 @@ #include "py/runtime.h" #include "shared-bindings/microcontroller/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "shared-bindings/microcontroller/Pin.h" // I2C timing specs for the H7 and F7 diff --git a/ports/stm/common-hal/busio/SPI.c b/ports/stm/common-hal/busio/SPI.c index f772cdeec0..1daa29a923 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 "supervisor/board.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "shared-bindings/microcontroller/Pin.h" // Note that any bugs introduced in this file can cause crashes at startup diff --git a/ports/stm/common-hal/busio/UART.c b/ports/stm/common-hal/busio/UART.c index d3fdb83c88..171e915dd9 100644 --- a/ports/stm/common-hal/busio/UART.c +++ b/ports/stm/common-hal/busio/UART.c @@ -35,7 +35,7 @@ #include "py/mperrno.h" #include "py/runtime.h" #include "py/stream.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #define ALL_UARTS 0xFFFF diff --git a/ports/stm/common-hal/digitalio/DigitalInOut.c b/ports/stm/common-hal/digitalio/DigitalInOut.c index 39c72b73c9..3a0e27943b 100644 --- a/ports/stm/common-hal/digitalio/DigitalInOut.c +++ b/ports/stm/common-hal/digitalio/DigitalInOut.c @@ -28,7 +28,7 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/microcontroller/Pin.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // The HAL is sparse on obtaining register information, so we use the LLs here. #if (CPY_STM32H7) diff --git a/ports/stm/common-hal/microcontroller/Processor.c b/ports/stm/common-hal/microcontroller/Processor.c index 13c661a60a..67cf9a73e4 100644 --- a/ports/stm/common-hal/microcontroller/Processor.c +++ b/ports/stm/common-hal/microcontroller/Processor.c @@ -32,7 +32,7 @@ #endif #include "common-hal/microcontroller/Processor.h" #include "shared-bindings/microcontroller/ResetReason.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include STM32_HAL_H diff --git a/ports/stm/common-hal/pulseio/PulseOut.c b/ports/stm/common-hal/pulseio/PulseOut.c index fe3caa08b2..7725d8cdde 100644 --- a/ports/stm/common-hal/pulseio/PulseOut.c +++ b/ports/stm/common-hal/pulseio/PulseOut.c @@ -33,7 +33,7 @@ #include "py/runtime.h" #include "shared-bindings/pulseio/PulseOut.h" #include "shared-bindings/pwmio/PWMOut.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include STM32_HAL_H #include "shared-bindings/microcontroller/Pin.h" diff --git a/ports/stm/common-hal/pwmio/PWMOut.c b/ports/stm/common-hal/pwmio/PWMOut.c index 6710f43f7d..45f00b901b 100644 --- a/ports/stm/common-hal/pwmio/PWMOut.c +++ b/ports/stm/common-hal/pwmio/PWMOut.c @@ -29,7 +29,7 @@ #include "py/runtime.h" #include "common-hal/pwmio/PWMOut.h" #include "shared-bindings/pwmio/PWMOut.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "shared-bindings/microcontroller/__init__.h" #include STM32_HAL_H diff --git a/ports/stm/common-hal/sdioio/SDCard.c b/ports/stm/common-hal/sdioio/SDCard.c index 40e6eddae1..8eeae2781d 100644 --- a/ports/stm/common-hal/sdioio/SDCard.c +++ b/ports/stm/common-hal/sdioio/SDCard.c @@ -32,7 +32,7 @@ #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/util.h" #include "supervisor/board.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "common-hal/microcontroller/Pin.h" #include "shared-bindings/microcontroller/Pin.h" diff --git a/ports/stm/peripherals/timers.c b/ports/stm/peripherals/timers.c index f0054648fc..371b8f414b 100644 --- a/ports/stm/peripherals/timers.c +++ b/ports/stm/peripherals/timers.c @@ -29,7 +29,7 @@ #include "py/gc.h" #include "py/obj.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Pin.h" diff --git a/ports/unix/modffi.c b/ports/unix/modffi.c index d1966c51f0..d8b63b571e 100644 --- a/ports/unix/modffi.c +++ b/ports/unix/modffi.c @@ -38,7 +38,7 @@ #include "py/objint.h" #include "py/gc.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" /* * modffi uses character codes to encode a value type, based on "struct" diff --git a/ports/unix/modmachine.c b/ports/unix/modmachine.c index 04ff325eef..987c70b26e 100644 --- a/ports/unix/modmachine.c +++ b/ports/unix/modmachine.c @@ -36,7 +36,7 @@ #include "extmod/machine_signal.h" #include "extmod/machine_pulse.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PLAT_DEV_MEM #include diff --git a/py/argcheck.c b/py/argcheck.c index 592b35940e..cabfaeeaae 100644 --- a/py/argcheck.c +++ b/py/argcheck.c @@ -29,7 +29,7 @@ #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" void mp_arg_check_num_sig(size_t n_args, size_t n_kw, uint32_t sig) { // TODO maybe take the function name as an argument so we can print nicer error messages diff --git a/py/bc.c b/py/bc.c index 33b94c4a9f..e1645dbff0 100644 --- a/py/bc.c +++ b/py/bc.c @@ -33,7 +33,7 @@ #include "py/bc0.h" #include "py/bc.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_DEBUG_VERBOSE // print debugging info #define DEBUG_PRINT (1) diff --git a/py/binary.c b/py/binary.c index 06f0157567..439993c0f7 100644 --- a/py/binary.c +++ b/py/binary.c @@ -36,7 +36,7 @@ #include "py/objint.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // Helpers to work with binary-encoded data diff --git a/py/builtinevex.c b/py/builtinevex.c index a96a3a5344..46d4a1277a 100644 --- a/py/builtinevex.c +++ b/py/builtinevex.c @@ -31,7 +31,7 @@ #include "py/runtime.h" #include "py/builtin.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_BUILTINS_COMPILE diff --git a/py/builtinhelp.c b/py/builtinhelp.c index 7411c57aae..86632f6dde 100644 --- a/py/builtinhelp.c +++ b/py/builtinhelp.c @@ -32,6 +32,8 @@ #include "py/mpconfig.h" #include "py/objmodule.h" +#include "supervisor/shared/translate/translate.h" + #if MICROPY_PY_BUILTINS_HELP const char mp_help_default_text[] = diff --git a/py/builtinimport.c b/py/builtinimport.c index d938cde7ea..92f3150306 100644 --- a/py/builtinimport.c +++ b/py/builtinimport.c @@ -39,7 +39,7 @@ #include "py/builtin.h" #include "py/frozenmod.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_DEBUG_VERBOSE // print debugging info #define DEBUG_PRINT (1) diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 2514cbaa2b..681eae779b 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -51,8 +51,7 @@ BASE_CFLAGS = \ -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF \ -DCIRCUITPY_CANARY_WORD=0xADAF00 \ -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF \ - -DCIRCUITPY_BOARD_ID="\"$(BOARD)\"" \ - --param max-inline-insns-single=500 + -DCIRCUITPY_BOARD_ID="\"$(BOARD)\"" # Use these flags to debug build times and header includes. # -ftime-report @@ -67,6 +66,13 @@ else CFLAGS += -DCIRCUITPY_DEBUG=0 endif +CIRCUITPY_LTO ?= 0 +ifneq ($(CIRCUITPY_LTO),0) +CFLAGS += -DCIRCUITPY_LTO=1 -flto=auto -flto-partition=$(CIRCUITPY_LTO) +else +CFLAGS += -DCIRCUITPY_LTO=0 +endif + ### # Handle frozen modules. @@ -756,3 +762,6 @@ endif check-release-needs-clean-build: @echo "RELEASE_NEEDS_CLEAN_BUILD = $(RELEASE_NEEDS_CLEAN_BUILD)" + +# Ignore these errors +$(BUILD)/lib/libm/kf_rem_pio2.o: CFLAGS += -Wno-maybe-uninitialized diff --git a/py/compile.c b/py/compile.c index e5f341a656..63f96f6085 100644 --- a/py/compile.c +++ b/py/compile.c @@ -37,7 +37,7 @@ #include "py/asmbase.h" #include "py/persistentcode.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_ENABLE_COMPILER @@ -92,7 +92,7 @@ typedef enum { #define NATIVE_EMITTER(f) emit_native_table[mp_dynamic_compiler.native_arch]->emit_##f #define NATIVE_EMITTER_TABLE emit_native_table[mp_dynamic_compiler.native_arch] -STATIC const emit_method_table_t *emit_native_table[] = { +STATIC const emit_method_table_t * emit_native_table[] = { NULL, &emit_native_x86_method_table, &emit_native_x64_method_table, @@ -131,7 +131,7 @@ STATIC const emit_method_table_t *emit_native_table[] = { #define ASM_EMITTER(f) emit_asm_table[mp_dynamic_compiler.native_arch]->asm_##f #define ASM_EMITTER_TABLE emit_asm_table[mp_dynamic_compiler.native_arch] -STATIC const emit_inline_asm_method_table_t *emit_asm_table[] = { +STATIC const emit_inline_asm_method_table_t * emit_asm_table[] = { NULL, NULL, NULL, @@ -3527,7 +3527,7 @@ mp_raw_code_t *mp_compile_to_raw_code(mp_parse_tree_t *parse_tree, qstr source_f switch (s->emit_options) { - #if MICROPY_EMIT_NATIVE + #if MICROPY_EMIT_NATIVE case MP_EMIT_OPT_NATIVE_PYTHON: case MP_EMIT_OPT_VIPER: if (emit_native == NULL) { @@ -3536,7 +3536,7 @@ mp_raw_code_t *mp_compile_to_raw_code(mp_parse_tree_t *parse_tree, qstr source_f comp->emit_method_table = NATIVE_EMITTER_TABLE; comp->emit = emit_native; break; - #endif // MICROPY_EMIT_NATIVE + #endif // MICROPY_EMIT_NATIVE default: comp->emit = emit_bc; diff --git a/py/enum.c b/py/enum.c index 4728c7f11d..681c3b3103 100644 --- a/py/enum.c +++ b/py/enum.c @@ -27,6 +27,8 @@ #include "py/enum.h" #include "py/runtime.h" +#include "supervisor/shared/translate/translate.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; i < dict->map.used; i++) { diff --git a/py/lexer.c b/py/lexer.c index 196f9a2644..0d6de0d522 100644 --- a/py/lexer.c +++ b/py/lexer.c @@ -32,7 +32,7 @@ #include "py/lexer.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_ENABLE_COMPILER diff --git a/py/makeqstrdata.py b/py/makeqstrdata.py index 74ad78c47d..dada7e8e59 100644 --- a/py/makeqstrdata.py +++ b/py/makeqstrdata.py @@ -4,7 +4,7 @@ Process raw qstr file and output qstr data with length, hash and data bytes. This script works with Python 2.7, 3.3 and 3.4. For documentation about the format of compressed translated strings, see -supervisor/shared/translate.h +supervisor/shared/translate/translate.h """ from __future__ import print_function diff --git a/py/modbuiltins.c b/py/modbuiltins.c index ebdbd52dff..91712812bc 100644 --- a/py/modbuiltins.c +++ b/py/modbuiltins.c @@ -35,7 +35,7 @@ #include "py/builtin.h" #include "py/stream.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_BUILTINS_FLOAT #include diff --git a/py/modmath.c b/py/modmath.c index 103310db5e..167d46d02b 100644 --- a/py/modmath.c +++ b/py/modmath.c @@ -27,7 +27,7 @@ #include "py/builtin.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_BUILTINS_FLOAT && MICROPY_PY_MATH diff --git a/py/modmicropython.c b/py/modmicropython.c index 0465a4eef8..42c84e5292 100644 --- a/py/modmicropython.c +++ b/py/modmicropython.c @@ -32,7 +32,7 @@ #include "py/gc.h" #include "py/mphal.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // Various builtins specific to MicroPython runtime, // living in micropython module diff --git a/py/modstruct.c b/py/modstruct.c index c0b0fb7890..17dfc548ab 100644 --- a/py/modstruct.c +++ b/py/modstruct.c @@ -33,7 +33,7 @@ #include "py/objtuple.h" #include "py/binary.h" #include "py/parsenum.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_STRUCT diff --git a/py/modthread.c b/py/modthread.c index 333d750a36..a3960cddcb 100644 --- a/py/modthread.c +++ b/py/modthread.c @@ -30,7 +30,7 @@ #include "py/runtime.h" #include "py/stackctrl.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_THREAD diff --git a/py/moduerrno.c b/py/moduerrno.c index 743be0b85d..0ac0503ccc 100644 --- a/py/moduerrno.c +++ b/py/moduerrno.c @@ -30,7 +30,7 @@ #include "py/obj.h" #include "py/mperrno.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // This list can be defined per port in mpconfigport.h to tailor it to a // specific port's needs. If it's not defined then we provide a default. diff --git a/py/obj.c b/py/obj.c index cc7f9006e8..da609aa8ce 100644 --- a/py/obj.c +++ b/py/obj.c @@ -41,7 +41,7 @@ #include "supervisor/linker.h" #include "supervisor/shared/stack.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" const mp_obj_type_t *MICROPY_WRAP_MP_OBJ_GET_TYPE(mp_obj_get_type)(mp_const_obj_t o_in) { #if MICROPY_OBJ_IMMEDIATE_OBJS && MICROPY_OBJ_REPR == MICROPY_OBJ_REPR_A diff --git a/py/obj.h b/py/obj.h index 5f8f71ba0b..8f38a4c7c0 100644 --- a/py/obj.h +++ b/py/obj.h @@ -34,7 +34,7 @@ #include "py/mpprint.h" #include "py/runtime0.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/compressed_string.h" // This is the definition of the opaque MicroPython object type. // All concrete objects have an encoding within this type and the diff --git a/py/objarray.c b/py/objarray.c index b71687fb35..a66a73a5ac 100644 --- a/py/objarray.c +++ b/py/objarray.c @@ -34,7 +34,7 @@ #include "py/objstr.h" #include "py/objarray.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_ARRAY || MICROPY_PY_BUILTINS_BYTEARRAY || MICROPY_PY_BUILTINS_MEMORYVIEW diff --git a/py/objcomplex.c b/py/objcomplex.c index b37b059d59..f205249bb4 100644 --- a/py/objcomplex.c +++ b/py/objcomplex.c @@ -31,7 +31,7 @@ #include "py/parsenum.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_BUILTINS_COMPLEX diff --git a/py/objdeque.c b/py/objdeque.c index 2d29d71e3b..59c4c709fc 100644 --- a/py/objdeque.c +++ b/py/objdeque.c @@ -28,7 +28,7 @@ #include #include "py/mpconfig.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_COLLECTIONS_DEQUE diff --git a/py/objdict.c b/py/objdict.c index 5f233741fa..306205d12f 100644 --- a/py/objdict.c +++ b/py/objdict.c @@ -34,7 +34,7 @@ #include "py/objstr.h" #include "supervisor/linker.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" const mp_obj_dict_t mp_const_empty_dict_obj = { .base = { .type = &mp_type_dict }, diff --git a/py/objexcept.c b/py/objexcept.c index fc0787631f..230f9d11ba 100644 --- a/py/objexcept.c +++ b/py/objexcept.c @@ -39,7 +39,7 @@ #include "py/gc.h" #include "py/mperrno.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // Number of items per traceback entry (file, line, block) #define TRACEBACK_ENTRY_LEN (3) diff --git a/py/objfloat.c b/py/objfloat.c index 6d1d10188c..f8261df933 100644 --- a/py/objfloat.c +++ b/py/objfloat.c @@ -32,7 +32,7 @@ #include "py/parsenum.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_BUILTINS_FLOAT diff --git a/py/objgenerator.c b/py/objgenerator.c index c63ea6b816..b18101cfa1 100644 --- a/py/objgenerator.c +++ b/py/objgenerator.c @@ -35,7 +35,7 @@ #include "py/objfun.h" #include "py/stackctrl.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // Instance of GeneratorExit exception - needed by generator.close() const mp_obj_exception_t mp_const_GeneratorExit_obj = {{&mp_type_GeneratorExit}, (mp_obj_tuple_t *)&mp_const_empty_tuple_obj, (mp_obj_traceback_t *)&mp_const_empty_traceback_obj}; diff --git a/py/objint.c b/py/objint.c index 50bcbf56f8..98178e7ffa 100644 --- a/py/objint.c +++ b/py/objint.c @@ -35,7 +35,7 @@ #include "py/runtime.h" #include "py/binary.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_BUILTINS_FLOAT #include diff --git a/py/objint_longlong.c b/py/objint_longlong.c index 368c74ec1d..67ec844f47 100644 --- a/py/objint_longlong.c +++ b/py/objint_longlong.c @@ -32,7 +32,7 @@ #include "py/objint.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_BUILTINS_FLOAT #include diff --git a/py/objint_mpz.c b/py/objint_mpz.c index b804ce28af..fd74803fe7 100644 --- a/py/objint_mpz.c +++ b/py/objint_mpz.c @@ -33,7 +33,7 @@ #include "py/objint.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_BUILTINS_FLOAT #include diff --git a/py/objlist.c b/py/objlist.c index 9d1949b7dc..434bca7d0a 100644 --- a/py/objlist.c +++ b/py/objlist.c @@ -31,7 +31,7 @@ #include "py/runtime.h" #include "py/stackctrl.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" STATIC mp_obj_t mp_obj_new_list_iterator(mp_obj_t list, size_t cur, mp_obj_iter_buf_t *iter_buf); STATIC mp_obj_list_t *list_new(size_t n); diff --git a/py/objnamedtuple.c b/py/objnamedtuple.c index c970d1afba..60a0a31847 100644 --- a/py/objnamedtuple.c +++ b/py/objnamedtuple.c @@ -33,7 +33,7 @@ #include "py/objnamedtuple.h" #include "py/objtype.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_COLLECTIONS diff --git a/py/objobject.c b/py/objobject.c index d9c75faff9..b32e5fac0d 100644 --- a/py/objobject.c +++ b/py/objobject.c @@ -29,7 +29,7 @@ #include "py/objtype.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" typedef struct _mp_obj_object_t { mp_obj_base_t base; diff --git a/py/objrange.c b/py/objrange.c index b23ab23bd7..b0c74815dc 100644 --- a/py/objrange.c +++ b/py/objrange.c @@ -28,7 +28,7 @@ #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" /******************************************************************************/ /* range iterator */ diff --git a/py/objset.c b/py/objset.c index d7dda6ba59..237e4c2471 100644 --- a/py/objset.c +++ b/py/objset.c @@ -31,7 +31,7 @@ #include "py/runtime.h" #include "py/builtin.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_BUILTINS_SET diff --git a/py/objslice.c b/py/objslice.c index 142f62fdac..3172f798c0 100644 --- a/py/objslice.c +++ b/py/objslice.c @@ -30,7 +30,7 @@ #include "py/obj.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" /******************************************************************************/ /* slice object */ diff --git a/py/objstr.c b/py/objstr.c index 3d45383bb3..df735a45cd 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -35,7 +35,7 @@ #include "py/runtime.h" #include "py/stackctrl.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_BUILTINS_STR_OP_MODULO STATIC mp_obj_t str_modulo_format(mp_obj_t pattern, size_t n_args, const mp_obj_t *args, mp_obj_t dict); diff --git a/py/objstringio.c b/py/objstringio.c index 336a041baf..c6d22d6c89 100644 --- a/py/objstringio.c +++ b/py/objstringio.c @@ -33,7 +33,7 @@ #include "py/runtime.h" #include "py/stream.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_IO diff --git a/py/objstrunicode.c b/py/objstrunicode.c index eb79d54991..0f26da62cf 100644 --- a/py/objstrunicode.c +++ b/py/objstrunicode.c @@ -32,7 +32,7 @@ #include "py/objlist.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_BUILTINS_STR_UNICODE diff --git a/py/objtuple.c b/py/objtuple.c index 90b0773bb4..87d16905df 100644 --- a/py/objtuple.c +++ b/py/objtuple.c @@ -32,7 +32,7 @@ #include "py/runtime.h" #include "py/objtype.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" /******************************************************************************/ diff --git a/py/objtype.c b/py/objtype.c index 62ea1ed602..071065041f 100644 --- a/py/objtype.c +++ b/py/objtype.c @@ -35,7 +35,7 @@ #include "py/runtime.h" #include "supervisor/shared/stack.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_DEBUG_VERBOSE // print debugging info #define DEBUG_PRINT (1) diff --git a/py/parse.c b/py/parse.c index dee662b4ec..b3be279c5b 100644 --- a/py/parse.c +++ b/py/parse.c @@ -39,7 +39,7 @@ #include "py/objstr.h" #include "py/builtin.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_ENABLE_COMPILER diff --git a/py/parsenum.c b/py/parsenum.c index bd41488204..adf2a4d84d 100644 --- a/py/parsenum.c +++ b/py/parsenum.c @@ -32,7 +32,7 @@ #include "py/parsenum.h" #include "py/smallint.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_BUILTINS_FLOAT #include diff --git a/py/persistentcode.c b/py/persistentcode.c index e604569fe2..787f724bf6 100644 --- a/py/persistentcode.c +++ b/py/persistentcode.c @@ -36,7 +36,7 @@ #include "py/objstr.h" #include "py/mpthread.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PERSISTENT_CODE_LOAD || MICROPY_PERSISTENT_CODE_SAVE diff --git a/py/proto.c b/py/proto.c index 9f110b9f9a..d70a9d2aac 100644 --- a/py/proto.c +++ b/py/proto.c @@ -28,6 +28,8 @@ #include "py/proto.h" #include "py/runtime.h" +#include "supervisor/shared/translate/translate.h" + #ifndef MICROPY_UNSAFE_PROTO const void *mp_proto_get(uint16_t name, mp_const_obj_t obj) { const mp_obj_type_t *type = mp_obj_get_type(obj); diff --git a/py/qstr.c b/py/qstr.c index 41176ec5ab..083e12d6f0 100644 --- a/py/qstr.c +++ b/py/qstr.c @@ -35,6 +35,7 @@ #include "py/runtime.h" #include "supervisor/linker.h" +#include "supervisor/shared/translate/translate.h" // NOTE: we are using linear arrays to store and search for qstr's (unique strings, interned strings) // ultimately we will replace this with a static hash table of some kind diff --git a/py/runtime.c b/py/runtime.c index f2ad8728a5..7fcad7366a 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -45,7 +45,7 @@ #include "py/stackctrl.h" #include "py/gc.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_DEBUG_VERBOSE // print debugging info #define DEBUG_PRINT (1) diff --git a/py/runtime.h b/py/runtime.h index dccdc2feed..a78969780b 100644 --- a/py/runtime.h +++ b/py/runtime.h @@ -33,6 +33,8 @@ #include "supervisor/linker.h" +#include "supervisor/shared/translate/translate.h" + typedef enum { MP_VM_RETURN_NORMAL, MP_VM_RETURN_YIELD, diff --git a/py/sequence.c b/py/sequence.c index ee400ccd8d..7befc85763 100644 --- a/py/sequence.c +++ b/py/sequence.c @@ -28,7 +28,7 @@ #include #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // Helpers for sequence types diff --git a/py/stream.c b/py/stream.c index b12d693c62..27609043fc 100644 --- a/py/stream.c +++ b/py/stream.c @@ -31,7 +31,7 @@ #include "py/objstr.h" #include "py/stream.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // This file defines generic Python stream read/write methods which // dispatch to the underlying stream interface of an object. diff --git a/py/vm.c b/py/vm.c index 8cb01d3552..12a0f2d445 100644 --- a/py/vm.c +++ b/py/vm.c @@ -37,6 +37,7 @@ #include "py/profile.h" #include "supervisor/linker.h" +#include "supervisor/shared/translate/translate.h" // *FORMAT-OFF* diff --git a/runtime.py b/runtime.py new file mode 100644 index 0000000000..28bf98962e --- /dev/null +++ b/runtime.py @@ -0,0 +1,10 @@ +import pathlib +paths = pathlib.Path(".").glob("**/*.c") +translate_h = "#include \"supervisor/shared/translate/translate.h\"" +for p in paths: + if "esp-idf" in p: + continue + lines = p.read_text().split("\n") + if "#include \"py/runtime.h\"" in lines and translate_h in lines: + lines.remove(translate_h) + p.write_text("\n".join(lines)) diff --git a/shared-bindings/_pew/PewPew.c b/shared-bindings/_pew/PewPew.c index 4015d31161..1a4356c719 100644 --- a/shared-bindings/_pew/PewPew.c +++ b/shared-bindings/_pew/PewPew.c @@ -32,7 +32,7 @@ #include "shared-bindings/util.h" #include "PewPew.h" #include "common-hal/_pew/PewPew.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class PewPew: //| """This is an internal module to be used by the ``pew.py`` library from diff --git a/shared-bindings/_stage/Layer.c b/shared-bindings/_stage/Layer.c index c3c0aa1801..9e64a252db 100644 --- a/shared-bindings/_stage/Layer.c +++ b/shared-bindings/_stage/Layer.c @@ -28,7 +28,7 @@ #include "__init__.h" #include "Layer.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class Layer: //| """Keep information about a single layer of graphics""" diff --git a/shared-bindings/_stage/Text.c b/shared-bindings/_stage/Text.c index d6b22171d6..48747bfd67 100644 --- a/shared-bindings/_stage/Text.c +++ b/shared-bindings/_stage/Text.c @@ -28,7 +28,7 @@ #include "__init__.h" #include "Text.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class Text: //| """Keep information about a single grid of text""" diff --git a/shared-bindings/adafruit_bus_device/i2c_device/I2CDevice.c b/shared-bindings/adafruit_bus_device/i2c_device/I2CDevice.c index 327e8e72b4..3ae5fc2a2f 100644 --- a/shared-bindings/adafruit_bus_device/i2c_device/I2CDevice.c +++ b/shared-bindings/adafruit_bus_device/i2c_device/I2CDevice.c @@ -36,7 +36,7 @@ #include "shared/runtime/context_manager_helpers.h" #include "py/runtime.h" #include "py/smallint.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class I2CDevice: diff --git a/shared-bindings/adafruit_bus_device/spi_device/SPIDevice.c b/shared-bindings/adafruit_bus_device/spi_device/SPIDevice.c index 2c5708b831..f7cc357e91 100644 --- a/shared-bindings/adafruit_bus_device/spi_device/SPIDevice.c +++ b/shared-bindings/adafruit_bus_device/spi_device/SPIDevice.c @@ -35,7 +35,7 @@ #include "shared/runtime/buffer_helper.h" #include "shared/runtime/context_manager_helpers.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class SPIDevice: diff --git a/shared-bindings/alarm/SleepMemory.c b/shared-bindings/alarm/SleepMemory.c index 37223f1f35..b4e68c964c 100644 --- a/shared-bindings/alarm/SleepMemory.c +++ b/shared-bindings/alarm/SleepMemory.c @@ -31,7 +31,7 @@ #include "py/runtime0.h" #include "shared-bindings/alarm/SleepMemory.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class SleepMemory: //| """Store raw bytes in RAM that persists during deep sleep. diff --git a/shared-bindings/alarm/pin/PinAlarm.c b/shared-bindings/alarm/pin/PinAlarm.c index ff34716786..06ad77c56d 100644 --- a/shared-bindings/alarm/pin/PinAlarm.c +++ b/shared-bindings/alarm/pin/PinAlarm.c @@ -33,7 +33,7 @@ #include "py/obj.h" #include "py/objproperty.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class PinAlarm: //| """Trigger an alarm when a pin changes state.""" diff --git a/shared-bindings/alarm/time/TimeAlarm.c b/shared-bindings/alarm/time/TimeAlarm.c index ab0274afa9..0b77913c9b 100644 --- a/shared-bindings/alarm/time/TimeAlarm.c +++ b/shared-bindings/alarm/time/TimeAlarm.c @@ -33,7 +33,7 @@ #include "shared-bindings/rtc/__init__.h" #include "shared-bindings/time/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_LONGINT_IMPL != MICROPY_LONGINT_IMPL_NONE mp_obj_t MP_WEAK rtc_get_time_source_time(void) { diff --git a/shared-bindings/analogio/AnalogOut.c b/shared-bindings/analogio/AnalogOut.c index 2f171c5a0f..41c9b053eb 100644 --- a/shared-bindings/analogio/AnalogOut.c +++ b/shared-bindings/analogio/AnalogOut.c @@ -34,7 +34,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/analogio/AnalogOut.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class AnalogOut: //| """Output analog values (a specific voltage). diff --git a/shared-bindings/audiobusio/I2SOut.c b/shared-bindings/audiobusio/I2SOut.c index 93c316d374..7c660abc4a 100644 --- a/shared-bindings/audiobusio/I2SOut.c +++ b/shared-bindings/audiobusio/I2SOut.c @@ -33,7 +33,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/audiobusio/I2SOut.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class I2SOut: //| """Output an I2S audio signal""" diff --git a/shared-bindings/audiobusio/PDMIn.c b/shared-bindings/audiobusio/PDMIn.c index aa810f2930..29752a442c 100644 --- a/shared-bindings/audiobusio/PDMIn.c +++ b/shared-bindings/audiobusio/PDMIn.c @@ -34,7 +34,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/audiobusio/PDMIn.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class PDMIn: //| """Record an input PDM audio stream""" diff --git a/shared-bindings/audiocore/RawSample.c b/shared-bindings/audiocore/RawSample.c index 82c02450ba..02d4bbaa2f 100644 --- a/shared-bindings/audiocore/RawSample.c +++ b/shared-bindings/audiocore/RawSample.c @@ -32,7 +32,7 @@ #include "py/runtime.h" #include "shared-bindings/util.h" #include "shared-bindings/audiocore/RawSample.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class RawSample: //| """A raw audio sample buffer in memory""" diff --git a/shared-bindings/audiocore/WaveFile.c b/shared-bindings/audiocore/WaveFile.c index 285bd7cbbe..b1c51a9746 100644 --- a/shared-bindings/audiocore/WaveFile.c +++ b/shared-bindings/audiocore/WaveFile.c @@ -31,7 +31,7 @@ #include "py/runtime.h" #include "shared-bindings/audiocore/WaveFile.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class WaveFile: //| """Load a wave file for audio playback diff --git a/shared-bindings/audioio/AudioOut.c b/shared-bindings/audioio/AudioOut.c index 0b4ed7b975..75ba7b5ec5 100644 --- a/shared-bindings/audioio/AudioOut.c +++ b/shared-bindings/audioio/AudioOut.c @@ -34,7 +34,7 @@ #include "shared-bindings/audioio/AudioOut.h" #include "shared-bindings/audiocore/RawSample.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class AudioOut: //| """Output an analog audio signal""" diff --git a/shared-bindings/audiomixer/Mixer.c b/shared-bindings/audiomixer/Mixer.c index 3ca6ccd5e3..47dbd94f19 100644 --- a/shared-bindings/audiomixer/Mixer.c +++ b/shared-bindings/audiomixer/Mixer.c @@ -36,7 +36,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/audiocore/RawSample.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class Mixer: //| """Mixes one or more audio samples together into one sample.""" diff --git a/shared-bindings/audiomixer/MixerVoice.c b/shared-bindings/audiomixer/MixerVoice.c index f02b9521af..f7bf16fb49 100644 --- a/shared-bindings/audiomixer/MixerVoice.c +++ b/shared-bindings/audiomixer/MixerVoice.c @@ -35,7 +35,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/audiocore/RawSample.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class MixerVoice: //| """Voice objects used with Mixer diff --git a/shared-bindings/audiomp3/MP3Decoder.c b/shared-bindings/audiomp3/MP3Decoder.c index 16efa361b8..8251b26c73 100644 --- a/shared-bindings/audiomp3/MP3Decoder.c +++ b/shared-bindings/audiomp3/MP3Decoder.c @@ -32,7 +32,7 @@ #include "py/runtime.h" #include "shared-bindings/audiomp3/MP3Decoder.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class MP3Decoder: //| """Load a mp3 file for audio playback diff --git a/shared-bindings/audiopwmio/PWMAudioOut.c b/shared-bindings/audiopwmio/PWMAudioOut.c index 8118eb47f2..f4f3675750 100644 --- a/shared-bindings/audiopwmio/PWMAudioOut.c +++ b/shared-bindings/audiopwmio/PWMAudioOut.c @@ -34,7 +34,7 @@ #include "shared-bindings/audiopwmio/PWMAudioOut.h" #include "shared-bindings/audiocore/RawSample.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class PWMAudioOut: //| """Output an analog audio signal by varying the PWM duty cycle.""" diff --git a/shared-bindings/bitbangio/I2C.c b/shared-bindings/bitbangio/I2C.c index 67c411120b..9c0555dd5a 100644 --- a/shared-bindings/bitbangio/I2C.c +++ b/shared-bindings/bitbangio/I2C.c @@ -35,7 +35,7 @@ #include "shared/runtime/context_manager_helpers.h" #include "py/mperrno.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class I2C: //| """Two wire serial protocol""" diff --git a/shared-bindings/bitbangio/SPI.c b/shared-bindings/bitbangio/SPI.c index 1f19f8c939..103dd9fbaa 100644 --- a/shared-bindings/bitbangio/SPI.c +++ b/shared-bindings/bitbangio/SPI.c @@ -37,7 +37,7 @@ #include "shared/runtime/context_manager_helpers.h" #include "py/mperrno.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class SPI: //| """A 3-4 wire serial protocol diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index e05e4e0546..b3afd9801d 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -34,7 +34,7 @@ #include "shared/runtime/buffer_helper.h" #include "shared/runtime/context_manager_helpers.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class I2C: //| """Two wire serial protocol""" diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index af853b84ac..eb89746d05 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -38,7 +38,7 @@ #include "py/mperrno.h" #include "py/objproperty.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class SPI: diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index 7a27b04aec..baa7f2cdba 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -38,7 +38,7 @@ #include "py/objtype.h" #include "py/runtime.h" #include "py/stream.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #define STREAM_DEBUG(...) (void)0 // #define STREAM_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) diff --git a/shared-bindings/digitalio/DigitalInOut.c b/shared-bindings/digitalio/DigitalInOut.c index a9026fbd59..ae72b5cb55 100644 --- a/shared-bindings/digitalio/DigitalInOut.c +++ b/shared-bindings/digitalio/DigitalInOut.c @@ -41,7 +41,7 @@ #include "shared-bindings/digitalio/DriveMode.h" #include "shared-bindings/digitalio/Pull.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class DigitalInOut: //| """Digital input and output diff --git a/shared-bindings/digitalio/Pull.c b/shared-bindings/digitalio/Pull.c index 4db68dda10..364be05de0 100644 --- a/shared-bindings/digitalio/Pull.c +++ b/shared-bindings/digitalio/Pull.c @@ -26,6 +26,7 @@ #include "py/runtime.h" #include "shared-bindings/digitalio/Pull.h" +#include "supervisor/shared/translate/translate.h" //| class Pull: //| """Defines the pull of a digital input pin""" diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index 3af152ffdc..ef5727261c 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -34,7 +34,7 @@ #include "py/objproperty.h" #include "py/runtime.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class Bitmap: //| """Stores values of a certain size in a 2D array diff --git a/shared-bindings/displayio/ColorConverter.c b/shared-bindings/displayio/ColorConverter.c index 18b88664c0..7b33b1ec8f 100644 --- a/shared-bindings/displayio/ColorConverter.c +++ b/shared-bindings/displayio/ColorConverter.c @@ -34,7 +34,7 @@ #include "py/objproperty.h" #include "py/runtime.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class ColorConverter: //| """Converts one color format to another.""" diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index b19c0bac53..4b5db33928 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -37,7 +37,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/util.h" #include "shared-module/displayio/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| _DisplayBus = Union['FourWire', 'paralleldisplay.ParallelBus', 'I2CDisplay'] //| """:py:class:`FourWire`, :py:class:`paralleldisplay.ParallelBus` or :py:class:`I2CDisplay`""" diff --git a/shared-bindings/displayio/EPaperDisplay.c b/shared-bindings/displayio/EPaperDisplay.c index 94d2978cef..81863b2a7a 100644 --- a/shared-bindings/displayio/EPaperDisplay.c +++ b/shared-bindings/displayio/EPaperDisplay.c @@ -37,7 +37,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/util.h" #include "shared-module/displayio/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class EPaperDisplay: //| """Manage updating an epaper display over a display bus diff --git a/shared-bindings/displayio/FourWire.c b/shared-bindings/displayio/FourWire.c index 2aa80df61d..7e72169230 100644 --- a/shared-bindings/displayio/FourWire.c +++ b/shared-bindings/displayio/FourWire.c @@ -37,7 +37,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/util.h" #include "shared-module/displayio/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class FourWire: //| """Manage updating a display over SPI four wire protocol in the background while Python code runs. diff --git a/shared-bindings/displayio/Group.c b/shared-bindings/displayio/Group.c index 75cc217af3..4a57b4a5f1 100644 --- a/shared-bindings/displayio/Group.c +++ b/shared-bindings/displayio/Group.c @@ -33,7 +33,7 @@ #include "py/objproperty.h" #include "py/objtype.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class Group: //| """Manage a group of sprites and groups and how they are inter-related.""" diff --git a/shared-bindings/displayio/I2CDisplay.c b/shared-bindings/displayio/I2CDisplay.c index a637fc5071..86138d8a36 100644 --- a/shared-bindings/displayio/I2CDisplay.c +++ b/shared-bindings/displayio/I2CDisplay.c @@ -37,7 +37,7 @@ #include "shared-bindings/busio/I2C.h" #include "shared-bindings/util.h" #include "shared-module/displayio/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class I2CDisplay: //| """Manage updating a display over I2C in the background while Python code runs. diff --git a/shared-bindings/displayio/OnDiskBitmap.c b/shared-bindings/displayio/OnDiskBitmap.c index aa749bf7f7..02c370c3c4 100644 --- a/shared-bindings/displayio/OnDiskBitmap.c +++ b/shared-bindings/displayio/OnDiskBitmap.c @@ -30,7 +30,7 @@ #include "py/runtime.h" #include "py/objproperty.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "shared-bindings/displayio/OnDiskBitmap.h" //| class OnDiskBitmap: diff --git a/shared-bindings/displayio/Palette.c b/shared-bindings/displayio/Palette.c index ad6d7c319a..171a243a95 100644 --- a/shared-bindings/displayio/Palette.c +++ b/shared-bindings/displayio/Palette.c @@ -34,7 +34,7 @@ #include "py/runtime.h" #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class Palette: //| """Map a pixel palette_index to a full color. Colors are transformed to the display's format internally to diff --git a/shared-bindings/displayio/Shape.c b/shared-bindings/displayio/Shape.c index cbfe12d551..30a51dadce 100644 --- a/shared-bindings/displayio/Shape.c +++ b/shared-bindings/displayio/Shape.c @@ -32,7 +32,7 @@ #include "py/objproperty.h" #include "py/runtime.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class Shape: //| """Represents a shape made by defining boundaries that may be mirrored.""" diff --git a/shared-bindings/displayio/TileGrid.c b/shared-bindings/displayio/TileGrid.c index b1557a1777..d084d94be2 100644 --- a/shared-bindings/displayio/TileGrid.c +++ b/shared-bindings/displayio/TileGrid.c @@ -38,7 +38,7 @@ #include "shared-bindings/displayio/OnDiskBitmap.h" #include "shared-bindings/displayio/Palette.h" #include "shared-bindings/displayio/Shape.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class TileGrid: //| """A grid of tiles sourced out of one bitmap diff --git a/shared-bindings/fontio/BuiltinFont.c b/shared-bindings/fontio/BuiltinFont.c index 5c1b976e81..02d3373797 100644 --- a/shared-bindings/fontio/BuiltinFont.c +++ b/shared-bindings/fontio/BuiltinFont.c @@ -34,7 +34,7 @@ #include "py/runtime.h" #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| from typing_extensions import Protocol # for compat with python < 3.8 //| diff --git a/shared-bindings/framebufferio/FramebufferDisplay.c b/shared-bindings/framebufferio/FramebufferDisplay.c index daff2174fa..6af8f16ce8 100644 --- a/shared-bindings/framebufferio/FramebufferDisplay.c +++ b/shared-bindings/framebufferio/FramebufferDisplay.c @@ -38,7 +38,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/util.h" #include "shared-module/displayio/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class FramebufferDisplay: //| """Manage updating a display with framebuffer in RAM diff --git a/shared-bindings/frequencyio/FrequencyIn.c b/shared-bindings/frequencyio/FrequencyIn.c index 2f6ebd06c2..b72627b19f 100644 --- a/shared-bindings/frequencyio/FrequencyIn.c +++ b/shared-bindings/frequencyio/FrequencyIn.c @@ -33,7 +33,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/frequencyio/FrequencyIn.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class FrequencyIn: //| """Read a frequency signal diff --git a/shared-bindings/math/__init__.c b/shared-bindings/math/__init__.c index 54dbf004ad..f5fb45cb4d 100644 --- a/shared-bindings/math/__init__.c +++ b/shared-bindings/math/__init__.c @@ -27,7 +27,7 @@ #include "py/builtin.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_BUILTINS_FLOAT diff --git a/shared-bindings/memorymonitor/AllocationAlarm.c b/shared-bindings/memorymonitor/AllocationAlarm.c index fe25a1a230..45e7019912 100644 --- a/shared-bindings/memorymonitor/AllocationAlarm.c +++ b/shared-bindings/memorymonitor/AllocationAlarm.c @@ -31,7 +31,7 @@ #include "py/runtime0.h" #include "shared-bindings/memorymonitor/AllocationAlarm.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class AllocationAlarm: //| diff --git a/shared-bindings/memorymonitor/AllocationSize.c b/shared-bindings/memorymonitor/AllocationSize.c index 1c39fdcd92..ed8252b67a 100644 --- a/shared-bindings/memorymonitor/AllocationSize.c +++ b/shared-bindings/memorymonitor/AllocationSize.c @@ -31,7 +31,7 @@ #include "py/runtime0.h" #include "shared-bindings/memorymonitor/AllocationSize.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class AllocationSize: //| diff --git a/shared-bindings/microcontroller/Pin.c b/shared-bindings/microcontroller/Pin.c index db96519dc7..840f468e2a 100644 --- a/shared-bindings/microcontroller/Pin.c +++ b/shared-bindings/microcontroller/Pin.c @@ -31,7 +31,7 @@ #include "py/nlr.h" #include "py/obj.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class Pin: //| """Identifies an IO pin on the microcontroller.""" diff --git a/shared-bindings/microcontroller/Processor.c b/shared-bindings/microcontroller/Processor.c index ff1b52eecd..067d6b0097 100644 --- a/shared-bindings/microcontroller/Processor.c +++ b/shared-bindings/microcontroller/Processor.c @@ -38,7 +38,7 @@ #include "py/objtype.h" #include "py/objproperty.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class Processor: diff --git a/shared-bindings/microcontroller/__init__.c b/shared-bindings/microcontroller/__init__.c index 1b14b32934..46382dc3e6 100644 --- a/shared-bindings/microcontroller/__init__.c +++ b/shared-bindings/microcontroller/__init__.c @@ -39,7 +39,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/Processor.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| """Pin references and cpu functionality //| diff --git a/shared-bindings/multiterminal/__init__.c b/shared-bindings/multiterminal/__init__.c index f3f8d1ab6c..8726e9a655 100644 --- a/shared-bindings/multiterminal/__init__.c +++ b/shared-bindings/multiterminal/__init__.c @@ -28,7 +28,7 @@ #include "py/obj.h" #include "py/mphal.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| """Manage additional terminal sources //| diff --git a/shared-bindings/neopixel_write/__init__.c b/shared-bindings/neopixel_write/__init__.c index d0234fe451..e45e970179 100644 --- a/shared-bindings/neopixel_write/__init__.c +++ b/shared-bindings/neopixel_write/__init__.c @@ -30,7 +30,7 @@ #include "py/runtime.h" #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // RGB LED timing information: diff --git a/shared-bindings/nvm/ByteArray.c b/shared-bindings/nvm/ByteArray.c index b01430c078..936e3bcee5 100644 --- a/shared-bindings/nvm/ByteArray.c +++ b/shared-bindings/nvm/ByteArray.c @@ -29,7 +29,7 @@ #include "py/runtime.h" #include "py/runtime0.h" #include "shared-bindings/nvm/ByteArray.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class ByteArray: //| r"""Presents a stretch of non-volatile memory as a bytearray. diff --git a/shared-bindings/os/__init__.c b/shared-bindings/os/__init__.c index a8545d9079..4c249c368e 100644 --- a/shared-bindings/os/__init__.c +++ b/shared-bindings/os/__init__.c @@ -36,6 +36,7 @@ #include "py/objstr.h" #include "py/runtime.h" #include "shared-bindings/os/__init__.h" +#include "supervisor/shared/translate/translate.h" //| """functions that an OS normally provides //| diff --git a/shared-bindings/paralleldisplay/ParallelBus.c b/shared-bindings/paralleldisplay/ParallelBus.c index c93f363d1a..a8b37fa956 100644 --- a/shared-bindings/paralleldisplay/ParallelBus.c +++ b/shared-bindings/paralleldisplay/ParallelBus.c @@ -35,7 +35,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/util.h" #include "shared-module/displayio/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class ParallelBus: //| """Manage updating a display over 8-bit parallel bus in the background while Python code runs. This diff --git a/shared-bindings/ps2io/Ps2.c b/shared-bindings/ps2io/Ps2.c index 2ceca6b044..d84e788de5 100644 --- a/shared-bindings/ps2io/Ps2.c +++ b/shared-bindings/ps2io/Ps2.c @@ -34,7 +34,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/ps2io/Ps2.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class Ps2: //| """Communicate with a PS/2 keyboard or mouse diff --git a/shared-bindings/pulseio/PulseIn.c b/shared-bindings/pulseio/PulseIn.c index 21dfdae42c..1769f5c7a8 100644 --- a/shared-bindings/pulseio/PulseIn.c +++ b/shared-bindings/pulseio/PulseIn.c @@ -33,7 +33,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/pulseio/PulseIn.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class PulseIn: //| """Measure a series of active and idle pulses. This is commonly used in infrared receivers diff --git a/shared-bindings/pulseio/PulseOut.c b/shared-bindings/pulseio/PulseOut.c index ac568231b9..3de2176ffc 100644 --- a/shared-bindings/pulseio/PulseOut.c +++ b/shared-bindings/pulseio/PulseOut.c @@ -34,7 +34,7 @@ #include "shared-bindings/pulseio/PulseOut.h" #include "shared-bindings/pwmio/PWMOut.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class PulseOut: //| """Pulse PWM "carrier" output on and off. This is commonly used in infrared remotes. The diff --git a/shared-bindings/pwmio/PWMOut.c b/shared-bindings/pwmio/PWMOut.c index 524a857e64..4acb2a6a8a 100644 --- a/shared-bindings/pwmio/PWMOut.c +++ b/shared-bindings/pwmio/PWMOut.c @@ -33,7 +33,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/pwmio/PWMOut.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" void common_hal_pwmio_pwmout_raise_error(pwmout_result_t result) { diff --git a/shared-bindings/random/__init__.c b/shared-bindings/random/__init__.c index 63570fe7e7..eee574d29e 100644 --- a/shared-bindings/random/__init__.c +++ b/shared-bindings/random/__init__.c @@ -31,7 +31,7 @@ #include "py/obj.h" #include "py/runtime.h" #include "shared-bindings/random/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| """pseudo-random numbers and choices //| diff --git a/shared-bindings/rtc/RTC.c b/shared-bindings/rtc/RTC.c index b07f90bd01..9e75576487 100644 --- a/shared-bindings/rtc/RTC.c +++ b/shared-bindings/rtc/RTC.c @@ -34,7 +34,7 @@ #include "shared-bindings/rtc/__init__.h" #include "shared-bindings/rtc/RTC.h" #include "shared-bindings/time/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" const rtc_rtc_obj_t rtc_rtc_obj = {{&rtc_rtc_type}}; diff --git a/shared-bindings/sdioio/SDCard.c b/shared-bindings/sdioio/SDCard.c index c06ce18826..dbeb50ddf3 100644 --- a/shared-bindings/sdioio/SDCard.c +++ b/shared-bindings/sdioio/SDCard.c @@ -38,7 +38,7 @@ #include "py/mperrno.h" #include "py/objproperty.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class SDCard: //| """SD Card Block Interface with SDIO diff --git a/shared-bindings/storage/__init__.c b/shared-bindings/storage/__init__.c index 277c8343e0..baf91a35c1 100644 --- a/shared-bindings/storage/__init__.c +++ b/shared-bindings/storage/__init__.c @@ -33,7 +33,7 @@ #include "py/objnamedtuple.h" #include "py/runtime.h" #include "shared-bindings/storage/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| """Storage management //| diff --git a/shared-bindings/struct/__init__.c b/shared-bindings/struct/__init__.c index c29c33c1c0..5b63a15f15 100644 --- a/shared-bindings/struct/__init__.c +++ b/shared-bindings/struct/__init__.c @@ -36,7 +36,7 @@ #include "py/parsenum.h" #include "shared-bindings/struct/__init__.h" #include "shared-module/struct/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| """Manipulation of c-style data //| diff --git a/shared-bindings/supervisor/__init__.c b/shared-bindings/supervisor/__init__.c index 6fcff963a6..cad8ccdeec 100644 --- a/shared-bindings/supervisor/__init__.c +++ b/shared-bindings/supervisor/__init__.c @@ -36,7 +36,7 @@ #include "supervisor/shared/reload.h" #include "supervisor/shared/stack.h" #include "supervisor/shared/traceback.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "supervisor/shared/workflow.h" #include "shared-bindings/microcontroller/__init__.h" diff --git a/shared-bindings/synthio/MidiTrack.c b/shared-bindings/synthio/MidiTrack.c index 7805c1a6a0..e27ff903c6 100644 --- a/shared-bindings/synthio/MidiTrack.c +++ b/shared-bindings/synthio/MidiTrack.c @@ -32,7 +32,7 @@ #include "py/runtime.h" #include "shared-bindings/util.h" #include "shared-bindings/synthio/MidiTrack.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class MidiTrack: //| """Simple square-wave MIDI synth""" diff --git a/shared-bindings/terminalio/Terminal.c b/shared-bindings/terminalio/Terminal.c index cdeca59164..c6fd389b12 100644 --- a/shared-bindings/terminalio/Terminal.c +++ b/shared-bindings/terminalio/Terminal.c @@ -35,7 +35,7 @@ #include "py/runtime.h" #include "py/stream.h" #include "shared-bindings/fontio/BuiltinFont.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class Terminal: //| """Display a character stream with a TileGrid""" diff --git a/shared-bindings/time/__init__.c b/shared-bindings/time/__init__.c index 5b16ded0e4..096c80d382 100644 --- a/shared-bindings/time/__init__.c +++ b/shared-bindings/time/__init__.c @@ -34,7 +34,7 @@ #include "shared/timeutils/timeutils.h" #include "shared-bindings/rtc/__init__.h" #include "shared-bindings/time/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| """time and timing related functions //| diff --git a/shared-bindings/touchio/TouchIn.c b/shared-bindings/touchio/TouchIn.c index 23b35253cb..729cf94d5d 100644 --- a/shared-bindings/touchio/TouchIn.c +++ b/shared-bindings/touchio/TouchIn.c @@ -36,7 +36,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/touchio/TouchIn.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class TouchIn: //| """Read the state of a capacitive touch sensor diff --git a/shared-bindings/usb_cdc/Serial.c b/shared-bindings/usb_cdc/Serial.c index 760efb6278..8a74380be3 100644 --- a/shared-bindings/usb_cdc/Serial.c +++ b/shared-bindings/usb_cdc/Serial.c @@ -33,7 +33,7 @@ #include "py/objproperty.h" #include "py/runtime.h" #include "py/stream.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class Serial: //| """Receives cdc commands over USB""" diff --git a/shared-bindings/usb_cdc/__init__.c b/shared-bindings/usb_cdc/__init__.c index eabe26ad07..e23e289309 100644 --- a/shared-bindings/usb_cdc/__init__.c +++ b/shared-bindings/usb_cdc/__init__.c @@ -31,6 +31,7 @@ #include "shared-bindings/usb_cdc/__init__.h" #include "shared-bindings/usb_cdc/Serial.h" +#include "supervisor/shared/translate/translate.h" #include "py/runtime.h" diff --git a/shared-bindings/usb_hid/Device.c b/shared-bindings/usb_hid/Device.c index 3f30a6264c..f0074f9cac 100644 --- a/shared-bindings/usb_hid/Device.c +++ b/shared-bindings/usb_hid/Device.c @@ -27,6 +27,7 @@ #include "py/objproperty.h" #include "shared-bindings/usb_hid/Device.h" #include "py/runtime.h" +#include "supervisor/shared/translate/translate.h" //| class Device: //| """HID Device specification""" diff --git a/shared-bindings/usb_hid/__init__.c b/shared-bindings/usb_hid/__init__.c index 3922ded03c..dcdf6933f7 100644 --- a/shared-bindings/usb_hid/__init__.c +++ b/shared-bindings/usb_hid/__init__.c @@ -31,6 +31,8 @@ #include "shared-bindings/usb_hid/__init__.h" #include "shared-bindings/usb_hid/Device.h" +#include "supervisor/shared/translate/translate.h" + //| """USB Human Interface Device //| //| The `usb_hid` module allows you to output data as a HID device.""" diff --git a/shared-bindings/usb_midi/PortIn.c b/shared-bindings/usb_midi/PortIn.c index 0056a0818a..273fa77b35 100644 --- a/shared-bindings/usb_midi/PortIn.c +++ b/shared-bindings/usb_midi/PortIn.c @@ -33,7 +33,7 @@ #include "py/objproperty.h" #include "py/runtime.h" #include "py/stream.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class PortIn: //| """Receives midi commands over USB""" diff --git a/shared-bindings/usb_midi/PortOut.c b/shared-bindings/usb_midi/PortOut.c index c468401924..d5652be5d4 100644 --- a/shared-bindings/usb_midi/PortOut.c +++ b/shared-bindings/usb_midi/PortOut.c @@ -33,7 +33,7 @@ #include "py/objproperty.h" #include "py/runtime.h" #include "py/stream.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class PortOut: //| """Sends midi messages to a computer over USB""" diff --git a/shared-bindings/usb_midi/__init__.c b/shared-bindings/usb_midi/__init__.c index ec065d1e18..d3d5cf2626 100644 --- a/shared-bindings/usb_midi/__init__.c +++ b/shared-bindings/usb_midi/__init__.c @@ -32,6 +32,7 @@ #include "shared-bindings/usb_midi/__init__.h" #include "shared-bindings/usb_midi/PortIn.h" #include "shared-bindings/usb_midi/PortOut.h" +#include "supervisor/shared/translate/translate.h" #include "py/runtime.h" diff --git a/shared-bindings/util.c b/shared-bindings/util.c index c1ca01e0ad..5c5eafad4a 100644 --- a/shared-bindings/util.c +++ b/shared-bindings/util.c @@ -30,7 +30,7 @@ #include "py/runtime.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // If so, deinit() has already been called on the object, so complain. void raise_deinited_error(void) { diff --git a/shared-bindings/vectorio/Circle.c b/shared-bindings/vectorio/Circle.c index ded1861896..f955cd2afe 100644 --- a/shared-bindings/vectorio/Circle.c +++ b/shared-bindings/vectorio/Circle.c @@ -8,7 +8,7 @@ #include "py/objproperty.h" #include "py/objtype.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class Circle: //| diff --git a/shared-bindings/vectorio/Polygon.c b/shared-bindings/vectorio/Polygon.c index ae9d7a01ca..60a4582e5a 100644 --- a/shared-bindings/vectorio/Polygon.c +++ b/shared-bindings/vectorio/Polygon.c @@ -9,7 +9,7 @@ #include "py/objproperty.h" #include "py/objtype.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #define VECTORIO_POLYGON_DEBUG(...) (void)0 diff --git a/shared-bindings/vectorio/Rectangle.c b/shared-bindings/vectorio/Rectangle.c index 739a1ba9d1..34b9e1eabe 100644 --- a/shared-bindings/vectorio/Rectangle.c +++ b/shared-bindings/vectorio/Rectangle.c @@ -7,7 +7,7 @@ #include "py/objtype.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class Rectangle: //| def __init__(self, pixel_shader: Union[displayio.ColorConverter, displayio.Palette], width: int, height: int, x: int, y: int) -> None: diff --git a/shared-bindings/vectorio/VectorShape.c b/shared-bindings/vectorio/VectorShape.c index 6a3e192cb9..ba55cfb851 100644 --- a/shared-bindings/vectorio/VectorShape.c +++ b/shared-bindings/vectorio/VectorShape.c @@ -16,7 +16,7 @@ #include "py/objproperty.h" #include "py/objtype.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // shape: The shape implementation to draw. diff --git a/shared-bindings/zlib/__init__.c b/shared-bindings/zlib/__init__.c index 65bec244e3..e3858d008d 100644 --- a/shared-bindings/zlib/__init__.c +++ b/shared-bindings/zlib/__init__.c @@ -39,7 +39,7 @@ #include "shared-bindings/zlib/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| """zlib decompression functionality //| diff --git a/shared-module/audiocore/WaveFile.c b/shared-module/audiocore/WaveFile.c index b4056e3f29..1b87532551 100644 --- a/shared-module/audiocore/WaveFile.c +++ b/shared-module/audiocore/WaveFile.c @@ -33,7 +33,7 @@ #include "py/runtime.h" #include "shared-module/audiocore/WaveFile.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" struct wave_format_chunk { uint16_t audio_format; diff --git a/shared-module/audiomp3/MP3Decoder.c b/shared-module/audiomp3/MP3Decoder.c index d0b5428a11..506ed5eff2 100644 --- a/shared-module/audiomp3/MP3Decoder.c +++ b/shared-module/audiomp3/MP3Decoder.c @@ -35,7 +35,7 @@ #include "py/runtime.h" #include "shared-module/audiomp3/MP3Decoder.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "supervisor/background_callback.h" #include "lib/mp3/src/mp3common.h" diff --git a/shared-module/bitbangio/I2C.c b/shared-module/bitbangio/I2C.c index eb897e122f..65926b8c07 100644 --- a/shared-module/bitbangio/I2C.c +++ b/shared-module/bitbangio/I2C.c @@ -32,7 +32,7 @@ #include "common-hal/microcontroller/Pin.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/digitalio/DigitalInOut.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" STATIC void delay(bitbangio_i2c_obj_t *self) { // We need to use an accurate delay to get acceptable I2C diff --git a/shared-module/bitbangio/SPI.c b/shared-module/bitbangio/SPI.c index 972b085978..d740a214e7 100644 --- a/shared-module/bitbangio/SPI.c +++ b/shared-module/bitbangio/SPI.c @@ -32,7 +32,7 @@ #include "shared-bindings/bitbangio/SPI.h" #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/microcontroller/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #define MAX_BAUDRATE (common_hal_mcu_get_clock_frequency() / 48) diff --git a/shared-module/board/__init__.c b/shared-module/board/__init__.c index 7bd0d42339..5d08c368b5 100644 --- a/shared-module/board/__init__.c +++ b/shared-module/board/__init__.c @@ -27,7 +27,7 @@ #include "shared-bindings/board/__init__.h" #include "shared-bindings/microcontroller/Pin.h" #include "shared-module/board/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "mpconfigboard.h" #include "py/runtime.h" diff --git a/shared-module/msgpack/__init__.c b/shared-module/msgpack/__init__.c index e1b98a9f93..d32550722c 100644 --- a/shared-module/msgpack/__init__.c +++ b/shared-module/msgpack/__init__.c @@ -36,7 +36,7 @@ #include "py/runtime.h" #include "py/stream.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "shared-bindings/msgpack/ExtType.h" #include "shared-bindings/msgpack/__init__.h" #include "shared-module/msgpack/__init__.h" diff --git a/shared-module/storage/__init__.c b/shared-module/storage/__init__.c index e36d3ec21e..8806b7c8c6 100644 --- a/shared-module/storage/__init__.c +++ b/shared-module/storage/__init__.c @@ -38,6 +38,7 @@ #include "shared-bindings/storage/__init__.h" #include "supervisor/filesystem.h" #include "supervisor/flash.h" +#include "supervisor/shared/translate/translate.h" #include "supervisor/usb.h" #if CIRCUITPY_USB_MSC diff --git a/shared-module/struct/__init__.c b/shared-module/struct/__init__.c index a0abd16408..e87321ae79 100644 --- a/shared-module/struct/__init__.c +++ b/shared-module/struct/__init__.c @@ -31,7 +31,7 @@ #include "py/runtime.h" #include "py/binary.h" #include "py/parsenum.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "shared-bindings/struct/__init__.h" STATIC void struct_validate_format(char fmt) { diff --git a/shared-module/usb_hid/Device.c b/shared-module/usb_hid/Device.c index 13e66058c2..f92c93baa3 100644 --- a/shared-module/usb_hid/Device.c +++ b/shared-module/usb_hid/Device.c @@ -31,7 +31,7 @@ #include "shared-bindings/usb_hid/Device.h" #include "shared-module/usb_hid/__init__.h" #include "shared-module/usb_hid/Device.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "supervisor/shared/tick.h" #include "tusb.h" diff --git a/shared-module/usb_hid/__init__.c b/shared-module/usb_hid/__init__.c index 89a05c77b3..99be84542f 100644 --- a/shared-module/usb_hid/__init__.c +++ b/shared-module/usb_hid/__init__.c @@ -33,6 +33,7 @@ #include "shared-bindings/usb_hid/__init__.h" #include "shared-bindings/usb_hid/Device.h" #include "supervisor/memory.h" +#include "supervisor/shared/translate/translate.h" #include "supervisor/usb.h" static const uint8_t usb_hid_descriptor_template[] = { diff --git a/shared-module/usb_midi/PortIn.c b/shared-module/usb_midi/PortIn.c index b16b77cf97..a5c73aa256 100644 --- a/shared-module/usb_midi/PortIn.c +++ b/shared-module/usb_midi/PortIn.c @@ -26,7 +26,7 @@ #include "shared-bindings/usb_midi/PortIn.h" #include "shared-module/usb_midi/PortIn.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "tusb.h" size_t common_hal_usb_midi_portin_read(usb_midi_portin_obj_t *self, uint8_t *data, size_t len, int *errcode) { diff --git a/shared-module/usb_midi/PortOut.c b/shared-module/usb_midi/PortOut.c index 4005d8b77d..c9d229635e 100644 --- a/shared-module/usb_midi/PortOut.c +++ b/shared-module/usb_midi/PortOut.c @@ -26,7 +26,7 @@ #include "shared-bindings/usb_midi/PortOut.h" #include "shared-module/usb_midi/PortOut.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "tusb.h" size_t common_hal_usb_midi_portout_write(usb_midi_portout_obj_t *self, const uint8_t *data, size_t len, int *errcode) { diff --git a/shared-module/usb_midi/__init__.c b/shared-module/usb_midi/__init__.c index 8cac2ba8af..ed1b8a0518 100644 --- a/shared-module/usb_midi/__init__.c +++ b/shared-module/usb_midi/__init__.c @@ -34,6 +34,7 @@ #include "shared-bindings/usb_midi/PortIn.h" #include "shared-bindings/usb_midi/PortOut.h" #include "supervisor/memory.h" +#include "supervisor/shared/translate/translate.h" #include "supervisor/usb.h" #include "tusb.h" diff --git a/shared/libc/abort_.c b/shared/libc/abort_.c index 45a2e0dedd..0c1d860aef 100644 --- a/shared/libc/abort_.c +++ b/shared/libc/abort_.c @@ -1,6 +1,6 @@ #include -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" NORETURN void abort_(void); diff --git a/shared/netutils/netutils.c b/shared/netutils/netutils.c index fe92e8bafb..030b1535cd 100644 --- a/shared/netutils/netutils.c +++ b/shared/netutils/netutils.c @@ -31,7 +31,7 @@ #include "py/runtime.h" #include "shared/netutils/netutils.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // Takes an array with a raw IPv4 address and returns something like '192.168.0.1'. mp_obj_t netutils_format_ipv4_addr(uint8_t *ip, netutils_endian_t endian) { diff --git a/supervisor/shared/safe_mode.c b/supervisor/shared/safe_mode.c index 7922cffc2b..875a1a0220 100644 --- a/supervisor/shared/safe_mode.c +++ b/supervisor/shared/safe_mode.c @@ -37,7 +37,7 @@ #include "supervisor/serial.h" #include "supervisor/shared/rgb_led_colors.h" #include "supervisor/shared/status_leds.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "supervisor/shared/tick.h" #define SAFE_MODE_DATA_GUARD 0xad0000af diff --git a/supervisor/shared/translate.h b/supervisor/shared/translate/compressed_string.h similarity index 81% rename from supervisor/shared/translate.h rename to supervisor/shared/translate/compressed_string.h index 1963c6fe65..e331a5866f 100644 --- a/supervisor/shared/translate.h +++ b/supervisor/shared/translate/compressed_string.h @@ -24,8 +24,7 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_SUPERVISOR_TRANSLATE_H -#define MICROPY_INCLUDED_SUPERVISOR_TRANSLATE_H +#pragma once #include #include @@ -83,29 +82,3 @@ typedef struct compressed_string { void serial_write_compressed(const compressed_string_t *compressed); char *decompress(const compressed_string_t *compressed, char *decompressed); uint16_t decompress_length(const compressed_string_t *compressed); - - -// Map MicroPython's error messages to our translations. -#if defined(MICROPY_ENABLE_DYNRUNTIME) && MICROPY_ENABLE_DYNRUNTIME -#define MP_ERROR_TEXT(x) (x) -#else -#define MP_ERROR_TEXT(x) translate(x) -#endif - -static inline -// gcc10 -flto has issues with this being always_inline for debug builds. -#if CIRCUITPY_DEBUG < 1 -__attribute__((always_inline)) -#endif -const compressed_string_t *translate(const char *original) { - #ifndef NO_QSTR - #define QDEF(id, hash, len, str) - #define TRANSLATION(id, firstbyte, ...) if (strcmp(original, id) == 0) { static const compressed_string_t v = { .data = firstbyte, .tail = { __VA_ARGS__ } }; return &v; } else - #include "genhdr/qstrdefs.generated.h" -#undef TRANSLATION -#undef QDEF - #endif - return NULL; -} - -#endif // MICROPY_INCLUDED_SUPERVISOR_TRANSLATE_H diff --git a/supervisor/shared/translate.c b/supervisor/shared/translate/translate.c similarity index 97% rename from supervisor/shared/translate.c rename to supervisor/shared/translate/translate.c index 55cc7d5d1e..cde3b90a1d 100644 --- a/supervisor/shared/translate.c +++ b/supervisor/shared/translate/translate.c @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include #include @@ -134,3 +134,7 @@ char *decompress(const compressed_string_t *compressed, char *decompressed) { decompressed[length - 1] = '\0'; return decompressed; } + +#if CIRCUITPY_LTO == 1 +#include "supervisor/shared/translate/translate_impl.h" +#endif diff --git a/supervisor/shared/translate/translate.h b/supervisor/shared/translate/translate.h new file mode 100644 index 0000000000..d87fce8746 --- /dev/null +++ b/supervisor/shared/translate/translate.h @@ -0,0 +1,55 @@ +/* + * 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. + */ + +#pragma once + +#include +#include +#include + +#include "supervisor/shared/translate/compressed_string.h" + +// Map MicroPython's error messages to our translations. +#if defined(MICROPY_ENABLE_DYNRUNTIME) && MICROPY_ENABLE_DYNRUNTIME +#define MP_ERROR_TEXT(x) (x) +#else +#define MP_ERROR_TEXT(x) translate(x) +#endif + +// translate() is a giant function with many strcmp calls. The assumption is +// that the build process will optimize this away and replace it with the +// appropriate compressed data for each call site. + +#if CIRCUITPY_LTO == 0 +// Without LTO, we need to include a copy of this function in each compilation +// unit so that the compile stage can do the optimization. Otherwise the linker +// will leave this as a giant function and have each call site call into it. +#include "supervisor/shared/translate/translate_impl.h" +#else +// In link time optimized (LTO) builds, we can compile this once into a .o and +// at link time the calls will be optimized. +const compressed_string_t *translate(const char *c); +#endif diff --git a/supervisor/shared/translate/translate_impl.h b/supervisor/shared/translate/translate_impl.h new file mode 100644 index 0000000000..48dea90d6b --- /dev/null +++ b/supervisor/shared/translate/translate_impl.h @@ -0,0 +1,52 @@ +/* + * 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. + */ + +#pragma once + +#include +#include +#include + +#include "supervisor/shared/translate/compressed_string.h" + +#if CIRCUITPY_LTO == 0 +static +#endif +inline +// gcc10 -flto has issues with this being always_inline for debug builds. +#if CIRCUITPY_DEBUG < 1 +__attribute__((always_inline)) +#endif +const compressed_string_t *translate(const char *original) { + #ifndef NO_QSTR + #define QDEF(id, hash, len, str) + #define TRANSLATION(id, firstbyte, ...) if (strcmp(original, id) == 0) { static const compressed_string_t v = { .data = firstbyte, .tail = { __VA_ARGS__ } }; return &v; } else + #include "genhdr/qstrdefs.generated.h" +#undef TRANSLATION +#undef QDEF + #endif + return NULL; +} diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index f4ca11db43..5f4a65623f 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -15,7 +15,7 @@ SRC_SUPERVISOR = \ supervisor/shared/status_leds.c \ supervisor/shared/tick.c \ supervisor/shared/traceback.c \ - supervisor/shared/translate.c \ + supervisor/shared/translate/translate.c \ supervisor/shared/workflow.c ifeq ($(DISABLE_FILESYSTEM),1) From 90fe20a15343b62e03fc8f8eee793b3a3ebab1e7 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Fri, 27 May 2022 15:33:54 -0500 Subject: [PATCH 176/246] Adding manual IP address set --- ports/espressif/common-hal/wifi/Radio.c | 19 +++++++++ ports/espressif/common-hal/wifi/__init__.c | 10 +++++ ports/espressif/common-hal/wifi/__init__.h | 2 + shared-bindings/wifi/Radio.c | 46 ++++++++++++++++++++++ shared-bindings/wifi/Radio.h | 5 +++ 5 files changed, 82 insertions(+) diff --git a/ports/espressif/common-hal/wifi/Radio.c b/ports/espressif/common-hal/wifi/Radio.c index 8ee1c80926..e43ce2fa51 100644 --- a/ports/espressif/common-hal/wifi/Radio.c +++ b/ports/espressif/common-hal/wifi/Radio.c @@ -398,6 +398,25 @@ mp_obj_t common_hal_wifi_radio_get_ipv4_dns(wifi_radio_obj_t *self) { return common_hal_ipaddress_new_ipv4address(self->dns_info.ip.u_addr.ip4.addr); } +void common_hal_wifi_radio_start_dhcp_client(wifi_radio_obj_t *self) { + esp_netif_dhcpc_start(self->netif); +} + +void common_hal_wifi_radio_stop_dhcp_client(wifi_radio_obj_t *self) { + esp_netif_dhcpc_stop(self->netif); +} + +void common_hal_wifi_radio_set_ipv4_address(wifi_radio_obj_t *self, mp_obj_t ipv4, mp_obj_t netmask, mp_obj_t gateway) { + common_hal_wifi_radio_stop_dhcp_client(self); // Must stop DHCP to set a manual address + + esp_netif_ip_info_t ip_info; + ipaddress_ipaddress_to_esp_idf_ip4(ipv4, &ip_info.ip); + ipaddress_ipaddress_to_esp_idf_ip4(netmask, &ip_info.netmask); + ipaddress_ipaddress_to_esp_idf_ip4(gateway, &ip_info.gw); + + esp_netif_set_ip_info(self->netif, &ip_info); +} + 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/espressif/common-hal/wifi/__init__.c b/ports/espressif/common-hal/wifi/__init__.c index cb9b028aba..36cf27a69f 100644 --- a/ports/espressif/common-hal/wifi/__init__.c +++ b/ports/espressif/common-hal/wifi/__init__.c @@ -189,6 +189,16 @@ void ipaddress_ipaddress_to_esp_idf(mp_obj_t ip_address, ip_addr_t *esp_ip_addre IP_ADDR4(esp_ip_address, bytes[0], bytes[1], bytes[2], bytes[3]); } +void ipaddress_ipaddress_to_esp_idf_ip4(mp_obj_t ip_address, esp_ip4_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); + esp_netif_set_ip4_addr(esp_ip_address, bytes[0], bytes[1], bytes[2], bytes[3]); +} + void common_hal_wifi_gc_collect(void) { common_hal_wifi_radio_gc_collect(&common_hal_wifi_radio_obj); } diff --git a/ports/espressif/common-hal/wifi/__init__.h b/ports/espressif/common-hal/wifi/__init__.h index be91dca758..4258f1643f 100644 --- a/ports/espressif/common-hal/wifi/__init__.h +++ b/ports/espressif/common-hal/wifi/__init__.h @@ -30,9 +30,11 @@ #include "py/obj.h" #include "lwip/api.h" +#include "components/esp_wifi/include/esp_wifi.h" void wifi_reset(void); void ipaddress_ipaddress_to_esp_idf(mp_obj_t ip_address, ip_addr_t *esp_ip_address); +void ipaddress_ipaddress_to_esp_idf_ip4(mp_obj_t ip_address, esp_ip4_addr_t *esp_ip_address); #endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_WIFI___INIT___H diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index e79d7047b3..93c8009e50 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -414,6 +414,27 @@ MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ipv4_subnet_ap_obj, wifi_radio_get_ipv4 MP_PROPERTY_GETTER(wifi_radio_ipv4_subnet_ap_obj, (mp_obj_t)&wifi_radio_get_ipv4_subnet_ap_obj); +//| def set_ipv4_address(self, ipv4: ipaddress.IPv4Address, netmask: ipaddress.IPv4Address, gateway: ipaddress.IPv4Address) -> None: +//| """Sets the IP v4 address of the station. Must include the netmask and gateway. +//| Setting the address manually will stop the DHCP client.""" +//| ... +STATIC mp_obj_t wifi_radio_set_ipv4_address(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_ipv4, ARG_netmask, ARG_gateway }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_ipv4, MP_ARG_REQUIRED | MP_ARG_OBJ, }, + { MP_QSTR_netmask, MP_ARG_REQUIRED | MP_ARG_OBJ, }, + { MP_QSTR_gateway, MP_ARG_REQUIRED | MP_ARG_OBJ, }, + }; + + 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); + + common_hal_wifi_radio_set_ipv4_address(self, args[ARG_ipv4].u_obj, args[ARG_netmask].u_obj, args[ARG_gateway].u_obj); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_KW(wifi_radio_set_ipv4_address_obj, 4, wifi_radio_set_ipv4_address); + //| ipv4_address: Optional[ipaddress.IPv4Address] //| """IP v4 Address of the station when connected to an access point. None otherwise.""" //| @@ -459,6 +480,26 @@ STATIC mp_obj_t wifi_radio_get_ap_info(mp_obj_t self) { } MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ap_info_obj, wifi_radio_get_ap_info); +//| def wifi_radio_start_dhcp_client(self) -> None: +//| """Starts the DHCP client.""" +//| ... +//| +STATIC mp_obj_t wifi_radio_start_dhcp_client(mp_obj_t self) { + common_hal_wifi_radio_start_dhcp_client(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_start_dhcp_client_obj, wifi_radio_start_dhcp_client); + +//| def wifi_radio_stop_dhcp_client(self) -> None: +//| """Stops the DHCP client. Needed to assign a static IP address.""" +//| ... +//| +STATIC mp_obj_t wifi_radio_stop_dhcp_client(mp_obj_t self) { + common_hal_wifi_radio_stop_dhcp_client(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_stop_dhcp_client_obj, wifi_radio_stop_dhcp_client); + MP_PROPERTY_GETTER(wifi_radio_ap_info_obj, (mp_obj_t)&wifi_radio_get_ap_info_obj); @@ -509,6 +550,9 @@ STATIC const mp_rom_map_elem_t wifi_radio_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_start_ap), MP_ROM_PTR(&wifi_radio_start_ap_obj) }, { MP_ROM_QSTR(MP_QSTR_stop_ap), MP_ROM_PTR(&wifi_radio_stop_ap_obj) }, + { MP_ROM_QSTR(MP_QSTR_start_dhcp), MP_ROM_PTR(&wifi_radio_start_dhcp_client_obj) }, + { MP_ROM_QSTR(MP_QSTR_stop_dhcp), MP_ROM_PTR(&wifi_radio_stop_dhcp_client_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) }, @@ -521,6 +565,8 @@ STATIC const mp_rom_map_elem_t wifi_radio_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_ipv4_address), MP_ROM_PTR(&wifi_radio_ipv4_address_obj) }, { MP_ROM_QSTR(MP_QSTR_ipv4_address_ap), MP_ROM_PTR(&wifi_radio_ipv4_address_ap_obj) }, + { MP_ROM_QSTR(MP_QSTR_set_ipv4_address), MP_ROM_PTR(&wifi_radio_set_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 cee9f6ef15..5590e17990 100644 --- a/shared-bindings/wifi/Radio.h +++ b/shared-bindings/wifi/Radio.h @@ -91,6 +91,9 @@ extern void common_hal_wifi_radio_stop_station(wifi_radio_obj_t *self); extern void common_hal_wifi_radio_start_ap(wifi_radio_obj_t *self, uint8_t *ssid, size_t ssid_len, uint8_t *password, size_t password_len, uint8_t channel, uint8_t authmode, uint8_t max_connections); extern void common_hal_wifi_radio_stop_ap(wifi_radio_obj_t *self); +extern void common_hal_wifi_radio_start_dhcp_client(wifi_radio_obj_t *self); +extern void common_hal_wifi_radio_stop_dhcp_client(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); @@ -102,6 +105,8 @@ extern mp_obj_t common_hal_wifi_radio_get_ipv4_subnet_ap(wifi_radio_obj_t *self) extern mp_obj_t common_hal_wifi_radio_get_ipv4_address(wifi_radio_obj_t *self); extern mp_obj_t common_hal_wifi_radio_get_ipv4_address_ap(wifi_radio_obj_t *self); +extern void common_hal_wifi_radio_set_ipv4_address(wifi_radio_obj_t *self, mp_obj_t ipv4, mp_obj_t netmask, mp_obj_t gateway); + 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 From 3cc46c74b95d6fdef0d31b37d08b18ad072c63ef Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 27 May 2022 15:39:55 -0700 Subject: [PATCH 177/246] Fix compiles --- mpy-cross/mpy-cross.mk | 2 +- ports/unix/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mpy-cross/mpy-cross.mk b/mpy-cross/mpy-cross.mk index 825566efec..0689322127 100644 --- a/mpy-cross/mpy-cross.mk +++ b/mpy-cross/mpy-cross.mk @@ -67,7 +67,7 @@ SRC_C += \ shared/runtime/gchelper_generic.c \ supervisor/stub/safe_mode.c \ supervisor/stub/stack.c \ - supervisor/shared/translate.c + supervisor/shared/translate/translate.c # Add fmode when compiling with mingw gcc COMPILER_TARGET := $(shell $(CC) -dumpmachine) diff --git a/ports/unix/Makefile b/ports/unix/Makefile index 9857ec5f88..c9a9289d42 100644 --- a/ports/unix/Makefile +++ b/ports/unix/Makefile @@ -233,7 +233,7 @@ SRC_C += \ supervisor/stub/filesystem.c \ supervisor/stub/safe_mode.c \ supervisor/stub/stack.c \ - supervisor/shared/translate.c \ + supervisor/shared/translate/translate.c \ $(SRC_MOD) \ $(wildcard $(VARIANT_DIR)/*.c) From 8d559196eda0ae9a60d65c7f47a757e6178a19ba Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 27 May 2022 15:48:01 -0700 Subject: [PATCH 178/246] Fix unix and pre-commit --- py/compile.c | 8 ++++---- py/mkrules.mk | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/py/compile.c b/py/compile.c index 63f96f6085..432aeca561 100644 --- a/py/compile.c +++ b/py/compile.c @@ -92,7 +92,7 @@ typedef enum { #define NATIVE_EMITTER(f) emit_native_table[mp_dynamic_compiler.native_arch]->emit_##f #define NATIVE_EMITTER_TABLE emit_native_table[mp_dynamic_compiler.native_arch] -STATIC const emit_method_table_t * emit_native_table[] = { +STATIC const emit_method_table_t *emit_native_table[] = { NULL, &emit_native_x86_method_table, &emit_native_x64_method_table, @@ -131,7 +131,7 @@ STATIC const emit_method_table_t * emit_native_table[] = { #define ASM_EMITTER(f) emit_asm_table[mp_dynamic_compiler.native_arch]->asm_##f #define ASM_EMITTER_TABLE emit_asm_table[mp_dynamic_compiler.native_arch] -STATIC const emit_inline_asm_method_table_t * emit_asm_table[] = { +STATIC const emit_inline_asm_method_table_t *emit_asm_table[] = { NULL, NULL, NULL, @@ -3527,7 +3527,7 @@ mp_raw_code_t *mp_compile_to_raw_code(mp_parse_tree_t *parse_tree, qstr source_f switch (s->emit_options) { - #if MICROPY_EMIT_NATIVE + #if MICROPY_EMIT_NATIVE case MP_EMIT_OPT_NATIVE_PYTHON: case MP_EMIT_OPT_VIPER: if (emit_native == NULL) { @@ -3536,7 +3536,7 @@ mp_raw_code_t *mp_compile_to_raw_code(mp_parse_tree_t *parse_tree, qstr source_f comp->emit_method_table = NATIVE_EMITTER_TABLE; comp->emit = emit_native; break; - #endif // MICROPY_EMIT_NATIVE + #endif // MICROPY_EMIT_NATIVE default: comp->emit = emit_bc; diff --git a/py/mkrules.mk b/py/mkrules.mk index b83a40dc29..ef0f66117d 100644 --- a/py/mkrules.mk +++ b/py/mkrules.mk @@ -62,7 +62,7 @@ $(BUILD)/%.o: %.c | $(HEADER_BUILD)/qstrdefs.generated.h $(HEADER_BUILD)/qstrdef $(call compile_c) vpath %.cpp . $(TOP) $(USER_C_MODULES) -$(BUILD)/%.o: %.cpp +$(BUILD)/%.o: %.cpp | $(HEADER_BUILD)/qstrdefs.generated.h $(HEADER_BUILD)/qstrdefs.enum.h $(call compile_cxx) QSTR_GEN_EXTRA_CFLAGS += -DNO_QSTR -x c From db318726a2250e66f189dc611a6a1b1f7a882894 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Fri, 27 May 2022 18:05:44 -0500 Subject: [PATCH 179/246] tilegrid.contains() function --- shared-bindings/displayio/TileGrid.c | 19 +++++++++++++++++++ shared-bindings/displayio/TileGrid.h | 2 ++ shared-module/displayio/TileGrid.c | 11 +++++++++++ 3 files changed, 32 insertions(+) diff --git a/shared-bindings/displayio/TileGrid.c b/shared-bindings/displayio/TileGrid.c index b1557a1777..5d7db650e0 100644 --- a/shared-bindings/displayio/TileGrid.c +++ b/shared-bindings/displayio/TileGrid.c @@ -322,6 +322,24 @@ MP_PROPERTY_GETSET(displayio_tilegrid_transpose_xy_obj, (mp_obj_t)&displayio_tilegrid_get_transpose_xy_obj, (mp_obj_t)&displayio_tilegrid_set_transpose_xy_obj); +//| def contains(self, touch_tuple: tuple) -> bool: +//| """returns true if first two values in touch_tuple represent an x,y coordinate +//| inside the tilegrid rectangle bounds""" +//| +STATIC mp_obj_t displayio_tilegrid_obj_contains(mp_obj_t self_in, mp_obj_t touch_tuple) { + displayio_tilegrid_t *self = MP_OBJ_TO_PTR(self_in); + + mp_obj_t *touch_tuple_items; + mp_obj_get_array_fixed_n(touch_tuple, 3, &touch_tuple_items); + uint16_t x = 0; + uint16_t y = 0; + x = mp_obj_get_int(touch_tuple_items[0]); + y = mp_obj_get_int(touch_tuple_items[1]); + + return mp_obj_new_bool(common_hal_displayio_tilegrid_contains(self, x, y)); +} +MP_DEFINE_CONST_FUN_OBJ_2(displayio_tilegrid_contains_obj, displayio_tilegrid_obj_contains); + //| pixel_shader: Union[ColorConverter, Palette] //| """The pixel shader of the tilegrid.""" //| @@ -484,6 +502,7 @@ STATIC const mp_rom_map_elem_t displayio_tilegrid_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_flip_x), MP_ROM_PTR(&displayio_tilegrid_flip_x_obj) }, { MP_ROM_QSTR(MP_QSTR_flip_y), MP_ROM_PTR(&displayio_tilegrid_flip_y_obj) }, { MP_ROM_QSTR(MP_QSTR_transpose_xy), MP_ROM_PTR(&displayio_tilegrid_transpose_xy_obj) }, + { MP_ROM_QSTR(MP_QSTR_contains), MP_ROM_PTR(&displayio_tilegrid_contains_obj) }, { MP_ROM_QSTR(MP_QSTR_pixel_shader), MP_ROM_PTR(&displayio_tilegrid_pixel_shader_obj) }, { MP_ROM_QSTR(MP_QSTR_bitmap), MP_ROM_PTR(&displayio_tilegrid_bitmap_obj) }, }; diff --git a/shared-bindings/displayio/TileGrid.h b/shared-bindings/displayio/TileGrid.h index 2c7941222f..2b4e42cb46 100644 --- a/shared-bindings/displayio/TileGrid.h +++ b/shared-bindings/displayio/TileGrid.h @@ -56,6 +56,8 @@ void common_hal_displayio_tilegrid_set_flip_y(displayio_tilegrid_t *self, bool f bool common_hal_displayio_tilegrid_get_transpose_xy(displayio_tilegrid_t *self); void common_hal_displayio_tilegrid_set_transpose_xy(displayio_tilegrid_t *self, bool transpose_xy); +bool common_hal_displayio_tilegrid_contains(displayio_tilegrid_t *self, uint16_t x, uint16_t y); + uint16_t common_hal_displayio_tilegrid_get_width(displayio_tilegrid_t *self); uint16_t common_hal_displayio_tilegrid_get_height(displayio_tilegrid_t *self); diff --git a/shared-module/displayio/TileGrid.c b/shared-module/displayio/TileGrid.c index 5c968c30e1..5f347420ac 100644 --- a/shared-module/displayio/TileGrid.c +++ b/shared-module/displayio/TileGrid.c @@ -342,6 +342,17 @@ void common_hal_displayio_tilegrid_set_transpose_xy(displayio_tilegrid_t *self, self->moved = true; } +bool common_hal_displayio_tilegrid_contains(displayio_tilegrid_t *self, uint16_t x, uint16_t y) { + uint16_t right_edge = self->x + (self->width_in_tiles * self->tile_width); + uint16_t bottom_edge = self->y + (self->height_in_tiles * self->tile_height); + if (x >= self->x && x <= right_edge && + y >= self->y && y <= bottom_edge) { + return true; + } else { + return false; + } +} + void common_hal_displayio_tilegrid_set_top_left(displayio_tilegrid_t *self, uint16_t x, uint16_t y) { self->top_left_x = x; self->top_left_y = y; From ffc451b3386a27a650783f7d21770050035a93d9 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Sat, 28 May 2022 12:01:05 -0500 Subject: [PATCH 180/246] argument for backlight_pwm_frequency and use it in pyportal titano build --- ports/atmel-samd/boards/pyportal_titano/board.c | 3 ++- shared-bindings/displayio/Display.c | 9 ++++++--- shared-bindings/displayio/Display.h | 2 +- shared-module/displayio/Display.c | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ports/atmel-samd/boards/pyportal_titano/board.c b/ports/atmel-samd/boards/pyportal_titano/board.c index 9fa7887a11..fcf8c5f44d 100644 --- a/ports/atmel-samd/boards/pyportal_titano/board.c +++ b/ports/atmel-samd/boards/pyportal_titano/board.c @@ -118,7 +118,8 @@ void board_init(void) { true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // SH1107_addressing + false, // SH1107_addressing + 500); // backlight_pwm_frequency } bool board_requests_safe_mode(void) { diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index b19c0bac53..680018bfe9 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -111,6 +111,7 @@ //| :param bool backlight_on_high: If True, pulling the backlight pin high turns the backlight on. //| :param bool SH1107_addressing: Special quirk for SH1107, use upper/lower column set and page set //| :param int set_vertical_scroll: This parameter is accepted but ignored for backwards compatibility. It will be removed in a future release. +//| :param int backlight_pwm_frequency: The frequency to use to drive the PWM for backlight brightness control. Default is 50000. //| """ //| ... //| @@ -123,7 +124,7 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a 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 }; + ARG_SH1107_addressing, ARG_backlight_pwm_frequency }; 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 }, @@ -151,7 +152,8 @@ 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_SH1107_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_QSTR_backlight_pwm_frequency, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 50000} } }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all_kw_array(n_args, n_kw, all_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); @@ -200,7 +202,8 @@ 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, - sh1107_addressing + sh1107_addressing, + args[ARG_backlight_pwm_frequency].u_int ); return self; diff --git a/shared-bindings/displayio/Display.h b/shared-bindings/displayio/Display.h index f193e61d2f..adc8623a69 100644 --- a/shared-bindings/displayio/Display.h +++ b/shared-bindings/displayio/Display.h @@ -44,7 +44,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 SH1107_addressing); + bool backlight_on_high, bool SH1107_addressing, uint16_t backlight_pwm_frequency); 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 5fab660268..9523d068ac 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -53,7 +53,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 SH1107_addressing) { + bool backlight_on_high, bool SH1107_addressing, uint16_t backlight_pwm_frequency) { // Turn off auto-refresh as we init. self->auto_refresh = false; @@ -116,7 +116,7 @@ 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_PWMIO) - pwmout_result_t result = common_hal_pwmio_pwmout_construct(&self->backlight_pwm, backlight_pin, 0, 500, false); + pwmout_result_t result = common_hal_pwmio_pwmout_construct(&self->backlight_pwm, backlight_pin, 0, backlight_pwm_frequency, false); if (result != PWMOUT_OK) { self->backlight_inout.base.type = &digitalio_digitalinout_type; common_hal_digitalio_digitalinout_construct(&self->backlight_inout, backlight_pin); From e8dd5d35d6d3549089212529563336a1eaa084a9 Mon Sep 17 00:00:00 2001 From: EmergReanimator Date: Sun, 29 May 2022 16:13:38 +0200 Subject: [PATCH 181/246] # WARNING: head commit changed in the meantime Fixed STM SPI frequency settings. Corrected default frequency settings in common_hal_busio_spi_construct. Fixed common_hal_busio_spi_get_frequency. --- ports/stm/common-hal/busio/SPI.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ports/stm/common-hal/busio/SPI.c b/ports/stm/common-hal/busio/SPI.c index f772cdeec0..a66a8dcb88 100644 --- a/ports/stm/common-hal/busio/SPI.c +++ b/ports/stm/common-hal/busio/SPI.c @@ -206,6 +206,10 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, spi_clock_enable(1 << (self->sck->periph_index - 1)); reserved_spi[self->sck->periph_index - 1] = true; + // Always start at 250khz which is what SD cards need. They are sensitive to + // SPI bus noise before they are put into SPI mode. + const uint32_t default_baudrate = 250000UL; + self->handle.Instance = SPIx; self->handle.Init.Mode = SPI_MODE_MASTER; // Direction change only required for RX-only, see RefMan RM0090:884 @@ -218,7 +222,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, self->handle.Init.CLKPolarity = SPI_POLARITY_LOW; self->handle.Init.CLKPhase = SPI_PHASE_1EDGE; self->handle.Init.NSS = SPI_NSS_SOFT; - self->handle.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_256; + self->handle.Init.BaudRatePrescaler = stm32_baud_to_spi_div(default_baudrate, &self->prescaler, get_busclock(self->handle.Instance)); self->handle.Init.FirstBit = SPI_FIRSTBIT_MSB; self->handle.Init.TIMode = SPI_TIMODE_DISABLE; self->handle.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; @@ -226,8 +230,8 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, if (HAL_SPI_Init(&self->handle) != HAL_OK) { mp_raise_ValueError(translate("SPI init error")); } - self->baudrate = (get_busclock(SPIx) / 16); - self->prescaler = 16; + self->baudrate = default_baudrate; + // self->prescaler = 16; // Initialised above by stm32_baud_to_spi_div self->half_duplex = half_duplex; self->polarity = 0; self->phase = 0; @@ -381,7 +385,7 @@ bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, uint32_t common_hal_busio_spi_get_frequency(busio_spi_obj_t *self) { // returns actual frequency - uint32_t result = HAL_RCC_GetPCLK2Freq() / self->prescaler; + uint32_t result = get_busclock(self->handle.Instance) / self->prescaler; return result; } From f36dbb386b2616c3af400aa120c16e6314af1f73 Mon Sep 17 00:00:00 2001 From: SimonVail <35699287+SimonVail@users.noreply.github.com> Date: Mon, 30 May 2022 11:47:51 -0400 Subject: [PATCH 182/246] Add files via upload --- .../boards/lilygo_ttgo_t-oi-plus/board.c | 21 +++++++++++++ .../lilygo_ttgo_t-oi-plus/mpconfigboard.h | 11 +++---- .../boards/lilygo_ttgo_t-oi-plus/pins.c | 30 +++++++++++-------- 3 files changed, 42 insertions(+), 20 deletions(-) diff --git a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/board.c b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/board.c index aa0cf7657a..deeb8041ea 100644 --- a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/board.c +++ b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/board.c @@ -4,12 +4,33 @@ #include "components/driver/include/driver/gpio.h" void board_init(void) { + // Debug UART + #ifdef DEBUG + common_hal_never_reset_pin(&pin_GPIO20); + common_hal_never_reset_pin(&pin_GPIO21); + #endif } bool board_requests_safe_mode(void) { return false; } +bool espressif_board_reset_pin_number(gpio_num_t pin_number) { + // Pull LED down on reset rather than the default up + if (pin_number == MICROPY_HW_LED_STATUS->number) { + gpio_config_t cfg = { + .pin_bit_mask = BIT64(pin_number), + .mode = GPIO_MODE_DISABLE, + .pull_up_en = false, + .pull_down_en = true, + .intr_type = GPIO_INTR_DISABLE, + }; + gpio_config(&cfg); + return true; + } + return false; +} + void reset_board(void) { } diff --git a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.h b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.h index 71987994e7..eb3ff11932 100644 --- a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.h +++ b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.h @@ -1,13 +1,10 @@ -// Define board #define MICROPY_HW_BOARD_NAME "LILYGO TTGO T-OI PLUS" #define MICROPY_HW_MCU_NAME "ESP32-C3" #define MICROPY_HW_LED_STATUS (&pin_GPIO3) -// I2C -#define CIRCUITPY_BOARD_I2C (1) -#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO18, .sda = &pin_GPIO19}} +#define DEFAULT_UART_BUS_RX (&pin_GPIO20) +#define DEFAULT_UART_BUS_TX (&pin_GPIO21) -// UART -#define CIRCUITPY_BOARD_UART (1) -#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO21, .rx = &pin_GPIO20}} +#define CIRCUITPY_DEBUG_UART_RX DEFAULT_UART_BUS_RX +#define CIRCUITPY_DEBUG_UART_TX DEFAULT_UART_BUS_TX diff --git a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/pins.c b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/pins.c index 963115bf1c..1f4080ba55 100644 --- a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/pins.c +++ b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/pins.c @@ -2,28 +2,32 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) }, { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_GPIO2) }, { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO2) }, - { MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, - { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO20) }, - { MP_ROM_QSTR(MP_QSTR_IO20), MP_ROM_PTR(&pin_GPIO20) }, - { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO21) }, - { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, - { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO3) }, - { MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) }, - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO19) }, - { MP_ROM_QSTR(MP_QSTR_IO19), MP_ROM_PTR(&pin_GPIO19) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO18) }, - { MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) }, { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, { MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, { MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, { MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) }, { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_IO20), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_IO19), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, - { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, - { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From b2344bcde204fc680df564b4777e101988aafed3 Mon Sep 17 00:00:00 2001 From: SimonVail <35699287+SimonVail@users.noreply.github.com> Date: Mon, 30 May 2022 11:52:29 -0400 Subject: [PATCH 183/246] Update pins.c --- ports/espressif/boards/lilygo_ttgo_t-oi-plus/pins.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/pins.c b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/pins.c index 1f4080ba55..79f2e2e42d 100644 --- a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/pins.c +++ b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/pins.c @@ -2,11 +2,9 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS - { MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) }, { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_GPIO2) }, - { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO2) }, - + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO2) }, { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, @@ -14,20 +12,16 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, { MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) }, { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, - { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO20) }, { MP_ROM_QSTR(MP_QSTR_IO20), MP_ROM_PTR(&pin_GPIO20) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO21) }, { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO19) }, { MP_ROM_QSTR(MP_QSTR_IO19), MP_ROM_PTR(&pin_GPIO19) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO18) }, { MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) }, - { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO3) }, { MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) }, - { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From f0b387e882a85e9e0363f7f3776bb7e1e9f80f28 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 31 May 2022 16:13:15 +0200 Subject: [PATCH 184/246] fix autoapi bug ourselves for now --- conf.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/conf.py b/conf.py index c92e8bb719..145bed4d7b 100644 --- a/conf.py +++ b/conf.py @@ -33,6 +33,25 @@ from sphinx import addnodes tools_describe = str(pathlib.Path(__file__).parent / "tools/describe") +# Monkeypatch autoapi +def _format_args(args_info, include_annotations=True, ignore_self=None): + result = [] + + for i, (prefix, name, annotation, default) in enumerate(args_info): + if i == 0 and ignore_self is not None and name == ignore_self: + continue + formatted = "{}{}{}{}".format( + prefix or "", + name or "", + ": {}".format(annotation) if annotation and include_annotations else "", + (" = {}" if annotation else "={}").format(default) if default else "", + ) + result.append(formatted) + return ", ".join(result) + +import autoapi.mappers.python.objects as objects +objects._format_args = _format_args + # 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 # documentation root, use os.path.abspath to make it absolute, like shown here. From 4d776339ad8d609bed6a628dca413e59cd0910b8 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 31 May 2022 12:18:05 -0700 Subject: [PATCH 185/246] Separate translate object control from LTO --- ports/broadcom/Makefile | 2 +- ports/cxd56/mpconfigport.mk | 2 ++ py/circuitpy_defns.mk | 13 ++++++++++++- supervisor/shared/translate/translate.c | 2 +- supervisor/shared/translate/translate.h | 2 +- supervisor/shared/translate/translate_impl.h | 2 +- 6 files changed, 18 insertions(+), 5 deletions(-) diff --git a/ports/broadcom/Makefile b/ports/broadcom/Makefile index 921d26958a..9731f819eb 100644 --- a/ports/broadcom/Makefile +++ b/ports/broadcom/Makefile @@ -107,7 +107,7 @@ OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o)) OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o)) # BCM CLFAGS -CFLAGS += -ffreestanding -nostartfiles -DMICROPY_HW_MCU_NAME="\"$(CHIP_VARIANT)\"" +CFLAGS += -nostartfiles -DMICROPY_HW_MCU_NAME="\"$(CHIP_VARIANT)\"" OPTIMIZATION_FLAGS ?= -O3 diff --git a/ports/cxd56/mpconfigport.mk b/ports/cxd56/mpconfigport.mk index 8787c55bcc..813d85d4a7 100644 --- a/ports/cxd56/mpconfigport.mk +++ b/ports/cxd56/mpconfigport.mk @@ -3,6 +3,8 @@ USB_HIGHSPEED = 1 # Number of USB endpoint pairs. USB_NUM_ENDPOINT_PAIRS = 6 +CIRCUITPY_TRANSLATE_OBJECT = 1 + # Longints can be implemented as mpz, as longlong, or not LONGINT_IMPL = MPZ diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 681eae779b..6a946dd248 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -51,7 +51,8 @@ BASE_CFLAGS = \ -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF \ -DCIRCUITPY_CANARY_WORD=0xADAF00 \ -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF \ - -DCIRCUITPY_BOARD_ID="\"$(BOARD)\"" + -DCIRCUITPY_BOARD_ID="\"$(BOARD)\"" \ + --param max-inline-insns-single=500 # Use these flags to debug build times and header includes. # -ftime-report @@ -73,6 +74,16 @@ else CFLAGS += -DCIRCUITPY_LTO=0 endif +# Produce an object file for translate.c instead of including it in a header. +# The header version can be optimized on non-LTO builds *if* inlining is allowed +# otherwise, it blows up the binary sizes with tons of translate copies. +ifeq ($(CIRCUITPY_LTO), 0) +CIRCUITPY_TRANSLATE_OBJECT ?= 0 +else +CIRCUITPY_TRANSLATE_OBJECT ?= 1 +endif +CFLAGS += -DCIRCUITPY_TRANSLATE_OBJECT=$(CIRCUITPY_TRANSLATE_OBJECT) + ### # Handle frozen modules. diff --git a/supervisor/shared/translate/translate.c b/supervisor/shared/translate/translate.c index cde3b90a1d..ae6c7524e5 100644 --- a/supervisor/shared/translate/translate.c +++ b/supervisor/shared/translate/translate.c @@ -135,6 +135,6 @@ char *decompress(const compressed_string_t *compressed, char *decompressed) { return decompressed; } -#if CIRCUITPY_LTO == 1 +#if CIRCUITPY_TRANSLATE_OBJECT == 1 #include "supervisor/shared/translate/translate_impl.h" #endif diff --git a/supervisor/shared/translate/translate.h b/supervisor/shared/translate/translate.h index d87fce8746..8bb343cabe 100644 --- a/supervisor/shared/translate/translate.h +++ b/supervisor/shared/translate/translate.h @@ -43,7 +43,7 @@ // that the build process will optimize this away and replace it with the // appropriate compressed data for each call site. -#if CIRCUITPY_LTO == 0 +#if CIRCUITPY_TRANSLATE_OBJECT == 0 // Without LTO, we need to include a copy of this function in each compilation // unit so that the compile stage can do the optimization. Otherwise the linker // will leave this as a giant function and have each call site call into it. diff --git a/supervisor/shared/translate/translate_impl.h b/supervisor/shared/translate/translate_impl.h index 48dea90d6b..acccfa4cd5 100644 --- a/supervisor/shared/translate/translate_impl.h +++ b/supervisor/shared/translate/translate_impl.h @@ -32,7 +32,7 @@ #include "supervisor/shared/translate/compressed_string.h" -#if CIRCUITPY_LTO == 0 +#if CIRCUITPY_TRANSLATE_OBJECT == 0 static #endif inline From 7fc0aa57914d2d32f44e8531362ed9c991803398 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 31 May 2022 14:48:41 -0700 Subject: [PATCH 186/246] Fix windows and two samd builds --- ports/atmel-samd/Makefile | 3 +++ ports/atmel-samd/boards/feather_m4_can/mpconfigboard.mk | 2 ++ ports/atmel-samd/mpconfigport.mk | 6 ++++++ py/circuitpy_defns.mk | 2 +- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 281b5efd2f..a0a211edb0 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -270,6 +270,9 @@ SRC_ASF += \ hpl/oscctrl/hpl_oscctrl.c \ hpl/trng/hpl_trng.c \ +# Ignore these errors +$(BUILD)/asf4/same54/hpl/sercom/hpl_sercom.o: CFLAGS += -Wno-maybe-uninitialized + else ifeq ($(CHIP_FAMILY), same51) SRC_ASF += \ hal/src/hal_rand_sync.c \ diff --git a/ports/atmel-samd/boards/feather_m4_can/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m4_can/mpconfigboard.mk index 088748a0cc..452acd15af 100644 --- a/ports/atmel-samd/boards/feather_m4_can/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m4_can/mpconfigboard.mk @@ -12,3 +12,5 @@ LONGINT_IMPL = MPZ CIRCUITPY__EVE = 1 CIRCUITPY_CANIO = 1 + +CIRCUITPY_LTO = one diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index 38abbb81f6..1b0ad7ed67 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -124,6 +124,12 @@ ifeq ($(CHIP_FAMILY),same51) # No native touchio on SAME51. CIRCUITPY_TOUCHIO_USE_NATIVE = 0 +ifeq ($(CIRCUITPY_FULL_BUILD),1) +CIRCUITPY_LTO ?= balanced +else +CIRCUITPY_LTO ?= one +endif + # The ?='s allow overriding in mpconfigboard.mk. CIRCUITPY_ALARM ?= 1 diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 6a946dd248..a93dce17ca 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -69,7 +69,7 @@ endif CIRCUITPY_LTO ?= 0 ifneq ($(CIRCUITPY_LTO),0) -CFLAGS += -DCIRCUITPY_LTO=1 -flto=auto -flto-partition=$(CIRCUITPY_LTO) +CFLAGS += -DCIRCUITPY_LTO=1 -flto=$(shell $(NPROC)) -flto-partition=$(CIRCUITPY_LTO) else CFLAGS += -DCIRCUITPY_LTO=0 endif From 4f6d4e2284b4461a843c98b048f62b0681251fd6 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Tue, 31 May 2022 22:13:18 -0500 Subject: [PATCH 187/246] Doc fix and add set for DNS --- ports/espressif/common-hal/wifi/Radio.c | 6 ++++++ shared-bindings/wifi/Radio.c | 20 ++++++++++++++------ shared-bindings/wifi/Radio.h | 1 + 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/ports/espressif/common-hal/wifi/Radio.c b/ports/espressif/common-hal/wifi/Radio.c index e43ce2fa51..b6f8fc1058 100644 --- a/ports/espressif/common-hal/wifi/Radio.c +++ b/ports/espressif/common-hal/wifi/Radio.c @@ -398,6 +398,12 @@ mp_obj_t common_hal_wifi_radio_get_ipv4_dns(wifi_radio_obj_t *self) { return common_hal_ipaddress_new_ipv4address(self->dns_info.ip.u_addr.ip4.addr); } +void common_hal_wifi_radio_set_ipv4_dns(wifi_radio_obj_t *self, mp_obj_t ipv4_dns_addr) { + esp_netif_dns_info_t dns_addr; + ipaddress_ipaddress_to_esp_idf_ip4(ipv4_dns_addr, &dns_addr.ip.u_addr.ip4); + esp_netif_set_dns_info(self->netif, ESP_NETIF_DNS_MAIN, &dns_addr); +} + void common_hal_wifi_radio_start_dhcp_client(wifi_radio_obj_t *self) { esp_netif_dhcpc_start(self->netif); } diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index 93c8009e50..958164d74a 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -459,8 +459,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ipv4_address_ap_obj, wifi_radio_get_ipv MP_PROPERTY_GETTER(wifi_radio_ipv4_address_ap_obj, (mp_obj_t)&wifi_radio_get_ipv4_address_ap_obj); -//| ipv4_dns: Optional[ipaddress.IPv4Address] -//| """IP v4 Address of the DNS server in use when connected to an access point. None otherwise.""" +//| ipv4_dns: ipaddress.IPv4Address +//| """IP v4 Address of the DNS server to be used.""" //| STATIC mp_obj_t wifi_radio_get_ipv4_dns(mp_obj_t self) { return common_hal_wifi_radio_get_ipv4_dns(self); @@ -468,8 +468,16 @@ STATIC mp_obj_t wifi_radio_get_ipv4_dns(mp_obj_t self) { } MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ipv4_dns_obj, wifi_radio_get_ipv4_dns); -MP_PROPERTY_GETTER(wifi_radio_ipv4_dns_obj, - (mp_obj_t)&wifi_radio_get_ipv4_dns_obj); +STATIC mp_obj_t wifi_radio_set_ipv4_dns(mp_obj_t self, mp_obj_t ipv4_dns_addr) { + common_hal_wifi_radio_set_ipv4_dns(self, ipv4_dns_addr); + + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(wifi_radio_set_ipv4_dns_obj, wifi_radio_set_ipv4_dns); + +MP_PROPERTY_GETSET(wifi_radio_ipv4_dns_obj, + (mp_obj_t)&wifi_radio_get_ipv4_dns_obj, + (mp_obj_t)&wifi_radio_set_ipv4_dns_obj); //| ap_info: Optional[Network] //| """Network object containing BSSID, SSID, authmode, channel, country and RSSI when connected to an access point. None otherwise.""" @@ -480,7 +488,7 @@ STATIC mp_obj_t wifi_radio_get_ap_info(mp_obj_t self) { } MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ap_info_obj, wifi_radio_get_ap_info); -//| def wifi_radio_start_dhcp_client(self) -> None: +//| def start_dhcp(self) -> None: //| """Starts the DHCP client.""" //| ... //| @@ -490,7 +498,7 @@ STATIC mp_obj_t wifi_radio_start_dhcp_client(mp_obj_t self) { } MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_start_dhcp_client_obj, wifi_radio_start_dhcp_client); -//| def wifi_radio_stop_dhcp_client(self) -> None: +//| def stop_dhcp(self) -> None: //| """Stops the DHCP client. Needed to assign a static IP address.""" //| ... //| diff --git a/shared-bindings/wifi/Radio.h b/shared-bindings/wifi/Radio.h index 5590e17990..208be8c44c 100644 --- a/shared-bindings/wifi/Radio.h +++ b/shared-bindings/wifi/Radio.h @@ -98,6 +98,7 @@ extern wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, 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_ipv4_dns(wifi_radio_obj_t *self); +extern void common_hal_wifi_radio_set_ipv4_dns(wifi_radio_obj_t *self, mp_obj_t ipv4_dns_addr); 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_gateway_ap(wifi_radio_obj_t *self); extern mp_obj_t common_hal_wifi_radio_get_ipv4_subnet(wifi_radio_obj_t *self); From 6d3698848c97a02fd23fb7a12b27633d3b152ca3 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 1 Jun 2022 10:46:46 -0700 Subject: [PATCH 188/246] Fix PDMIn.c formatting --- .../atmel-samd/common-hal/audiobusio/PDMIn.c | 173 +++++++++--------- 1 file changed, 87 insertions(+), 86 deletions(-) diff --git a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c index 3711ba9c1b..6796fe03f8 100644 --- a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c +++ b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -110,74 +110,75 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t *self, } else if (clock_pin == &pin_PB11) { self->clock_unit = 1; #endif - #endif + #else #ifdef SAM_D5X_E5X if (clock_pin == &pin_PA10 || clock_pin == &pin_PB16) { self->clock_unit = 0; } else if (clock_pin == &pin_PB12 #if defined(PIN_PB28) && !defined(IGNORE_PIN_PB28) - || data_pin == &pin_PB28) { - #else + || data_pin == &pin_PB28 + #endif ) { - #endif self->clock_unit = 1; #endif -} else { - raise_ValueError_invalid_pin_name(MP_QSTR_clock); -} + #endif + } else { + raise_ValueError_invalid_pin_name(MP_QSTR_clock); + } -self->data_pin = data_pin; // PA07, PA19 -> SD0, PA08, PB16 -> SD1 + self->data_pin = data_pin; // PA07, PA19 -> SD0, PA08, PB16 -> SD1 #ifdef SAMD21 -if (false + if (false #if defined(PIN_PA07) && !defined(IGNORE_PIN_PA07) - || data_pin == &pin_PA07 + || data_pin == &pin_PA07 #endif #if defined(PIN_PA19) && !defined(IGNORE_PIN_PA19) - || data_pin == &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 + ) { + 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; + #else + #ifdef SAM_D5X_E5X + if (data_pin == &pin_PB10 || data_pin == &pin_PA22) { + self->serializer = 1; + #endif #endif - #if defined(PIN_PB16) && !defined(IGNORE_PIN_PB16) - || data_pin == &pin_PB16 - #endif - ) { - self->serializer = 1; - #endif - #ifdef SAM_D5X_E5X -if (data_pin == &pin_PB10 || data_pin == &pin_PA22) { - self->serializer = 1; - #endif -}else { - raise_ValueError_invalid_pin_name(MP_QSTR_data); -} - -if (!(bit_depth == 16 || bit_depth == 8) || !mono || oversample != OVERSAMPLING) { - mp_raise_NotImplementedError(translate("Only 8 or 16 bit mono with " MP_STRINGIFY(OVERSAMPLING) "x oversampling is supported.")); -} - -turn_on_i2s(); - -if (I2S->CTRLA.bit.ENABLE == 0) { - I2S->CTRLA.bit.SWRST = 1; - while (I2S->CTRLA.bit.SWRST == 1) { + } else { + raise_ValueError_invalid_pin_name(MP_QSTR_data); } -} else { - #ifdef SAMD21 - if ((I2S->CTRLA.vec.SEREN & (1 << self->serializer)) != 0) { - mp_raise_RuntimeError(translate("Serializer in use")); + + if (!(bit_depth == 16 || bit_depth == 8) || !mono || oversample != OVERSAMPLING) { + mp_raise_NotImplementedError(translate("Only 8 or 16 bit mono with " MP_STRINGIFY(OVERSAMPLING) "x oversampling is supported.")); } - #endif - #ifdef SAM_D5X_E5X - if (I2S->CTRLA.bit.RXEN == 1) { - mp_raise_RuntimeError(translate("Serializer in use")); + + turn_on_i2s(); + + if (I2S->CTRLA.bit.ENABLE == 0) { + I2S->CTRLA.bit.SWRST = 1; + while (I2S->CTRLA.bit.SWRST == 1) { + } + } else { + #ifdef SAMD21 + if ((I2S->CTRLA.vec.SEREN & (1 << self->serializer)) != 0) { + mp_raise_RuntimeError(translate("Serializer in use")); + } + #endif + #ifdef SAM_D5X_E5X + if (I2S->CTRLA.bit.RXEN == 1) { + mp_raise_RuntimeError(translate("Serializer in use")); + } + #endif } - #endif -} #ifdef SAM_D5X_E5X #define GPIO_I2S_FUNCTION GPIO_PIN_FUNCTION_J #endif @@ -185,62 +186,62 @@ if (I2S->CTRLA.bit.ENABLE == 0) { #define GPIO_I2S_FUNCTION GPIO_PIN_FUNCTION_G #endif -uint32_t clock_divisor = (uint32_t)roundf(48000000.0f / sample_rate / oversample); -float mic_clock_freq = 48000000.0f / clock_divisor; -self->sample_rate = mic_clock_freq / oversample; -if (mic_clock_freq < MIN_MIC_CLOCK || clock_divisor == 0) { - mp_raise_ValueError(translate("sampling rate out of range")); -} -// Find a free GCLK to generate the MCLK signal. -uint8_t gclk = find_free_gclk(clock_divisor); -if (gclk > GCLK_GEN_NUM) { - mp_raise_RuntimeError(translate("Unable to find free GCLK")); -} -self->gclk = gclk; + uint32_t clock_divisor = (uint32_t)roundf(48000000.0f / sample_rate / oversample); + float mic_clock_freq = 48000000.0f / clock_divisor; + self->sample_rate = mic_clock_freq / oversample; + if (mic_clock_freq < MIN_MIC_CLOCK || clock_divisor == 0) { + mp_raise_ValueError(translate("sampling rate out of range")); + } + // Find a free GCLK to generate the MCLK signal. + uint8_t gclk = find_free_gclk(clock_divisor); + if (gclk > GCLK_GEN_NUM) { + mp_raise_RuntimeError(translate("Unable to find free GCLK")); + } + self->gclk = gclk; -enable_clock_generator(self->gclk, CLOCK_48MHZ, clock_divisor); -connect_gclk_to_peripheral(self->gclk, I2S_GCLK_ID_0 + self->clock_unit); + enable_clock_generator(self->gclk, CLOCK_48MHZ, clock_divisor); + connect_gclk_to_peripheral(self->gclk, I2S_GCLK_ID_0 + self->clock_unit); -// Clock unit configuration + // Clock unit configuration -uint32_t clkctrl = I2S_CLKCTRL_MCKSEL_GCLK | - I2S_CLKCTRL_NBSLOTS(2) | - I2S_CLKCTRL_FSWIDTH_SLOT | - I2S_CLKCTRL_SLOTSIZE_16; + uint32_t clkctrl = I2S_CLKCTRL_MCKSEL_GCLK | + I2S_CLKCTRL_NBSLOTS(2) | + I2S_CLKCTRL_FSWIDTH_SLOT | + I2S_CLKCTRL_SLOTSIZE_16; -// Serializer configuration + // Serializer configuration #ifdef SAMD21 -uint32_t serctrl = (self->clock_unit << I2S_SERCTRL_CLKSEL_Pos) | SERCTRL(SERMODE_PDM2) | SERCTRL(DATASIZE_32); + uint32_t serctrl = (self->clock_unit << I2S_SERCTRL_CLKSEL_Pos) | SERCTRL(SERMODE_PDM2) | SERCTRL(DATASIZE_32); #endif #ifdef SAM_D5X_E5X -uint32_t serctrl = (self->clock_unit << I2S_RXCTRL_CLKSEL_Pos) | SERCTRL(SERMODE_PDM2) | SERCTRL(DATASIZE_32); + uint32_t serctrl = (self->clock_unit << I2S_RXCTRL_CLKSEL_Pos) | SERCTRL(SERMODE_PDM2) | SERCTRL(DATASIZE_32); #endif -// Configure the I2S peripheral -i2s_set_enable(false); + // Configure the I2S peripheral + i2s_set_enable(false); -I2S->CLKCTRL[self->clock_unit].reg = clkctrl; + I2S->CLKCTRL[self->clock_unit].reg = clkctrl; #ifdef SAMD21 -I2S->SERCTRL[self->serializer].reg = serctrl; + I2S->SERCTRL[self->serializer].reg = serctrl; #endif #ifdef SAM_D5X_E5X -I2S->RXCTRL.reg = serctrl; + I2S->RXCTRL.reg = serctrl; #endif -i2s_set_enable(true); + i2s_set_enable(true); -// Run the clock all the time. This eliminates startup delay for the microphone, -// which can be 10-100ms. Turn serializer on as needed. -i2s_set_clock_unit_enable(self->clock_unit, true); + // Run the clock all the time. This eliminates startup delay for the microphone, + // which can be 10-100ms. Turn serializer on as needed. + i2s_set_clock_unit_enable(self->clock_unit, true); -claim_pin(clock_pin); -claim_pin(data_pin); + claim_pin(clock_pin); + claim_pin(data_pin); -gpio_set_pin_function(self->clock_pin->number, GPIO_I2S_FUNCTION); -gpio_set_pin_function(self->data_pin->number, GPIO_I2S_FUNCTION); + gpio_set_pin_function(self->clock_pin->number, GPIO_I2S_FUNCTION); + gpio_set_pin_function(self->data_pin->number, GPIO_I2S_FUNCTION); -self->bytes_per_sample = oversample >> 3; -self->bit_depth = bit_depth; + self->bytes_per_sample = oversample >> 3; + self->bit_depth = bit_depth; } bool common_hal_audiobusio_pdmin_deinited(audiobusio_pdmin_obj_t *self) { From 09c61efcff64937234b268b8a9d58f9ae15ffcb6 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 1 Jun 2022 11:12:14 -0700 Subject: [PATCH 189/246] Split partition from LTO enable --- .../boards/feather_m4_can/mpconfigboard.mk | 2 +- ports/atmel-samd/mpconfigport.mk | 15 ++++++--------- ports/nrf/mpconfigport.mk | 6 ++++-- py/circuitpy_defns.mk | 13 ++++--------- 4 files changed, 15 insertions(+), 21 deletions(-) diff --git a/ports/atmel-samd/boards/feather_m4_can/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m4_can/mpconfigboard.mk index 452acd15af..1c337d6256 100644 --- a/ports/atmel-samd/boards/feather_m4_can/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m4_can/mpconfigboard.mk @@ -13,4 +13,4 @@ LONGINT_IMPL = MPZ CIRCUITPY__EVE = 1 CIRCUITPY_CANIO = 1 -CIRCUITPY_LTO = one +CIRCUITPY_LTO_PARTITION = one diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index 1b0ad7ed67..66ebb54a6b 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -9,6 +9,7 @@ USB_NUM_ENDPOINT_PAIRS = 8 CIRCUITPY_ROTARYIO_SOFTENCODER = 1 CIRCUITPY_OPTIMIZE_PROPERTY_FLASH_SIZE ?= 1 +CIRCUITPY_LTO = 1 ###################################################################### # Put samd21-only choices here. @@ -78,7 +79,7 @@ endif SUPEROPT_GC = 0 SUPEROPT_VM = 0 -CIRCUITPY_LTO = one +CIRCUITPY_LTO_PARTITION = one ifeq ($(CIRCUITPY_FULL_BUILD),0) # On the smallest boards, this saves about 180 bytes. On other boards, it may -increase- space used. @@ -96,10 +97,8 @@ ifeq ($(CHIP_FAMILY),samd51) # No native touchio on SAMD51. CIRCUITPY_TOUCHIO_USE_NATIVE = 0 -ifeq ($(CIRCUITPY_FULL_BUILD),1) -CIRCUITPY_LTO ?= balanced -else -CIRCUITPY_LTO ?= one +ifeq ($(CIRCUITPY_FULL_BUILD),0) +CIRCUITPY_LTO_PARTITION ?= one endif # The ?='s allow overriding in mpconfigboard.mk. @@ -124,10 +123,8 @@ ifeq ($(CHIP_FAMILY),same51) # No native touchio on SAME51. CIRCUITPY_TOUCHIO_USE_NATIVE = 0 -ifeq ($(CIRCUITPY_FULL_BUILD),1) -CIRCUITPY_LTO ?= balanced -else -CIRCUITPY_LTO ?= one +ifeq ($(CIRCUITPY_FULL_BUILD),0) +CIRCUITPY_LTO_PARTITION ?= one endif # The ?='s allow overriding in mpconfigboard.mk. diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index 4bb4f3dfb4..f265ac1940 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -73,7 +73,8 @@ CFLAGS += -DCONFIG_NFCT_PINS_AS_GPIOS ifeq ($(INTERNAL_FLASH_FILESYSTEM),1) OPTIMIZATION_FLAGS ?= -Os - CIRCUITPY_LTO=balanced + CIRCUITPY_LTO = 1 + CIRCUITPY_LTO_PARTITION = balanced endif else @@ -94,6 +95,7 @@ NRF_DEFINES += -DNRF52833_XXAA -DNRF52833 OPTIMIZATION_FLAGS ?= -Os -CIRCUITPY_LTO=one +CIRCUITPY_LTO = 1 +CIRCUITPY_LTO_PARTITION = one endif endif diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index a93dce17ca..1918938255 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -68,20 +68,15 @@ CFLAGS += -DCIRCUITPY_DEBUG=0 endif CIRCUITPY_LTO ?= 0 -ifneq ($(CIRCUITPY_LTO),0) -CFLAGS += -DCIRCUITPY_LTO=1 -flto=$(shell $(NPROC)) -flto-partition=$(CIRCUITPY_LTO) -else -CFLAGS += -DCIRCUITPY_LTO=0 +CIRCUITPY_LTO_PARTITION ?= balanced +ifeq ($(CIRCUITPY_LTO),1) +CFLAGS += -flto -flto-partition=$(CIRCUITPY_LTO_PARTITION) endif # Produce an object file for translate.c instead of including it in a header. # The header version can be optimized on non-LTO builds *if* inlining is allowed # otherwise, it blows up the binary sizes with tons of translate copies. -ifeq ($(CIRCUITPY_LTO), 0) -CIRCUITPY_TRANSLATE_OBJECT ?= 0 -else -CIRCUITPY_TRANSLATE_OBJECT ?= 1 -endif +CIRCUITPY_TRANSLATE_OBJECT ?= $(CIRCUITPY_LTO) CFLAGS += -DCIRCUITPY_TRANSLATE_OBJECT=$(CIRCUITPY_TRANSLATE_OBJECT) ### From 14ab3c737506087acf2a98a18efa08a0e6f2c107 Mon Sep 17 00:00:00 2001 From: KurtE Date: Wed, 1 Jun 2022 17:09:44 -0700 Subject: [PATCH 190/246] ESP32 USE uart_param_config Use this function instead of several individual configuration functions to configure such things as Baud rate, transfer size, stop bits, parity... This function also resets both the RX and TX Hardware Fifo reset functions are called to setup the hardware. --- ports/espressif/common-hal/busio/UART.c | 52 +++++++++++++++---------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/ports/espressif/common-hal/busio/UART.c b/ports/espressif/common-hal/busio/UART.c index 27323fecf4..e7ddb9433b 100644 --- a/ports/espressif/common-hal/busio/UART.c +++ b/ports/espressif/common-hal/busio/UART.c @@ -108,6 +108,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, bool have_rx = rx != NULL; bool have_rts = rts != NULL; bool have_cts = cts != NULL; + + uart_config_t uart_config = {0}; bool have_rs485_dir = rs485_dir != NULL; if (!have_tx && !have_rx) { mp_raise_ValueError(translate("tx and rx cannot both be None")); @@ -135,25 +137,26 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } uart_mode_t mode = UART_MODE_UART; - uart_hw_flowcontrol_t flow_control = UART_HW_FLOWCTRL_DISABLE; + uart_config.flow_ctrl = UART_HW_FLOWCTRL_DISABLE; if (have_rs485_dir) { mode = UART_MODE_RS485_HALF_DUPLEX; if (!rs485_invert) { + // This one is not in the set uart_set_line_inverse(self->uart_num, UART_SIGNAL_DTR_INV); } } else if (have_rts && have_cts) { - flow_control = UART_HW_FLOWCTRL_CTS_RTS; + uart_config.flow_ctrl = UART_HW_FLOWCTRL_CTS_RTS; } else if (have_rts) { - flow_control = UART_HW_FLOWCTRL_RTS; + uart_config.flow_ctrl = UART_HW_FLOWCTRL_RTS; } else if (have_rts) { - flow_control = UART_HW_FLOWCTRL_CTS; + uart_config.flow_ctrl = UART_HW_FLOWCTRL_CTS; } if (receiver_buffer_size <= UART_FIFO_LEN) { receiver_buffer_size = UART_FIFO_LEN + 8; } - uint8_t rx_threshold = UART_FIFO_LEN - 8; + uart_config.rx_flow_ctrl_thresh = UART_FIFO_LEN - 8; // Install the driver before we change the settings. if (uart_driver_install(self->uart_num, receiver_buffer_size, 0, 20, &self->event_queue, 0) != ESP_OK || uart_set_mode(self->uart_num, mode) != ESP_OK) { @@ -175,55 +178,62 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, CONFIG_PTHREAD_TASK_PRIO_DEFAULT, &self->event_task, xPortGetCoreID()); - uart_set_hw_flow_ctrl(self->uart_num, flow_control, rx_threshold); + // uart_set_hw_flow_ctrl(self->uart_num, uart_config.flow_control, uart_config.rx_flow_ctrl_thresh); // Set baud rate - common_hal_busio_uart_set_baudrate(self, baudrate); + // common_hal_busio_uart_set_baudrate(self, baudrate); + uart_config.baud_rate = baudrate; - uart_word_length_t word_length = UART_DATA_8_BITS; + uart_config.data_bits = UART_DATA_8_BITS; switch (bits) { // Shared bindings prevents data < 7 bits. // case 5: - // word_length = UART_DATA_5_BITS; + // uart_config.data_bits = UART_DATA_5_BITS; // break; // case 6: - // word_length = UART_DATA_6_BITS; + // uart_config.data_bits = UART_DATA_6_BITS; // break; case 7: - word_length = UART_DATA_7_BITS; + uart_config.data_bits = UART_DATA_7_BITS; break; case 8: - word_length = UART_DATA_8_BITS; + uart_config.data_bits = 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_set_word_length(self->uart_num, uart_config.data_bits); - uart_parity_t parity_mode = UART_PARITY_DISABLE; + uart_config.parity = UART_PARITY_DISABLE; switch (parity) { case BUSIO_UART_PARITY_NONE: - parity_mode = UART_PARITY_DISABLE; + uart_config.parity = UART_PARITY_DISABLE; break; case BUSIO_UART_PARITY_EVEN: - parity_mode = UART_PARITY_EVEN; + uart_config.parity = UART_PARITY_EVEN; break; case BUSIO_UART_PARITY_ODD: - parity_mode = UART_PARITY_ODD; + uart_config.parity = 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); + // uart_set_parity(self->uart_num, uart_config.parity); // Stop is 1 or 2 always. - uart_stop_bits_t stop_bits = UART_STOP_BITS_1; + uart_config.stop_bits = UART_STOP_BITS_1; if (stop == 2) { - stop_bits = UART_STOP_BITS_2; + uart_config.stop_bits = UART_STOP_BITS_2; + } + // uart_set_stop_bits(self->uart_num, stop_bits); + uart_config.source_clk = UART_SCLK_APB; // guessing here... + + // config all in one? + if (uart_param_config(self->uart_num, &uart_config) != ESP_OK) { + mp_raise_RuntimeError(translate("UART init")); } - uart_set_stop_bits(self->uart_num, stop_bits); self->tx_pin = NULL; self->rx_pin = NULL; From 40e890323b24038aaf98aa95935689ab28ed06f8 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Wed, 1 Jun 2022 20:13:51 -0500 Subject: [PATCH 191/246] Add DNS optional to set IP --- ports/espressif/common-hal/wifi/Radio.c | 6 +++++- shared-bindings/wifi/Radio.c | 9 +++++---- shared-bindings/wifi/Radio.h | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ports/espressif/common-hal/wifi/Radio.c b/ports/espressif/common-hal/wifi/Radio.c index b6f8fc1058..6451cb1414 100644 --- a/ports/espressif/common-hal/wifi/Radio.c +++ b/ports/espressif/common-hal/wifi/Radio.c @@ -412,7 +412,7 @@ void common_hal_wifi_radio_stop_dhcp_client(wifi_radio_obj_t *self) { esp_netif_dhcpc_stop(self->netif); } -void common_hal_wifi_radio_set_ipv4_address(wifi_radio_obj_t *self, mp_obj_t ipv4, mp_obj_t netmask, mp_obj_t gateway) { +void common_hal_wifi_radio_set_ipv4_address(wifi_radio_obj_t *self, mp_obj_t ipv4, mp_obj_t netmask, mp_obj_t gateway, mp_obj_t ipv4_dns) { common_hal_wifi_radio_stop_dhcp_client(self); // Must stop DHCP to set a manual address esp_netif_ip_info_t ip_info; @@ -421,6 +421,10 @@ void common_hal_wifi_radio_set_ipv4_address(wifi_radio_obj_t *self, mp_obj_t ipv ipaddress_ipaddress_to_esp_idf_ip4(gateway, &ip_info.gw); esp_netif_set_ip_info(self->netif, &ip_info); + + if (ipv4_dns != MP_OBJ_NULL) { + common_hal_wifi_radio_set_ipv4_dns(self, ipv4_dns); + } } 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/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index 958164d74a..a0cf97c092 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -414,23 +414,24 @@ MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ipv4_subnet_ap_obj, wifi_radio_get_ipv4 MP_PROPERTY_GETTER(wifi_radio_ipv4_subnet_ap_obj, (mp_obj_t)&wifi_radio_get_ipv4_subnet_ap_obj); -//| def set_ipv4_address(self, ipv4: ipaddress.IPv4Address, netmask: ipaddress.IPv4Address, gateway: ipaddress.IPv4Address) -> None: -//| """Sets the IP v4 address of the station. Must include the netmask and gateway. +//| def set_ipv4_address(self, ipv4: ipaddress.IPv4Address, netmask: ipaddress.IPv4Address, gateway: ipaddress.IPv4Address, ipv4_dns: Optional[ipaddress.IPv4Address]) -> None: +//| """Sets the IP v4 address of the station. Must include the netmask and gateway. DNS address is optional. //| Setting the address manually will stop the DHCP client.""" //| ... STATIC mp_obj_t wifi_radio_set_ipv4_address(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_ipv4, ARG_netmask, ARG_gateway }; + enum { ARG_ipv4, ARG_netmask, ARG_gateway, ARG_ipv4_dns }; static const mp_arg_t allowed_args[] = { { MP_QSTR_ipv4, MP_ARG_REQUIRED | MP_ARG_OBJ, }, { MP_QSTR_netmask, MP_ARG_REQUIRED | MP_ARG_OBJ, }, { MP_QSTR_gateway, MP_ARG_REQUIRED | MP_ARG_OBJ, }, + { MP_QSTR_ipv4_dns, MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, }; 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); - common_hal_wifi_radio_set_ipv4_address(self, args[ARG_ipv4].u_obj, args[ARG_netmask].u_obj, args[ARG_gateway].u_obj); + common_hal_wifi_radio_set_ipv4_address(self, args[ARG_ipv4].u_obj, args[ARG_netmask].u_obj, args[ARG_gateway].u_obj, args[ARG_ipv4_dns].u_obj); return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(wifi_radio_set_ipv4_address_obj, 4, wifi_radio_set_ipv4_address); diff --git a/shared-bindings/wifi/Radio.h b/shared-bindings/wifi/Radio.h index 208be8c44c..09a66b2e63 100644 --- a/shared-bindings/wifi/Radio.h +++ b/shared-bindings/wifi/Radio.h @@ -106,7 +106,7 @@ extern mp_obj_t common_hal_wifi_radio_get_ipv4_subnet_ap(wifi_radio_obj_t *self) extern mp_obj_t common_hal_wifi_radio_get_ipv4_address(wifi_radio_obj_t *self); extern mp_obj_t common_hal_wifi_radio_get_ipv4_address_ap(wifi_radio_obj_t *self); -extern void common_hal_wifi_radio_set_ipv4_address(wifi_radio_obj_t *self, mp_obj_t ipv4, mp_obj_t netmask, mp_obj_t gateway); +extern void common_hal_wifi_radio_set_ipv4_address(wifi_radio_obj_t *self, mp_obj_t ipv4, mp_obj_t netmask, mp_obj_t gateway, mp_obj_t ipv4_dns_addr); extern mp_int_t common_hal_wifi_radio_ping(wifi_radio_obj_t *self, mp_obj_t ip_address, mp_float_t timeout); From 27fb96e6b0ce6770bbfc3cdd70b36439d6602763 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 1 Jun 2022 21:35:01 -0400 Subject: [PATCH 192/246] Remove trailing whitespace --- ports/espressif/boards/lilygo_ttgo_t-oi-plus/pins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/pins.c b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/pins.c index 79f2e2e42d..c906b7a555 100644 --- a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/pins.c +++ b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/pins.c @@ -4,7 +4,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS { MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) }, { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_GPIO2) }, - { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO2) }, { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, From 3202d52554c6f6790b7ca5ad5f3edfc398c9c31f Mon Sep 17 00:00:00 2001 From: Maxime Leroy Date: Thu, 2 Jun 2022 04:51:02 +0000 Subject: [PATCH 193/246] Translated using Weblate (French) Currently translated at 95.5% (939 of 983 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/fr/ --- locale/fr.po | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 15b05ca98a..0639a2ba88 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2021-12-13 05:53+0000\n" -"Last-Translator: Jeff Epler \n" +"PO-Revision-Date: 2022-06-02 04:53+0000\n" +"Last-Translator: Maxime Leroy \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.10-dev\n" +"X-Generator: Weblate 4.13-dev\n" #: main.c msgid "" @@ -147,7 +147,7 @@ msgstr "%q doit être %d-%d" #: shared-bindings/displayio/Display.c msgid "%q must be 1 when %q is True" -msgstr "" +msgstr "%q doit être à 1 alors que %q est True" #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" @@ -179,7 +179,7 @@ msgstr "%q doit être du type %q" #: shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or None" -msgstr "" +msgstr "%q doit être du type %q ou None" #: ports/atmel-samd/common-hal/busio/UART.c msgid "%q must be power of 2" @@ -1034,6 +1034,8 @@ msgstr "Format non supporté" msgid "" "Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" msgstr "" +"La fréquence doit être 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 ou " +"1008 MHz" #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" @@ -1282,7 +1284,7 @@ msgstr "La partie gauche de l'argument nommé doit être un identifiant" #: shared-module/displayio/Group.c msgid "Layer already in a group" -msgstr "" +msgstr "Ce calque est déjà dans un groupe" #: shared-module/displayio/Group.c msgid "Layer must be a Group or TileGrid subclass" @@ -1320,7 +1322,7 @@ msgstr "Broche MISO ou MOSI manquante" #: ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI pin" -msgstr "" +msgstr "La broche MISO ou MOSI est manquante" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format @@ -1416,7 +1418,7 @@ msgstr "Aucun minuteur de rythme DMA trouvé" #: shared-module/adafruit_bus_device/i2c_device/I2CDevice.c #, c-format msgid "No I2C device at address: 0x%x" -msgstr "" +msgstr "Aucun périphérique I2S à l'adresse : 0x%x" #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1425,7 +1427,7 @@ msgstr "Pas de broche MISO" #: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c msgid "No MISO pin" -msgstr "" +msgstr "Aucune broche MISO" #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1434,7 +1436,7 @@ msgstr "Pas de broche MOSI" #: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c msgid "No MOSI pin" -msgstr "" +msgstr "Aucune broche MOSI" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c @@ -1520,7 +1522,7 @@ msgstr "Aucun espace libre sur le dispositif" #: py/moduerrno.c msgid "No such device" -msgstr "" +msgstr "Aucun périphérique correspondant" #: py/moduerrno.c msgid "No such file/directory" @@ -1640,7 +1642,7 @@ msgstr "Une seule couleur peut être transparente à la fois" #: py/moduerrno.c msgid "Operation not permitted" -msgstr "" +msgstr "Cette opération n'est pas permise" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" @@ -1792,7 +1794,7 @@ msgstr "Mode RAISE n'est pas implémenté" #: ports/raspberrypi/common-hal/countio/Counter.c msgid "RISE_AND_FALL not available on this chip" -msgstr "" +msgstr "RISE_AND_FALL n'est pas disponible sur cette puce" #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" @@ -2547,7 +2549,7 @@ msgstr "étalonnage en lecture seule" #: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c msgid "can only have one parent" -msgstr "" +msgstr "ne peut avoir qu'un seul parent" #: py/emitinlinethumb.c msgid "can only have up to 4 parameters to Thumb assembly" @@ -2590,7 +2592,7 @@ msgstr "impossible de convertir l'objet '%q' en '%q' implicitement" #: extmod/ulab/code/numpy/vector.c msgid "can't convert complex to float" -msgstr "" +msgstr "ne peut convertir un complexe en flottant" #: py/obj.c msgid "can't convert to %q" @@ -2698,11 +2700,11 @@ msgstr "output ne peut être projeté sans règle de projection" #: extmod/ulab/code/ndarray.c msgid "cannot convert complex to dtype" -msgstr "" +msgstr "ne peut convertir un complexe en dtype" #: extmod/ulab/code/ndarray.c msgid "cannot convert complex type" -msgstr "" +msgstr "ne peut convertir un type complexe" #: py/objtype.c msgid "cannot create '%q' instances" @@ -2893,7 +2895,7 @@ msgstr "division par zéro" #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" -msgstr "" +msgstr "le dtype doit être un flottant, ou un complexe" #: py/objdeque.c msgid "empty" @@ -3040,7 +3042,7 @@ msgstr "le format nécessite un dict" #: shared-bindings/microcontroller/Processor.c msgid "frequency is read-only for this board" -msgstr "" +msgstr "la fréquence est en lecture seule pour cette carte" #: py/objdeque.c msgid "full" @@ -3220,7 +3222,7 @@ msgstr "la matrice d'entrée est singulière" #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" -msgstr "" +msgstr "l'entrée doit être un ndarray 1D" #: extmod/ulab/code/scipy/linalg/linalg.c extmod/ulab/code/user/user.c msgid "input must be a dense ndarray" @@ -3623,7 +3625,7 @@ msgstr "pas assez d'arguments pour la chaîne de format" #: extmod/ulab/code/numpy/carray/carray_tools.c msgid "not implemented for complex dtype" -msgstr "" +msgstr "n'est pas implémenté pour les dtype complexes" #: extmod/ulab/code/numpy/create.c msgid "number of points must be at least 2" From 29e9f447249e46a98e471593196e2b8cf3321cd1 Mon Sep 17 00:00:00 2001 From: ajs256 Date: Wed, 1 Jun 2022 22:02:36 +0000 Subject: [PATCH 194/246] Translated using Weblate (French) Currently translated at 95.5% (939 of 983 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/fr/ --- locale/fr.po | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 0639a2ba88..ce77777225 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,7 +9,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" "PO-Revision-Date: 2022-06-02 04:53+0000\n" -"Last-Translator: Maxime Leroy \n" +"Last-Translator: ajs256 \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" @@ -83,7 +83,7 @@ msgstr "" #: ports/raspberrypi/common-hal/analogio/AnalogOut.c #: ports/raspberrypi/common-hal/rtc/RTC.c msgid "%q" -msgstr "" +msgstr "%q" #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" @@ -91,7 +91,7 @@ msgstr "%q et %q contiennent des broches en double" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "%q and %q must be different" -msgstr "" +msgstr "%q et %q doivent être différents" #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" @@ -119,7 +119,7 @@ msgstr "" #: py/argcheck.c msgid "%q length must be %d" -msgstr "" +msgstr "La longeur de %q doit être %d" #: py/argcheck.c msgid "%q length must be %d-%d" @@ -127,11 +127,11 @@ msgstr "La longueur de %q doit être %d-%d" #: py/argcheck.c msgid "%q length must be <= %d" -msgstr "" +msgstr "La longeur de %q doit être <= %d" #: py/argcheck.c msgid "%q length must be >= %d" -msgstr "" +msgstr "La longeur de %q doit être >= %d" #: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" @@ -139,7 +139,7 @@ msgstr "La longueur de %q doit être >= 1" #: py/argcheck.c msgid "%q must be %d" -msgstr "" +msgstr "%q doit être %d" #: py/argcheck.c msgid "%q must be %d-%d" @@ -171,7 +171,7 @@ msgstr "%q doit être une chaîne de caractères" #: py/argcheck.c msgid "%q must be an int" -msgstr "" +msgstr "%q doit être un entier" #: py/argcheck.c msgid "%q must be of type %q" From fd5ef009a40ed6d056495da95c7970f2fafdac2a Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 2 Jun 2022 11:48:56 -0700 Subject: [PATCH 195/246] Move compressed strings into own object file This breaks the translation dependency to all of the other objects and therefore speeds up subsequent builds. Now, even when the big translate() function is inlined in the header, it only needs to be optimized once. --- py/makeqstrdata.py | 369 +------------ py/maketranslationdata.py | 525 +++++++++++++++++++ py/py.mk | 13 +- supervisor/shared/translate/translate_impl.h | 10 +- supervisor/supervisor.mk | 2 +- 5 files changed, 556 insertions(+), 363 deletions(-) create mode 100644 py/maketranslationdata.py diff --git a/py/makeqstrdata.py b/py/makeqstrdata.py index dada7e8e59..2abbdedefd 100644 --- a/py/makeqstrdata.py +++ b/py/makeqstrdata.py @@ -24,10 +24,6 @@ if hasattr(sys.stdout, "reconfigure"): py = os.path.dirname(sys.argv[0]) top = os.path.dirname(py) -sys.path.append(os.path.join(top, "tools/huffman")) - -import huffman - # Python 2/3 compatibility: # - iterating through bytes is different # - codepoint2name lives in a different module @@ -262,325 +258,6 @@ def compute_hash(qstr, bytes_hash): return (hash & ((1 << (8 * bytes_hash)) - 1)) or 1 -def translate(translation_file, i18ns): - with open(translation_file, "rb") as f: - table = gettext.GNUTranslations(f) - - translations = [] - for original in i18ns: - unescaped = original - for s in C_ESCAPES: - unescaped = unescaped.replace(C_ESCAPES[s], s) - translation = table.gettext(unescaped) - # Add in carriage returns to work in terminals - translation = translation.replace("\n", "\r\n") - translations.append((original, translation)) - return translations - - -class TextSplitter: - def __init__(self, words): - words = sorted(words, key=lambda x: len(x), reverse=True) - self.words = set(words) - 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 = [] - words = self.words - for m in self.pat.finditer(text): - t = m.group(0) - if t in words: - if s: - yield (False, "".join(s)) - s = [] - yield (True, t) - else: - s.append(t) - if s: - yield (False, "".join(s)) - - def iter(self, text): - for m in self.pat.finditer(text): - yield m.group(0) - - -def iter_substrings(s, minlen, 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): - yield s[begin : begin + n] - - -def compute_huffman_coding(translations, compression_filename): - texts = [t[1] for t in translations] - words = [] - - start_unused = 0x80 - end_unused = 0xFF - max_ord = 0 - for text in texts: - for c in text: - ord_c = ord(c) - max_ord = max(ord_c, max_ord) - if 0x80 <= ord_c < 0xFF: - end_unused = min(ord_c, end_unused) - max_words = end_unused - 0x80 - - bits_per_codepoint = 16 if max_ord > 255 else 8 - values_type = "uint16_t" if max_ord > 255 else "uint8_t" - while len(words) < max_words: - # Until the dictionary is filled to capacity, use a heuristic to find - # the best "word" (2- to 11-gram) to add to it. - # - # 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: - for atom in extractor.iter(t): - counter[atom] += 1 - cb = huffman.codebook(counter.items()) - lengths = sorted(dict((v, len(cb[k])) for k, v in counter.items()).items()) - - def bit_length(s): - return sum(len(cb[c]) for c in s) - - def est_len(occ): - idx = bisect.bisect_left(lengths, (occ, 0)) - return lengths[idx][1] + 1 - - # The cost of adding a dictionary word is just its storage size - # while its savings is close to the difference between the original - # huffman bit-length of the string and the estimated bit-length - # of the dictionary word, times the number of times the word appears. - # - # The savings is not strictly accurate because including a word into - # the Huffman tree bumps up the encoding lengths of all words in the - # same subtree. In the extreme case when the new word is so frequent - # that it gets a one-bit encoding, all other words will cost an extra - # bit each. This is empirically modeled by the constant factor added to - # cost, but the specific value used isn't "proven" to be correct. - # - # Another source of inaccuracy is that compressed strings end up - # on byte boundaries, not bit boundaries, so saving 1 bit somewhere - # might not save a byte. - # - # In fact, when this change was first made, some translations (luckily, - # ones on boards not at all close to full) wasted up to 40 bytes, - # while the most constrained boards typically gained 100 bytes or - # more. - # - # The difference between the two is the estimated net savings, in bits. - def est_net_savings(s, occ): - savings = occ * (bit_length(s) - est_len(occ)) - cost = len(s) * bits_per_codepoint + 24 - return savings - cost - - 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=11): - counter[substr] += 1 - - # Score the candidates we found. This is a semi-empirical formula that - # attempts to model the number of bits saved as closely as possible. - # - # It attempts to compute the codeword lengths of the original word - # to the codeword length the dictionary entry would get, times - # the number of occurrences, less the ovehead of the entries in the - # words[] array. - - scores = sorted( - ((s, -est_net_savings(s, occ)) for (s, occ) in counter.items()), key=lambda x: x[1] - ) - - # Pick the one with the highest score. The score must be negative. - if not scores or scores[0][-1] >= 0: - break - - word = scores[0][0] - words.append(word) - - words.sort(key=len) - 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 = start_unused - word_end = word_start + len(words) - 1 - print("// # words", len(words)) - print("// words", words) - - values = [] - length_count = {} - renumbered = 0 - last_length = None - canonical = {} - for atom, code in sorted(cb.items(), key=lambda x: (len(x[1]), x[0])): - values.append(atom) - 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) - else: - s = C_ESCAPES.get(atom, atom) - o = ord(atom) - print("//", o, s, counter[atom], canonical[atom], renumbered) - renumbered += 1 - 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) - - print("//", values, lengths) - values = [(atom if len(atom) == 1 else chr(0x80 + words.index(atom))) for atom in values] - max_translation_encoded_length = max( - len(translation.encode("utf-8")) for (original, translation) in translations - ) - - maxlen = len(words[-1]) - minlen = len(words[0]) - wlencount = [len([None for w in words if len(w) == l]) for l in range(minlen, maxlen + 1)] - - with open(compression_filename, "w") as f: - f.write("typedef {} mchar_t;".format(values_type)) - f.write("const uint8_t lengths[] = {{ {} }};\n".format(", ".join(map(str, lengths)))) - f.write( - "const mchar_t values[] = {{ {} }};\n".format(", ".join(str(ord(u)) for u in values)) - ) - f.write( - "#define compress_max_length_bits ({})\n".format( - max_translation_encoded_length.bit_length() - ) - ) - f.write( - "const mchar_t words[] = {{ {} }};\n".format( - ", ".join(str(ord(c)) for w in words for c in w) - ) - ) - f.write( - "const uint8_t wlencount[] = {{ {} }};\n".format(", ".join(str(p) for p in wlencount)) - ) - f.write("#define word_start {}\n".format(word_start)) - f.write("#define word_end {}\n".format(word_end)) - f.write("#define minlen {}\n".format(minlen)) - f.write("#define maxlen {}\n".format(maxlen)) - - return (values, lengths, words, canonical, extractor) - - -def decompress(encoding_table, encoded, encoded_length_bits): - (values, lengths, words, _, _) = encoding_table - dec = [] - this_byte = 0 - this_bit = 7 - b = encoded[this_byte] - bits = 0 - for i in range(encoded_length_bits): - bits <<= 1 - if 0x80 & b: - bits |= 1 - - b <<= 1 - if this_bit == 0: - this_bit = 7 - this_byte += 1 - if this_byte < len(encoded): - b = encoded[this_byte] - else: - this_bit -= 1 - length = bits - - i = 0 - while i < length: - bits = 0 - bit_length = 0 - max_code = lengths[0] - searched_length = lengths[0] - while True: - bits <<= 1 - if 0x80 & b: - bits |= 1 - - b <<= 1 - bit_length += 1 - if this_bit == 0: - this_bit = 7 - this_byte += 1 - if this_byte < len(encoded): - b = encoded[this_byte] - else: - this_bit -= 1 - if max_code > 0 and bits < max_code: - # print('{0:0{width}b}'.format(bits, width=bit_length)) - break - max_code = (max_code << 1) + lengths[bit_length] - searched_length += lengths[bit_length] - - v = values[searched_length + bits - max_code] - 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) - - -def compress(encoding_table, decompressed, encoded_length_bits, len_translation_encoded): - if not isinstance(decompressed, str): - raise TypeError() - (_, _, _, canonical, extractor) = encoding_table - - enc = bytearray(len(decompressed) * 3) - current_bit = 7 - current_byte = 0 - - 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 - current_byte += 1 - else: - current_bit -= 1 - - for atom in extractor.iter(decompressed): - for b in canonical[atom]: - if b == "1": - enc[current_byte] |= 1 << current_bit - if current_bit == 0: - current_bit = 7 - current_byte += 1 - else: - current_bit -= 1 - - if current_bit != 7: - current_byte += 1 - return enc[:current_byte] - - def qstr_escape(qst): def esc_char(m): c = ord(m.group(0)) @@ -694,7 +371,7 @@ def make_bytes(cfg_bytes_len, cfg_bytes_hash, qstr): return '%d, %d, "%s"' % (qhash, qlen, qdata) -def print_qstr_data(encoding_table, qcfgs, qstrs, i18ns): +def print_qstr_data(qcfgs, qstrs, i18ns): # get config variables cfg_bytes_len = int(qcfgs["BYTES_IN_LEN"]) cfg_bytes_hash = int(qcfgs["BYTES_IN_HASH"]) @@ -707,7 +384,6 @@ def print_qstr_data(encoding_table, qcfgs, qstrs, i18ns): print('QDEF(MP_QSTRnull, 0, 0, "")') total_qstr_size = 0 - total_qstr_compressed_size = 0 # go through each qstr and print it out for order, ident, qstr in sorted(qstrs.values(), key=lambda x: x[0]): qbytes = make_bytes(cfg_bytes_len, cfg_bytes_hash, qstr) @@ -715,34 +391,14 @@ def print_qstr_data(encoding_table, qcfgs, qstrs, i18ns): total_qstr_size += len(qstr) - total_text_size = 0 - total_text_compressed_size = 0 - max_translation_encoded_length = max( - len(translation.encode("utf-8")) for original, translation in i18ns + print( + "// Enumerate translated texts but don't actually include translations. Instead, the linker will link them in." ) - encoded_length_bits = max_translation_encoded_length.bit_length() - for original, translation in i18ns: - translation_encoded = translation.encode("utf-8") - compressed = compress( - encoding_table, translation, encoded_length_bits, len(translation_encoded) - ) - total_text_compressed_size += len(compressed) - decompressed = decompress(encoding_table, compressed, encoded_length_bits) - assert decompressed == translation - for c in C_ESCAPES: - decompressed = decompressed.replace(c, C_ESCAPES[c]) - print( - 'TRANSLATION("{}", {}) // {}'.format( - original, ", ".join(["{:d}".format(x) for x in compressed]), decompressed - ) - ) - total_text_size += len(translation.encode("utf-8")) + for i, original in enumerate(i18ns): + print('TRANSLATION("{}", {})'.format(original, i)) print() print("// {} bytes worth of qstr".format(total_qstr_size)) - print("// {} bytes worth of translations".format(total_text_size)) - print("// {} bytes worth of translations compressed".format(total_text_compressed_size)) - print("// {} bytes saved".format(total_text_size - total_text_compressed_size)) def print_qstr_enums(qstrs): @@ -768,19 +424,18 @@ if __name__ == "__main__": "infiles", metavar="N", type=str, nargs="+", help="an integer for the accumulator" ) parser.add_argument( - "--translation", default=None, type=str, help="translations for i18n() items" - ) - parser.add_argument( - "--compression_filename", default=None, type=str, help="header for compression info" + "--output_type", + default="enums", + type=str, + help="output definitions", + choices=("enums", "data"), ) args = parser.parse_args() qcfgs, qstrs, i18ns = parse_input_headers(args.infiles) - if args.translation: + if args.output_type == "data": i18ns = sorted(i18ns) - translations = translate(args.translation, i18ns) - encoding_table = compute_huffman_coding(translations, args.compression_filename) - print_qstr_data(encoding_table, qcfgs, qstrs, translations) + print_qstr_data(qcfgs, qstrs, i18ns) else: print_qstr_enums(qstrs) diff --git a/py/maketranslationdata.py b/py/maketranslationdata.py new file mode 100644 index 0000000000..07dd06c631 --- /dev/null +++ b/py/maketranslationdata.py @@ -0,0 +1,525 @@ +""" +Process raw qstr file and output qstr data with length, hash and data bytes. + +This script works with Python 2.7, 3.3 and 3.4. + +For documentation about the format of compressed translated strings, see +supervisor/shared/translate/translate.h +""" + +from __future__ import print_function + +import bisect +import re +import sys + +import collections +import gettext +import os.path + +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) + +sys.path.append(os.path.join(top, "tools/huffman")) + +import huffman + +# Python 2/3 compatibility: +# - iterating through bytes is different +# - codepoint2name lives in a different module +import platform + +if platform.python_version_tuple()[0] == "2": + bytes_cons = lambda val, enc=None: bytearray(val) + from htmlentitydefs import codepoint2name +elif platform.python_version_tuple()[0] == "3": + bytes_cons = bytes + from html.entities import codepoint2name +# end compatibility code + +codepoint2name[ord("-")] = "hyphen" + +# add some custom names to map characters that aren't in HTML +codepoint2name[ord(" ")] = "space" +codepoint2name[ord("'")] = "squot" +codepoint2name[ord(",")] = "comma" +codepoint2name[ord(".")] = "dot" +codepoint2name[ord(":")] = "colon" +codepoint2name[ord(";")] = "semicolon" +codepoint2name[ord("/")] = "slash" +codepoint2name[ord("%")] = "percent" +codepoint2name[ord("#")] = "hash" +codepoint2name[ord("(")] = "paren_open" +codepoint2name[ord(")")] = "paren_close" +codepoint2name[ord("[")] = "bracket_open" +codepoint2name[ord("]")] = "bracket_close" +codepoint2name[ord("{")] = "brace_open" +codepoint2name[ord("}")] = "brace_close" +codepoint2name[ord("*")] = "star" +codepoint2name[ord("!")] = "bang" +codepoint2name[ord("\\")] = "backslash" +codepoint2name[ord("+")] = "plus" +codepoint2name[ord("$")] = "dollar" +codepoint2name[ord("=")] = "equals" +codepoint2name[ord("?")] = "question" +codepoint2name[ord("@")] = "at_sign" +codepoint2name[ord("^")] = "caret" +codepoint2name[ord("|")] = "pipe" +codepoint2name[ord("~")] = "tilde" + +C_ESCAPES = { + "\a": "\\a", + "\b": "\\b", + "\f": "\\f", + "\n": "\\n", + "\r": "\\r", + "\t": "\\t", + "\v": "\\v", + "'": "\\'", + '"': '\\"', +} + +# this must match the equivalent function in qstr.c +def compute_hash(qstr, bytes_hash): + hash = 5381 + for b in qstr: + hash = (hash * 33) ^ b + # Make sure that valid hash is never zero, zero means "hash not computed" + return (hash & ((1 << (8 * bytes_hash)) - 1)) or 1 + + +def translate(translation_file, i18ns): + with open(translation_file, "rb") as f: + table = gettext.GNUTranslations(f) + + translations = [] + for original in i18ns: + unescaped = original + for s in C_ESCAPES: + unescaped = unescaped.replace(C_ESCAPES[s], s) + translation = table.gettext(unescaped) + # Add in carriage returns to work in terminals + translation = translation.replace("\n", "\r\n") + translations.append((original, translation)) + return translations + + +class TextSplitter: + def __init__(self, words): + words = sorted(words, key=lambda x: len(x), reverse=True) + self.words = set(words) + 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 = [] + words = self.words + for m in self.pat.finditer(text): + t = m.group(0) + if t in words: + if s: + yield (False, "".join(s)) + s = [] + yield (True, t) + else: + s.append(t) + if s: + yield (False, "".join(s)) + + def iter(self, text): + for m in self.pat.finditer(text): + yield m.group(0) + + +def iter_substrings(s, minlen, 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): + yield s[begin : begin + n] + + +def compute_huffman_coding(translations, f): + texts = [t[1] for t in translations] + words = [] + + start_unused = 0x80 + end_unused = 0xFF + max_ord = 0 + for text in texts: + for c in text: + ord_c = ord(c) + max_ord = max(ord_c, max_ord) + if 0x80 <= ord_c < 0xFF: + end_unused = min(ord_c, end_unused) + max_words = end_unused - 0x80 + + bits_per_codepoint = 16 if max_ord > 255 else 8 + values_type = "uint16_t" if max_ord > 255 else "uint8_t" + while len(words) < max_words: + # Until the dictionary is filled to capacity, use a heuristic to find + # the best "word" (2- to 11-gram) to add to it. + # + # 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: + for atom in extractor.iter(t): + counter[atom] += 1 + cb = huffman.codebook(counter.items()) + lengths = sorted(dict((v, len(cb[k])) for k, v in counter.items()).items()) + + def bit_length(s): + return sum(len(cb[c]) for c in s) + + def est_len(occ): + idx = bisect.bisect_left(lengths, (occ, 0)) + return lengths[idx][1] + 1 + + # The cost of adding a dictionary word is just its storage size + # while its savings is close to the difference between the original + # huffman bit-length of the string and the estimated bit-length + # of the dictionary word, times the number of times the word appears. + # + # The savings is not strictly accurate because including a word into + # the Huffman tree bumps up the encoding lengths of all words in the + # same subtree. In the extreme case when the new word is so frequent + # that it gets a one-bit encoding, all other words will cost an extra + # bit each. This is empirically modeled by the constant factor added to + # cost, but the specific value used isn't "proven" to be correct. + # + # Another source of inaccuracy is that compressed strings end up + # on byte boundaries, not bit boundaries, so saving 1 bit somewhere + # might not save a byte. + # + # In fact, when this change was first made, some translations (luckily, + # ones on boards not at all close to full) wasted up to 40 bytes, + # while the most constrained boards typically gained 100 bytes or + # more. + # + # The difference between the two is the estimated net savings, in bits. + def est_net_savings(s, occ): + savings = occ * (bit_length(s) - est_len(occ)) + cost = len(s) * bits_per_codepoint + 24 + return savings - cost + + 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=11): + counter[substr] += 1 + + # Score the candidates we found. This is a semi-empirical formula that + # attempts to model the number of bits saved as closely as possible. + # + # It attempts to compute the codeword lengths of the original word + # to the codeword length the dictionary entry would get, times + # the number of occurrences, less the ovehead of the entries in the + # words[] array. + + scores = sorted( + ((s, -est_net_savings(s, occ)) for (s, occ) in counter.items()), key=lambda x: x[1] + ) + + # Pick the one with the highest score. The score must be negative. + if not scores or scores[0][-1] >= 0: + break + + word = scores[0][0] + words.append(word) + + words.sort(key=len) + 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 = start_unused + word_end = word_start + len(words) - 1 + f.write(f"// # words {len(words)}\n") + f.write(f"// words {words}\n") + + values = [] + length_count = {} + renumbered = 0 + last_length = None + canonical = {} + for atom, code in sorted(cb.items(), key=lambda x: (len(x[1]), x[0])): + values.append(atom) + 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) + else: + s = C_ESCAPES.get(atom, atom) + o = ord(atom) + f.write(f"// {o} {s} {counter[atom]} {canonical[atom]} {renumbered}\n") + renumbered += 1 + last_length = length + lengths = bytearray() + f.write(f"// length count {length_count}\n") + + for i in range(1, max(length_count) + 2): + lengths.append(length_count.get(i, 0)) + f.write(f"// values {values} lengths {len(lengths)} {lengths}\n") + + f.write(f"// {values} {lengths}\n") + values = [(atom if len(atom) == 1 else chr(0x80 + words.index(atom))) for atom in values] + max_translation_encoded_length = max( + len(translation.encode("utf-8")) for (original, translation) in translations + ) + + maxlen = len(words[-1]) + minlen = len(words[0]) + wlencount = [len([None for w in words if len(w) == l]) for l in range(minlen, maxlen + 1)] + + f.write("typedef {} mchar_t;\n".format(values_type)) + f.write("const uint8_t lengths[] = {{ {} }};\n".format(", ".join(map(str, lengths)))) + f.write("const mchar_t values[] = {{ {} }};\n".format(", ".join(str(ord(u)) for u in values))) + f.write( + "#define compress_max_length_bits ({})\n".format( + max_translation_encoded_length.bit_length() + ) + ) + f.write( + "const mchar_t words[] = {{ {} }};\n".format( + ", ".join(str(ord(c)) for w in words for c in w) + ) + ) + f.write("const uint8_t wlencount[] = {{ {} }};\n".format(", ".join(str(p) for p in wlencount))) + f.write("#define word_start {}\n".format(word_start)) + f.write("#define word_end {}\n".format(word_end)) + f.write("#define minlen {}\n".format(minlen)) + f.write("#define maxlen {}\n".format(maxlen)) + + return (values, lengths, words, canonical, extractor) + + +def decompress(encoding_table, encoded, encoded_length_bits): + (values, lengths, words, _, _) = encoding_table + dec = [] + this_byte = 0 + this_bit = 7 + b = encoded[this_byte] + bits = 0 + for i in range(encoded_length_bits): + bits <<= 1 + if 0x80 & b: + bits |= 1 + + b <<= 1 + if this_bit == 0: + this_bit = 7 + this_byte += 1 + if this_byte < len(encoded): + b = encoded[this_byte] + else: + this_bit -= 1 + length = bits + + i = 0 + while i < length: + bits = 0 + bit_length = 0 + max_code = lengths[0] + searched_length = lengths[0] + while True: + bits <<= 1 + if 0x80 & b: + bits |= 1 + + b <<= 1 + bit_length += 1 + if this_bit == 0: + this_bit = 7 + this_byte += 1 + if this_byte < len(encoded): + b = encoded[this_byte] + else: + this_bit -= 1 + if max_code > 0 and bits < max_code: + # print('{0:0{width}b}'.format(bits, width=bit_length)) + break + max_code = (max_code << 1) + lengths[bit_length] + searched_length += lengths[bit_length] + + v = values[searched_length + bits - max_code] + 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) + + +def compress(encoding_table, decompressed, encoded_length_bits, len_translation_encoded): + if not isinstance(decompressed, str): + raise TypeError() + (_, _, _, canonical, extractor) = encoding_table + + enc = bytearray(len(decompressed) * 3) + current_bit = 7 + current_byte = 0 + + 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 + current_byte += 1 + else: + current_bit -= 1 + + for atom in extractor.iter(decompressed): + for b in canonical[atom]: + if b == "1": + enc[current_byte] |= 1 << current_bit + if current_bit == 0: + current_bit = 7 + current_byte += 1 + else: + current_bit -= 1 + + if current_bit != 7: + current_byte += 1 + return enc[:current_byte] + + +def qstr_escape(qst): + def esc_char(m): + c = ord(m.group(0)) + try: + name = codepoint2name[c] + except KeyError: + name = "0x%02x" % c + return "_" + name + "_" + + return re.sub(r"[^A-Za-z0-9_]", esc_char, qst) + + +def parse_input_headers(infiles): + i18ns = set() + + # read the qstrs in from the input files + for infile in infiles: + with open(infile, "rt") as f: + for line in f: + line = line.strip() + + match = re.match(r'^TRANSLATE\("(.*)"\)$', line) + if match: + i18ns.add(match.group(1)) + continue + + return i18ns + + +def escape_bytes(qstr): + if all(32 <= ord(c) <= 126 and c != "\\" and c != '"' for c in qstr): + # qstr is all printable ASCII so render it as-is (for easier debugging) + return qstr + else: + # qstr contains non-printable codes so render entire thing as hex pairs + qbytes = bytes_cons(qstr, "utf8") + return "".join(("\\x%02x" % b) for b in qbytes) + + +def make_bytes(cfg_bytes_len, cfg_bytes_hash, qstr): + qbytes = bytes_cons(qstr, "utf8") + qlen = len(qbytes) + qhash = compute_hash(qbytes, cfg_bytes_hash) + if qlen >= (1 << (8 * cfg_bytes_len)): + print("qstr is too long:", qstr) + assert False + qdata = escape_bytes(qstr) + return '%d, %d, "%s"' % (qhash, qlen, qdata) + + +def output_translation_data(encoding_table, i18ns, out): + # print out the starter of the generated C file + out.write("// This file was automatically generated by maketranslatedata.py\n") + out.write('#include "supervisor/shared/translate/compressed_string.h"\n') + out.write("\n") + + total_text_size = 0 + total_text_compressed_size = 0 + max_translation_encoded_length = max( + len(translation.encode("utf-8")) for original, translation in i18ns + ) + encoded_length_bits = max_translation_encoded_length.bit_length() + for i, translation in enumerate(i18ns): + original, translation = translation + translation_encoded = translation.encode("utf-8") + compressed = compress( + encoding_table, translation, encoded_length_bits, len(translation_encoded) + ) + total_text_compressed_size += len(compressed) + decompressed = decompress(encoding_table, compressed, encoded_length_bits) + assert decompressed == translation + for c in C_ESCAPES: + decompressed = decompressed.replace(c, C_ESCAPES[c]) + formatted = ["{:d}".format(x) for x in compressed] + out.write( + "const compressed_string_t translation{} = {{ .data = {}, .tail = {{ {} }} }}; // {}\n".format( + i, formatted[0], ", ".join(formatted[1:]), original, decompressed + ) + ) + total_text_size += len(translation.encode("utf-8")) + + out.write("\n") + out.write("// {} bytes worth of translations\n".format(total_text_size)) + out.write("// {} bytes worth of translations compressed\n".format(total_text_compressed_size)) + out.write("// {} bytes saved\n".format(total_text_size - total_text_compressed_size)) + + +if __name__ == "__main__": + import argparse + + parser = argparse.ArgumentParser( + description="Process QSTR definitions into headers for compilation" + ) + parser.add_argument( + "infiles", metavar="N", type=str, nargs="+", help="an integer for the accumulator" + ) + parser.add_argument( + "--translation", default=None, type=str, help="translations for i18n() items" + ) + parser.add_argument( + "--compression_filename", + type=argparse.FileType("w", encoding="UTF-8"), + help="header for compression info", + ) + parser.add_argument( + "--translation_filename", + type=argparse.FileType("w", encoding="UTF-8"), + help="c file for translation data", + ) + + args = parser.parse_args() + + i18ns = parse_input_headers(args.infiles) + i18ns = sorted(i18ns) + translations = translate(args.translation, i18ns) + encoding_table = compute_huffman_coding(translations, args.compression_filename) + output_translation_data(encoding_table, translations, args.translation_filename) diff --git a/py/py.mk b/py/py.mk index f1864e58b3..2d10358e47 100644 --- a/py/py.mk +++ b/py/py.mk @@ -252,19 +252,24 @@ $(HEADER_BUILD)/qstrdefs.preprocessed.h: $(PY_QSTR_DEFS) $(QSTR_DEFS) $(QSTR_DEF # qstr data $(HEADER_BUILD)/qstrdefs.enum.h: $(PY_SRC)/makeqstrdata.py $(HEADER_BUILD)/qstrdefs.preprocessed.h $(STEPECHO) "GEN $@" - $(Q)$(PYTHON) $(PY_SRC)/makeqstrdata.py $(HEADER_BUILD)/qstrdefs.preprocessed.h > $@ + $(Q)$(PYTHON) $(PY_SRC)/makeqstrdata.py --output_type=enums $(HEADER_BUILD)/qstrdefs.preprocessed.h > $@ # Adding an order only dependency on $(HEADER_BUILD) causes $(HEADER_BUILD) to get # created before we run the script to generate the .h # Note: we need to protect the qstr names from the preprocessor, so we wrap # the lines in "" and then unwrap after the preprocessor is finished. -$(HEADER_BUILD)/qstrdefs.generated.h: $(PY_SRC)/makeqstrdata.py $(HEADER_BUILD)/$(TRANSLATION).mo $(HEADER_BUILD)/qstrdefs.preprocessed.h +$(HEADER_BUILD)/qstrdefs.generated.h: $(PY_SRC)/makeqstrdata.py $(HEADER_BUILD)/qstrdefs.preprocessed.h $(STEPECHO) "GEN $@" - $(Q)$(PYTHON) $(PY_SRC)/makeqstrdata.py --compression_filename $(HEADER_BUILD)/compression.generated.h --translation $(HEADER_BUILD)/$(TRANSLATION).mo $(HEADER_BUILD)/qstrdefs.preprocessed.h > $@ + $(Q)$(PYTHON) $(PY_SRC)/makeqstrdata.py --output_type=data $(HEADER_BUILD)/qstrdefs.preprocessed.h > $@ + +$(PY_BUILD)/translations-$(TRANSLATION).c $(HEADER_BUILD)/compression.generated.h: $(PY_SRC)/maketranslationdata.py $(HEADER_BUILD)/$(TRANSLATION).mo $(HEADER_BUILD)/qstrdefs.preprocessed.h + $(STEPECHO) "GEN $@" + $(Q)$(PYTHON) $(PY_SRC)/maketranslationdata.py --compression_filename $(HEADER_BUILD)/compression.generated.h --translation $(HEADER_BUILD)/$(TRANSLATION).mo --translation_filename $(PY_BUILD)/translations-$(TRANSLATION).c $(HEADER_BUILD)/qstrdefs.preprocessed.h + +PY_O += $(PY_BUILD)/translations-$(TRANSLATION).o $(PY_BUILD)/qstr.o: $(HEADER_BUILD)/qstrdefs.generated.h - # build a list of registered modules for py/objmodule.c. $(HEADER_BUILD)/moduledefs.h: $(SRC_QSTR) $(QSTR_GLOBAL_DEPENDENCIES) | $(HEADER_BUILD)/mpversion.h @$(ECHO) "GEN $@" diff --git a/supervisor/shared/translate/translate_impl.h b/supervisor/shared/translate/translate_impl.h index acccfa4cd5..ff90aae525 100644 --- a/supervisor/shared/translate/translate_impl.h +++ b/supervisor/shared/translate/translate_impl.h @@ -32,6 +32,14 @@ #include "supervisor/shared/translate/compressed_string.h" +#ifndef NO_QSTR +#define QDEF(id, hash, len, str) +#define TRANSLATION(english_id, number) extern compressed_string_t translation##number; +#include "genhdr/qstrdefs.generated.h" +#undef TRANSLATION +#undef QDEF +#endif + #if CIRCUITPY_TRANSLATE_OBJECT == 0 static #endif @@ -43,7 +51,7 @@ __attribute__((always_inline)) const compressed_string_t *translate(const char *original) { #ifndef NO_QSTR #define QDEF(id, hash, len, str) - #define TRANSLATION(id, firstbyte, ...) if (strcmp(original, id) == 0) { static const compressed_string_t v = { .data = firstbyte, .tail = { __VA_ARGS__ } }; return &v; } else + #define TRANSLATION(english_id, number) if (strcmp(original, english_id) == 0) { return &translation##number; } else #include "genhdr/qstrdefs.generated.h" #undef TRANSLATION #undef QDEF diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index 5f4a65623f..9c78f420a8 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -190,7 +190,7 @@ endif USB_HIGHSPEED ?= 0 CFLAGS += -DUSB_HIGHSPEED=$(USB_HIGHSPEED) -$(BUILD)/supervisor/shared/translate.o: $(HEADER_BUILD)/qstrdefs.generated.h +$(BUILD)/supervisor/shared/translate/translate.o: $(HEADER_BUILD)/qstrdefs.generated.h $(HEADER_BUILD)/compression.generated.h CIRCUITPY_DISPLAY_FONT ?= "../../tools/fonts/ter-u12n.bdf" From 4f27337207a74351a4d85016428df815896c0efa Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 2 Jun 2022 21:24:56 +0200 Subject: [PATCH 196/246] Only check the savings if a word occurs at least twice Profiling shows that `est_net_savings` is one of the highest costs of the whole process. Approximately, you can save storage only if a word appears more than once, and doing this greatly reduces the number of `est_net_savings` calls. Locally, it reduces the time for this specific build step by 50% on ports/unix coverage build, without affecting the size of the generated binary. --- py/makeqstrdata.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/py/makeqstrdata.py b/py/makeqstrdata.py index 74ad78c47d..7222ded805 100644 --- a/py/makeqstrdata.py +++ b/py/makeqstrdata.py @@ -400,7 +400,8 @@ def compute_huffman_coding(translations, compression_filename): # words[] array. scores = sorted( - ((s, -est_net_savings(s, occ)) for (s, occ) in counter.items()), key=lambda x: x[1] + ((s, -est_net_savings(s, occ)) for (s, occ) in counter.items() if occ > 1), + key=lambda x: x[1], ) # Pick the one with the highest score. The score must be negative. From 36b4d49a78092550a8c5666c30e4a5fa3bce5d5c Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 2 Jun 2022 12:26:42 -0700 Subject: [PATCH 197/246] Fix display resources build qstrdefs.generated.h no longer includes the translated strings. So, use the .po file directly. --- supervisor/supervisor.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index 9c78f420a8..d5c49aa7fc 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -156,7 +156,7 @@ ifeq ($(CIRCUITPY_DISPLAYIO), 1) supervisor/shared/display.c ifeq ($(CIRCUITPY_TERMINALIO), 1) - SUPERVISOR_O += $(BUILD)/autogen_display_resources.o + SUPERVISOR_O += $(BUILD)/autogen_display_resources-$(TRANSLATION).o endif endif @@ -194,10 +194,10 @@ $(BUILD)/supervisor/shared/translate/translate.o: $(HEADER_BUILD)/qstrdefs.gener CIRCUITPY_DISPLAY_FONT ?= "../../tools/fonts/ter-u12n.bdf" -$(BUILD)/autogen_display_resources.c: ../../tools/gen_display_resources.py $(HEADER_BUILD)/qstrdefs.generated.h Makefile | $(HEADER_BUILD) +$(BUILD)/autogen_display_resources-$(TRANSLATION).c: ../../tools/gen_display_resources.py $(TOP)/locale/$(TRANSLATION).po Makefile | $(HEADER_BUILD) $(STEPECHO) "GEN $@" $(Q)install -d $(BUILD)/genhdr $(Q)$(PYTHON) ../../tools/gen_display_resources.py \ --font $(CIRCUITPY_DISPLAY_FONT) \ - --sample_file $(HEADER_BUILD)/qstrdefs.generated.h \ - --output_c_file $(BUILD)/autogen_display_resources.c + --sample_file $(TOP)/locale/$(TRANSLATION).po \ + --output_c_file $(BUILD)/autogen_display_resources-$(TRANSLATION).c From 0d257fc4f875d2e44e01abf7703ee124b4af8e66 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 2 Jun 2022 12:30:19 -0700 Subject: [PATCH 198/246] Fix mpy-cross and unix builds --- mpy-cross/mpy-cross.mk | 2 +- ports/unix/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mpy-cross/mpy-cross.mk b/mpy-cross/mpy-cross.mk index 0689322127..311b5239d1 100644 --- a/mpy-cross/mpy-cross.mk +++ b/mpy-cross/mpy-cross.mk @@ -78,6 +78,6 @@ endif OBJ = $(PY_CORE_O) OBJ += $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) -$(BUILD)/supervisor/shared/translate.o: $(HEADER_BUILD)/qstrdefs.generated.h +$(BUILD)/supervisor/shared/translate.o: $(HEADER_BUILD)/qstrdefs.generated.h $(HEADER_BUILD)/compression.generated.h include $(TOP)/py/mkrules.mk diff --git a/ports/unix/Makefile b/ports/unix/Makefile index c9a9289d42..cd72b45fe6 100644 --- a/ports/unix/Makefile +++ b/ports/unix/Makefile @@ -363,4 +363,4 @@ install: $(PROG) uninstall: -rm $(BINDIR)/$(PROG) -$(BUILD)/supervisor/shared/translate.o: $(HEADER_BUILD)/qstrdefs.generated.h +$(BUILD)/supervisor/shared/translate.o: $(HEADER_BUILD)/qstrdefs.generated.h $(HEADER_BUILD)/compression.generated.h From b6901078506de8cd468a9d8d3fe1623d3fe8b05d Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 2 Jun 2022 12:33:51 -0700 Subject: [PATCH 199/246] Fix mpy-cross again --- mpy-cross/mpy-cross.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpy-cross/mpy-cross.mk b/mpy-cross/mpy-cross.mk index 311b5239d1..452e2f3c1f 100644 --- a/mpy-cross/mpy-cross.mk +++ b/mpy-cross/mpy-cross.mk @@ -78,6 +78,6 @@ endif OBJ = $(PY_CORE_O) OBJ += $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) -$(BUILD)/supervisor/shared/translate.o: $(HEADER_BUILD)/qstrdefs.generated.h $(HEADER_BUILD)/compression.generated.h +$(BUILD)/supervisor/shared/translate/translate.o: $(HEADER_BUILD)/qstrdefs.generated.h $(HEADER_BUILD)/compression.generated.h include $(TOP)/py/mkrules.mk From 1d0546da313b27cd33f4788c7e351917b1c1a496 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Thu, 2 Jun 2022 16:31:39 -0500 Subject: [PATCH 200/246] Made tcp set arguments keywords --- shared-bindings/wifi/Radio.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index a0cf97c092..cb5090d0f4 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -414,17 +414,17 @@ MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ipv4_subnet_ap_obj, wifi_radio_get_ipv4 MP_PROPERTY_GETTER(wifi_radio_ipv4_subnet_ap_obj, (mp_obj_t)&wifi_radio_get_ipv4_subnet_ap_obj); -//| def set_ipv4_address(self, ipv4: ipaddress.IPv4Address, netmask: ipaddress.IPv4Address, gateway: ipaddress.IPv4Address, ipv4_dns: Optional[ipaddress.IPv4Address]) -> None: +//| def set_ipv4_address(self, *, ipv4: ipaddress.IPv4Address, netmask: ipaddress.IPv4Address, gateway: ipaddress.IPv4Address, ipv4_dns: Optional[ipaddress.IPv4Address]) -> None: //| """Sets the IP v4 address of the station. Must include the netmask and gateway. DNS address is optional. //| Setting the address manually will stop the DHCP client.""" //| ... STATIC mp_obj_t wifi_radio_set_ipv4_address(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_ipv4, ARG_netmask, ARG_gateway, ARG_ipv4_dns }; static const mp_arg_t allowed_args[] = { - { MP_QSTR_ipv4, MP_ARG_REQUIRED | MP_ARG_OBJ, }, - { MP_QSTR_netmask, MP_ARG_REQUIRED | MP_ARG_OBJ, }, - { MP_QSTR_gateway, MP_ARG_REQUIRED | MP_ARG_OBJ, }, - { MP_QSTR_ipv4_dns, MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, + { MP_QSTR_ipv4, MP_ARG_REQUIRED | MP_ARG_KW_ONLY | MP_ARG_OBJ, }, + { MP_QSTR_netmask, MP_ARG_REQUIRED | MP_ARG_KW_ONLY | MP_ARG_OBJ, }, + { MP_QSTR_gateway, MP_ARG_REQUIRED | MP_ARG_KW_ONLY | MP_ARG_OBJ, }, + { MP_QSTR_ipv4_dns, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = MP_OBJ_NULL} }, }; wifi_radio_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); @@ -434,7 +434,7 @@ STATIC mp_obj_t wifi_radio_set_ipv4_address(size_t n_args, const mp_obj_t *pos_a common_hal_wifi_radio_set_ipv4_address(self, args[ARG_ipv4].u_obj, args[ARG_netmask].u_obj, args[ARG_gateway].u_obj, args[ARG_ipv4_dns].u_obj); return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_KW(wifi_radio_set_ipv4_address_obj, 4, wifi_radio_set_ipv4_address); +STATIC MP_DEFINE_CONST_FUN_OBJ_KW(wifi_radio_set_ipv4_address_obj, 1, wifi_radio_set_ipv4_address); //| ipv4_address: Optional[ipaddress.IPv4Address] //| """IP v4 Address of the station when connected to an access point. None otherwise.""" From fdb133bbe8262ec72e469976b5c652f8d66364a3 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 2 Jun 2022 16:41:11 -0400 Subject: [PATCH 201/246] add adafruit_feather_esp32s3_4mbflash_2mbpsram --- .../board.c | 50 +++++++++++++ .../mpconfigboard.h | 45 ++++++++++++ .../mpconfigboard.mk | 22 ++++++ .../pins.c | 73 +++++++++++++++++++ .../sdkconfig | 47 ++++++++++++ 5 files changed, 237 insertions(+) create mode 100644 ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/board.c create mode 100644 ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.h create mode 100644 ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.mk create mode 100644 ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/pins.c create mode 100644 ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/sdkconfig diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/board.c b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/board.c new file mode 100644 index 0000000000..d4d55c2e23 --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/board.c @@ -0,0 +1,50 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "components/driver/include/driver/gpio.h" +#include "components/hal/include/hal/gpio_hal.h" +#include "common-hal/microcontroller/Pin.h" + +void board_init(void) { + reset_board(); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + // Turn on I2C power by default. + + gpio_set_direction(7, GPIO_MODE_DEF_OUTPUT); + gpio_set_level(7, true); +} + +void board_deinit(void) { +} diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.h b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.h new file mode 100644 index 0000000000..125d0440d5 --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/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 "Adafruit Feather ESP32S3 4MB Flash 2MB PSPRAM" +#define MICROPY_HW_MCU_NAME "ESP32S3" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO33) +#define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO21) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO4) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO3) + +#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_GPIO38) +#define DEFAULT_UART_BUS_TX (&pin_GPIO39) + +#define DOUBLE_TAP_PIN (&pin_GPIO34) diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.mk new file mode 100644 index 0000000000..c2785fba92 --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.mk @@ -0,0 +1,22 @@ +USB_VID = 0x239A +USB_PID = 0x811C +USB_PRODUCT = "Adafruit Feather ESP32S3 4MB Flash 2MB PSRAM" +USB_MANUFACTURER = "Adafruit" + +IDF_TARGET = esp32s3 + +# Make room for build +CIRCUITPY_ULAB = 0 + +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=4MB + +CIRCUITPY_MODULE=wrover diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/pins.c b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/pins.c new file mode 100644 index 0000000000..cf4c915e7f --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/pins.c @@ -0,0 +1,73 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_BOOT0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_I2C_POWER), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO14) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO15) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO16) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO33) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO35) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO37) }, + + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_GPIO38) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO39) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) } +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/sdkconfig b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/sdkconfig new file mode 100644 index 0000000000..9a05ab0205 --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/sdkconfig @@ -0,0 +1,47 @@ +# +# Component config +# +# +# ESP32S3-Specific +# +CONFIG_ESP32S3_SPIRAM_SUPPORT=y +# +# SPI RAM config +# +CONFIG_SPIRAM_MODE_QUAD=y +# CONFIG_SPIRAM_MODE_OCT is not set +CONFIG_SPIRAM_TYPE_AUTO=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +CONFIG_SPIRAM_SIZE=2097152 +# +# PSRAM Clock and CS IO for ESP32S3 +# +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +CONFIG_DEFAULT_PSRAM_CS_IO=26 +# end of PSRAM Clock and CS IO for ESP32S3 + +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_SPEED_120M is not set +CONFIG_SPIRAM_SPEED_80M=y +# CONFIG_SPIRAM_SPEED_40M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# end of SPI RAM config + +# end of ESP32S3-Specific + +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="espressif-esp32s3" +# end of LWIP + +# end of Component config From 963861d0b6b64a1326c0043d4422f71f9eb6cb71 Mon Sep 17 00:00:00 2001 From: ajs256 Date: Thu, 2 Jun 2022 04:53:36 +0000 Subject: [PATCH 202/246] Translated using Weblate (French) Currently translated at 95.5% (939 of 983 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/fr/ --- locale/fr.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index ce77777225..94aa8879de 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: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-06-02 04:53+0000\n" +"PO-Revision-Date: 2022-06-03 01:35+0000\n" "Last-Translator: ajs256 \n" "Language: fr\n" "MIME-Version: 1.0\n" @@ -147,7 +147,7 @@ msgstr "%q doit être %d-%d" #: shared-bindings/displayio/Display.c msgid "%q must be 1 when %q is True" -msgstr "%q doit être à 1 alors que %q est True" +msgstr "%q doit être 1 quand %q est True" #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" From 113b070e77041e738206c63bf0c7105ff947296c Mon Sep 17 00:00:00 2001 From: Matthew McGowan Date: Fri, 3 Jun 2022 14:19:47 -0700 Subject: [PATCH 203/246] fix(swan_r5): 3v3 was enabled but then immediately reset. Moved initialization to `reset_board` which happens after `reset_all_pins`. --- ports/stm/boards/swan_r5/board.c | 3 +-- ports/stm/boards/swan_r5/mpconfigboard.h | 3 +++ ports/stm/boards/swan_r5/pins.c | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ports/stm/boards/swan_r5/board.c b/ports/stm/boards/swan_r5/board.c index 36f3946236..bb424eea0b 100644 --- a/ports/stm/boards/swan_r5/board.c +++ b/ports/stm/boards/swan_r5/board.c @@ -59,8 +59,6 @@ void board_init(void) { // Without this, USB does not function. HAL_InitTick((1UL << __NVIC_PRIO_BITS) - 1UL); - initialize_discharge_pin(); - __HAL_RCC_GPIOE_CLK_ENABLE(); GPIO_InitTypeDef GPIO_InitStruct; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; @@ -78,6 +76,7 @@ bool board_requests_safe_mode(void) { } void reset_board(void) { + initialize_discharge_pin(); } void board_deinit(void) { diff --git a/ports/stm/boards/swan_r5/mpconfigboard.h b/ports/stm/boards/swan_r5/mpconfigboard.h index da07d6530b..e82b8ab3d2 100644 --- a/ports/stm/boards/swan_r5/mpconfigboard.h +++ b/ports/stm/boards/swan_r5/mpconfigboard.h @@ -64,3 +64,6 @@ #define DEFAULT_UART_BUS_RX (&pin_PA10) #define DEFAULT_UART_BUS_TX (&pin_PA09) + +#define SWAN_R5_DISCHARGE_3V3 (&pin_PE06) +#define SWAN_R5_ENABLE_3V3 (&pin_PE04) \ No newline at end of file diff --git a/ports/stm/boards/swan_r5/pins.c b/ports/stm/boards/swan_r5/pins.c index 6780795dee..7032eae4c4 100644 --- a/ports/stm/boards/swan_r5/pins.c +++ b/ports/stm/boards/swan_r5/pins.c @@ -86,8 +86,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_ext), MP_ROM_PTR(&carrier_type) }, - { MP_ROM_QSTR(MP_QSTR_ENABLE_3V3), MP_ROM_PTR(&pin_PE04) }, - { MP_ROM_QSTR(MP_QSTR_DISCHARGE_3V3), MP_ROM_PTR(&pin_PE06) }, + { MP_ROM_QSTR(MP_QSTR_ENABLE_3V3), MP_ROM_PTR(SWAN_R5_ENABLE_3V3) }, + { MP_ROM_QSTR(MP_QSTR_DISCHARGE_3V3), MP_ROM_PTR(SWAN_R5_DISCHARGE_3V3) }, { MP_ROM_QSTR(MP_QSTR_DISABLE_DISCHARGING), MP_ROM_TRUE }, { MP_ROM_QSTR(MP_QSTR_ENABLE_DISCHARGING), MP_ROM_FALSE }, From 87f4cd6bcaacc3f0d5d32dd8f069fb111790b675 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Fri, 3 Jun 2022 16:21:50 -0500 Subject: [PATCH 204/246] return expression instead of if statement Co-authored-by: Scott Shawcroft --- shared-module/displayio/TileGrid.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/shared-module/displayio/TileGrid.c b/shared-module/displayio/TileGrid.c index 5f347420ac..3fd4c99d44 100644 --- a/shared-module/displayio/TileGrid.c +++ b/shared-module/displayio/TileGrid.c @@ -345,12 +345,8 @@ void common_hal_displayio_tilegrid_set_transpose_xy(displayio_tilegrid_t *self, bool common_hal_displayio_tilegrid_contains(displayio_tilegrid_t *self, uint16_t x, uint16_t y) { uint16_t right_edge = self->x + (self->width_in_tiles * self->tile_width); uint16_t bottom_edge = self->y + (self->height_in_tiles * self->tile_height); - if (x >= self->x && x <= right_edge && - y >= self->y && y <= bottom_edge) { - return true; - } else { - return false; - } + return x >= self->x && x <= right_edge && + y >= self->y && y <= bottom_edge; } void common_hal_displayio_tilegrid_set_top_left(displayio_tilegrid_t *self, uint16_t x, uint16_t y) { From bc0fdaa026e2c8164a149c8337df7e0d6fb33cee Mon Sep 17 00:00:00 2001 From: foamyguy Date: Fri, 3 Jun 2022 17:01:24 -0500 Subject: [PATCH 205/246] fix tilegrid.contains() docstring --- shared-bindings/displayio/TileGrid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/displayio/TileGrid.c b/shared-bindings/displayio/TileGrid.c index 5d7db650e0..89010674f9 100644 --- a/shared-bindings/displayio/TileGrid.c +++ b/shared-bindings/displayio/TileGrid.c @@ -323,8 +323,8 @@ MP_PROPERTY_GETSET(displayio_tilegrid_transpose_xy_obj, (mp_obj_t)&displayio_tilegrid_set_transpose_xy_obj); //| def contains(self, touch_tuple: tuple) -> bool: -//| """returns true if first two values in touch_tuple represent an x,y coordinate -//| inside the tilegrid rectangle bounds""" +//| """Returns True if the first two values in ``touch_tuple`` represent an x,y coordinate +//| inside the tilegrid rectangle bounds.""" //| STATIC mp_obj_t displayio_tilegrid_obj_contains(mp_obj_t self_in, mp_obj_t touch_tuple) { displayio_tilegrid_t *self = MP_OBJ_TO_PTR(self_in); From 6831dd8aaa92238b6edec45839f99abc571e6ea4 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Fri, 3 Jun 2022 17:04:53 -0500 Subject: [PATCH 206/246] return expression formatting --- shared-module/displayio/TileGrid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/displayio/TileGrid.c b/shared-module/displayio/TileGrid.c index 3fd4c99d44..dde398109f 100644 --- a/shared-module/displayio/TileGrid.c +++ b/shared-module/displayio/TileGrid.c @@ -346,7 +346,7 @@ bool common_hal_displayio_tilegrid_contains(displayio_tilegrid_t *self, uint16_t uint16_t right_edge = self->x + (self->width_in_tiles * self->tile_width); uint16_t bottom_edge = self->y + (self->height_in_tiles * self->tile_height); return x >= self->x && x <= right_edge && - y >= self->y && y <= bottom_edge; + y >= self->y && y <= bottom_edge; } void common_hal_displayio_tilegrid_set_top_left(displayio_tilegrid_t *self, uint16_t x, uint16_t y) { From 8ccb95547540ee8d07b95d603138f562ca093bd0 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 3 Jun 2022 15:06:58 -0700 Subject: [PATCH 207/246] Move translation .o to PY_CORE_O --- py/py.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/py.mk b/py/py.mk index 2d10358e47..6827fbe786 100644 --- a/py/py.mk +++ b/py/py.mk @@ -266,7 +266,7 @@ $(PY_BUILD)/translations-$(TRANSLATION).c $(HEADER_BUILD)/compression.generated. $(STEPECHO) "GEN $@" $(Q)$(PYTHON) $(PY_SRC)/maketranslationdata.py --compression_filename $(HEADER_BUILD)/compression.generated.h --translation $(HEADER_BUILD)/$(TRANSLATION).mo --translation_filename $(PY_BUILD)/translations-$(TRANSLATION).c $(HEADER_BUILD)/qstrdefs.preprocessed.h -PY_O += $(PY_BUILD)/translations-$(TRANSLATION).o +PY_CORE_O += $(PY_BUILD)/translations-$(TRANSLATION).o $(PY_BUILD)/qstr.o: $(HEADER_BUILD)/qstrdefs.generated.h From 78e4b9446b822b13bd6a52af9a907486966f3689 Mon Sep 17 00:00:00 2001 From: Matthew McGowan Date: Fri, 3 Jun 2022 15:12:41 -0700 Subject: [PATCH 208/246] chore(swan_r5): pre-commit formatting --- ports/stm/boards/swan_r5/mpconfigboard.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/stm/boards/swan_r5/mpconfigboard.h b/ports/stm/boards/swan_r5/mpconfigboard.h index e82b8ab3d2..94cc58ff9d 100644 --- a/ports/stm/boards/swan_r5/mpconfigboard.h +++ b/ports/stm/boards/swan_r5/mpconfigboard.h @@ -66,4 +66,4 @@ #define DEFAULT_UART_BUS_TX (&pin_PA09) #define SWAN_R5_DISCHARGE_3V3 (&pin_PE06) -#define SWAN_R5_ENABLE_3V3 (&pin_PE04) \ No newline at end of file +#define SWAN_R5_ENABLE_3V3 (&pin_PE04) From d1cdb7202000b8aae0d03cefb7cea3201ef6dd90 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 3 Jun 2022 18:21:20 -0400 Subject: [PATCH 209/246] Update ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.h Co-authored-by: Scott Shawcroft --- .../adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.h b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.h index 125d0440d5..da623f73be 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.h +++ b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.h @@ -26,7 +26,7 @@ // Micropython setup -#define MICROPY_HW_BOARD_NAME "Adafruit Feather ESP32S3 4MB Flash 2MB PSPRAM" +#define MICROPY_HW_BOARD_NAME "Adafruit Feather ESP32S3 4MB Flash 2MB PSRAM" #define MICROPY_HW_MCU_NAME "ESP32S3" #define MICROPY_HW_NEOPIXEL (&pin_GPIO33) From c9c864a4f7cab0ad32fd6bc758fc663c33651e59 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Fri, 3 Jun 2022 17:51:33 -0500 Subject: [PATCH 210/246] fix off by one right and bottom edges of tilegrid.contains() --- shared-module/displayio/TileGrid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-module/displayio/TileGrid.c b/shared-module/displayio/TileGrid.c index dde398109f..36cbf76619 100644 --- a/shared-module/displayio/TileGrid.c +++ b/shared-module/displayio/TileGrid.c @@ -345,8 +345,8 @@ void common_hal_displayio_tilegrid_set_transpose_xy(displayio_tilegrid_t *self, bool common_hal_displayio_tilegrid_contains(displayio_tilegrid_t *self, uint16_t x, uint16_t y) { uint16_t right_edge = self->x + (self->width_in_tiles * self->tile_width); uint16_t bottom_edge = self->y + (self->height_in_tiles * self->tile_height); - return x >= self->x && x <= right_edge && - y >= self->y && y <= bottom_edge; + return x >= self->x && x < right_edge && + y >= self->y && y < bottom_edge; } void common_hal_displayio_tilegrid_set_top_left(displayio_tilegrid_t *self, uint16_t x, uint16_t y) { From be6936c8ec6028943b18940e2c34d06b293b2a98 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 3 Jun 2022 18:57:01 -0700 Subject: [PATCH 211/246] Shrink MatrixPortal M4 build --- ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk b/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk index fdedf9bc9b..3a1d417626 100644 --- a/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk @@ -10,6 +10,8 @@ QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICES = "S25FL116K, S25FL216K, GD25Q16C" LONGINT_IMPL = MPZ +CIRCUITPY_LTO_PARTITION = one + CIRCUITPY_AESIO = 0 CIRCUITPY_ONEWIREIO = 0 CIRCUITPY_PARALLELDISPLAY = 0 From 761e66e85b76eef2df59f3e962bc0b102a57e2d6 Mon Sep 17 00:00:00 2001 From: Nathan Young <77929198+NathanY3G@users.noreply.github.com> Date: Sat, 4 Jun 2022 15:21:06 +0200 Subject: [PATCH 212/246] Enable UF2 builds for STM32 Thing Plus --- tools/build_board_info.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/build_board_info.py b/tools/build_board_info.py index 1534288b04..b86e6dd4ba 100755 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -69,6 +69,7 @@ extension_by_board = { "microbit_v2": COMBINED_HEX, # stm32 "meowbit_v121": UF2, + "sparkfun_stm32_thing_plus": BIN_UF2, # esp32c3 "adafruit_qtpy_esp32c3": BIN, "ai_thinker_esp32-c3s": BIN, From cbff9dd8e3cd590a26239814e7ec543c0936ef37 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Sat, 4 Jun 2022 11:08:20 -0500 Subject: [PATCH 213/246] add new argument for all boards with built-in display --- ports/atmel-samd/boards/hallowing_m0_express/board.c | 3 ++- ports/atmel-samd/boards/hallowing_m4_express/board.c | 3 ++- ports/atmel-samd/boards/monster_m4sk/board.c | 3 ++- ports/atmel-samd/boards/pewpew_lcd/board.c | 3 ++- ports/atmel-samd/boards/pewpew_m4/board.c | 3 ++- ports/atmel-samd/boards/pybadge/board.c | 3 ++- ports/atmel-samd/boards/pygamer/board.c | 3 ++- ports/atmel-samd/boards/pyportal/board.c | 3 ++- ports/atmel-samd/boards/seeeduino_wio_terminal/board.c | 3 ++- ports/atmel-samd/boards/ugame10/board.c | 3 ++- ports/espressif/boards/adafruit_esp32s2_camera/board.c | 3 ++- ports/espressif/boards/adafruit_feather_esp32s2_tft/board.c | 3 ++- .../boards/adafruit_feather_esp32s2_tftback_nopsram/board.c | 3 ++- ports/espressif/boards/adafruit_funhouse/board.c | 3 ++- ports/espressif/boards/espressif_esp32s3_box/board.c | 3 ++- ports/espressif/boards/espressif_esp32s3_usb_otg_n8/board.c | 3 ++- ports/espressif/boards/hexky_s2/board.c | 3 ++- ports/espressif/boards/hiibot_iots2/board.c | 3 ++- ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/board.c | 3 ++- ports/espressif/boards/morpheans_morphesp-240/board.c | 3 ++- ports/nrf/boards/clue_nrf52840_express/board.c | 3 ++- ports/nrf/boards/hiibot_bluefi/board.c | 3 ++- ports/nrf/boards/makerdiary_nrf52840_m2_devkit/board.c | 3 ++- ports/nrf/boards/ohs2020_badge/board.c | 3 ++- ports/raspberrypi/boards/adafruit_macropad_rp2040/board.c | 3 ++- ports/raspberrypi/boards/pimoroni_picosystem/board.c | 3 ++- ports/stm/boards/meowbit_v121/board.c | 3 ++- 27 files changed, 54 insertions(+), 27 deletions(-) diff --git a/ports/atmel-samd/boards/hallowing_m0_express/board.c b/ports/atmel-samd/boards/hallowing_m0_express/board.c index aace060b01..5a6b43e475 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/board.c +++ b/ports/atmel-samd/boards/hallowing_m0_express/board.c @@ -111,7 +111,8 @@ void board_init(void) { true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // not SH1107 + false, // not SH1107 + 50000); // backlight pwm frequency } 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 358c326b62..d17835d0f8 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) { true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // not SH1107 + false, // not SH1107 + 50000); // backlight pwm frequency } 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 e4e5da3ea5..e42721dee7 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) { true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // SH1107_addressing + false, // SH1107_addressing + 50000); // backlight pwm frequency } bool board_requests_safe_mode(void) { diff --git a/ports/atmel-samd/boards/pewpew_lcd/board.c b/ports/atmel-samd/boards/pewpew_lcd/board.c index 8198a3c83d..7f5cac5241 100644 --- a/ports/atmel-samd/boards/pewpew_lcd/board.c +++ b/ports/atmel-samd/boards/pewpew_lcd/board.c @@ -90,7 +90,8 @@ void board_init(void) { true, // auto_refresh 2, // native_frames_per_second true, // backlight_on_high - true); // SH1107_addressing + true, // SH1107_addressing + 50000); // backlight pwm frequency } 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 50f829fa88..331056fb9f 100644 --- a/ports/atmel-samd/boards/pewpew_m4/board.c +++ b/ports/atmel-samd/boards/pewpew_m4/board.c @@ -144,7 +144,8 @@ void board_init(void) { false, // auto_refresh 20, // native_frames_per_second true, // backlight_on_high - false); // SH1107_addressing + false, // SH1107_addressing + 50000); // backlight pwm frequency } 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 ce5beb6bc3..b7646cabe1 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) { true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // SH1107_addressing + false, // SH1107_addressing + 50000); // backlight pwm frequency } 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 9a85e166c4..a9041de305 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) { true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // SH1107_addressing + false, // SH1107_addressing + 50000); // backlight pwm frequency } 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 262850cbf2..8176d363c9 100644 --- a/ports/atmel-samd/boards/pyportal/board.c +++ b/ports/atmel-samd/boards/pyportal/board.c @@ -101,7 +101,8 @@ void board_init(void) { true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // SH1107_addressing + false, // SH1107_addressing + 50000); // backlight pwm frequency } 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 62b2299f56..4a25ed64ec 100644 --- a/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c @@ -109,7 +109,8 @@ void board_init(void) { true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // SH1107_addressing + false, // SH1107_addressing + 50000); // backlight pwm frequency // Enabling the Power of the 40-pin at the back CTR_5V.base.type = &digitalio_digitalinout_type; diff --git a/ports/atmel-samd/boards/ugame10/board.c b/ports/atmel-samd/boards/ugame10/board.c index d75841be54..53bc613088 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) { true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // SH1107_addressing + false, // SH1107_addressing + 50000); // backlight pwm frequency } bool board_requests_safe_mode(void) { diff --git a/ports/espressif/boards/adafruit_esp32s2_camera/board.c b/ports/espressif/boards/adafruit_esp32s2_camera/board.c index 109e9b4b9a..23a2eb7a34 100644 --- a/ports/espressif/boards/adafruit_esp32s2_camera/board.c +++ b/ports/espressif/boards/adafruit_esp32s2_camera/board.c @@ -96,7 +96,8 @@ void board_init(void) { true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // not SH1107 + false, // not SH1107 + 50000); // backlight pwm frequency } bool board_requests_safe_mode(void) { diff --git a/ports/espressif/boards/adafruit_feather_esp32s2_tft/board.c b/ports/espressif/boards/adafruit_feather_esp32s2_tft/board.c index 46f1fbd31c..aab7fbc608 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2_tft/board.c +++ b/ports/espressif/boards/adafruit_feather_esp32s2_tft/board.c @@ -125,7 +125,8 @@ void board_init(void) { true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false // SH1107_addressing + false, // SH1107_addressing + 50000 // backlight pwm frequency ); common_hal_never_reset_pin(&pin_GPIO45); // backlight pin diff --git a/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/board.c b/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/board.c index 71b381616f..04b6a46779 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/board.c +++ b/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/board.c @@ -101,7 +101,8 @@ void board_init(void) { true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // not SH1107 + false, // not SH1107 + 50000); // backlight pwm frequency */ } diff --git a/ports/espressif/boards/adafruit_funhouse/board.c b/ports/espressif/boards/adafruit_funhouse/board.c index 03e967148c..8b4adc5fa9 100644 --- a/ports/espressif/boards/adafruit_funhouse/board.c +++ b/ports/espressif/boards/adafruit_funhouse/board.c @@ -104,7 +104,8 @@ void board_init(void) { true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // not SH1107 + false, // not SH1107 + 50000); // backlight pwm frequency } bool board_requests_safe_mode(void) { diff --git a/ports/espressif/boards/espressif_esp32s3_box/board.c b/ports/espressif/boards/espressif_esp32s3_box/board.c index 8e93c31e07..7eb4c6b20c 100644 --- a/ports/espressif/boards/espressif_esp32s3_box/board.c +++ b/ports/espressif/boards/espressif_esp32s3_box/board.c @@ -87,7 +87,8 @@ void board_init(void) { true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // SH1107_addressing + false, // SH1107_addressing + 50000); // backlight pwm frequency // Debug UART #ifdef DEBUG diff --git a/ports/espressif/boards/espressif_esp32s3_usb_otg_n8/board.c b/ports/espressif/boards/espressif_esp32s3_usb_otg_n8/board.c index edb8e6a994..0cfedf9933 100644 --- a/ports/espressif/boards/espressif_esp32s3_usb_otg_n8/board.c +++ b/ports/espressif/boards/espressif_esp32s3_usb_otg_n8/board.c @@ -115,7 +115,8 @@ void board_init(void) { true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // SH1107_addressing + false, // SH1107_addressing + 50000); // backlight pwm frequency } bool espressif_board_reset_pin_number(gpio_num_t pin_number) { diff --git a/ports/espressif/boards/hexky_s2/board.c b/ports/espressif/boards/hexky_s2/board.c index 88ac4fc661..584253488b 100644 --- a/ports/espressif/boards/hexky_s2/board.c +++ b/ports/espressif/boards/hexky_s2/board.c @@ -119,7 +119,8 @@ void board_init(void) { true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false // SH1107_addressing + false, // SH1107_addressing + 50000 // backlight pwm frequency ); common_hal_never_reset_pin(&pin_GPIO45); // backlight pin diff --git a/ports/espressif/boards/hiibot_iots2/board.c b/ports/espressif/boards/hiibot_iots2/board.c index 23ba71ed7e..e65401deda 100644 --- a/ports/espressif/boards/hiibot_iots2/board.c +++ b/ports/espressif/boards/hiibot_iots2/board.c @@ -124,7 +124,8 @@ static void display_init(void) { true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false // SH1107_addressing + false, // SH1107_addressing + 50000 // backlight pwm frequency ); common_hal_never_reset_pin(&pin_GPIO38); // backlight pin diff --git a/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/board.c b/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/board.c index 492c3f8f4d..8f0d01fe79 100644 --- a/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/board.c +++ b/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/board.c @@ -124,7 +124,8 @@ static void display_init(void) { true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false // SH1107_addressing + false, // SH1107_addressing + 50000 // backlight pwm frequency ); common_hal_never_reset_pin(&pin_GPIO33); // backlight pin diff --git a/ports/espressif/boards/morpheans_morphesp-240/board.c b/ports/espressif/boards/morpheans_morphesp-240/board.c index b15562de38..54e83eaaab 100644 --- a/ports/espressif/boards/morpheans_morphesp-240/board.c +++ b/ports/espressif/boards/morpheans_morphesp-240/board.c @@ -205,7 +205,8 @@ void board_init(void) { true, // auto_refresh 60, // native_frames_per_second false, // backlight_on_high - false // SH1107_addressing + false, // SH1107_addressing + 50000 // backlight pwm frequency ); } diff --git a/ports/nrf/boards/clue_nrf52840_express/board.c b/ports/nrf/boards/clue_nrf52840_express/board.c index f2e648f473..549b3a54ca 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) { true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // not SH1107 + false, // not SH1107 + 50000); // backlight pwm frequency } 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 9616596caa..6ee4292e70 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) { true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // SH1107_addressing + false, // SH1107_addressing + 50000); // backlight pwm frequency } 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 87c9b2f226..db65ecbbd2 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) { true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // SH1107_addressing + false, // SH1107_addressing + 50000); // backlight pwm frequency } 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 dd0a9b2547..14f1467c79 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) { true, // auto_refresh 60, // native_frames_per_second false, // backlight_on_high - false); // SH1107_addressing + false, // SH1107_addressing + 50000); // backlight pwm frequency } bool board_requests_safe_mode(void) { diff --git a/ports/raspberrypi/boards/adafruit_macropad_rp2040/board.c b/ports/raspberrypi/boards/adafruit_macropad_rp2040/board.c index 7b00ff7ecc..7aa9feee1b 100644 --- a/ports/raspberrypi/boards/adafruit_macropad_rp2040/board.c +++ b/ports/raspberrypi/boards/adafruit_macropad_rp2040/board.c @@ -103,7 +103,8 @@ void board_init(void) { true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - true); // SH1107_addressing + true, // SH1107_addressing + 50000); // backlight pwm frequency } bool board_requests_safe_mode(void) { diff --git a/ports/raspberrypi/boards/pimoroni_picosystem/board.c b/ports/raspberrypi/boards/pimoroni_picosystem/board.c index e8458e90d9..0a07f3b0dd 100644 --- a/ports/raspberrypi/boards/pimoroni_picosystem/board.c +++ b/ports/raspberrypi/boards/pimoroni_picosystem/board.c @@ -108,7 +108,8 @@ void board_init(void) { true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // SH1107_addressing + false, // SH1107_addressing + 50000); // backlight pwm frequency } void board_deinit(void) { diff --git a/ports/stm/boards/meowbit_v121/board.c b/ports/stm/boards/meowbit_v121/board.c index 59ba948237..95d9139998 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) { true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // SH1107_addressing + false, // SH1107_addressing + 50000); // backlight pwm frequency board_buzz_obj.base.type = &audiopwmio_pwmaudioout_type; common_hal_audiopwmio_pwmaudioout_construct(&board_buzz_obj, From 67de89861e5834e5adfa40090d6f3de0675d3b52 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Sat, 4 Jun 2022 11:36:45 -0500 Subject: [PATCH 214/246] new argument for feather s3 tft display init --- ports/espressif/boards/adafruit_feather_esp32s3_tft/board.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_tft/board.c b/ports/espressif/boards/adafruit_feather_esp32s3_tft/board.c index 46f1fbd31c..aab7fbc608 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s3_tft/board.c +++ b/ports/espressif/boards/adafruit_feather_esp32s3_tft/board.c @@ -125,7 +125,8 @@ void board_init(void) { true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false // SH1107_addressing + false, // SH1107_addressing + 50000 // backlight pwm frequency ); common_hal_never_reset_pin(&pin_GPIO45); // backlight pin From 7a073317f7a3a7257391624cecfa5509291f9518 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 6 Jun 2022 01:03:02 +0200 Subject: [PATCH 215/246] Update PID (0x102E) --- ports/raspberrypi/boards/weact_studio_pico/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/raspberrypi/boards/weact_studio_pico/mpconfigboard.mk b/ports/raspberrypi/boards/weact_studio_pico/mpconfigboard.mk index 358928a9ac..73f3676825 100644 --- a/ports/raspberrypi/boards/weact_studio_pico/mpconfigboard.mk +++ b/ports/raspberrypi/boards/weact_studio_pico/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x239A -USB_PID = 0x000B +USB_PID = 0x102E USB_PRODUCT = "Pico" USB_MANUFACTURER = "WeAct Studio" From 2f0d82a50ba16300dff596f6ddc7c957f803179a Mon Sep 17 00:00:00 2001 From: Nathan Young <77929198+NathanY3G@users.noreply.github.com> Date: Mon, 6 Jun 2022 09:52:23 +0200 Subject: [PATCH 216/246] Disable board.SPI() for Challenger NB RP2040 WiFi This was done as a result of an issue with the SPI pin mappings. Please refer to the following for additional information: https://ilabs.se/challenger-rp2040-wifi-spi-bug --- .../boards/challenger_nb_rp2040_wifi/mpconfigboard.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/ports/raspberrypi/boards/challenger_nb_rp2040_wifi/mpconfigboard.h b/ports/raspberrypi/boards/challenger_nb_rp2040_wifi/mpconfigboard.h index 013b8e9276..a3f79af481 100644 --- a/ports/raspberrypi/boards/challenger_nb_rp2040_wifi/mpconfigboard.h +++ b/ports/raspberrypi/boards/challenger_nb_rp2040_wifi/mpconfigboard.h @@ -5,6 +5,3 @@ #define DEFAULT_UART_BUS_RX (&pin_GPIO17) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO0) #define DEFAULT_I2C_BUS_SCL (&pin_GPIO1) -#define DEFAULT_SPI_BUS_SCK (&pin_GPIO22) -#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO23) -#define DEFAULT_SPI_BUS_MISO (&pin_GPIO24) From 6b09f99eaa1930505c5d9149ca0ddc48a0007a92 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 6 Jun 2022 10:35:37 -0700 Subject: [PATCH 217/246] Add back ULAB --- .../mpconfigboard.mk | 3 --- 1 file changed, 3 deletions(-) diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.mk index c2785fba92..22175fce5d 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.mk @@ -5,9 +5,6 @@ USB_MANUFACTURER = "Adafruit" IDF_TARGET = esp32s3 -# Make room for build -CIRCUITPY_ULAB = 0 - INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ From 0a3808807510eea8d8aef6199587f198a307b3cd Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 7 Jun 2022 07:35:54 +0200 Subject: [PATCH 218/246] Fix dependencies for translate.c again --- ports/unix/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/unix/Makefile b/ports/unix/Makefile index cd72b45fe6..ae293fcb7d 100644 --- a/ports/unix/Makefile +++ b/ports/unix/Makefile @@ -363,4 +363,4 @@ install: $(PROG) uninstall: -rm $(BINDIR)/$(PROG) -$(BUILD)/supervisor/shared/translate.o: $(HEADER_BUILD)/qstrdefs.generated.h $(HEADER_BUILD)/compression.generated.h +$(BUILD)/supervisor/shared/translate/translate.o: $(HEADER_BUILD)/qstrdefs.generated.h $(HEADER_BUILD)/compression.generated.h From 37bbd2c6758d9230ca59617d97e826511977bb41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Soukup?= Date: Sun, 5 Jun 2022 20:00:40 +0000 Subject: [PATCH 219/246] Translated using Weblate (Czech) Currently translated at 11.3% (112 of 983 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/cs/ --- locale/cs.po | 130 +++++++++++++++++++++++++-------------------------- 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/locale/cs.po b/locale/cs.po index d15b61c9eb..3a95daae9c 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -6,15 +6,15 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2021-12-23 01:53+0000\n" -"Last-Translator: dronecz \n" +"PO-Revision-Date: 2022-06-07 16:16+0000\n" +"Last-Translator: Matěj Soukup \n" "Language-Team: LANGUAGE \n" "Language: cs\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>=2 && n<=4) ? 1 : 2;\n" -"X-Generator: Weblate 4.10.1\n" +"X-Generator: Weblate 4.13-dev\n" #: main.c msgid "" @@ -79,7 +79,7 @@ msgstr "%d adresní pin, %d rgb pin a %d dlaždice indikuje výšku %d, ne %d" #: ports/raspberrypi/common-hal/analogio/AnalogOut.c #: ports/raspberrypi/common-hal/rtc/RTC.c msgid "%q" -msgstr "" +msgstr "%q" #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" @@ -87,7 +87,7 @@ msgstr "%q a %q obsahují duplicitní piny" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "%q and %q must be different" -msgstr "" +msgstr "%q a %q musí být rozdílné" #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" @@ -111,31 +111,31 @@ msgstr "Indexy %q musí být celá čísla, nikoli %s" #: shared-module/bitbangio/SPI.c msgid "%q init failed" -msgstr "" +msgstr "Inicializace %q selhala" #: py/argcheck.c msgid "%q length must be %d" -msgstr "" +msgstr "Délka %q musí být %d" #: py/argcheck.c msgid "%q length must be %d-%d" -msgstr "%q délka musí být %d-%d" +msgstr "%q délka musí být %d-%d" #: py/argcheck.c msgid "%q length must be <= %d" -msgstr "" +msgstr "Délka %q musí být <= %d" #: py/argcheck.c msgid "%q length must be >= %d" -msgstr "" +msgstr "Délka %q musí být >= %d" #: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" -msgstr "%q délka musí být >= 1" +msgstr "%q délka musí být >= 1" #: py/argcheck.c msgid "%q must be %d" -msgstr "" +msgstr "%q musí být %d" #: py/argcheck.c msgid "%q must be %d-%d" @@ -143,7 +143,7 @@ msgstr "%q musí být %d-%d" #: shared-bindings/displayio/Display.c msgid "%q must be 1 when %q is True" -msgstr "" +msgstr "%q musí být 1, pokud %q je True" #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" @@ -167,7 +167,7 @@ msgstr "%q musí být string" #: py/argcheck.c msgid "%q must be an int" -msgstr "" +msgstr "%q musí být int" #: py/argcheck.c msgid "%q must be of type %q" @@ -175,7 +175,7 @@ msgstr "%q musí být typu %q" #: shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or None" -msgstr "" +msgstr "%q musí být typu %q nebo None" #: ports/atmel-samd/common-hal/busio/UART.c msgid "%q must be power of 2" @@ -310,47 +310,47 @@ msgstr "" #: shared-module/struct/__init__.c msgid "'S' and 'O' are not supported format types" -msgstr "" +msgstr "'S' a 'O' nejsou podporované typy formátů" #: py/compile.c msgid "'align' requires 1 argument" -msgstr "" +msgstr "'align' vyžaduje 1 argument" #: py/compile.c msgid "'await' outside function" -msgstr "" +msgstr "'await' je volán mimo funkci" #: py/compile.c msgid "'await', 'async for' or 'async with' outside async function" -msgstr "" +msgstr "'await', 'async for' nebo 'async' je volán mimo async" #: py/compile.c msgid "'break' outside loop" -msgstr "" +msgstr "'break' je volán vně cyklu" #: py/compile.c msgid "'continue' outside loop" -msgstr "" +msgstr "'continue' je volán vně cyklu" #: py/objgenerator.c msgid "'coroutine' object is not an iterator" -msgstr "" +msgstr "Objekt 'coroutine' není iterátor" #: py/compile.c msgid "'data' requires at least 2 arguments" -msgstr "" +msgstr "'data' vyžaduje nejméně 2 argumenty" #: py/compile.c msgid "'data' requires integer arguments" -msgstr "" +msgstr "'data' vyžaduje celočíselné argumenty" #: py/compile.c msgid "'label' requires 1 argument" -msgstr "" +msgstr "'label' vyžaduje 1 argument" #: py/compile.c msgid "'return' outside function" -msgstr "" +msgstr "'return' je volán mimo funkci" #: py/compile.c msgid "'yield from' inside async function" @@ -366,7 +366,7 @@ msgstr "" #: py/obj.c msgid ", in %q\n" -msgstr ", v %q\n" +msgstr ", v% q\n" #: py/objcomplex.c msgid "0.0 to a complex power" @@ -374,11 +374,11 @@ msgstr "" #: py/modbuiltins.c msgid "3-arg pow() not supported" -msgstr "" +msgstr "pow() nepodporuje 3 argumenty" #: shared-module/msgpack/__init__.c msgid "64 bit types" -msgstr "" +msgstr "64 bit typy" #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c @@ -388,22 +388,22 @@ msgstr "" #: ports/espressif/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" -msgstr "" +msgstr "WiFi používá ADC2" #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" -msgstr "" +msgstr "Adresa musí být %d bajtů dlouhá" #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" -msgstr "" +msgstr "Všechny CAN periferie jsou používány" #: ports/espressif/common-hal/busio/I2C.c #: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" -msgstr "" +msgstr "Všechny I2C periferie jsou používány" #: ports/espressif/common-hal/countio/Counter.c #: ports/espressif/common-hal/frequencyio/FrequencyIn.c @@ -419,19 +419,19 @@ msgstr "" #: ports/espressif/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" -msgstr "" +msgstr "Všechny SPI periferie jsou používány" #: ports/espressif/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/raspberrypi/common-hal/busio/UART.c msgid "All UART peripherals are in use" -msgstr "" +msgstr "Všechny UART periferie jsou používány" #: ports/nrf/common-hal/countio/Counter.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/rotaryio/IncrementalEncoder.c #: shared-bindings/pwmio/PWMOut.c msgid "All channels in use" -msgstr "" +msgstr "Všechny kanály jsou používány" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "All event channels in use" @@ -448,7 +448,7 @@ msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "All timers for this pin are in use" -msgstr "" +msgstr "Všechny časovače pro tento pin jsou používány" #: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -465,7 +465,7 @@ msgstr "" #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c msgid "All timers in use" -msgstr "" +msgstr "Všechny časovače jsou použity" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c @@ -479,15 +479,15 @@ msgstr "" #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" -msgstr "" +msgstr "Již běží" #: ports/espressif/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" -msgstr "" +msgstr "Již skenuje wifi sítě" #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" -msgstr "" +msgstr "Jiný PWMAudioOut je již aktivní" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c @@ -496,28 +496,28 @@ msgstr "" #: shared-bindings/pulseio/PulseOut.c msgid "Array must contain halfwords (type 'H')" -msgstr "" +msgstr "Pole musí obsahovat poloviční slova (typ „H“)" #: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." -msgstr "" +msgstr "Hodnoty pole by měly být jednoduché bajty." #: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" -msgstr "" +msgstr "Lze zadat maximálně %d %q (nikoli %d)" #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" -msgstr "" +msgstr "Pokus o alokování %d bloků" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when VM not running." -msgstr "" +msgstr "Pokus o alokaci haldy, když neběží VM." #: ports/raspberrypi/audio_dma.c msgid "Audio conversion not implemented" -msgstr "" +msgstr "Konverze audia není implementována" #: shared-bindings/wifi/Radio.c msgid "AuthMode.OPEN is not used with password" @@ -525,28 +525,28 @@ msgstr "" #: shared-bindings/wifi/Radio.c msgid "Authentication failure" -msgstr "" +msgstr "Autentizace selhala" #: main.c msgid "Auto-reload is off.\n" -msgstr "Automatické načtení je vypnuté.\n" +msgstr "Automatické načtení je vypnuto.\n" #: main.c msgid "" "Auto-reload is on. Simply save files over USB to run them or enter REPL to " "disable.\n" msgstr "" -"Automatické načtení je zapnuté. Stačí uložit soubory na USB nebo vstoupit " -"do REPLu pro jeho zakázání.\n" +"Automatické opětovné načtení je zapnuto. Jednoduše uložte soubory přes USB a " +"spusťte je, nebo vypněte REPL.\n" #: ports/espressif/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" -msgstr "" +msgstr "Baudrate není podporován periférií" #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" -msgstr "" +msgstr "Pod minimální obnovovací frekvencí" #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must be sequential pins" @@ -558,40 +558,40 @@ msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." -msgstr "" +msgstr "Bitová hloubka musí být násobkem 8." #: shared-bindings/bitmaptools/__init__.c msgid "Bitmap size and bits per value must match" -msgstr "" +msgstr "Velikost bitmapy a počet bitů na hodnotu se musí shodovat" #: supervisor/shared/safe_mode.c msgid "Boot device must be first device (interface #0)." -msgstr "" +msgstr "Bootovací zařízení musí být první (rozhraní #0)." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Both RX and TX required for flow control" -msgstr "" +msgstr "RX a TX jsou vyžadovány pro kontrolu toku" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" -msgstr "" +msgstr "Oba piny musí podporovat hardwarové přerušení" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c #: shared-bindings/is31fl3741/FrameBuffer.c #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" -msgstr "" +msgstr "Jas musí být 0-1,0" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness not adjustable" -msgstr "" +msgstr "Jas není nastavitelný" #: shared-bindings/_bleio/UUID.c #, c-format msgid "Buffer + offset too small %d %d %d" -msgstr "" +msgstr "Vyrovnávací paměť + offset je příliš malý %d %d %d" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Buffer elements must be 4 bytes long or less" @@ -604,17 +604,17 @@ msgstr "" #: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" -msgstr "" +msgstr "Vyrovnávací paměť je příliš malá" #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" -msgstr "" +msgstr "Délka vyrovnávací paměti %d je příliš velká. Musí být menší než %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élka vyrovnávací paměti musí být násobkem 512" #: ports/stm/common-hal/sdioio/SDCard.c shared-bindings/floppyio/__init__.c msgid "Buffer must be a multiple of 512 bytes" @@ -659,7 +659,7 @@ msgstr "" #: ports/cxd56/common-hal/camera/Camera.c msgid "Camera init" -msgstr "" +msgstr "Inizializace kamery" #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." From db28264c5c9ca2cbe26a3cde6016f1fd3f176082 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Soukup?= Date: Tue, 7 Jun 2022 21:17:21 +0000 Subject: [PATCH 220/246] Translated using Weblate (Czech) Currently translated at 11.6% (115 of 983 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/cs/ --- locale/cs.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/cs.po b/locale/cs.po index 3a95daae9c..08b236ec9f 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-06-07 16:16+0000\n" +"PO-Revision-Date: 2022-06-07 21:19+0000\n" "Last-Translator: Matěj Soukup \n" "Language-Team: LANGUAGE \n" "Language: cs\n" @@ -358,7 +358,7 @@ msgstr "" #: py/compile.c msgid "'yield' outside function" -msgstr "" +msgstr "'yield' je volán mimo funkci" #: py/compile.c msgid "*x must be assignment target" @@ -384,7 +384,7 @@ msgstr "64 bit typy" #: 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 "Kanál hardwarového přerušení je již používán" #: ports/espressif/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" @@ -435,7 +435,7 @@ msgstr "Všechny kanály jsou používány" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "All event channels in use" -msgstr "" +msgstr "Všechny kanály událostí jsou již používány" #: ports/raspberrypi/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c From 91000ea294b40c8cca34a29b19078ce77f538ef5 Mon Sep 17 00:00:00 2001 From: Pontus Oldberg Date: Wed, 8 Jun 2022 16:38:21 +0200 Subject: [PATCH 221/246] Adds support for Challenger RP2040 LoRa boards --- .../boards/challenger_rp2040_lora/board.c | 40 +++++++++ .../challenger_rp2040_lora/mpconfigboard.h | 10 +++ .../challenger_rp2040_lora/mpconfigboard.mk | 13 +++ .../pico-sdk-configboard.h | 1 + .../boards/challenger_rp2040_lora/pins.c | 85 +++++++++++++++++++ 5 files changed, 149 insertions(+) create mode 100644 ports/raspberrypi/boards/challenger_rp2040_lora/board.c create mode 100644 ports/raspberrypi/boards/challenger_rp2040_lora/mpconfigboard.h create mode 100644 ports/raspberrypi/boards/challenger_rp2040_lora/mpconfigboard.mk create mode 100644 ports/raspberrypi/boards/challenger_rp2040_lora/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/challenger_rp2040_lora/pins.c diff --git a/ports/raspberrypi/boards/challenger_rp2040_lora/board.c b/ports/raspberrypi/boards/challenger_rp2040_lora/board.c new file mode 100644 index 0000000000..dc22834750 --- /dev/null +++ b/ports/raspberrypi/boards/challenger_rp2040_lora/board.c @@ -0,0 +1,40 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Pontus Oldberg, Invector Labs + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} + +void board_deinit(void) { +} diff --git a/ports/raspberrypi/boards/challenger_rp2040_lora/mpconfigboard.h b/ports/raspberrypi/boards/challenger_rp2040_lora/mpconfigboard.h new file mode 100644 index 0000000000..a5245b98fe --- /dev/null +++ b/ports/raspberrypi/boards/challenger_rp2040_lora/mpconfigboard.h @@ -0,0 +1,10 @@ +#define MICROPY_HW_BOARD_NAME "Challenger RP2040 LoRa" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define DEFAULT_UART_BUS_TX (&pin_GPIO16) +#define DEFAULT_UART_BUS_RX (&pin_GPIO17) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO0) +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO1) +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO22) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO23) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO20) diff --git a/ports/raspberrypi/boards/challenger_rp2040_lora/mpconfigboard.mk b/ports/raspberrypi/boards/challenger_rp2040_lora/mpconfigboard.mk new file mode 100644 index 0000000000..1150bfb331 --- /dev/null +++ b/ports/raspberrypi/boards/challenger_rp2040_lora/mpconfigboard.mk @@ -0,0 +1,13 @@ +USB_VID = 0x2e8a +USB_PID = 0x1023 +USB_PRODUCT = "Challenger RP2040 LoRa" +USB_MANUFACTURER = "Invector Labs" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "W25Q64JVxQ" + +CIRCUITPY__EVE = 1 + +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_RFM9x diff --git a/ports/raspberrypi/boards/challenger_rp2040_lora/pico-sdk-configboard.h b/ports/raspberrypi/boards/challenger_rp2040_lora/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/challenger_rp2040_lora/pico-sdk-configboard.h @@ -0,0 +1 @@ +// Put board-specific pico-sdk definitions here. This file must exist. diff --git a/ports/raspberrypi/boards/challenger_rp2040_lora/pins.c b/ports/raspberrypi/boards/challenger_rp2040_lora/pins.c new file mode 100644 index 0000000000..0eff192f9f --- /dev/null +++ b/ports/raspberrypi/boards/challenger_rp2040_lora/pins.c @@ -0,0 +1,85 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_GP0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_GP1), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_GP2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_GP3), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_GP4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_GP5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_GP6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_GP7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_GP8), MP_ROM_PTR(&pin_GPIO8) }, + + // RFM95W connections + { MP_ROM_QSTR(MP_QSTR_RFM95W_CS), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_GP9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_RFM95W_SCK), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_GP10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_RFM95W_SDO), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_GP11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_RFM95W_SDI), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_GP12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_RFM95W_RST), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_GP13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_RFM95W_DIO0), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_GP14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_RFM95W_DIO1), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_GP15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_RFM95W_DIO2), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_GP18), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO24) }, + { MP_ROM_QSTR(MP_QSTR_GP24), MP_ROM_PTR(&pin_GPIO24) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO24) }, + + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_GP16), MP_ROM_PTR(&pin_GPIO16) }, + + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_GP17), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_GP22), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_GP23), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_GP20), MP_ROM_PTR(&pin_GPIO20) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_GP26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_GP27), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_GP28), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_GP29), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_GP19), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_GP21), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From 5c13f844c723513096236e4c47dbc7fe31fb490a Mon Sep 17 00:00:00 2001 From: Pontus Oldberg Date: Wed, 8 Jun 2022 16:43:49 +0200 Subject: [PATCH 222/246] Fixed pre-commit trailing whitespace --- ports/raspberrypi/boards/challenger_rp2040_lora/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/raspberrypi/boards/challenger_rp2040_lora/board.c b/ports/raspberrypi/boards/challenger_rp2040_lora/board.c index dc22834750..e8208ee5d3 100644 --- a/ports/raspberrypi/boards/challenger_rp2040_lora/board.c +++ b/ports/raspberrypi/boards/challenger_rp2040_lora/board.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2022 Pontus Oldberg, Invector Labs + * Copyright (c) 2022 Pontus Oldberg, Invector Labs * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal From d492565ab64f8b124335f2fffe5bb1f3796fcb23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Soukup?= Date: Tue, 7 Jun 2022 21:30:09 +0000 Subject: [PATCH 223/246] Translated using Weblate (Czech) Currently translated at 20.7% (204 of 983 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/cs/ --- locale/cs.po | 179 ++++++++++++++++++++++++++------------------------- 1 file changed, 91 insertions(+), 88 deletions(-) diff --git a/locale/cs.po b/locale/cs.po index 08b236ec9f..a60095c054 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-06-07 21:19+0000\n" +"PO-Revision-Date: 2022-06-08 15:15+0000\n" "Last-Translator: Matěj Soukup \n" "Language-Team: LANGUAGE \n" "Language: cs\n" @@ -470,7 +470,7 @@ msgstr "Všechny časovače jsou použity" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Already advertising." -msgstr "" +msgstr "Již propagujeme." #: ports/atmel-samd/common-hal/canio/Listener.c msgid "Already have all-matches listener" @@ -492,7 +492,7 @@ msgstr "Jiný PWMAudioOut je již aktivní" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c msgid "Another send is already active" -msgstr "" +msgstr "Další odesílání je již aktivní" #: shared-bindings/pulseio/PulseOut.c msgid "Array must contain halfwords (type 'H')" @@ -554,7 +554,7 @@ msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" -msgstr "" +msgstr "Výběr bitových hodin a slov musí sdílet jednotku hodin" #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." @@ -599,7 +599,7 @@ msgstr "" #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." -msgstr "" +msgstr "Buffer není bytearray." #: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c @@ -623,7 +623,7 @@ msgstr "" #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" -msgstr "" +msgstr "Buffer je příliš krátký o %d bajtů" #: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c msgid "Buffers must be same size" @@ -635,15 +635,15 @@ msgstr "" #: ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c #, c-format msgid "Bus pin %d is already in use" -msgstr "" +msgstr "Sběrnicový pin %d je již používán" #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." -msgstr "" +msgstr "Bajtový buffer musí být 16 bajtů." #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" -msgstr "" +msgstr "Bloky CBC musí být násobky 16 bajtů" #: supervisor/shared/safe_mode.c msgid "CIRCUITPY drive could not be found or created." @@ -655,7 +655,7 @@ msgstr "" #: py/objtype.c msgid "Call super().__init__() before accessing native object." -msgstr "" +msgstr "Volání super().__init__() před přístupem k nativnímu objektu." #: ports/cxd56/common-hal/camera/Camera.c msgid "Camera init" @@ -676,7 +676,7 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "Can't set CCCD on local Characteristic" -msgstr "" +msgstr "Nelze nastavit CCCD na místní charakteristiku" #: shared-bindings/storage/__init__.c shared-bindings/usb_cdc/__init__.c #: shared-bindings/usb_hid/__init__.c shared-bindings/usb_midi/__init__.c @@ -691,18 +691,18 @@ msgstr "" #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" -msgstr "" +msgstr "Nelze odstranit hodnoty" #: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c #: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c #: ports/nrf/common-hal/digitalio/DigitalInOut.c #: ports/raspberrypi/common-hal/digitalio/DigitalInOut.c msgid "Cannot get pull while in output mode" -msgstr "" +msgstr "Nelze získat ve výstupním režimu" #: ports/nrf/common-hal/microcontroller/Processor.c msgid "Cannot get temperature" -msgstr "" +msgstr "Nelze získat teplotu" #: shared-bindings/_bleio/Adapter.c msgid "Cannot have scan responses for extended, connectable advertisements." @@ -714,7 +714,7 @@ msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" -msgstr "" +msgstr "Nelze nahrávat do souboru" #: shared-module/storage/__init__.c msgid "Cannot remount '/' when visible via USB." @@ -732,16 +732,16 @@ msgstr "" #: shared-bindings/digitalio/DigitalInOut.c msgid "Cannot set value when direction is input." -msgstr "" +msgstr "Nelze nastavit hodnotu, když směr je vstup." #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" -msgstr "" +msgstr "Nelze určit RTS nebo CTS v režimu RS485" #: py/objslice.c msgid "Cannot subclass slice" -msgstr "" +msgstr "Nelze použít řez podtřídy" #: shared-module/bitbangio/SPI.c msgid "Cannot transfer without MOSI and MISO pins" @@ -749,7 +749,7 @@ msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" -msgstr "" +msgstr "Nelze měnit frekvenci časovače, který je již používán" #: ports/nrf/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge, only level" @@ -761,11 +761,11 @@ msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" -msgstr "" +msgstr "CharacteristicBuffer psaní není poskytováno" #: supervisor/shared/safe_mode.c msgid "CircuitPython core code crashed hard. Whoops!\n" -msgstr "" +msgstr "Jádro kódu CircuitPython tvrdě havarovalo. Jejda!\n" #: supervisor/shared/safe_mode.c msgid "CircuitPython was unable to allocate the heap." @@ -773,17 +773,18 @@ msgstr "" #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" -msgstr "" +msgstr "Hodiny jsou příliš dlouhé" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Clock unit in use" -msgstr "" +msgstr "Jednotka hodin je používána" #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " "connection." msgstr "" +"Připojení bylo odpojeno a nelze jej dále používat. Vytvořte nové připojení." #: py/persistentcode.c msgid "Corrupt .mpy file" @@ -799,40 +800,40 @@ msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Could not start PWM" -msgstr "" +msgstr "Nelze spustit PWM" #: ports/stm/common-hal/busio/UART.c msgid "Could not start interrupt, RX busy" -msgstr "" +msgstr "Nelze začít přerušení, RX je zaneprázdněn" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" -msgstr "" +msgstr "Dekodér nelze přiřadit" #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." -msgstr "" +msgstr "Pád do HardFault_Handler." #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Channel Init Error" -msgstr "" +msgstr "Chyba inicializace kanálu DAC" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Device Init Error" -msgstr "" +msgstr "Chyba inicializace zařízení DAC" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" -msgstr "" +msgstr "DAC se již používá" #: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c #: ports/nrf/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned" -msgstr "" +msgstr "Datový pin 0 musí být zarovnán na bajty" #: shared-module/audiocore/WaveFile.c msgid "Data chunk must follow fmt chunk" -msgstr "" +msgstr "Datový blok musí následovat fmt blok" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c @@ -842,7 +843,7 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Data too large for advertisement packet" -msgstr "" +msgstr "Data jsou příliš velká pro propagovaný paket" #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Deep sleep pins must use a rising edge with pulldown" @@ -850,22 +851,22 @@ msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "Destination capacity is smaller than destination_length." -msgstr "" +msgstr "Cílová kapacita je menší než destination_length." #: ports/nrf/common-hal/audiobusio/I2SOut.c msgid "Device in use" -msgstr "" +msgstr "Zařízení je používáno" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." -msgstr "" +msgstr "Displej musí mít 16bitový barevný prostor." #: 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 "Otočení displeje musí být po 90 stupních" #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." @@ -873,7 +874,7 @@ msgstr "" #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" -msgstr "" +msgstr "ECB operuje najednou pouze 16 bajtů" #: ports/espressif/common-hal/busio/SPI.c #: ports/espressif/common-hal/canio/CAN.c @@ -885,7 +886,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c msgid "EXTINT channel already in use" -msgstr "" +msgstr "EXTINT kanál se již používá" #: shared-module/synthio/MidiTrack.c #, c-format @@ -894,7 +895,7 @@ msgstr "" #: extmod/modure.c msgid "Error in regex" -msgstr "" +msgstr "Chyba v regulárním výrazu" #: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c msgid "Error: Failure to bind" @@ -905,7 +906,7 @@ msgstr "" #: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" -msgstr "" +msgstr "Očekává se %q" #: shared-bindings/alarm/__init__.c msgid "Expected an alarm" @@ -930,7 +931,7 @@ msgstr "" #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." -msgstr "" +msgstr "Nepodařilo se odeslat příkaz." #: ports/nrf/sd_mutex.c #, c-format @@ -956,11 +957,11 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" -msgstr "" +msgstr "Připojení se nezdařilo: interní chyba" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: timeout" -msgstr "" +msgstr "Nepodařilo se připojit: časový limit" #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to init wifi" @@ -968,7 +969,7 @@ msgstr "" #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" -msgstr "" +msgstr "Soubor MP3 se nepodařilo analyzovat" #: ports/nrf/sd_mutex.c #, c-format @@ -977,7 +978,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "Failed to write internal flash." -msgstr "" +msgstr "Nepodařilo se zapsat do interní paměti." #: supervisor/shared/safe_mode.c msgid "Fatal error." @@ -985,7 +986,7 @@ msgstr "" #: py/moduerrno.c msgid "File exists" -msgstr "" +msgstr "soubor existuje" #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/espressif/common-hal/canio/Listener.c @@ -1021,7 +1022,7 @@ 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 "" +msgstr "Funkce vyžaduje zámek" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "GNSS init" @@ -1035,7 +1036,7 @@ msgstr "" #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Group already used" -msgstr "" +msgstr "Skupina již byla použita" #: ports/atmel-samd/common-hal/busio/SPI.c ports/cxd56/common-hal/busio/SPI.c #: ports/espressif/common-hal/busio/SPI.c @@ -1048,11 +1049,11 @@ msgstr "" #: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/canio/CAN.c #: ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" -msgstr "" +msgstr "Hardware je zaneprázdněn, zkuste alternativní piny" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" -msgstr "" +msgstr "Hardware je používán, zkuste alternativní piny" #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" @@ -1073,7 +1074,7 @@ msgstr "" #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" -msgstr "" +msgstr "IV musí být dlouhé %d bajtů" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "In-buffer elements must be <= 4 bytes long" @@ -1084,10 +1085,12 @@ msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" "mpy-update for more info." msgstr "" +"Nekompatibilní soubor .mpy. Aktualizujte prosím všechny soubory .mpy. Další " +"informace naleznete na adrese http://adafru.it/mpy-update." #: shared-bindings/_pew/PewPew.c msgid "Incorrect buffer size" -msgstr "" +msgstr "Nesprávná velikost vyrovnávací paměti" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Init program size invalid" @@ -1116,7 +1119,7 @@ msgstr "" #: ports/espressif/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" -msgstr "" +msgstr "Vstupně/výstupní chyba" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format @@ -1140,11 +1143,11 @@ msgstr "" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient authentication" -msgstr "" +msgstr "Nedostatečná autentizace" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient encryption" -msgstr "" +msgstr "Nedostatečné šifrování" #: ports/espressif/common-hal/wifi/Radio.c msgid "Interface must be started" @@ -1165,7 +1168,7 @@ msgstr "" #: shared-module/rgbmatrix/RGBMatrix.c #, c-format msgid "Internal error #%d" -msgstr "" +msgstr "Vnitřní chyba #%d" #: py/argcheck.c msgid "Invalid %q" @@ -1173,11 +1176,11 @@ msgstr "" #: shared-bindings/microcontroller/Pin.c msgid "Invalid %q pin" -msgstr "" +msgstr "Neplatný pin %q" #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" -msgstr "" +msgstr "Neplatná hodnota jednotky ADC" #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c @@ -1195,7 +1198,7 @@ msgstr "" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #: py/moduerrno.c msgid "Invalid argument" -msgstr "" +msgstr "Neplatný argument" #: shared-module/displayio/Bitmap.c msgid "Invalid bits per value" @@ -1208,11 +1211,11 @@ msgstr "" #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" -msgstr "" +msgstr "Neplatná velikost bloku" #: supervisor/shared/safe_mode.c msgid "Invalid memory access." -msgstr "" +msgstr "Neplatný přístup k paměti." #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" @@ -1220,7 +1223,7 @@ msgstr "" #: shared-bindings/busio/UART.c msgid "Invalid pins" -msgstr "" +msgstr "Neplatné piny" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" @@ -1236,7 +1239,7 @@ msgstr "" #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" -msgstr "" +msgstr "Klíč musí být dlouhý 16, 24 nebo 32 bajtů" #: shared-module/is31fl3741/FrameBuffer.c msgid "LED mappings must match display size" @@ -1265,7 +1268,7 @@ msgstr "" #: shared-module/displayio/Shape.c #, c-format msgid "Maximum x value when mirrored is %d" -msgstr "" +msgstr "Maximální hodnota x při zrcadlení je %d" #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" @@ -1282,7 +1285,7 @@ msgstr "" #: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" -msgstr "" +msgstr "Chybí pin MISO nebo MOSI" #: ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI pin" @@ -1325,16 +1328,16 @@ msgstr "" #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." -msgstr "" +msgstr "Musí být podtřída %q." #: ports/mimxrt10xx/common-hal/busio/SPI.c shared-bindings/busio/SPI.c msgid "Must provide MISO or MOSI pin" -msgstr "" +msgstr "Musí poskytnout pin MISO nebo MOSI" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" -msgstr "" +msgstr "Je nutné použít několik kolíků 6 rgb, nikoli %d" #: supervisor/shared/safe_mode.c msgid "NLR jump failed. Likely memory corruption." @@ -1346,7 +1349,7 @@ msgstr "" #: py/qstr.c msgid "Name too long" -msgstr "" +msgstr "Jméno je příliš dlouhé" #: shared-bindings/displayio/TileGrid.c msgid "New bitmap must be same size as old bitmap" @@ -1359,19 +1362,19 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "No CCCD for this Characteristic" -msgstr "" +msgstr "Žádné CCCD pro tuto charakteristiku" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" -msgstr "" +msgstr "Žádný DAC na čipu" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "No DMA channel found" -msgstr "" +msgstr "Nebyl nalezen žádný kanál DMA" #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "No DMA pacing timer found" @@ -1385,7 +1388,7 @@ msgstr "" #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" -msgstr "" +msgstr "Žádný pin MISO" #: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c msgid "No MISO pin" @@ -1394,7 +1397,7 @@ msgstr "" #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" -msgstr "" +msgstr "Žádný pin MOSI" #: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c msgid "No MOSI pin" @@ -1405,18 +1408,18 @@ msgstr "" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "No RX pin" -msgstr "" +msgstr "Žádný RX pin" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "No TX pin" -msgstr "" +msgstr "Žádný TX pin" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "No available clocks" -msgstr "" +msgstr "Žádné dostupné hodiny" #: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c msgid "No capture in progress" @@ -1424,15 +1427,15 @@ msgstr "" #: shared-bindings/_bleio/PacketBuffer.c msgid "No connection: length cannot be determined" -msgstr "" +msgstr "Žádné připojení: nelze určit délku" #: shared-bindings/board/__init__.c msgid "No default %q bus" -msgstr "" +msgstr "Žádná výchozí sběrnice %q" #: ports/atmel-samd/common-hal/touchio/TouchIn.c msgid "No free GCLKs" -msgstr "" +msgstr "Žádné volné GCLK" #: shared-bindings/os/__init__.c msgid "No hardware random available" @@ -1448,7 +1451,7 @@ msgstr "" #: shared-bindings/aesio/aes.c msgid "No key was specified" -msgstr "" +msgstr "Nebyl zadán klíč" #: shared-bindings/time/__init__.c msgid "No long integer support" @@ -1476,11 +1479,11 @@ msgstr "" #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" -msgstr "" +msgstr "Žádný pulldown na pinu; doporučeno 1Mohm" #: py/moduerrno.c msgid "No space left on device" -msgstr "" +msgstr "Na zařízení nezůstal žádný prostor" #: py/moduerrno.c msgid "No such device" @@ -1488,11 +1491,11 @@ msgstr "" #: py/moduerrno.c msgid "No such file/directory" -msgstr "" +msgstr "Žádný takový soubor / adresář" #: shared-module/rgbmatrix/RGBMatrix.c msgid "No timer available" -msgstr "" +msgstr "Není k dispozici žádný časovač" #: supervisor/shared/safe_mode.c msgid "Nordic system firmware failure assertion." @@ -1510,12 +1513,12 @@ msgstr "" #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" -msgstr "" +msgstr "Nepřipojený" #: shared-bindings/audiobusio/I2SOut.c shared-bindings/audioio/AudioOut.c #: shared-bindings/audiopwmio/PWMAudioOut.c msgid "Not playing" -msgstr "" +msgstr "Nehraje" #: shared-bindings/_bleio/__init__.c msgid "Not settable" From 64460107531ee110c809edec7823a557e1455b49 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 6 Jun 2022 16:54:02 -0700 Subject: [PATCH 224/246] Wi-Fi autoconnect and title bar status This adds support for CIRCUITPY_WIFI_SSID and CIRCUITPY_WIFI_PASSWORD in `/.env`. When both are defined, CircuitPython will attempt to connect to the network even when user code isn't running. If the user code attempts to a network with the same SSID, it will return immediately. Connecting to another SSID will disconnect from the auto-connected network. If the user code initiates the connection, then it will be shutdown after user code exits. (Should match <8 behavior.) This PR also reworks the default displayio terminal. It now supports a title bar TileGrid in addition to the (newly renamed) scroll area. The default title bar is the top row of the display and is positioned to the right of the Blinka logo when it is enabled. The scroll area is now below the Blinka logo. The Wi-Fi auto-connect code now uses the title bar to show its state including the IP address when connected. It does this through the "standard" OSC control sequence `ESC ] 0 ; ESC \` where is the title bar string. This is commonly supported by terminals so it should work over USB and UART as well. Related to #6174 --- README.rst | 7 +- docs/environment.rst | 40 +++++++ docs/index.rst | 1 + locale/circuitpython.pot | 12 ++ main.c | 33 ++--- .../espressif_esp32s3_usb_otg_n8/board.c | 4 + .../espressif/common-hal/socketpool/Socket.c | 2 +- .../espressif/common-hal/socketpool/Socket.h | 2 +- .../common-hal/socketpool/__init__.c | 8 ++ ports/espressif/common-hal/wifi/Radio.c | 32 ++++- ports/espressif/common-hal/wifi/__init__.c | 20 +++- ports/espressif/supervisor/port.c | 8 -- py/circuitpy_defns.mk | 4 +- py/circuitpy_mpconfig.mk | 3 + shared-bindings/displayio/TileGrid.h | 1 + shared-bindings/socketpool/__init__.h | 2 + shared-bindings/terminalio/Terminal.c | 33 ++++- shared-bindings/terminalio/Terminal.h | 2 +- shared-bindings/wifi/Radio.c | 4 +- shared-bindings/wifi/Radio.h | 1 + shared-bindings/wifi/__init__.c | 2 +- shared-bindings/wifi/__init__.h | 4 +- shared-module/displayio/TileGrid.c | 21 ++++ shared-module/terminalio/Terminal.c | 113 +++++++++++------- shared-module/terminalio/Terminal.h | 7 +- supervisor/shared/background_callback.c | 18 ++- supervisor/shared/display.c | 101 ++++++++-------- supervisor/shared/display.h | 3 +- supervisor/shared/translate/translate_impl.h | 2 +- supervisor/shared/web_workflow/web_workflow.c | 92 ++++++++++++++ supervisor/shared/web_workflow/web_workflow.h | 35 ++++++ supervisor/shared/workflow.c | 69 +++++++++++ supervisor/supervisor.mk | 4 + supervisor/workflow.h | 4 + tools/gen_display_resources.py | 37 +++++- 35 files changed, 587 insertions(+), 144 deletions(-) create mode 100644 docs/environment.rst create mode 100644 supervisor/shared/web_workflow/web_workflow.c create mode 100644 supervisor/shared/web_workflow/web_workflow.h diff --git a/README.rst b/README.rst index 801466cbad..1f45007082 100644 --- a/README.rst +++ b/README.rst @@ -120,7 +120,7 @@ Behavior make each file independent from each other. - ``boot.py`` runs only once on start up before - USB is initialized. This lays the ground work for configuring USB at + workflows are initialized. This lays the ground work for configuring USB at startup rather than it being fixed. Since serial is not available, output is written to ``boot_out.txt``. - ``code.py`` (or ``main.py``) is run after every reload until it @@ -135,7 +135,10 @@ Behavior possible to fix code that causes nasty crashes by making it available through mass storage after the crash. A reset (the button) is needed after it's fixed to get back into normal mode. - RGB status LED indicating CircuitPython state. -- Re-runs ``code.py`` or other main file after file system writes over USB mass storage. (Disable with + - One green flash - code completed without error. + - Two red flashes - code ended due to an exception. + - Three yellow flashes - safe mode. May be due to CircuitPython internal error. +- Re-runs ``code.py`` or other main file after file system writes by a workflow. (Disable with ``supervisor.disable_autoreload()``) - Autoreload is disabled while the REPL is active. - Main is one of these: ``code.txt``, ``code.py``, ``main.py``, diff --git a/docs/environment.rst b/docs/environment.rst new file mode 100644 index 0000000000..2e5d81fca8 --- /dev/null +++ b/docs/environment.rst @@ -0,0 +1,40 @@ +Environment Variables +===================== + +CircuitPython 8.0.0 introduces support for environment variables. Environment +variables are commonly used to store "secrets" such as Wi-Fi passwords and API +keys. This method *does not* make them secure. It only separates them from the +code. + +CircuitPython supports these by mimicking the `dotenv `_ +CPython library. Other languages such as Javascript, PHP and Ruby also have +dotenv libraries. + +These libraries store environment variables in a ``.env`` file. Here is a simple +example: + +.. code-block:: bash + + KEY1='value1' + # Comment + KEY2='value2 + is multiple lines' + +CircuitPython uses the ``.env`` at the drive root (no folder) as the environment. +User code can access the values from the file using `os.getenv()`. It is +recommended to save any values used repeatedly in a variable because `os.getenv()` +will parse the ``/.env`` on every access. + +CircuitPython behavior +---------------------- + +CircuitPython will also read the environment to configure its behavior. Other +keys are ignored by CircuitPython. Here are the keys it uses: + +CIRCUITPY_WIFI_PASSWORD +~~~~~~~~~~~~~~~~~~~~~~~ +Wi-Fi password used to auto connect to CIRCUITPY_WIFI_SSID + +CIRCUITPY_WIFI_SSID +~~~~~~~~~~~~~~~~~~~ +Wi-Fi SSID to auto-connect to even if user code is not running. diff --git a/docs/index.rst b/docs/index.rst index 6e9789852e..6a67fe0b7c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -22,6 +22,7 @@ Full Table of Contents supported_ports.rst troubleshooting.rst drivers.rst + environment.rst .. toctree:: :maxdepth: 1 diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index aa94f2485f..f965506d1b 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -1375,6 +1375,10 @@ msgstr "" msgid "No I2C device at address: 0x%x" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" @@ -2254,6 +2258,10 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "" @@ -3579,6 +3587,10 @@ msgstr "" msgid "odd-length string" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + #: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" diff --git a/main.c b/main.c index d2b3edb16a..3488899946 100644 --- a/main.c +++ b/main.c @@ -101,6 +101,10 @@ #include "shared-module/memorymonitor/__init__.h" #endif +#if CIRCUITPY_SOCKETPOOL +#include "shared-bindings/socketpool/__init__.h" +#endif + #if CIRCUITPY_USB_HID #include "shared-module/usb_hid/__init__.h" #endif @@ -290,6 +294,16 @@ STATIC void cleanup_after_vm(supervisor_allocation *heap, mp_obj_t exception) { keypad_reset(); #endif + // Close user-initiated sockets. + #if CIRCUITPY_SOCKETPOOL + socketpool_user_reset(); + #endif + + // Turn off user initiated WiFi connections. + #if CIRCUITPY_WIFI + wifi_user_reset(); + #endif + // reset_board_buses() first because it may release pins from the never_reset state, so that // reset_port() can reset them. #if CIRCUITPY_BOARD @@ -303,6 +317,9 @@ STATIC void cleanup_after_vm(supervisor_allocation *heap, mp_obj_t exception) { stop_mp(); free_memory(heap); supervisor_move_memory(); + + // Let the workflows know we've reset in case they want to restart. + supervisor_workflow_reset(); } STATIC void print_code_py_status_message(safe_mode_t safe_mode) { @@ -889,21 +906,7 @@ int __attribute__((used)) main(void) { run_boot_py(safe_mode); - // Start USB after giving boot.py a chance to tweak behavior. - #if CIRCUITPY_USB - // Setup USB connection after heap is available. - // It needs the heap to build descriptors. - usb_init(); - #endif - - // Set up any other serial connection. - serial_init(); - - #if CIRCUITPY_BLEIO - bleio_reset(); - supervisor_bluetooth_enable_workflow(); - supervisor_start_bluetooth(); - #endif + supervisor_workflow_start(); // Boot script is finished, so now go into REPL or run code.py. int exit_code = PYEXEC_FORCED_EXIT; diff --git a/ports/espressif/boards/espressif_esp32s3_usb_otg_n8/board.c b/ports/espressif/boards/espressif_esp32s3_usb_otg_n8/board.c index 0cfedf9933..f278c7ddbc 100644 --- a/ports/espressif/boards/espressif_esp32s3_usb_otg_n8/board.c +++ b/ports/espressif/boards/espressif_esp32s3_usb_otg_n8/board.c @@ -117,6 +117,10 @@ void board_init(void) { true, // backlight_on_high false, // SH1107_addressing 50000); // backlight pwm frequency + + #if CIRCUITPY_DEBUG + common_hal_never_reset_pin(DEFAULT_UART_BUS_TX); + #endif } bool espressif_board_reset_pin_number(gpio_num_t pin_number) { diff --git a/ports/espressif/common-hal/socketpool/Socket.c b/ports/espressif/common-hal/socketpool/Socket.c index c16be01998..856400a4e7 100644 --- a/ports/espressif/common-hal/socketpool/Socket.c +++ b/ports/espressif/common-hal/socketpool/Socket.c @@ -39,7 +39,7 @@ STATIC socketpool_socket_obj_t *open_socket_handles[CONFIG_LWIP_MAX_SOCKETS]; -void socket_reset(void) { +void socket_user_reset(void) { for (size_t i = 0; i < MP_ARRAY_SIZE(open_socket_handles); i++) { if (open_socket_handles[i]) { if (open_socket_handles[i]->num > 0) { diff --git a/ports/espressif/common-hal/socketpool/Socket.h b/ports/espressif/common-hal/socketpool/Socket.h index 943b5d9fdd..2b8ea9fcbf 100644 --- a/ports/espressif/common-hal/socketpool/Socket.h +++ b/ports/espressif/common-hal/socketpool/Socket.h @@ -45,7 +45,7 @@ typedef struct { mp_uint_t timeout_ms; } socketpool_socket_obj_t; -void socket_reset(void); +void socket_user_reset(void); bool register_open_socket(socketpool_socket_obj_t *self); #endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_SOCKETPOOL_SOCKET_H diff --git a/ports/espressif/common-hal/socketpool/__init__.c b/ports/espressif/common-hal/socketpool/__init__.c index fa0e7d5f3f..595977d24f 100644 --- a/ports/espressif/common-hal/socketpool/__init__.c +++ b/ports/espressif/common-hal/socketpool/__init__.c @@ -23,3 +23,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ + +#include "shared-bindings/socketpool/__init__.h" + +#include "common-hal/socketpool/Socket.h" + +void socketpool_user_reset(void) { + socket_user_reset(); +} diff --git a/ports/espressif/common-hal/wifi/Radio.c b/ports/espressif/common-hal/wifi/Radio.c index 6451cb1414..e4a9aa4646 100644 --- a/ports/espressif/common-hal/wifi/Radio.c +++ b/ports/espressif/common-hal/wifi/Radio.c @@ -236,6 +236,7 @@ wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t if (!common_hal_wifi_radio_get_enabled(self)) { mp_raise_RuntimeError(translate("wifi is not enabled")); } + wifi_config_t *config = &self->sta_config; EventBits_t bits; // can't block since both bits are false after wifi_init @@ -245,16 +246,31 @@ wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t pdTRUE, pdTRUE, 0); - if (((bits & WIFI_CONNECTED_BIT) != 0) && - !((bits & WIFI_DISCONNECTED_BIT) != 0)) { - return WIFI_RADIO_ERROR_NONE; + bool connected = ((bits & WIFI_CONNECTED_BIT) != 0) && + !((bits & WIFI_DISCONNECTED_BIT) != 0); + if (connected) { + if (memcmp(ssid, config->sta.ssid, ssid_len) == 0) { + // Already connected to the desired network. + return WIFI_RADIO_ERROR_NONE; + } else { + xEventGroupClearBits(self->event_group_handle, WIFI_DISCONNECTED_BIT); + // Trying to switch networks so disconnect first. + esp_wifi_disconnect(); + do { + RUN_BACKGROUND_TASKS; + bits = xEventGroupWaitBits(self->event_group_handle, + WIFI_DISCONNECTED_BIT, + pdTRUE, + pdTRUE, + 0); + } while ((bits & WIFI_DISCONNECTED_BIT) == 0 && !mp_hal_is_interrupted()); + } } // explicitly clear bits since xEventGroupWaitBits may have timed out xEventGroupClearBits(self->event_group_handle, WIFI_CONNECTED_BIT); xEventGroupClearBits(self->event_group_handle, WIFI_DISCONNECTED_BIT); set_mode_station(self, true); - wifi_config_t *config = &self->sta_config; memcpy(&config->sta.ssid, ssid, ssid_len); config->sta.ssid[ssid_len] = 0; memcpy(&config->sta.password, password, password_len); @@ -368,6 +384,14 @@ mp_obj_t common_hal_wifi_radio_get_ipv4_subnet_ap(wifi_radio_obj_t *self) { return common_hal_ipaddress_new_ipv4address(self->ap_ip_info.netmask.addr); } +uint32_t wifi_radio_get_ipv4_address(wifi_radio_obj_t *self) { + if (!esp_netif_is_netif_up(self->netif)) { + return 0; + } + esp_netif_get_ip_info(self->netif, &self->ip_info); + return self->ip_info.ip.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/ports/espressif/common-hal/wifi/__init__.c b/ports/espressif/common-hal/wifi/__init__.c index 36cf27a69f..3da0fc7297 100644 --- a/ports/espressif/common-hal/wifi/__init__.c +++ b/ports/espressif/common-hal/wifi/__init__.c @@ -42,6 +42,8 @@ wifi_radio_obj_t common_hal_wifi_radio_obj; #include "components/log/include/esp_log.h" +#include "supervisor/workflow.h" + static const char *TAG = "wifi"; static void event_handler(void *arg, esp_event_base_t event_base, @@ -106,12 +108,19 @@ static void event_handler(void *arg, esp_event_base_t event_base, radio->retries_left = radio->starting_retries; xEventGroupSetBits(radio->event_group_handle, WIFI_CONNECTED_BIT); } + supervisor_workflow_request_background(); } -static bool wifi_inited, wifi_ever_inited; +static bool wifi_inited; +static bool wifi_ever_inited; +static bool wifi_user_initiated; -void common_hal_wifi_init(void) { +void common_hal_wifi_init(bool user_initiated) { + if (wifi_inited) { + return; + } wifi_inited = true; + wifi_user_initiated = user_initiated; common_hal_wifi_radio_obj.base.type = &wifi_radio_type; if (!wifi_ever_inited) { @@ -157,6 +166,12 @@ void common_hal_wifi_init(void) { common_hal_wifi_radio_set_enabled(self, true); } +void wifi_user_reset(void) { + if (wifi_user_initiated) { + wifi_reset(); + } +} + void wifi_reset(void) { if (!wifi_inited) { return; @@ -176,6 +191,7 @@ void wifi_reset(void) { esp_netif_destroy(radio->ap_netif); radio->ap_netif = NULL; wifi_inited = false; + supervisor_workflow_request_background(); } void ipaddress_ipaddress_to_esp_idf(mp_obj_t ip_address, ip_addr_t *esp_ip_address) { diff --git a/ports/espressif/supervisor/port.c b/ports/espressif/supervisor/port.c index bf606ad159..7ecdd140a2 100644 --- a/ports/espressif/supervisor/port.c +++ b/ports/espressif/supervisor/port.c @@ -282,14 +282,6 @@ void reset_port(void) { #if CIRCUITPY_WATCHDOG watchdog_reset(); #endif - - #if CIRCUITPY_WIFI - wifi_reset(); - #endif - - #if CIRCUITPY_SOCKETPOOL - socket_reset(); - #endif } void reset_to_bootloader(void) { diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 1918938255..c5c89ab19f 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -70,7 +70,9 @@ endif CIRCUITPY_LTO ?= 0 CIRCUITPY_LTO_PARTITION ?= balanced ifeq ($(CIRCUITPY_LTO),1) -CFLAGS += -flto -flto-partition=$(CIRCUITPY_LTO_PARTITION) +CFLAGS += -flto -flto-partition=$(CIRCUITPY_LTO_PARTITION) -DCIRCUITPY_LTO=1 +else +CFLAGS += -DCIRCUITPY_LTO=0 endif # Produce an object file for translate.c instead of including it in a header. diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 69f4c248bc..758e0226a8 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -480,6 +480,9 @@ CFLAGS += -DCIRCUITPY_WATCHDOG=$(CIRCUITPY_WATCHDOG) CIRCUITPY_WIFI ?= 0 CFLAGS += -DCIRCUITPY_WIFI=$(CIRCUITPY_WIFI) +CIRCUITPY_WEB_WORKFLOW ?= $(CIRCUITPY_WIFI) +CFLAGS += -DCIRCUITPY_WEB_WORKFLOW=$(CIRCUITPY_WEB_WORKFLOW) + # tinyusb port tailored configuration CIRCUITPY_TUSB_MEM_ALIGN ?= 4 CFLAGS += -DCIRCUITPY_TUSB_MEM_ALIGN=$(CIRCUITPY_TUSB_MEM_ALIGN) diff --git a/shared-bindings/displayio/TileGrid.h b/shared-bindings/displayio/TileGrid.h index 2b4e42cb46..fb56ba6101 100644 --- a/shared-bindings/displayio/TileGrid.h +++ b/shared-bindings/displayio/TileGrid.h @@ -69,5 +69,6 @@ void common_hal_displayio_tilegrid_set_tile(displayio_tilegrid_t *self, uint16_t // Private API for scrolling the TileGrid. void common_hal_displayio_tilegrid_set_top_left(displayio_tilegrid_t *self, uint16_t x, uint16_t y); +void common_hal_displayio_tilegrid_set_all_tiles(displayio_tilegrid_t *self, uint8_t tile_index); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_TILEGRID_H diff --git a/shared-bindings/socketpool/__init__.h b/shared-bindings/socketpool/__init__.h index a017e96c6d..46034f257d 100644 --- a/shared-bindings/socketpool/__init__.h +++ b/shared-bindings/socketpool/__init__.h @@ -27,4 +27,6 @@ #ifndef MICROPY_INCLUDED_SHARED_BINDINGS_SOCKETPOOL___INIT___H #define MICROPY_INCLUDED_SHARED_BINDINGS_SOCKETPOOL___INIT___H +void socketpool_user_reset(void); + #endif // MICROPY_INCLUDED_SHARED_BINDINGS_SOCKETPOOL___INIT___H diff --git a/shared-bindings/terminalio/Terminal.c b/shared-bindings/terminalio/Terminal.c index c6fd389b12..605ee2727f 100644 --- a/shared-bindings/terminalio/Terminal.c +++ b/shared-bindings/terminalio/Terminal.c @@ -38,31 +38,52 @@ #include "supervisor/shared/translate/translate.h" //| class Terminal: -//| """Display a character stream with a TileGrid""" +//| """Display a character stream with a TileGrid //| -//| def __init__(self, tilegrid: displayio.TileGrid, font: fontio.BuiltinFont) -> None: +//| ASCII control: +//| * ``\\r`` - Move cursor to column 1 +//| * ``\\n`` - Move cursor down a row +//| * ``\\b`` - Move cursor left one if possible +//| +//| OSC control sequences: +//| * ``ESC ] 0; ESC \\`` - Set title bar to +//| * ``ESC ] ####; ESC \\`` - Ignored +//| +//| VT100 control sequences: +//| * ``ESC [ K`` - Clear the remainder of the line +//| * ``ESC [ #### D`` - Move the cursor to the left by #### +//| * ``ESC [ 2 J`` - Erase the entire display +//| * ``ESC [ nnnn ; mmmm H`` - Move the cursor to mmmm, nnnn. +//| """ +//| +//| def __init__(self, scroll_area: displayio.TileGrid, font: fontio.BuiltinFont, *, title_bar: displayio.TileGrid = None) -> None: //| """Terminal manages tile indices and cursor position based on VT100 commands. The font should be //| a `fontio.BuiltinFont` and the TileGrid's bitmap should match the font's bitmap.""" //| ... //| STATIC mp_obj_t terminalio_terminal_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { - enum { ARG_tilegrid, ARG_font }; + enum { ARG_scroll_area, ARG_font, ARG_title_bar }; static const mp_arg_t allowed_args[] = { - { MP_QSTR_tilegrid, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_scroll_area, MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_font, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_title_bar, MP_ARG_KW_ONLY | MP_ARG_OBJ, { .u_obj = mp_const_none } }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all_kw_array(n_args, n_kw, all_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - displayio_tilegrid_t *tilegrid = mp_arg_validate_type(args[ARG_tilegrid].u_obj, &displayio_tilegrid_type, MP_QSTR_tilegrid); + displayio_tilegrid_t *scroll_area = mp_arg_validate_type(args[ARG_scroll_area].u_obj, &displayio_tilegrid_type, MP_QSTR_scroll_area); + displayio_tilegrid_t *title_bar = NULL; + if (args[ARG_title_bar].u_obj != mp_const_none) { + title_bar = mp_arg_validate_type(args[ARG_title_bar].u_obj, &displayio_tilegrid_type, MP_QSTR_title_bar); + } fontio_builtinfont_t *font = mp_arg_validate_type(args[ARG_font].u_obj, &fontio_builtinfont_type, MP_QSTR_font); terminalio_terminal_obj_t *self = m_new_obj(terminalio_terminal_obj_t); self->base.type = &terminalio_terminal_type; - common_hal_terminalio_terminal_construct(self, tilegrid, font); + common_hal_terminalio_terminal_construct(self, scroll_area, font, title_bar); return MP_OBJ_FROM_PTR(self); } diff --git a/shared-bindings/terminalio/Terminal.h b/shared-bindings/terminalio/Terminal.h index f884edd6d5..64609b49b1 100644 --- a/shared-bindings/terminalio/Terminal.h +++ b/shared-bindings/terminalio/Terminal.h @@ -34,7 +34,7 @@ extern const mp_obj_type_t terminalio_terminal_type; extern void common_hal_terminalio_terminal_construct(terminalio_terminal_obj_t *self, - displayio_tilegrid_t *tilegrid, const fontio_builtinfont_t *font); + displayio_tilegrid_t *scroll_area, const fontio_builtinfont_t *font, displayio_tilegrid_t *title_bar); // Write characters. len is in characters NOT bytes! extern size_t common_hal_terminalio_terminal_write(terminalio_terminal_obj_t *self, diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index cb5090d0f4..0b55df70fa 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -439,11 +439,11 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(wifi_radio_set_ipv4_address_obj, 1, wifi_radio //| ipv4_address: Optional[ipaddress.IPv4Address] //| """IP v4 Address of the station when connected to an access point. None otherwise.""" //| -STATIC mp_obj_t wifi_radio_get_ipv4_address(mp_obj_t 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_ipv4_address_obj, wifi_radio_get_ipv4_address); +MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ipv4_address_obj, _wifi_radio_get_ipv4_address); MP_PROPERTY_GETTER(wifi_radio_ipv4_address_obj, (mp_obj_t)&wifi_radio_get_ipv4_address_obj); diff --git a/shared-bindings/wifi/Radio.h b/shared-bindings/wifi/Radio.h index 09a66b2e63..b2593ba8ff 100644 --- a/shared-bindings/wifi/Radio.h +++ b/shared-bindings/wifi/Radio.h @@ -103,6 +103,7 @@ 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_gateway_ap(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_subnet_ap(wifi_radio_obj_t *self); +uint32_t wifi_radio_get_ipv4_address(wifi_radio_obj_t *self); extern mp_obj_t common_hal_wifi_radio_get_ipv4_address(wifi_radio_obj_t *self); extern mp_obj_t common_hal_wifi_radio_get_ipv4_address_ap(wifi_radio_obj_t *self); diff --git a/shared-bindings/wifi/__init__.c b/shared-bindings/wifi/__init__.c index 0f9dee8462..f5bfd3a362 100644 --- a/shared-bindings/wifi/__init__.c +++ b/shared-bindings/wifi/__init__.c @@ -42,7 +42,7 @@ // Called when wifi is imported. STATIC mp_obj_t wifi___init__(void) { - common_hal_wifi_init(); + common_hal_wifi_init(true); return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_0(wifi___init___obj, wifi___init__); diff --git a/shared-bindings/wifi/__init__.h b/shared-bindings/wifi/__init__.h index e626727e77..9553e92ce1 100644 --- a/shared-bindings/wifi/__init__.h +++ b/shared-bindings/wifi/__init__.h @@ -31,7 +31,9 @@ extern wifi_radio_obj_t common_hal_wifi_radio_obj; -void common_hal_wifi_init(void); +void common_hal_wifi_init(bool user_initiated); void common_hal_wifi_gc_collect(void); +void wifi_user_reset(void); + #endif // MICROPY_INCLUDED_SHARED_BINDINGS_WIFI___INIT___H diff --git a/shared-module/displayio/TileGrid.c b/shared-module/displayio/TileGrid.c index 36cbf76619..769c334ac6 100644 --- a/shared-module/displayio/TileGrid.c +++ b/shared-module/displayio/TileGrid.c @@ -296,6 +296,27 @@ void common_hal_displayio_tilegrid_set_tile(displayio_tilegrid_t *self, uint16_t self->partial_change = true; } +void common_hal_displayio_tilegrid_set_all_tiles(displayio_tilegrid_t *self, uint8_t tile_index) { + if (tile_index >= self->tiles_in_bitmap) { + mp_raise_ValueError(translate("Tile index out of bounds")); + } + uint8_t *tiles = self->tiles; + if (self->inline_tiles) { + tiles = (uint8_t *)&self->tiles; + } + if (tiles == NULL) { + return; + } + + for (uint16_t x = 0; x < self->width_in_tiles; x++) { + for (uint16_t y = 0; y < self->height_in_tiles; y++) { + tiles[y * self->width_in_tiles + x] = tile_index; + } + } + + self->full_change = true; +} + bool common_hal_displayio_tilegrid_get_flip_x(displayio_tilegrid_t *self) { return self->flip_x; } diff --git a/shared-module/terminalio/Terminal.c b/shared-module/terminalio/Terminal.c index fc33533b17..d45495d14a 100644 --- a/shared-module/terminalio/Terminal.c +++ b/shared-module/terminalio/Terminal.c @@ -30,24 +30,28 @@ #include "shared-bindings/displayio/TileGrid.h" #include "shared-bindings/terminalio/Terminal.h" -void common_hal_terminalio_terminal_construct(terminalio_terminal_obj_t *self, displayio_tilegrid_t *tilegrid, const fontio_builtinfont_t *font) { +void common_hal_terminalio_terminal_construct(terminalio_terminal_obj_t *self, + displayio_tilegrid_t *scroll_area, const fontio_builtinfont_t *font, + displayio_tilegrid_t *title_bar) { self->cursor_x = 0; self->cursor_y = 0; self->font = font; - self->tilegrid = tilegrid; + self->scroll_area = scroll_area; + self->title_bar = title_bar; + self->title_x = 0; + self->title_y = 0; self->first_row = 0; - for (uint16_t x = 0; x < self->tilegrid->width_in_tiles; x++) { - for (uint16_t y = 0; y < self->tilegrid->height_in_tiles; y++) { - common_hal_displayio_tilegrid_set_tile(self->tilegrid, x, y, 0); - } + common_hal_displayio_tilegrid_set_all_tiles(self->scroll_area, 0); + if (self->title_bar) { + common_hal_displayio_tilegrid_set_all_tiles(self->title_bar, 0); } - common_hal_displayio_tilegrid_set_top_left(self->tilegrid, 0, 1); + common_hal_displayio_tilegrid_set_top_left(self->scroll_area, 0, 1); } size_t common_hal_terminalio_terminal_write(terminalio_terminal_obj_t *self, const byte *data, size_t len, int *errcode) { // Make sure the terminal is initialized before we do anything with it. - if (self->tilegrid == NULL) { + if (self->scroll_area == NULL) { return len; } const byte *i = data; @@ -55,11 +59,34 @@ size_t common_hal_terminalio_terminal_write(terminalio_terminal_obj_t *self, con while (i < data + len) { unichar c = utf8_get_char(i); i = utf8_next_char(i); + if (self->in_osc_command) { + if (c == 0x1b && i[0] == '\\') { + self->in_osc_command = false; + self->title_x = 0; + self->title_y = 0; + i += 1; + } else if (self->osc_command == 0 && self->title_bar != NULL && self->title_y < self->title_bar->height_in_tiles) { + uint8_t tile_index = fontio_builtinfont_get_glyph_index(self->font, c); + if (tile_index != 0xff) { + // Clear the tile grid before we start putting new info. + if (self->title_x == 0 && self->title_y == 0) { + common_hal_displayio_tilegrid_set_all_tiles(self->title_bar, 0); + } + common_hal_displayio_tilegrid_set_tile(self->title_bar, self->title_x, self->title_y, tile_index); + self->title_x++; + if (self->title_x >= self->title_bar->width_in_tiles) { + self->title_y++; + self->title_x %= self->title_bar->width_in_tiles; + } + } + } + continue; + } // Always handle ASCII. if (c < 128) { if (c >= 0x20 && c <= 0x7e) { uint8_t tile_index = fontio_builtinfont_get_glyph_index(self->font, c); - common_hal_displayio_tilegrid_set_tile(self->tilegrid, self->cursor_x, self->cursor_y, tile_index); + common_hal_displayio_tilegrid_set_tile(self->scroll_area, self->cursor_x, self->cursor_y, tile_index); self->cursor_x++; } else if (c == '\r') { self->cursor_x = 0; @@ -71,25 +98,25 @@ size_t common_hal_terminalio_terminal_write(terminalio_terminal_obj_t *self, con self->cursor_x--; } } else if (c == 0x1b) { + // Handle commands of the form \x1b.####D where . is ignored. + uint16_t n = 0; + uint8_t j = 1; + for (; j < 6; j++) { + if ('0' <= i[j] && i[j] <= '9') { + n = n * 10 + (i[j] - '0'); + } else { + c = i[j]; + break; + } + } if (i[0] == '[') { if (i[1] == 'K') { // Clear the rest of the line. - for (uint16_t j = self->cursor_x; j < self->tilegrid->width_in_tiles; j++) { - common_hal_displayio_tilegrid_set_tile(self->tilegrid, j, self->cursor_y, 0); + for (uint16_t k = self->cursor_x; k < self->scroll_area->width_in_tiles; k++) { + common_hal_displayio_tilegrid_set_tile(self->scroll_area, k, self->cursor_y, 0); } i += 2; } else { - // Handle commands of the form \x1b[####D - uint16_t n = 0; - uint8_t j = 1; - for (; j < 6; j++) { - if ('0' <= i[j] && i[j] <= '9') { - n = n * 10 + (i[j] - '0'); - } else { - c = i[j]; - break; - } - } if (c == 'D') { if (n > self->cursor_x) { self->cursor_x = 0; @@ -99,14 +126,10 @@ size_t common_hal_terminalio_terminal_write(terminalio_terminal_obj_t *self, con } if (c == 'J') { if (n == 2) { - common_hal_displayio_tilegrid_set_top_left(self->tilegrid, 0, 0); + common_hal_displayio_tilegrid_set_top_left(self->scroll_area, 0, 0); self->cursor_x = self->cursor_y = start_y = 0; n = 0; - for (uint16_t x = 0; x < self->tilegrid->width_in_tiles; x++) { - for (uint16_t y = 0; y < self->tilegrid->height_in_tiles; y++) { - common_hal_displayio_tilegrid_set_tile(self->tilegrid, x, y, 0); - } - } + common_hal_displayio_tilegrid_set_all_tiles(self->scroll_area, 0); } } if (c == ';') { @@ -126,13 +149,13 @@ size_t common_hal_terminalio_terminal_write(terminalio_terminal_obj_t *self, con if (m > 0) { m--; } - if (n >= self->tilegrid->height_in_tiles) { - n = self->tilegrid->height_in_tiles - 1; + if (n >= self->scroll_area->height_in_tiles) { + n = self->scroll_area->height_in_tiles - 1; } - if (m >= self->tilegrid->width_in_tiles) { - m = self->tilegrid->width_in_tiles - 1; + if (m >= self->scroll_area->width_in_tiles) { + m = self->scroll_area->width_in_tiles - 1; } - n = (n + self->tilegrid->top_left_y) % self->tilegrid->height_in_tiles; + n = (n + self->scroll_area->top_left_y) % self->scroll_area->height_in_tiles; self->cursor_x = m; self->cursor_y = n; start_y = self->cursor_y; @@ -141,30 +164,34 @@ size_t common_hal_terminalio_terminal_write(terminalio_terminal_obj_t *self, con i += j + 1; continue; } + } else if (i[0] == ']' && c == ';') { + self->in_osc_command = true; + self->osc_command = n; + i += j + 1; } } } else { uint8_t tile_index = fontio_builtinfont_get_glyph_index(self->font, c); if (tile_index != 0xff) { - common_hal_displayio_tilegrid_set_tile(self->tilegrid, self->cursor_x, self->cursor_y, tile_index); + common_hal_displayio_tilegrid_set_tile(self->scroll_area, self->cursor_x, self->cursor_y, tile_index); self->cursor_x++; } } - if (self->cursor_x >= self->tilegrid->width_in_tiles) { + if (self->cursor_x >= self->scroll_area->width_in_tiles) { self->cursor_y++; - self->cursor_x %= self->tilegrid->width_in_tiles; + self->cursor_x %= self->scroll_area->width_in_tiles; } - if (self->cursor_y >= self->tilegrid->height_in_tiles) { - self->cursor_y %= self->tilegrid->height_in_tiles; + if (self->cursor_y >= self->scroll_area->height_in_tiles) { + self->cursor_y %= self->scroll_area->height_in_tiles; } if (self->cursor_y != start_y) { // clear the new row in case of scroll up - if (self->cursor_y == self->tilegrid->top_left_y) { - for (uint16_t j = 0; j < self->tilegrid->width_in_tiles; j++) { - common_hal_displayio_tilegrid_set_tile(self->tilegrid, j, self->cursor_y, 0); + if (self->cursor_y == self->scroll_area->top_left_y) { + for (uint16_t j = 0; j < self->scroll_area->width_in_tiles; j++) { + common_hal_displayio_tilegrid_set_tile(self->scroll_area, j, self->cursor_y, 0); } - common_hal_displayio_tilegrid_set_top_left(self->tilegrid, 0, (self->cursor_y + self->tilegrid->height_in_tiles + 1) % self->tilegrid->height_in_tiles); + common_hal_displayio_tilegrid_set_top_left(self->scroll_area, 0, (self->cursor_y + self->scroll_area->height_in_tiles + 1) % self->scroll_area->height_in_tiles); } start_y = self->cursor_y; } @@ -173,5 +200,5 @@ size_t common_hal_terminalio_terminal_write(terminalio_terminal_obj_t *self, con } bool common_hal_terminalio_terminal_ready_to_tx(terminalio_terminal_obj_t *self) { - return self->tilegrid != NULL; + return self->scroll_area != NULL; } diff --git a/shared-module/terminalio/Terminal.h b/shared-module/terminalio/Terminal.h index 2ba7e21f72..2e628f5df6 100644 --- a/shared-module/terminalio/Terminal.h +++ b/shared-module/terminalio/Terminal.h @@ -39,8 +39,13 @@ typedef struct { const fontio_builtinfont_t *font; uint16_t cursor_x; uint16_t cursor_y; - displayio_tilegrid_t *tilegrid; + displayio_tilegrid_t *scroll_area; + displayio_tilegrid_t *title_bar; + uint16_t title_x; + uint16_t title_y; uint16_t first_row; + uint16_t osc_command; + bool in_osc_command; } terminalio_terminal_obj_t; #endif /* SHARED_MODULE_TERMINALIO_TERMINAL_H */ diff --git a/supervisor/shared/background_callback.c b/supervisor/shared/background_callback.c index e53edb506f..88ffc15911 100644 --- a/supervisor/shared/background_callback.c +++ b/supervisor/shared/background_callback.c @@ -111,16 +111,28 @@ void background_callback_end_critical_section() { CALLBACK_CRITICAL_END; } + +// Filter out queued callbacks if they are allocated on the heap. void background_callback_reset() { + background_callback_t *new_head = NULL; + background_callback_t **previous_next = &new_head; + background_callback_t *new_tail = NULL; 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)); + if (!HEAP_PTR((void *)cb)) { + *previous_next = cb; + previous_next = &cb->next; + cb->next = NULL; + new_tail = cb; + } else { + memset(cb, 0, sizeof(*cb)); + } cb = next; } - callback_head = NULL; - callback_tail = NULL; + callback_head = new_head; + callback_tail = new_tail; in_background_callback = false; CALLBACK_CRITICAL_END; } diff --git a/supervisor/shared/display.c b/supervisor/shared/display.c index a8a9b056f2..849b9c3fe2 100644 --- a/supervisor/shared/display.c +++ b/supervisor/shared/display.c @@ -61,37 +61,26 @@ void supervisor_start_terminal(uint16_t width_px, uint16_t height_px) { uint8_t scale = 2; #if CIRCUITPY_TERMINALIO - displayio_tilegrid_t *grid = &supervisor_terminal_text_grid; - bool tall = height_px > width_px; + displayio_tilegrid_t *scroll_area = &supervisor_terminal_scroll_area_text_grid; + displayio_tilegrid_t *title_bar = &supervisor_terminal_title_bar_text_grid; bool reset_tiles = false; - #if CIRCUITPY_REPL_LOGO - uint16_t terminal_width_px = tall ? width_px : width_px - blinka_bitmap.width; - uint16_t terminal_height_px = tall ? height_px - blinka_bitmap.height : height_px; - #else - uint16_t terminal_width_px = width_px; - uint16_t terminal_height_px = height_px; - #endif - uint16_t width_in_tiles = terminal_width_px / grid->tile_width; + uint16_t width_in_tiles = width_px / scroll_area->tile_width; // determine scale based on h if (width_in_tiles < 80) { scale = 1; } - width_in_tiles = terminal_width_px / (grid->tile_width * scale); + width_in_tiles = width_px / (scroll_area->tile_width * scale); if (width_in_tiles < 1) { width_in_tiles = 1; } - uint16_t height_in_tiles = terminal_height_px / (grid->tile_height * scale); - uint16_t remaining_pixels = tall ? 0 : terminal_height_px % (grid->tile_height * scale); - if (height_in_tiles < 1 || remaining_pixels > 0) { - height_in_tiles += 1; - } + uint16_t height_in_tiles = height_px / (scroll_area->tile_height * scale); uint16_t total_tiles = width_in_tiles * height_in_tiles; // check if the terminal tile dimensions are the same - if ((grid->width_in_tiles != width_in_tiles) || - (grid->height_in_tiles != height_in_tiles)) { + if ((scroll_area->width_in_tiles != width_in_tiles) || + (scroll_area->height_in_tiles != height_in_tiles - 1)) { reset_tiles = true; } // Reuse the previous allocation if possible @@ -114,27 +103,39 @@ void supervisor_start_terminal(uint16_t width_px, uint16_t height_px) { uint8_t *tiles = (uint8_t *)tilegrid_tiles->ptr; #if CIRCUITPY_REPL_LOGO - grid->y = tall ? blinka_bitmap.height : 0; - grid->x = tall ? 0 : blinka_bitmap.width; + title_bar->x = blinka_bitmap.width; + // Align the title bar to the bottom of the logo. + title_bar->y = blinka_bitmap.height - title_bar->tile_height; #else - grid->y = 0; - grid->x = 0; + title_bar->x = 0; + title_bar->y = 0; #endif - grid->top_left_y = 0; - if (remaining_pixels > 0) { - grid->y -= (grid->tile_height - remaining_pixels); - } - grid->width_in_tiles = width_in_tiles; - grid->height_in_tiles = height_in_tiles; + title_bar->top_left_y = 0; + title_bar->width_in_tiles = width_in_tiles; + title_bar->height_in_tiles = 1; 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; + title_bar->pixel_width = width_in_tiles * title_bar->tile_width; + title_bar->pixel_height = title_bar->tile_height; + title_bar->tiles = tiles; + title_bar->full_change = true; - grid->full_change = true; + scroll_area->x = 0; + #if CIRCUITPY_REPL_LOGO + scroll_area->y = blinka_bitmap.height; + #else + scroll_area->y = scroll_area->tile_height; + #endif + scroll_area->top_left_y = 0; + scroll_area->width_in_tiles = width_in_tiles; + scroll_area->height_in_tiles = height_in_tiles - 1; + assert(width_in_tiles > 0); + assert(height_in_tiles > 1); + scroll_area->pixel_width = width_in_tiles * scroll_area->tile_width; + scroll_area->pixel_height = (height_in_tiles - 1) * scroll_area->tile_height; + scroll_area->tiles = tiles + width_in_tiles; + scroll_area->full_change = true; - common_hal_terminalio_terminal_construct(&supervisor_terminal, grid, &supervisor_terminal_font); + common_hal_terminalio_terminal_construct(&supervisor_terminal, scroll_area, &supervisor_terminal_font, title_bar); } #endif @@ -146,18 +147,24 @@ void supervisor_stop_terminal(void) { if (tilegrid_tiles != NULL) { free_memory(tilegrid_tiles); tilegrid_tiles = NULL; - supervisor_terminal_text_grid.tiles = NULL; - supervisor_terminal.tilegrid = NULL; + supervisor_terminal_scroll_area_text_grid.tiles = NULL; + supervisor_terminal_title_bar_text_grid.tiles = NULL; + supervisor_terminal.scroll_area = NULL; + supervisor_terminal.title_bar = NULL; } #endif } void supervisor_display_move_memory(void) { #if CIRCUITPY_TERMINALIO + displayio_tilegrid_t *scroll_area = &supervisor_terminal_scroll_area_text_grid; + displayio_tilegrid_t *title_bar = &supervisor_terminal_title_bar_text_grid; if (tilegrid_tiles != NULL) { - supervisor_terminal_text_grid.tiles = (uint8_t *)tilegrid_tiles->ptr; + title_bar->tiles = (uint8_t *)tilegrid_tiles->ptr; + scroll_area->tiles = (uint8_t *)tilegrid_tiles->ptr + scroll_area->width_in_tiles; } else { - supervisor_terminal_text_grid.tiles = NULL; + scroll_area->tiles = NULL; + title_bar->tiles = NULL; } #endif @@ -298,21 +305,21 @@ displayio_tilegrid_t blinka_sprite = { #if CIRCUITPY_TERMINALIO #if CIRCUITPY_REPL_LOGO -mp_obj_t members[] = { &blinka_sprite, &supervisor_terminal_text_grid, }; +mp_obj_t members[] = { &blinka_sprite, &supervisor_terminal_title_bar_text_grid, &supervisor_terminal_scroll_area_text_grid, }; +mp_obj_list_t splash_children = { + .base = {.type = &mp_type_list }, + .alloc = 3, + .len = 3, + .items = members, +}; +#else +mp_obj_t members[] = { &supervisor_terminal_title_bar_text_grid, &supervisor_terminal_scroll_area_text_grid, }; mp_obj_list_t splash_children = { .base = {.type = &mp_type_list }, .alloc = 2, .len = 2, .items = members, }; -#else -mp_obj_t members[] = { &supervisor_terminal_text_grid, }; -mp_obj_list_t splash_children = { - .base = {.type = &mp_type_list }, - .alloc = 1, - .len = 1, - .items = members, -}; #endif #else #if CIRCUITPY_REPL_LOGO diff --git a/supervisor/shared/display.h b/supervisor/shared/display.h index 4110cfe8e4..d965fdc764 100644 --- a/supervisor/shared/display.h +++ b/supervisor/shared/display.h @@ -43,7 +43,8 @@ extern const fontio_builtinfont_t supervisor_terminal_font; // These will change so they must live in RAM. extern displayio_bitmap_t supervisor_terminal_font_bitmap; -extern displayio_tilegrid_t supervisor_terminal_text_grid; +extern displayio_tilegrid_t supervisor_terminal_scroll_area_text_grid; +extern displayio_tilegrid_t supervisor_terminal_title_bar_text_grid; extern terminalio_terminal_obj_t supervisor_terminal; #endif diff --git a/supervisor/shared/translate/translate_impl.h b/supervisor/shared/translate/translate_impl.h index ff90aae525..1c144197cb 100644 --- a/supervisor/shared/translate/translate_impl.h +++ b/supervisor/shared/translate/translate_impl.h @@ -45,7 +45,7 @@ static #endif inline // gcc10 -flto has issues with this being always_inline for debug builds. -#if CIRCUITPY_DEBUG < 1 +#if !CIRCUITPY_LTO || CIRCUITPY_DEBUG < 1 __attribute__((always_inline)) #endif const compressed_string_t *translate(const char *original) { diff --git a/supervisor/shared/web_workflow/web_workflow.c b/supervisor/shared/web_workflow/web_workflow.c new file mode 100644 index 0000000000..dcc79ecf27 --- /dev/null +++ b/supervisor/shared/web_workflow/web_workflow.c @@ -0,0 +1,92 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include "shared-bindings/wifi/Radio.h" +#include "supervisor/shared/translate/translate.h" +#include "supervisor/shared/web_workflow/web_workflow.h" + +#if CIRCUITPY_WIFI +#include "shared-bindings/wifi/__init__.h" +#endif + +#if CIRCUITPY_DOTENV +#include "shared-module/dotenv/__init__.h" +#endif + +static wifi_radio_error_t wifi_status = WIFI_RADIO_ERROR_NONE; + +void supervisor_web_workflow_status(void) { + serial_write_compressed(translate("Wi-Fi: ")); + if (common_hal_wifi_radio_get_enabled(&common_hal_wifi_radio_obj)) { + uint32_t ipv4_address = wifi_radio_get_ipv4_address(&common_hal_wifi_radio_obj); + if (wifi_status != WIFI_RADIO_ERROR_NONE) { + mp_printf(&mp_plat_print, "%d", wifi_status); + } else if (ipv4_address == 0) { + serial_write_compressed(translate("No IP")); + } else { + uint8_t *octets = (uint8_t *)&ipv4_address; + mp_printf(&mp_plat_print, "%d.%d.%d.%d", octets[0], octets[1], octets[2], octets[3]); + } + } else { + serial_write_compressed(translate("off")); + } +} + +void supervisor_start_web_workflow(void) { + #if CIRCUITPY_WEB_WORKFLOW && CIRCUITPY_WIFI + char ssid[33]; + char password[64]; + mp_int_t ssid_len = 0; + mp_int_t password_len = 0; + + #if CIRCUITPY_DOTENV + ssid_len = dotenv_get_key("/.env", "CIRCUITPY_WIFI_SSID", ssid, sizeof(ssid) - 1); + password_len = dotenv_get_key("/.env", "CIRCUITPY_WIFI_PASSWORD", password, sizeof(password) - 1); + #endif + if (ssid_len <= 0 || (size_t)ssid_len >= sizeof(ssid) || + password_len <= 0 || (size_t)password_len >= sizeof(password)) { + return; + } + common_hal_wifi_init(false); + common_hal_wifi_radio_set_enabled(&common_hal_wifi_radio_obj, true); + + // NUL terminate the strings because dotenv doesn't. + ssid[ssid_len] = '\0'; + password[password_len] = '\0'; + wifi_status = common_hal_wifi_radio_connect( + &common_hal_wifi_radio_obj, (uint8_t *)ssid, ssid_len, (uint8_t *)password, password_len, + 0, 1, NULL, 0); + + if (wifi_status != WIFI_RADIO_ERROR_NONE) { + common_hal_wifi_radio_set_enabled(&common_hal_wifi_radio_obj, false); + } + #endif +} + +void supervisor_stop_web_workflow(void) { +} diff --git a/supervisor/shared/web_workflow/web_workflow.h b/supervisor/shared/web_workflow/web_workflow.h new file mode 100644 index 0000000000..6e550aaa9d --- /dev/null +++ b/supervisor/shared/web_workflow/web_workflow.h @@ -0,0 +1,35 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#pragma once + +#include + +void supervisor_wifi_background(void); +void supervisor_wifi_init(void); +void supervisor_web_workflow_status(void); +void supervisor_start_web_workflow(void); +void supervisor_stop_web_workflow(void); diff --git a/supervisor/shared/workflow.c b/supervisor/shared/workflow.c index 8d2c0f74fc..335f0f3b97 100644 --- a/supervisor/shared/workflow.c +++ b/supervisor/shared/workflow.c @@ -26,14 +26,61 @@ #include #include "py/mpconfig.h" +#include "supervisor/background_callback.h" #include "supervisor/workflow.h" +#include "supervisor/serial.h" #include "supervisor/shared/workflow.h" +#if CIRCUITPY_BLEIO +#include "shared-bindings/_bleio/__init__.h" +#include "supervisor/shared/bluetooth/bluetooth.h" +#endif + #if CIRCUITPY_USB +#include "supervisor/usb.h" #include "tusb.h" #endif +#if CIRCUITPY_WEB_WORKFLOW +#include "supervisor/shared/web_workflow/web_workflow.h" +#endif +static background_callback_t workflow_background_cb; + +static void supervisor_workflow_update_status_bar(void) { + // Neighboring "" "" are concatenated by the compiler. Without this separation, the hex code + // doesn't get terminated after two following characters and the value is invalid. + // This is the OSC command to set the title and the icon text. It can be up to 255 characters + // but some may be cut off. + serial_write("\x1b" "]0;"); + serial_write("🐍 "); + #if CIRCUITPY_WEB_WORKFLOW + supervisor_web_workflow_status(); + #endif + // Send string terminator + serial_write("\x1b" "\\"); +} + +static void workflow_background(void *data) { + supervisor_workflow_update_status_bar(); +} + +// Called during a VM reset. Doesn't actually reset things. void supervisor_workflow_reset(void) { + #if CIRCUITPY_BLEIO + supervisor_start_bluetooth(); + #endif + + #if CIRCUITPY_WEB_WORKFLOW + supervisor_start_web_workflow(); + #endif + + workflow_background_cb.fun = workflow_background; + workflow_background_cb.data = NULL; + supervisor_workflow_request_background(); +} + +void supervisor_workflow_request_background(void) { + background_callback_add_core(&workflow_background_cb); } // Return true as soon as USB communication with host has started, @@ -58,3 +105,25 @@ bool supervisor_workflow_active(void) { return false; #endif } + +void supervisor_workflow_start(void) { + // Start USB after giving boot.py a chance to tweak behavior. + #if CIRCUITPY_USB + // Setup USB connection after heap is available. + // It needs the heap to build descriptors. + usb_init(); + #endif + + // Set up any other serial connection. + serial_init(); + + #if CIRCUITPY_BLEIO + bleio_reset(); + supervisor_bluetooth_enable_workflow(); + supervisor_start_bluetooth(); + #endif + + #if CIRCUITPY_WEB_WORKFLOW + supervisor_start_web_workflow(); + #endif +} diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index d5c49aa7fc..2fa9ff1f0e 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -146,6 +146,10 @@ ifeq ($(CIRCUITPY_USB),1) endif endif +ifeq ($(CIRCUITPY_WEB_WORKFLOW),1) + SRC_SUPERVISOR += supervisor/shared/web_workflow/web_workflow.c +endif + SRC_TINYUSB = $(filter lib/tinyusb/%.c, $(SRC_SUPERVISOR)) $(patsubst %.c,$(BUILD)/%.o,$(SRC_TINYUSB)): CFLAGS += -Wno-missing-prototypes diff --git a/supervisor/workflow.h b/supervisor/workflow.h index 31900392cd..f550f8e88c 100755 --- a/supervisor/workflow.h +++ b/supervisor/workflow.h @@ -30,3 +30,7 @@ void supervisor_workflow_reset(void); // True when the user could be actively iterating on their code. bool supervisor_workflow_active(void); + +void supervisor_workflow_request_background(void); + +void supervisor_workflow_start(void); diff --git a/tools/gen_display_resources.py b/tools/gen_display_resources.py index 552e5f1245..3c481cc812 100644 --- a/tools/gen_display_resources.py +++ b/tools/gen_display_resources.py @@ -139,11 +139,41 @@ displayio_palette_t supervisor_terminal_color = { c_file.write( """\ -displayio_tilegrid_t supervisor_terminal_text_grid = {{ +displayio_tilegrid_t supervisor_terminal_scroll_area_text_grid = {{ .base = {{ .type = &displayio_tilegrid_type }}, .bitmap = (displayio_bitmap_t*) &supervisor_terminal_font_bitmap, .pixel_shader = &supervisor_terminal_color, - .x = 16, + .x = 0, + .y = 0, + .pixel_width = {1}, + .pixel_height = {2}, + .bitmap_width_in_tiles = {0}, + .tiles_in_bitmap = {0}, + .width_in_tiles = 1, + .height_in_tiles = 1, + .tile_width = {1}, + .tile_height = {2}, + .tiles = NULL, + .partial_change = false, + .full_change = false, + .hidden = false, + .hidden_by_parent = false, + .moved = false, + .inline_tiles = false, + .in_group = true +}}; +""".format( + len(all_characters), tile_x, tile_y + ) +) + +c_file.write( + """\ +displayio_tilegrid_t supervisor_terminal_title_bar_text_grid = {{ + .base = {{ .type = &displayio_tilegrid_type }}, + .bitmap = (displayio_bitmap_t*) &supervisor_terminal_font_bitmap, + .pixel_shader = &supervisor_terminal_color, + .x = 0, .y = 0, .pixel_width = {1}, .pixel_height = {2}, @@ -228,7 +258,8 @@ terminalio_terminal_obj_t supervisor_terminal = { .font = &supervisor_terminal_font, .cursor_x = 0, .cursor_y = 0, - .tilegrid = NULL + .scroll_area = NULL, + .title_bar = NULL }; """ ) From 09091ecb8351f62cfd57859dd7e207e90e6bc8a4 Mon Sep 17 00:00:00 2001 From: Roberto Tyley Date: Fri, 10 Jun 2022 08:28:58 +0100 Subject: [PATCH 225/246] Enable collections deque for CIRCUITPY_FULL_BUILD I'd like to use `collections.deque`: https://docs.circuitpython.org/en/latest/docs/library/collections.html#collections.deque ...on my RP2040-based Keybow 2040 (https://circuitpython.org/board/pimoroni_keybow2040/). For MicroPython, `collections.deque` is enabled for all `rp2` devices, because they all have `MICROPY_CONFIG_ROM_LEVEL` set to 'extra features': https://github.com/micropython/micropython/blob/cf7d962cf38db296d1ac419fc4d5302b64c59644/ports/rp2/mpconfigport.h#L44 ...which includes `MICROPY_PY_COLLECTIONS_DEQUE` (see https://github.com/micropython/micropython/blob/6bda80d81147217a1d830b99b93d2e35d372e8f9/py/mpconfig.h#L1225-L1227 ). For CircuitPython, it looks like `MICROPY_CONFIG_ROM_LEVEL` defaults to 'core' (`MICROPY_CONFIG_ROM_LEVEL_CORE_FEATURES`) and isn't updated against any of the ports, so the only port getting `collections.deque` is the `unix` port, which explcitly sets `MICROPY_PY_COLLECTIONS_DEQUE`: https://github.com/adafruit/circuitpython/blob/6925a001382d41940ea9b412b1d1ba517d9880f9/ports/unix/mpconfigport.h#L134 At Dan Halbert's suggestion... https://github.com/adafruit/circuitpython/pull/6474#issuecomment-1152364768 ... this commit enables `MICROPY_PY_COLLECTIONS_DEQUE` for all builds where `CIRCUITPY_FULL_BUILD` is true - which includes Raspberry Pi: https://github.com/adafruit/circuitpython/blob/6925a001382d41940ea9b412b1d1ba517d9880f9/ports/raspberrypi/mpconfigport.mk#L11 See also: * https://github.com/adafruit/circuitpython/issues/5734 * https://github.com/micropython/micropython/commit/970eedce8f37af46cb2b67fa0e91d76c82057541 which originally added collections.deque to MicroPython --- py/circuitpy_mpconfig.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 24d8fb98ca..973f7caf1d 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -226,6 +226,9 @@ typedef long mp_off_t; #ifndef MICROPY_PY_COLLECTIONS_ORDEREDDICT #define MICROPY_PY_COLLECTIONS_ORDEREDDICT (CIRCUITPY_FULL_BUILD) #endif +#ifndef MICROPY_PY_COLLECTIONS_DEQUE +#define MICROPY_PY_COLLECTIONS_DEQUE (CIRCUITPY_FULL_BUILD) +#endif #define MICROPY_PY_URE_MATCH_GROUPS (CIRCUITPY_RE) #define MICROPY_PY_URE_MATCH_SPAN_START_END (CIRCUITPY_RE) #define MICROPY_PY_URE_SUB (CIRCUITPY_RE) From 6e090c96a559672bc94490494b336c13f90d473b Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 10 Jun 2022 16:24:52 -0400 Subject: [PATCH 226/246] squeeze some specialized builds --- ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk | 2 ++ ports/atmel-samd/mpconfigport.h | 1 + ports/nrf/boards/bluemicro833/mpconfigboard.mk | 1 + ports/nrf/boards/pca10100/mpconfigboard.mk | 1 + ports/nrf/boards/simmel/mpconfigboard.mk | 1 + 5 files changed, 6 insertions(+) diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk index 11abb8a727..9bc50ab429 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk @@ -27,6 +27,8 @@ CIRCUITPY_PS2IO = 0 CIRCUITPY_RGBMATRIX = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_TOUCHIO = 0 +CIRCUITPY_USB_HID = 0 +CIRCUITPY_USB_MIDI = 0 CIRCUITPY_ULAB = 0 diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index e200ce67db..9d4ddd7134 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -46,6 +46,7 @@ #define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (0) #define MICROPY_PY_FUNCTION_ATTRS (0) #define MICROPY_PY_REVERSE_SPECIAL_METHODS (0) +#define MICROPY_PY_COLLECTIONS_DEQUE (0) #define MICROPY_PY_COLLECTIONS_ORDEREDDICT (0) #define MICROPY_PY_UERRNO_LIST \ X(EPERM) \ diff --git a/ports/nrf/boards/bluemicro833/mpconfigboard.mk b/ports/nrf/boards/bluemicro833/mpconfigboard.mk index bfefcbf100..61dc4de325 100644 --- a/ports/nrf/boards/bluemicro833/mpconfigboard.mk +++ b/ports/nrf/boards/bluemicro833/mpconfigboard.mk @@ -23,6 +23,7 @@ CIRCUITPY_COUNTIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_FREQUENCYIO = 0 +CIRCUITPY_GETPASS = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_JSON = 0 CIRCUITPY_KEYPAD = 1 diff --git a/ports/nrf/boards/pca10100/mpconfigboard.mk b/ports/nrf/boards/pca10100/mpconfigboard.mk index 553da88963..88ed0cfb14 100644 --- a/ports/nrf/boards/pca10100/mpconfigboard.mk +++ b/ports/nrf/boards/pca10100/mpconfigboard.mk @@ -18,6 +18,7 @@ CIRCUITPY_COUNTIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_FREQUENCYIO = 0 +CIRCUITPY_GETPASS = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_JSON = 0 CIRCUITPY_KEYPAD = 0 diff --git a/ports/nrf/boards/simmel/mpconfigboard.mk b/ports/nrf/boards/simmel/mpconfigboard.mk index faf9d2d1e3..68aae1f503 100644 --- a/ports/nrf/boards/simmel/mpconfigboard.mk +++ b/ports/nrf/boards/simmel/mpconfigboard.mk @@ -14,6 +14,7 @@ CIRCUITPY_ALARM = 0 CIRCUITPY_AESIO = 1 CIRCUITPY_AUDIOMIXER = 0 CIRCUITPY_AUDIOMP3 = 0 +CIRCUITPY_BITBANGIO = 0 CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_BUSDEVICE = 0 CIRCUITPY_BUSIO = 1 From b6c7815f83d4da190f52f9dc9c5d9000f3e599dd Mon Sep 17 00:00:00 2001 From: foamyguy Date: Fri, 10 Jun 2022 18:01:02 -0500 Subject: [PATCH 227/246] improving rotozoom() argument docstrings --- shared-bindings/bitmaptools/__init__.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/shared-bindings/bitmaptools/__init__.c b/shared-bindings/bitmaptools/__init__.c index 5122d039e8..6c00ca44a9 100644 --- a/shared-bindings/bitmaptools/__init__.c +++ b/shared-bindings/bitmaptools/__init__.c @@ -139,23 +139,29 @@ STATIC void validate_clip_region(displayio_bitmap_t *bitmap, mp_obj_t clip0_tupl //| :param bitmap dest_bitmap: Destination bitmap that will be copied into //| :param bitmap source_bitmap: Source bitmap that contains the graphical region to be copied //| :param int ox: Horizontal pixel location in destination bitmap where source bitmap -//| point (px,py) is placed +//| point (px,py) is placed. Defaults to None which causes it to use the horizontal +//| midway point of the destination bitmap. //| :param int oy: Vertical pixel location in destination bitmap where source bitmap -//| point (px,py) is placed +//| point (px,py) is placed. Defaults to None which causes it to use the vertical +//| midway point of the destination bitmap. //| :param Tuple[int,int] dest_clip0: First corner of rectangular destination clipping //| region that constrains region of writing into destination bitmap //| :param Tuple[int,int] dest_clip1: Second corner of rectangular destination clipping //| region that constrains region of writing into destination bitmap //| :param int px: Horizontal pixel location in source bitmap that is placed into the -//| destination bitmap at (ox,oy) +//| destination bitmap at (ox,oy). Defaults to None which causes it to use the +//| horizontal midway point in the source bitmap. //| :param int py: Vertical pixel location in source bitmap that is placed into the -//| destination bitmap at (ox,oy) +//| destination bitmap at (ox,oy). Defaults to None which causes it to use the +//| vertical midway point in the source bitmap. //| :param Tuple[int,int] source_clip0: First corner of rectangular source clipping //| region that constrains region of reading from the source bitmap //| :param Tuple[int,int] source_clip1: Second corner of rectangular source clipping //| region that constrains region of reading from the source bitmap -//| :param float angle: Angle of rotation, in radians (positive is clockwise direction) -//| :param float scale: Scaling factor +//| :param float angle: Angle of rotation, in radians (positive is clockwise direction). +//| Defaults to None which gets treated as 0.0 radians or no rotation. +//| :param float scale: Scaling factor. Defaults to None which gets treated as 1.0 or same +//| as original source size. //| :param int skip_index: Bitmap palette index in the source that will not be copied, //| set to None to copy all pixels""" //| ... From a8896384686e0ec5830b1629a203f835d88b6f2e Mon Sep 17 00:00:00 2001 From: Matthew McGowan Date: Tue, 7 Jun 2022 13:39:31 -0700 Subject: [PATCH 228/246] feat(swan_r5): adds a basic RTC implementation. --- ports/stm/boards/swan_r5/mpconfigboard.mk | 1 + ports/stm/common-hal/rtc/RTC.c | 54 +++++++++++++++++++++++ ports/stm/common-hal/rtc/RTC.h | 33 ++++++++++++++ ports/stm/common-hal/rtc/__init__.c | 0 ports/stm/common-hal/rtc/__init__.h | 0 ports/stm/peripherals/rtc.c | 41 +++++++++++++++++ ports/stm/peripherals/rtc.h | 7 +++ ports/stm/supervisor/port.c | 7 +++ 8 files changed, 143 insertions(+) create mode 100644 ports/stm/common-hal/rtc/RTC.c create mode 100644 ports/stm/common-hal/rtc/RTC.h create mode 100644 ports/stm/common-hal/rtc/__init__.c create mode 100644 ports/stm/common-hal/rtc/__init__.h diff --git a/ports/stm/boards/swan_r5/mpconfigboard.mk b/ports/stm/boards/swan_r5/mpconfigboard.mk index a451b3d18f..5d51c9406b 100644 --- a/ports/stm/boards/swan_r5/mpconfigboard.mk +++ b/ports/stm/boards/swan_r5/mpconfigboard.mk @@ -70,3 +70,4 @@ CIRCUITPY_BLEIO = 0 CIRCUITPY_BUSDEVICE = 0 CIRCUITPY_KEYPAD = 1 CIRCUITPY_RGBMATRIX = 0 +CIRCUITPY_RTC = 1 diff --git a/ports/stm/common-hal/rtc/RTC.c b/ports/stm/common-hal/rtc/RTC.c new file mode 100644 index 0000000000..1ea2d63ebf --- /dev/null +++ b/ports/stm/common-hal/rtc/RTC.c @@ -0,0 +1,54 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 20212 Matthew McGowan for Blues Wireless Inc + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include "py/obj.h" +#include "py/runtime.h" +#include "shared/timeutils/timeutils.h" +#include "shared-bindings/rtc/__init__.h" +#include "common-hal/rtc/RTC.h" +#include "shared-bindings/rtc/RTC.h" +#include "supervisor/port.h" +#include "supervisor/shared/translate.h" +#include "peripherals/rtc.h" + + +void common_hal_rtc_set_time(timeutils_struct_time_t *tm) { + stm32_peripherals_rtc_set_time(tm); +} + +void common_hal_rtc_get_time(timeutils_struct_time_t *tm) { + stm32_peripherals_rtc_get_time(tm); +} + +int common_hal_rtc_get_calibration(void) { + return 0; +} + +void common_hal_rtc_set_calibration(int calibration) { + mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_calibration); +} diff --git a/ports/stm/common-hal/rtc/RTC.h b/ports/stm/common-hal/rtc/RTC.h new file mode 100644 index 0000000000..d0ba720bfc --- /dev/null +++ b/ports/stm/common-hal/rtc/RTC.h @@ -0,0 +1,33 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Matthew McGowan for Blues Wireless Inc + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM_COMMON_HAL_RTC_RTC_H +#define MICROPY_INCLUDED_STM_COMMON_HAL_RTC_RTC_H + +extern void rtc_init(void); +extern void rtc_reset(void); + +#endif // MICROPY_INCLUDED_STM_COMMON_HAL_RTC_RTC_H diff --git a/ports/stm/common-hal/rtc/__init__.c b/ports/stm/common-hal/rtc/__init__.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/stm/common-hal/rtc/__init__.h b/ports/stm/common-hal/rtc/__init__.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/stm/peripherals/rtc.c b/ports/stm/peripherals/rtc.c index 9b0eb399c2..bd65ccbf17 100644 --- a/ports/stm/peripherals/rtc.c +++ b/ports/stm/peripherals/rtc.c @@ -4,6 +4,7 @@ * The MIT License (MIT) * * Copyright (c) 2021 Lucian Copeland for Adafruit Industries + * Copyright (c) 2022 Matthew McGowan for Blues Wireless Inc * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -76,6 +77,46 @@ void stm32_peripherals_rtc_init(void) { HAL_NVIC_EnableIRQ(RTC_Alarm_IRQn); } +#if CIRCUITPY_RTC +void stm32_peripherals_rtc_get_time(timeutils_struct_time_t *tm) { + RTC_DateTypeDef date = {0}; + RTC_TimeTypeDef time = {0}; + + int code; + if ((code = HAL_RTC_GetTime(&hrtc, &time, RTC_FORMAT_BIN)) == HAL_OK && + (code = HAL_RTC_GetDate(&hrtc, &date, RTC_FORMAT_BIN)) == HAL_OK) { + tm->tm_hour = time.Hours; + tm->tm_min = time.Minutes; + tm->tm_sec = time.Seconds; + tm->tm_wday = date.WeekDay - 1; + tm->tm_mday = date.Date; + tm->tm_mon = date.Month; + tm->tm_year = date.Year + 2000; + tm->tm_yday = -1; + } +} + +void stm32_peripherals_rtc_set_time(timeutils_struct_time_t *tm) { + RTC_DateTypeDef date = {0}; + RTC_TimeTypeDef time = {0}; + + time.Hours = tm->tm_hour; + time.Minutes = tm->tm_min; + time.Seconds = tm->tm_sec; + date.WeekDay = tm->tm_wday + 1; + date.Date = tm->tm_mday; + date.Month = tm->tm_mon; + date.Year = tm->tm_year - 2000; + time.DayLightSaving = RTC_DAYLIGHTSAVING_NONE; + time.StoreOperation = RTC_STOREOPERATION_RESET; + + if (HAL_RTC_SetTime(&hrtc, &time, RTC_FORMAT_BIN) != HAL_OK || + HAL_RTC_SetDate(&hrtc, &date, RTC_FORMAT_BIN) != HAL_OK) { + // todo - throw an exception + } +} +#endif + // This function is called often for timing so we cache the seconds elapsed computation based on the // register value. The STM HAL always does shifts and conversion if we use it directly. uint64_t stm32_peripherals_rtc_raw_ticks(uint8_t *subticks) { diff --git a/ports/stm/peripherals/rtc.h b/ports/stm/peripherals/rtc.h index 65cae14d1c..474cba1881 100644 --- a/ports/stm/peripherals/rtc.h +++ b/ports/stm/peripherals/rtc.h @@ -4,6 +4,7 @@ * The MIT License (MIT) * * Copyright (c) 2021 Lucian Copeland for Adafruit Industries + * Copyright (c) 2022 Matthew McGowan for Blues Wireless Inc * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -48,4 +49,10 @@ void stm32_peripherals_rtc_assign_alarm_callback(uint8_t alarm_idx, void (*callb void stm32_peripherals_rtc_set_alarm(uint8_t alarm_idx, uint32_t ticks); bool stm32_peripherals_rtc_alarm_triggered(uint8_t alarm_idx); +#if CIRCUITPY_RTC +typedef struct _timeutils_struct_time_t timeutils_struct_time_t; +void stm32_peripherals_rtc_get_time(timeutils_struct_time_t *tm); +void stm32_peripherals_rtc_set_time(timeutils_struct_time_t *tm); +#endif + #endif // __MICROPY_INCLUDED_STM32_PERIPHERALS_RTC_H__ diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index e4cce571ea..b15d81611e 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -61,6 +61,9 @@ #if CIRCUITPY_ALARM #include "common-hal/alarm/__init__.h" #endif +#if CIRCUITPY_RTC +#include "shared-bindings/rtc/__init__.h" +#endif #include "peripherals/clocks.h" #include "peripherals/gpio.h" @@ -241,6 +244,10 @@ void SysTick_Handler(void) { void reset_port(void) { reset_all_pins(); + #if CIRCUITPY_RTC + rtc_reset(); + #endif + #if CIRCUITPY_AUDIOPWMIO audiopwmout_reset(); #endif From 6ee8e0093630620b48abeedba71ba478d586084f Mon Sep 17 00:00:00 2001 From: Matthew McGowan Date: Fri, 10 Jun 2022 12:19:43 -0700 Subject: [PATCH 229/246] fix(stm32): correct include path after translation header was moved --- ports/stm/common-hal/rtc/RTC.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/stm/common-hal/rtc/RTC.c b/ports/stm/common-hal/rtc/RTC.c index 1ea2d63ebf..48c47fda8c 100644 --- a/ports/stm/common-hal/rtc/RTC.c +++ b/ports/stm/common-hal/rtc/RTC.c @@ -33,7 +33,7 @@ #include "common-hal/rtc/RTC.h" #include "shared-bindings/rtc/RTC.h" #include "supervisor/port.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "peripherals/rtc.h" From beafbc7c60c27bb9099eb609c713949079351ce3 Mon Sep 17 00:00:00 2001 From: Matthew McGowan Date: Fri, 10 Jun 2022 17:36:32 -0700 Subject: [PATCH 230/246] enable RTC for all STM32 devices --- ports/stm/mpconfigport.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index b9f6c2df65..4f18637f13 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -24,7 +24,7 @@ ifeq ($(MCU_SERIES),F4) CIRCUITPY_I2CPERIPHERAL ?= 0 CIRCUITPY_NVM ?= 0 CIRCUITPY_ROTARYIO ?= 0 - CIRCUITPY_RTC ?= 0 + CIRCUITPY_RTC ?= 1 USB_NUM_ENDPOINT_PAIRS = 4 UF2_FAMILY_ID ?= 0x57755a57 endif @@ -42,7 +42,7 @@ ifeq ($(MCU_SERIES),H7) CIRCUITPY_PULSEIO ?= 0 CIRCUITPY_PWMIO ?= 0 CIRCUITPY_ROTARYIO ?= 0 - CIRCUITPY_RTC ?= 0 + CIRCUITPY_RTC ?= 1 USB_NUM_ENDPOINT_PAIRS = 9 UF2_FAMILY_ID ?= 0x6db66082 @@ -59,7 +59,7 @@ ifeq ($(MCU_SERIES),F7) CIRCUITPY_NEOPIXEL_WRITE ?= 0 CIRCUITPY_NVM ?= 0 CIRCUITPY_ROTARYIO ?= 0 - CIRCUITPY_RTC ?= 0 + CIRCUITPY_RTC ?= 1 USB_NUM_ENDPOINT_PAIRS = 6 UF2_FAMILY_ID ?= 0x53b80f00 @@ -76,7 +76,7 @@ ifeq ($(MCU_SERIES),L4) CIRCUITPY_NEOPIXEL_WRITE ?= 0 CIRCUITPY_NVM ?= 0 CIRCUITPY_ROTARYIO ?= 0 - CIRCUITPY_RTC ?= 0 + CIRCUITPY_RTC ?= 1 # todo - this varies between devices in the series # This slide deck https://www.st.com/content/ccc/resource/training/technical/product_training/98/89/c8/6c/3e/e9/49/79/STM32L4_Peripheral_USB.pdf/files/STM32L4_Peripheral_USB.pdf/jcr:content/translations/en.STM32L4_Peripheral_USB.pdf # cites 16 endpoints, 8 endpoint pairs, while section 3.39 of the L4R5 datasheet states 6 endpoint pairs. From 9485cab5944d0fa855b3e2016e0a431471a63e5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Soukup?= Date: Fri, 10 Jun 2022 09:14:27 +0000 Subject: [PATCH 231/246] Translated using Weblate (Czech) Currently translated at 26.4% (260 of 983 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/cs/ --- locale/cs.po | 119 +++++++++++++++++++++++++++------------------------ 1 file changed, 62 insertions(+), 57 deletions(-) diff --git a/locale/cs.po b/locale/cs.po index a60095c054..184afcf453 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-06-08 15:15+0000\n" +"PO-Revision-Date: 2022-06-11 10:17+0000\n" "Last-Translator: Matěj Soukup \n" "Language-Team: LANGUAGE \n" "Language: cs\n" @@ -29,6 +29,8 @@ msgid "" "\n" "Code stopped by auto-reload. Reloading soon.\n" msgstr "" +"\n" +"Kód byl zastaven kvůli automatickému načtení. K načtení dojde brzy.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -243,17 +245,17 @@ msgstr "'%s' očekává popisek" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a register" -msgstr "'%s' očekává register" +msgstr "'%s' očekává registr" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects a special register" -msgstr "'%s' očekává speciální register" +msgstr "'%s' očekává speciální registr" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects an FPU register" -msgstr "'%s' očekává register FPU" +msgstr "'%s' očekává registr FPU" #: py/emitinlinethumb.c #, c-format @@ -354,7 +356,7 @@ msgstr "'return' je volán mimo funkci" #: py/compile.c msgid "'yield from' inside async function" -msgstr "" +msgstr "'yield from' volán uvnitř funkce async" #: py/compile.c msgid "'yield' outside function" @@ -409,13 +411,13 @@ msgstr "Všechny I2C periferie jsou používány" #: ports/espressif/common-hal/frequencyio/FrequencyIn.c #: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c msgid "All PCNT units in use" -msgstr "" +msgstr "Všechny PCNT jednotky jsou používány" #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" -msgstr "" +msgstr "Všechny RX FIFO jsou používány" #: ports/espressif/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" @@ -521,7 +523,7 @@ msgstr "Konverze audia není implementována" #: shared-bindings/wifi/Radio.c msgid "AuthMode.OPEN is not used with password" -msgstr "" +msgstr "AuthMode.OPEN nepoužívá heslo" #: shared-bindings/wifi/Radio.c msgid "Authentication failure" @@ -550,7 +552,7 @@ msgstr "Pod minimální obnovovací frekvencí" #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must be sequential pins" -msgstr "" +msgstr "Bitové hodiny a výběr slov musí být sekvenční piny" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" @@ -595,7 +597,7 @@ msgstr "Vyrovnávací paměť + offset je příliš malý %d %d %d" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Buffer elements must be 4 bytes long or less" -msgstr "" +msgstr "Prvky bufferu musí být 4 bajty dlouhé nebo méně" #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." @@ -618,7 +620,7 @@ msgstr "Délka vyrovnávací paměti musí být násobkem 512" #: ports/stm/common-hal/sdioio/SDCard.c shared-bindings/floppyio/__init__.c msgid "Buffer must be a multiple of 512 bytes" -msgstr "" +msgstr "Buffer musí být násobkem 512 bajtů" #: shared-bindings/_bleio/PacketBuffer.c #, c-format @@ -627,7 +629,7 @@ msgstr "Buffer je příliš krátký o %d bajtů" #: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c msgid "Buffers must be same size" -msgstr "" +msgstr "Buffery musí mít stejnou velikost" #: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c @@ -647,7 +649,7 @@ msgstr "Bloky CBC musí být násobky 16 bajtů" #: supervisor/shared/safe_mode.c msgid "CIRCUITPY drive could not be found or created." -msgstr "" +msgstr "Disk CIRCUITPY nelze nalézt nebo vytvořit." #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" @@ -681,11 +683,11 @@ msgstr "Nelze nastavit CCCD na místní charakteristiku" #: shared-bindings/storage/__init__.c shared-bindings/usb_cdc/__init__.c #: shared-bindings/usb_hid/__init__.c shared-bindings/usb_midi/__init__.c msgid "Cannot change USB devices now" -msgstr "" +msgstr "Nelze změnit USB zařízení" #: shared-bindings/_bleio/Adapter.c msgid "Cannot create a new Adapter; use _bleio.adapter;" -msgstr "" +msgstr "Není možné vytvořit nový adaptér; použití _bleio.adapter;" #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c @@ -718,13 +720,13 @@ msgstr "Nelze nahrávat do souboru" #: shared-module/storage/__init__.c msgid "Cannot remount '/' when visible via USB." -msgstr "" +msgstr "Není možné znovu připojit '/', pokud je viditelné pomocí 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 "Reset do bootloaderu není možný, protože žádný bootloader není přítomen" #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -769,7 +771,7 @@ msgstr "Jádro kódu CircuitPython tvrdě havarovalo. Jejda!\n" #: supervisor/shared/safe_mode.c msgid "CircuitPython was unable to allocate the heap." -msgstr "" +msgstr "CircuitPython nedokázal alokovat haldu." #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" @@ -788,7 +790,7 @@ msgstr "" #: py/persistentcode.c msgid "Corrupt .mpy file" -msgstr "" +msgstr "Poškozený soubor .mpy" #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" @@ -796,7 +798,7 @@ msgstr "" #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" -msgstr "" +msgstr "Není možné nastavit adresu" #: shared-bindings/pwmio/PWMOut.c msgid "Could not start PWM" @@ -891,7 +893,7 @@ msgstr "EXTINT kanál se již používá" #: shared-module/synthio/MidiTrack.c #, c-format msgid "Error in MIDI stream at position %d" -msgstr "" +msgstr "Chyba v MIDI přenosu na pozici %d" #: extmod/modure.c msgid "Error in regex" @@ -923,7 +925,7 @@ msgstr "" #: extmod/ulab/code/numpy/fft/fft_tools.c msgid "FFT is implemented for linear arrays only" -msgstr "" +msgstr "FFT je implementován pouze pro lineární pole" #: ports/espressif/common-hal/ssl/SSLSocket.c msgid "Failed SSL handshake" @@ -940,11 +942,11 @@ msgstr "" #: shared-module/rgbmatrix/RGBMatrix.c msgid "Failed to allocate %q buffer" -msgstr "" +msgstr "Chyba alokace %q bufferu" #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" -msgstr "" +msgstr "Chyba alokace paměti WiFi" #: ports/espressif/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" @@ -965,7 +967,7 @@ msgstr "Nepodařilo se připojit: časový limit" #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to init wifi" -msgstr "" +msgstr "Chyba inicializace WiFi" #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" @@ -982,7 +984,7 @@ msgstr "Nepodařilo se zapsat do interní paměti." #: supervisor/shared/safe_mode.c msgid "Fatal error." -msgstr "" +msgstr "Fatální chyba." #: py/moduerrno.c msgid "File exists" @@ -996,7 +998,7 @@ msgstr "" #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware image is invalid" -msgstr "" +msgstr "Obraz firmwaru je nevalidní" #: shared-bindings/bitmaptools/__init__.c msgid "For L8 colorspace, input bitmap must have 8 bits per pixel" @@ -1008,12 +1010,14 @@ msgstr "" #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" -msgstr "" +msgstr "Formát není podporován" #: ports/mimxrt10xx/common-hal/microcontroller/Processor.c msgid "" "Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" msgstr "" +"Frekvence musí být 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 nebo 1008 " +"Mhz" #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" @@ -1026,11 +1030,11 @@ msgstr "Funkce vyžaduje zámek" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "GNSS init" -msgstr "" +msgstr "Inicializace GNSS" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" -msgstr "" +msgstr "Základní chyba" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c @@ -1061,11 +1065,11 @@ msgstr "" #: ports/stm/common-hal/busio/I2C.c msgid "I2C init error" -msgstr "" +msgstr "Chyba inicializace I2C" #: ports/raspberrypi/common-hal/busio/I2C.c msgid "I2C peripheral in use" -msgstr "" +msgstr "Periférie I2C je používána" #: shared-bindings/audiobusio/I2SOut.c msgid "I2SOut not available" @@ -1115,7 +1119,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" -msgstr "" +msgstr "Vstup trval příliš dlouho" #: ports/espressif/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" @@ -1163,7 +1167,7 @@ msgstr "" #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c msgid "Internal error" -msgstr "" +msgstr "Interní chyba" #: shared-module/rgbmatrix/RGBMatrix.c #, c-format @@ -1185,15 +1189,15 @@ msgstr "Neplatná hodnota jednotky ADC" #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" -msgstr "" +msgstr "Chybný BLE parametr" #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" -msgstr "" +msgstr "Chybné BSSID" #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" -msgstr "" +msgstr "Chybná MAC adresa" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #: py/moduerrno.c @@ -1207,7 +1211,7 @@ msgstr "" #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" -msgstr "" +msgstr "Chybný data_pin[%d]" #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" @@ -1219,7 +1223,7 @@ msgstr "Neplatný přístup k paměti." #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" -msgstr "" +msgstr "Chybná multicastová MAC adresa" #: shared-bindings/busio/UART.c msgid "Invalid pins" @@ -1227,15 +1231,15 @@ msgstr "Neplatné piny" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" -msgstr "" +msgstr "Chybná velikost" #: ports/espressif/common-hal/ssl/SSLContext.c msgid "Invalid socket for TLS" -msgstr "" +msgstr "Chybný soket pro TLS" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" -msgstr "" +msgstr "Chybný stav" #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" @@ -1243,7 +1247,7 @@ msgstr "Klíč musí být dlouhý 16, 24 nebo 32 bajtů" #: shared-module/is31fl3741/FrameBuffer.c msgid "LED mappings must match display size" -msgstr "" +msgstr "Mapování LED musí korespondovat s velikostí displeje" #: py/compile.c msgid "LHS of keyword arg must be an id" @@ -1259,7 +1263,7 @@ msgstr "" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" -msgstr "" +msgstr "MAC adresa byla chybná" #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" @@ -1289,7 +1293,7 @@ msgstr "Chybí pin MISO nebo MOSI" #: ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI pin" -msgstr "" +msgstr "Chybějící MISO nebo MOSI pin" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format @@ -1345,7 +1349,7 @@ msgstr "" #: ports/espressif/common-hal/nvm/ByteArray.c msgid "NVS Error" -msgstr "" +msgstr "Chyba NVS" #: py/qstr.c msgid "Name too long" @@ -1353,7 +1357,7 @@ msgstr "Jméno je příliš dlouhé" #: shared-bindings/displayio/TileGrid.c msgid "New bitmap must be same size as old bitmap" -msgstr "" +msgstr "Nová bitmapa musí mít stejnou velikost jako původní bitmapa" #: ports/espressif/common-hal/_bleio/__init__.c msgid "Nimble out of memory" @@ -1383,7 +1387,7 @@ msgstr "" #: shared-module/adafruit_bus_device/i2c_device/I2CDevice.c #, c-format msgid "No I2C device at address: 0x%x" -msgstr "" +msgstr "Žádné I2C zařízení na adrese: 0x%x" #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1392,7 +1396,7 @@ msgstr "Žádný pin MISO" #: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c msgid "No MISO pin" -msgstr "" +msgstr "Žádný MISO pin" #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1401,7 +1405,7 @@ msgstr "Žádný pin MOSI" #: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c msgid "No MOSI pin" -msgstr "" +msgstr "Žádný MOSI pin" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c @@ -1460,11 +1464,11 @@ msgstr "" #: shared-module/usb_hid/__init__.c #, c-format msgid "No more than %d HID devices allowed" -msgstr "" +msgstr "Ne více než %d HID zařízení je povoleno" #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" -msgstr "" +msgstr "Žádná síť s takovým SSID" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No out in program" @@ -1487,7 +1491,7 @@ msgstr "Na zařízení nezůstal žádný prostor" #: py/moduerrno.c msgid "No such device" -msgstr "" +msgstr "Žádné takové zařízení" #: py/moduerrno.c msgid "No such file/directory" @@ -1507,7 +1511,7 @@ msgstr "" #: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c msgid "Not a valid IP string" -msgstr "" +msgstr "Nevalidní IP string" #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c @@ -1527,12 +1531,13 @@ msgstr "" #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c #, c-format msgid "Number of data_pins must be 8 or 16, not %d" -msgstr "" +msgstr "Počet data_pins musí být 8 nebo 16, nikoli %d" #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." msgstr "" +"Objekt byl deinicializován a nelze jej dále používat. Vytvořte nový objekt." #: ports/nrf/common-hal/busio/UART.c msgid "Odd parity is not supported" @@ -1545,11 +1550,11 @@ msgstr "" #: ports/espressif/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" -msgstr "" +msgstr "Pouze IPv4 adresy podporovány" #: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Only IPv4 sockets supported" -msgstr "" +msgstr "Pouze IPv4 sokety podporovány" #: shared-module/displayio/OnDiskBitmap.c #, c-format From b191075ab81c79b4675391fe35544f0a18001aaa Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 13 Jun 2022 09:18:42 -0700 Subject: [PATCH 232/246] Better length checks --- ports/espressif/common-hal/wifi/Radio.c | 8 ++++++-- shared-bindings/wifi/Radio.c | 5 ++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ports/espressif/common-hal/wifi/Radio.c b/ports/espressif/common-hal/wifi/Radio.c index e4a9aa4646..c914bdd8e1 100644 --- a/ports/espressif/common-hal/wifi/Radio.c +++ b/ports/espressif/common-hal/wifi/Radio.c @@ -249,7 +249,9 @@ wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t bool connected = ((bits & WIFI_CONNECTED_BIT) != 0) && !((bits & WIFI_DISCONNECTED_BIT) != 0); if (connected) { - if (memcmp(ssid, config->sta.ssid, ssid_len) == 0) { + // SSIDs are up to 32 bytes. Assume it is null terminated if it is less. + if (memcmp(ssid, config->sta.ssid, ssid_len) == 0 && + (ssid_len == 32 || strlen((const char *)config->sta.ssid) == ssid_len)) { // Already connected to the desired network. return WIFI_RADIO_ERROR_NONE; } else { @@ -272,7 +274,9 @@ wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t set_mode_station(self, true); memcpy(&config->sta.ssid, ssid, ssid_len); - config->sta.ssid[ssid_len] = 0; + if (ssid_len < 32) { + config->sta.ssid[ssid_len] = 0; + } memcpy(&config->sta.password, password, password_len); config->sta.password[password_len] = 0; config->sta.channel = channel; diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index 0b55df70fa..42a4c53161 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -257,6 +257,7 @@ STATIC mp_obj_t wifi_radio_start_ap(size_t n_args, const mp_obj_t *pos_args, mp_ mp_buffer_info_t ssid; mp_get_buffer_raise(args[ARG_ssid].u_obj, &ssid, MP_BUFFER_READ); + mp_arg_validate_length_range(ssid.len, 1, 32, MP_QSTR_ssid); mp_buffer_info_t password; password.len = 0; @@ -330,9 +331,7 @@ 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; mp_get_buffer_raise(args[ARG_ssid].u_obj, &ssid, MP_BUFFER_READ); - if (ssid.len > 32) { - mp_raise_ValueError(translate("ssid can't be more than 32 bytes")); - } + mp_arg_validate_length_range(ssid.len, 1, 32, MP_QSTR_ssid); mp_buffer_info_t password; password.len = 0; From 4e70781c454839b1842748bcf1937e03abff8e7a Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 13 Jun 2022 09:21:41 -0700 Subject: [PATCH 233/246] Remove extra glyph padding --- tools/gen_display_resources.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/gen_display_resources.py b/tools/gen_display_resources.py index 3c481cc812..dc9dbd69a4 100644 --- a/tools/gen_display_resources.py +++ b/tools/gen_display_resources.py @@ -75,8 +75,7 @@ for c in set(all_characters): 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 +tile_x, tile_y, dx, dy = f.get_bounding_box() total_bits = tile_x * len(all_characters) total_bits += 32 - total_bits % 32 bytes_per_row = total_bits // 8 From 1a3d2a5b5eeb555e4c5cec0cb5d0bf2483b27dc4 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 13 Jun 2022 15:36:15 -0700 Subject: [PATCH 234/246] Shrink nrf52833 builds Make them CIRCUITPY_FULL_BUILD = 0 and rework the boards to have the same modules enabled (ish.) Also make ZLIB require FULL_BUILD and disable advanced `micropython` module APIs by default on all builds. --- .../nrf/boards/bluemicro833/mpconfigboard.mk | 33 +------------------ ports/nrf/boards/microbit_v2/mpconfigboard.mk | 23 +------------ ports/nrf/boards/pca10100/mpconfigboard.mk | 29 ---------------- ports/nrf/boards/simmel/mpconfigboard.mk | 18 ---------- ports/nrf/mpconfigport.mk | 17 +++++++--- py/circuitpy_mpconfig.h | 2 +- py/circuitpy_mpconfig.mk | 2 +- 7 files changed, 16 insertions(+), 108 deletions(-) diff --git a/ports/nrf/boards/bluemicro833/mpconfigboard.mk b/ports/nrf/boards/bluemicro833/mpconfigboard.mk index bfefcbf100..6108f23102 100644 --- a/ports/nrf/boards/bluemicro833/mpconfigboard.mk +++ b/ports/nrf/boards/bluemicro833/mpconfigboard.mk @@ -7,41 +7,10 @@ MCU_CHIP = nrf52833 INTERNAL_FLASH_FILESYSTEM = 1 -CIRCUITPY_AESIO = 0 -CIRCUITPY_ALARM = 0 CIRCUITPY_AUDIOBUSIO = 0 -#CIRCUITPY_AUDIOCORE = 0 -#CIRCUITPY_AUDIOIO = 0 CIRCUITPY_AUDIOMIXER = 0 -CIRCUITPY_AUDIOMP3 = 0 -CIRCUITPY_BINASCII = 0 -CIRCUITPY_BITBANGIO = 0 -CIRCUITPY_BITMAPTOOLS = 0 -CIRCUITPY_BUILTINS_POW3=0 -CIRCUITPY_BUSDEVICE = 0 -CIRCUITPY_COUNTIO = 0 -CIRCUITPY_DISPLAYIO = 0 -CIRCUITPY_FRAMEBUFFERIO = 0 -CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CPERIPHERAL = 0 -CIRCUITPY_JSON = 0 CIRCUITPY_KEYPAD = 1 -CIRCUITPY_MSGPACK = 0 -#CIRCUITPY_NEOPIXEL_WRITE = 1 -CIRCUITPY_ONEWIREIO = 0 CIRCUITPY_NVM = 0 +CIRCUITPY_ONEWIREIO = 0 CIRCUITPY_PIXELBUF = 1 -CIRCUITPY_PULSEIO = 1 -CIRCUITPY_RE = 0 -CIRCUITPY_RGBMATRIX = 0 -CIRCUITPY_SDCARDIO = 0 -CIRCUITPY_SYNTHIO = 0 -CIRCUITPY_TRACEBACK = 0 CIRCUITPY_TOUCHIO = 0 -CIRCUITPY_TRACEBACK = 0 -CIRCUITPY_ULAB = 0 -CIRCUITPY_USB_MIDI = 0 -CIRCUITPY_VECTORIO = 0 -CIRCUITPY_ZLIB = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 diff --git a/ports/nrf/boards/microbit_v2/mpconfigboard.mk b/ports/nrf/boards/microbit_v2/mpconfigboard.mk index 413efda7f7..78e76d3b53 100644 --- a/ports/nrf/boards/microbit_v2/mpconfigboard.mk +++ b/ports/nrf/boards/microbit_v2/mpconfigboard.mk @@ -5,26 +5,5 @@ MCU_CHIP = nrf52833 INTERNAL_FLASH_FILESYSTEM = 1 -CIRCUITPY_ALARM = 0 -CIRCUITPY_AUDIOMP3 = 0 -CIRCUITPY_BITBANGIO = 0 -CIRCUITPY_BUILTINS_POW3=0 -CIRCUITPY_BUSDEVICE = 0 -CIRCUITPY_COUNTIO = 0 -CIRCUITPY_DISPLAYIO = 0 -CIRCUITPY_FRAMEBUFFERIO = 0 -CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CPERIPHERAL = 0 -CIRCUITPY_JSON = 0 -CIRCUITPY_KEYPAD = 0 -CIRCUITPY_MSGPACK = 0 -CIRCUITPY_NEOPIXEL_WRITE = 0 -CIRCUITPY_NVM = 0 -CIRCUITPY_PIXELBUF = 0 -CIRCUITPY_RE = 0 -CIRCUITPY_RGBMATRIX = 0 -CIRCUITPY_SDCARDIO = 0 -CIRCUITPY_ULAB = 0 +# USB pins aren't used. CIRCUITPY_USB = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 diff --git a/ports/nrf/boards/pca10100/mpconfigboard.mk b/ports/nrf/boards/pca10100/mpconfigboard.mk index 553da88963..356eb16f11 100644 --- a/ports/nrf/boards/pca10100/mpconfigboard.mk +++ b/ports/nrf/boards/pca10100/mpconfigboard.mk @@ -6,32 +6,3 @@ USB_MANUFACTURER = "Nordic Semiconductor" MCU_CHIP = nrf52833 INTERNAL_FLASH_FILESYSTEM = 1 - -CIRCUITPY_AESIO = 0 -CIRCUITPY_ALARM = 0 -CIRCUITPY_AUDIOMP3 = 0 -CIRCUITPY_BINASCII = 0 -CIRCUITPY_BITBANGIO = 0 -CIRCUITPY_BITMAPTOOLS = 0 -CIRCUITPY_BUSDEVICE = 0 -CIRCUITPY_COUNTIO = 0 -CIRCUITPY_DISPLAYIO = 0 -CIRCUITPY_FRAMEBUFFERIO = 0 -CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CPERIPHERAL = 0 -CIRCUITPY_JSON = 0 -CIRCUITPY_KEYPAD = 0 -CIRCUITPY_MSGPACK = 0 -CIRCUITPY_NEOPIXEL_WRITE = 0 -CIRCUITPY_NVM = 0 -CIRCUITPY_PIXELBUF = 0 -CIRCUITPY_RE = 0 -CIRCUITPY_RGBMATRIX = 0 -CIRCUITPY_SDCARDIO = 0 -CIRCUITPY_SYNTHIO = 0 -CIRCUITPY_ULAB = 0 -CIRCUITPY_USB_MIDI = 0 -CIRCUITPY_VECTORIO = 0 -CIRCUITPY_ZLIB = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 diff --git a/ports/nrf/boards/simmel/mpconfigboard.mk b/ports/nrf/boards/simmel/mpconfigboard.mk index faf9d2d1e3..20a50ac700 100644 --- a/ports/nrf/boards/simmel/mpconfigboard.mk +++ b/ports/nrf/boards/simmel/mpconfigboard.mk @@ -13,36 +13,18 @@ INTERNAL_FLASH_FILESYSTEM = 1 CIRCUITPY_ALARM = 0 CIRCUITPY_AESIO = 1 CIRCUITPY_AUDIOMIXER = 0 -CIRCUITPY_AUDIOMP3 = 0 -CIRCUITPY_BITMAPTOOLS = 0 -CIRCUITPY_BUSDEVICE = 0 -CIRCUITPY_BUSIO = 1 -CIRCUITPY_COUNTIO = 0 -CIRCUITPY_DISPLAYIO = 0 -CIRCUITPY_ERRNO = 0 -CIRCUITPY_FRAMEBUFFERIO = 0 -CIRCUITPY_GETPASS = 0 -CIRCUITPY_KEYPAD = 0 -CIRCUITPY_MSGPACK = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_NVM = 0 CIRCUITPY_ONEWIREIO = 0 -CIRCUITPY_PIXELBUF = 0 CIRCUITPY_PULSEIO = 0 CIRCUITPY_PWMIO = 1 # Deliberately excluded for other reasons than code space, see #5534 CIRCUITPY_RAINBOWIO = 0 -CIRCUITPY_RGBMATRIX = 0 CIRCUITPY_ROTARYIO = 0 -CIRCUITPY_RTC = 1 -CIRCUITPY_SDCARDIO = 0 -CIRCUITPY_SYNTHIO = 0 CIRCUITPY_TOUCHIO = 0 -CIRCUITPY_ULAB = 0 CIRCUITPY_USB_CDC = 0 CIRCUITPY_USB_MIDI = 0 CIRCUITPY_WATCHDOG = 1 -CIRCUITPY_ZLIB = 0 # Enable micropython.native #CIRCUITPY_ENABLE_MPY_NATIVE = 1 diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index f265ac1940..6aff88b289 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -32,12 +32,7 @@ CIRCUITPY_RTC ?= 1 # frequencyio not yet implemented CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_RGBMATRIX ?= 1 CIRCUITPY_ROTARYIO_SOFTENCODER = 1 -CIRCUITPY_FRAMEBUFFERIO ?= 1 - -CIRCUITPY_COUNTIO ?= 1 -CIRCUITPY_WATCHDOG ?= 1 # Sleep and Wakeup CIRCUITPY_ALARM ?= 1 @@ -60,6 +55,12 @@ MCU_SUB_VARIANT = nrf52840 # Fits on nrf52840 but space is tight on nrf52833. CIRCUITPY_AESIO ?= 1 +CIRCUITPY_RGBMATRIX ?= 1 +CIRCUITPY_FRAMEBUFFERIO ?= 1 + +CIRCUITPY_COUNTIO ?= 1 +CIRCUITPY_WATCHDOG ?= 1 + SD ?= s140 SOFTDEV_VERSION ?= 6.1.0 @@ -87,6 +88,8 @@ MCU_SUB_VARIANT = nrf52833 SUPEROPT_GC ?= 0 SUPEROPT_VM ?= 0 +CIRCUITPY_SYNTHIO ?= 0 + SD ?= s140 SOFTDEV_VERSION ?= 7.0.1 @@ -97,5 +100,9 @@ OPTIMIZATION_FLAGS ?= -Os CIRCUITPY_LTO = 1 CIRCUITPY_LTO_PARTITION = one +ifeq ($(INTERNAL_FLASH_FILESYSTEM),1) + CIRCUITPY_FULL_BUILD ?= 0 + CIRCUITPY_PULSEIO ?= 1 +endif endif endif diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 24d8fb98ca..2936e0f124 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -230,7 +230,7 @@ typedef long mp_off_t; #define MICROPY_PY_URE_MATCH_SPAN_START_END (CIRCUITPY_RE) #define MICROPY_PY_URE_SUB (CIRCUITPY_RE) -#define CIRCUITPY_MICROPYTHON_ADVANCED (CIRCUITPY_FULL_BUILD) +#define CIRCUITPY_MICROPYTHON_ADVANCED (0) #ifndef MICROPY_FATFS_EXFAT #define MICROPY_FATFS_EXFAT (CIRCUITPY_FULL_BUILD) diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 758e0226a8..8505fe1cb7 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -460,7 +460,7 @@ CIRCUITPY_USTACK ?= 0 CFLAGS += -DCIRCUITPY_USTACK=$(CIRCUITPY_USTACK) # for decompressing utlities -CIRCUITPY_ZLIB ?= 1 +CIRCUITPY_ZLIB ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_ZLIB=$(CIRCUITPY_ZLIB) # ulab numerics library From dc794f91c0eea3cca7ed4cf8fb74867c191a0941 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 13 Jun 2022 15:38:19 -0700 Subject: [PATCH 235/246] Speed up auto-wifi with wrong password This adds basic timeout support to connect by preventing subsequent retries if over time. The first connect may still take more than the timeout. --- ports/espressif/common-hal/wifi/Radio.c | 8 ++++++++ supervisor/shared/web_workflow/web_workflow.c | 11 +++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ports/espressif/common-hal/wifi/Radio.c b/ports/espressif/common-hal/wifi/Radio.c index c914bdd8e1..b6b155a71c 100644 --- a/ports/espressif/common-hal/wifi/Radio.c +++ b/ports/espressif/common-hal/wifi/Radio.c @@ -238,6 +238,10 @@ wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t } wifi_config_t *config = &self->sta_config; + size_t timeout_ms = timeout * 1000; + uint32_t start_time = common_hal_time_monotonic_ms(); + uint32_t end_time = start_time + timeout_ms; + EventBits_t bits; // can't block since both bits are false after wifi_init // both bits are true after an existing connection stops @@ -309,6 +313,10 @@ wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t pdTRUE, pdTRUE, 0); + // Don't retry anymore if we're over our time budget. + if (self->retries_left > 0 && common_hal_time_monotonic_ms() > end_time) { + self->retries_left = 0; + } } while ((bits & (WIFI_CONNECTED_BIT | WIFI_DISCONNECTED_BIT)) == 0 && !mp_hal_is_interrupted()); if ((bits & WIFI_DISCONNECTED_BIT) != 0) { if (self->last_disconnect_reason == WIFI_REASON_AUTH_FAIL) { diff --git a/supervisor/shared/web_workflow/web_workflow.c b/supervisor/shared/web_workflow/web_workflow.c index dcc79ecf27..bb83048dca 100644 --- a/supervisor/shared/web_workflow/web_workflow.c +++ b/supervisor/shared/web_workflow/web_workflow.c @@ -44,13 +44,17 @@ void supervisor_web_workflow_status(void) { serial_write_compressed(translate("Wi-Fi: ")); if (common_hal_wifi_radio_get_enabled(&common_hal_wifi_radio_obj)) { uint32_t ipv4_address = wifi_radio_get_ipv4_address(&common_hal_wifi_radio_obj); - if (wifi_status != WIFI_RADIO_ERROR_NONE) { + if (wifi_status == WIFI_RADIO_ERROR_AUTH_EXPIRE || + wifi_status == WIFI_RADIO_ERROR_AUTH_FAIL) { + serial_write_compressed(translate("Authentication failure")); + } else if (wifi_status != WIFI_RADIO_ERROR_NONE) { mp_printf(&mp_plat_print, "%d", wifi_status); } else if (ipv4_address == 0) { serial_write_compressed(translate("No IP")); } else { uint8_t *octets = (uint8_t *)&ipv4_address; mp_printf(&mp_plat_print, "%d.%d.%d.%d", octets[0], octets[1], octets[2], octets[3]); + // TODO: Use these unicode to show signal strength: ▂▄▆█ } } else { serial_write_compressed(translate("off")); @@ -75,12 +79,15 @@ void supervisor_start_web_workflow(void) { common_hal_wifi_init(false); common_hal_wifi_radio_set_enabled(&common_hal_wifi_radio_obj, true); + // TODO: Do our own scan so that we can find the channel we want before calling connect. + // Otherwise, connect will do a full slow scan to pick the best AP. + // NUL terminate the strings because dotenv doesn't. ssid[ssid_len] = '\0'; password[password_len] = '\0'; wifi_status = common_hal_wifi_radio_connect( &common_hal_wifi_radio_obj, (uint8_t *)ssid, ssid_len, (uint8_t *)password, password_len, - 0, 1, NULL, 0); + 0, 0.1, NULL, 0); if (wifi_status != WIFI_RADIO_ERROR_NONE) { common_hal_wifi_radio_set_enabled(&common_hal_wifi_radio_obj, false); From 9fbad229c06f2dc89fa3ca4ac7c6ce4d2da3cafd Mon Sep 17 00:00:00 2001 From: Omer Kilic Date: Tue, 14 Jun 2022 15:51:10 +0100 Subject: [PATCH 236/246] Add custom board: Electrolama minik (RP2040) --- .../boards/electrolama_minik/board.c | 40 ++++++++++++++ .../boards/electrolama_minik/mpconfigboard.h | 8 +++ .../boards/electrolama_minik/mpconfigboard.mk | 11 ++++ .../electrolama_minik/pico-sdk-configboard.h | 1 + .../boards/electrolama_minik/pins.c | 52 +++++++++++++++++++ 5 files changed, 112 insertions(+) create mode 100644 ports/raspberrypi/boards/electrolama_minik/board.c create mode 100644 ports/raspberrypi/boards/electrolama_minik/mpconfigboard.h create mode 100644 ports/raspberrypi/boards/electrolama_minik/mpconfigboard.mk create mode 100644 ports/raspberrypi/boards/electrolama_minik/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/electrolama_minik/pins.c diff --git a/ports/raspberrypi/boards/electrolama_minik/board.c b/ports/raspberrypi/boards/electrolama_minik/board.c new file mode 100644 index 0000000000..de6e424ed9 --- /dev/null +++ b/ports/raspberrypi/boards/electrolama_minik/board.c @@ -0,0 +1,40 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} + +void board_deinit(void) { +} diff --git a/ports/raspberrypi/boards/electrolama_minik/mpconfigboard.h b/ports/raspberrypi/boards/electrolama_minik/mpconfigboard.h new file mode 100644 index 0000000000..f2261ac8b7 --- /dev/null +++ b/ports/raspberrypi/boards/electrolama_minik/mpconfigboard.h @@ -0,0 +1,8 @@ +#define MICROPY_HW_BOARD_NAME "Electrolama minik" +#define MICROPY_HW_MCU_NAME "rp2040" + +// GPIO25 is the WS2812 LED on the module +#define MICROPY_HW_NEOPIXEL (&pin_GPIO25) + +// GPIO15 is not routed out +#define IGNORE_PIN_GPIO15 1 diff --git a/ports/raspberrypi/boards/electrolama_minik/mpconfigboard.mk b/ports/raspberrypi/boards/electrolama_minik/mpconfigboard.mk new file mode 100644 index 0000000000..8bd2394127 --- /dev/null +++ b/ports/raspberrypi/boards/electrolama_minik/mpconfigboard.mk @@ -0,0 +1,11 @@ +USB_VID = 0x1209 +USB_PID = 0xF123 +USB_PRODUCT = "minik" +USB_MANUFACTURER = "Electrolama" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ" + +CIRCUITPY__EVE = 1 diff --git a/ports/raspberrypi/boards/electrolama_minik/pico-sdk-configboard.h b/ports/raspberrypi/boards/electrolama_minik/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/electrolama_minik/pico-sdk-configboard.h @@ -0,0 +1 @@ +// Put board-specific pico-sdk definitions here. This file must exist. diff --git a/ports/raspberrypi/boards/electrolama_minik/pins.c b/ports/raspberrypi/boards/electrolama_minik/pins.c new file mode 100644 index 0000000000..21331ffda5 --- /dev/null +++ b/ports/raspberrypi/boards/electrolama_minik/pins.c @@ -0,0 +1,52 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_GP0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_GP1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_GP2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_GP3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_GP4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_GP5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_GP6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_GP7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_GP8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_GP9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_GP10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_GP11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_GP12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_GP13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_GP14), MP_ROM_PTR(&pin_GPIO14) }, + // GPIO15 is not routed out. + { MP_ROM_QSTR(MP_QSTR_GP16), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_GP17), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_GP18), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_GP19), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_GP20), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_GP21), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_GP22), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_GP23), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_GP24), MP_ROM_PTR(&pin_GPIO24) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_GP25), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_GP26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_GP26_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_GP27), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_GP27_A1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, + + { MP_ROM_QSTR(MP_QSTR_GP28), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_GP28_A2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) }, + + { MP_ROM_QSTR(MP_QSTR_GP29), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_GP29_A3), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From 015e95807a44fdc9bfd9b1a4eecf47d541a207ec Mon Sep 17 00:00:00 2001 From: root Date: Tue, 14 Jun 2022 12:14:05 -0500 Subject: [PATCH 237/246] Fix for Issue #6478 --- ports/nrf/boards/clue_nrf52840_express/board.c | 1 + ports/nrf/common-hal/alarm/__init__.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/ports/nrf/boards/clue_nrf52840_express/board.c b/ports/nrf/boards/clue_nrf52840_express/board.c index f2e648f473..06ee622f93 100644 --- a/ports/nrf/boards/clue_nrf52840_express/board.c +++ b/ports/nrf/boards/clue_nrf52840_express/board.c @@ -102,4 +102,5 @@ void reset_board(void) { } void board_deinit(void) { + common_hal_displayio_release_displays(); } diff --git a/ports/nrf/common-hal/alarm/__init__.c b/ports/nrf/common-hal/alarm/__init__.c index 92dac1c789..c79158e8f1 100644 --- a/ports/nrf/common-hal/alarm/__init__.c +++ b/ports/nrf/common-hal/alarm/__init__.c @@ -48,6 +48,9 @@ #include "nrf_power.h" #include "nrfx.h" #include "nrfx_gpiote.h" +#ifdef NRF_DEBUG_PRINT +void print_wakeup_cause(nrf_sleep_source_t cause); +#endif // Singleton instance of SleepMemory. const alarm_sleep_memory_obj_t alarm_sleep_memory_obj = { From c95f4cdd0306be1d436fcc5bbd388bd1f8a25d86 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 14 Jun 2022 19:41:43 +0200 Subject: [PATCH 238/246] 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 | 15 ++++++++++++++- locale/de_DE.po | 12 ++++++++++++ locale/el.po | 12 ++++++++++++ locale/en_GB.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/ru.po | 12 ++++++++++++ locale/sv.po | 12 ++++++++++++ locale/tr.po | 12 ++++++++++++ locale/zh_Latn_pinyin.po | 12 ++++++++++++ 19 files changed, 230 insertions(+), 1 deletion(-) diff --git a/locale/ID.po b/locale/ID.po index 5860b0f544..a301eb7852 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -1390,6 +1390,10 @@ msgstr "" msgid "No I2C device at address: 0x%x" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" @@ -2285,6 +2289,10 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "" @@ -3610,6 +3618,10 @@ msgstr "" msgid "odd-length string" msgstr "panjang data string memiliki keganjilan (odd-length)" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + #: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 184afcf453..bfd9dc8db8 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -726,7 +726,8 @@ msgstr "Není možné znovu připojit '/', pokud je viditelné pomocí 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 "Reset do bootloaderu není možný, protože žádný bootloader není přítomen" +msgstr "" +"Reset do bootloaderu není možný, protože žádný bootloader není přítomen" #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -1389,6 +1390,10 @@ msgstr "" msgid "No I2C device at address: 0x%x" msgstr "Žádné I2C zařízení na adrese: 0x%x" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" @@ -2271,6 +2276,10 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "" @@ -3596,6 +3605,10 @@ msgstr "" msgid "odd-length string" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + #: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index db4b9304c1..ac02ca72f2 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -1404,6 +1404,10 @@ msgstr "Kein DMA-Pacing Timer gefunden" msgid "No I2C device at address: 0x%x" msgstr "Kein I2C-Gerät an Adresse: 0x%x" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" @@ -2322,6 +2326,10 @@ msgstr "" "\n" "Um die vorhandenen Module anzuzeigen, gebe `help(\"modules\")` ein.\n" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "Aufgeweckt durch Alarm.\n" @@ -3670,6 +3678,10 @@ msgstr "Objekt mit Pufferprotokoll (buffer protocol) erforderlich" msgid "odd-length string" msgstr "String mit ungerader Länge" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + #: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "Offset ist zu groß" diff --git a/locale/el.po b/locale/el.po index 0460f2a146..86529084bb 100644 --- a/locale/el.po +++ b/locale/el.po @@ -1375,6 +1375,10 @@ msgstr "" msgid "No I2C device at address: 0x%x" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" @@ -2254,6 +2258,10 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "" @@ -3579,6 +3587,10 @@ msgstr "" msgid "odd-length string" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + #: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" diff --git a/locale/en_GB.po b/locale/en_GB.po index 618d38f484..7f2642fe10 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -1391,6 +1391,10 @@ msgstr "No DMA pacing timer found" msgid "No I2C device at address: 0x%x" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" @@ -2287,6 +2291,10 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "Woken up by alarm.\n" @@ -3616,6 +3624,10 @@ msgstr "object with buffer protocol required" msgid "odd-length string" msgstr "odd-length string" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + #: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "offset is too large" diff --git a/locale/es.po b/locale/es.po index fd67f869ff..fbd682d61a 100644 --- a/locale/es.po +++ b/locale/es.po @@ -1410,6 +1410,10 @@ msgstr "timer por establecedor de paso DMA no encontrado" msgid "No I2C device at address: 0x%x" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" @@ -2319,6 +2323,10 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "Despertado por la alarma.\n" @@ -3660,6 +3668,10 @@ msgstr "objeto con protocolo de buffer requerido" msgid "odd-length string" msgstr "string de longitud impar" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + #: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "offset es demasiado grande" diff --git a/locale/fil.po b/locale/fil.po index b81a0ac156..8112eb048c 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -1388,6 +1388,10 @@ msgstr "" msgid "No I2C device at address: 0x%x" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" @@ -2274,6 +2278,10 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "" @@ -3616,6 +3624,10 @@ msgstr "object na may buffer protocol kinakailangan" msgid "odd-length string" msgstr "odd-length string" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + #: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 94aa8879de..33f58c6185 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -1420,6 +1420,10 @@ msgstr "Aucun minuteur de rythme DMA trouvé" msgid "No I2C device at address: 0x%x" msgstr "Aucun périphérique I2S à l'adresse : 0x%x" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" @@ -2339,6 +2343,10 @@ msgstr "" "\n" "Pour lister les modules internes, entrez `help(\"modules\")`.\n" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "Réveil par alarme.\n" @@ -3685,6 +3693,10 @@ msgstr "un objet avec un protocole de tampon est nécessaire" msgid "odd-length string" msgstr "chaîne de longueur impaire" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + #: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "offset est trop large" diff --git a/locale/hi.po b/locale/hi.po index ca6f580adc..2c18e7ca9a 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -1375,6 +1375,10 @@ msgstr "" msgid "No I2C device at address: 0x%x" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" @@ -2254,6 +2258,10 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "" @@ -3579,6 +3587,10 @@ msgstr "" msgid "odd-length string" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + #: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 187f9648f9..20c57c6475 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -1394,6 +1394,10 @@ msgstr "" msgid "No I2C device at address: 0x%x" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" @@ -2284,6 +2288,10 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "" @@ -3627,6 +3635,10 @@ msgstr "" msgid "odd-length string" msgstr "stringa di lunghezza dispari" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + #: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" diff --git a/locale/ja.po b/locale/ja.po index 32d0336334..d459a06b25 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -1386,6 +1386,10 @@ msgstr "" msgid "No I2C device at address: 0x%x" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" @@ -2268,6 +2272,10 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "" @@ -3598,6 +3606,10 @@ msgstr "" msgid "odd-length string" msgstr "奇数長の文字列" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + #: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index 10b930ca12..95b68a1b77 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -1378,6 +1378,10 @@ msgstr "" msgid "No I2C device at address: 0x%x" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" @@ -2258,6 +2262,10 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "" @@ -3583,6 +3591,10 @@ msgstr "" msgid "odd-length string" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + #: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 58e5c4a676..39199c71c2 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -1386,6 +1386,10 @@ msgstr "" msgid "No I2C device at address: 0x%x" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" @@ -2284,6 +2288,10 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "Gewekt door alarm.\n" @@ -3616,6 +3624,10 @@ msgstr "object met buffer protocol vereist" msgid "odd-length string" msgstr "string met oneven lengte" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + #: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "compensatie is te groot" diff --git a/locale/pl.po b/locale/pl.po index 03357dfb91..21f695316b 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -1386,6 +1386,10 @@ msgstr "" msgid "No I2C device at address: 0x%x" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" @@ -2265,6 +2269,10 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "" @@ -3591,6 +3599,10 @@ msgstr "wymagany obiekt z protokołem buforu" msgid "odd-length string" msgstr "łańcuch o nieparzystej długości" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + #: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 56c8a4737b..d685d80c86 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -1414,6 +1414,10 @@ msgstr "Nenhum temporizador DMA foi encontrado" msgid "No I2C device at address: 0x%x" msgstr "Não há nenhum dispositivo I2C no endereço: 0x%x" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" @@ -2335,6 +2339,10 @@ msgstr "" "\n" "Para listar os módulos existente digite `help(\"modules\")`.\n" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "Foi despertado através do alarme.\n" @@ -3677,6 +3685,10 @@ msgstr "é necessário objeto com protocolo do buffer" msgid "odd-length string" msgstr "sequência com comprimento ímpar" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + #: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "o offset é muito grande" diff --git a/locale/ru.po b/locale/ru.po index 06a3702a48..07bcb2967a 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -1412,6 +1412,10 @@ msgstr "" msgid "No I2C device at address: 0x%x" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" @@ -2303,6 +2307,10 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "" @@ -3628,6 +3636,10 @@ msgstr "" msgid "odd-length string" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + #: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index aafbc0ab75..e2a9ccedfa 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -1396,6 +1396,10 @@ msgstr "Ingen DMA pacing timer hittades" msgid "No I2C device at address: 0x%x" msgstr "Ingen I2C-enhet på adress: 0x%x" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" @@ -2305,6 +2309,10 @@ msgstr "" "\n" "För att lista inbyggda moduler skriver du `help(\"modules\")`.\n" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "Vaknade av larm.\n" @@ -3640,6 +3648,10 @@ msgstr "objekt med buffertprotokoll krävs" msgid "odd-length string" msgstr "sträng har udda längd" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + #: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "offset är för stor" diff --git a/locale/tr.po b/locale/tr.po index b0b7afaae2..7f1a22dafd 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -1392,6 +1392,10 @@ msgstr "" msgid "No I2C device at address: 0x%x" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" @@ -2274,6 +2278,10 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "" @@ -3599,6 +3607,10 @@ msgstr "" msgid "odd-length string" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + #: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 224d766066..41964f866b 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -1410,6 +1410,10 @@ msgstr "wèi zhǎo dào DMA qǐ bó qì" msgid "No I2C device at address: 0x%x" msgstr "dì zhǐ: 0x%x shí méi yǒu I2C qì jiàn" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" @@ -2316,6 +2320,10 @@ msgstr "" "\n" "liè chū nèi zhì mó kuài jiàn rù `help(\"modules\")`.\n" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "bèi jǐng bào chǎo xǐng.\n" @@ -3650,6 +3658,10 @@ msgstr "xūyào huǎnchōng qū xiéyì de duìxiàng" msgid "odd-length string" msgstr "jīshù zìfú chuàn" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + #: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "piān yí tài dà" From 669e45497c83b42a53f9b685d6c429ad06f122eb Mon Sep 17 00:00:00 2001 From: root Date: Tue, 14 Jun 2022 13:27:15 -0500 Subject: [PATCH 239/246] Uncommented call to print_wakeup_cause --- ports/nrf/common-hal/alarm/__init__.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/nrf/common-hal/alarm/__init__.c b/ports/nrf/common-hal/alarm/__init__.c index c79158e8f1..1acc0c0324 100644 --- a/ports/nrf/common-hal/alarm/__init__.c +++ b/ports/nrf/common-hal/alarm/__init__.c @@ -49,7 +49,7 @@ #include "nrfx.h" #include "nrfx_gpiote.h" #ifdef NRF_DEBUG_PRINT -void print_wakeup_cause(nrf_sleep_source_t cause); +static void print_wakeup_cause(nrf_sleep_source_t cause); #endif // Singleton instance of SleepMemory. @@ -111,7 +111,7 @@ bool common_hal_alarm_woken_from_sleep(void) { nrf_sleep_source_t cause = _get_wakeup_cause(); #ifdef NRF_DEBUG_PRINT if (cause != NRF_SLEEP_WAKEUP_UNDEFINED) { - // print_wakeup_cause(cause); + print_wakeup_cause(cause); } #endif return cause == NRF_SLEEP_WAKEUP_GPIO || cause == NRF_SLEEP_WAKEUP_TIMER From 8668dee3dfe8b9e9bc4ad63ae5ea6d95a15aab4b Mon Sep 17 00:00:00 2001 From: root Date: Tue, 14 Jun 2022 20:51:07 -0500 Subject: [PATCH 240/246] Fix declaration of print_wakeup_cause --- ports/nrf/common-hal/alarm/__init__.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ports/nrf/common-hal/alarm/__init__.c b/ports/nrf/common-hal/alarm/__init__.c index 1acc0c0324..043be0b319 100644 --- a/ports/nrf/common-hal/alarm/__init__.c +++ b/ports/nrf/common-hal/alarm/__init__.c @@ -48,9 +48,6 @@ #include "nrf_power.h" #include "nrfx.h" #include "nrfx_gpiote.h" -#ifdef NRF_DEBUG_PRINT -static void print_wakeup_cause(nrf_sleep_source_t cause); -#endif // Singleton instance of SleepMemory. const alarm_sleep_memory_obj_t alarm_sleep_memory_obj = { @@ -99,7 +96,7 @@ static const char *cause_str[] = { "VBUS", "RESETPIN", }; -void print_wakeup_cause(nrf_sleep_source_t cause) { +static void print_wakeup_cause(nrf_sleep_source_t cause) { if (cause >= 0 && cause < NRF_SLEEP_WAKEUP_ZZZ) { mp_printf(&mp_plat_print, "wakeup cause = NRF_SLEEP_WAKEUP_%s\r\n", cause_str[(int)cause]); From 987196fe78728b04f8f3c1d09fb61d6fd47bec3a Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Tue, 14 Jun 2022 20:26:17 +0000 Subject: [PATCH 241/246] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (986 of 986 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 d685d80c86..c2de3f1b02 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-05-25 11:17+0000\n" +"PO-Revision-Date: 2022-06-16 08:18+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -1416,7 +1416,7 @@ msgstr "Não há nenhum dispositivo I2C no endereço: 0x%x" #: supervisor/shared/web_workflow/web_workflow.c msgid "No IP" -msgstr "" +msgstr "Sem IP" #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -2341,7 +2341,7 @@ msgstr "" #: supervisor/shared/web_workflow/web_workflow.c msgid "Wi-Fi: " -msgstr "" +msgstr "Wi-Fi: " #: main.c msgid "Woken up by alarm.\n" @@ -3687,7 +3687,7 @@ msgstr "sequência com comprimento ímpar" #: supervisor/shared/web_workflow/web_workflow.c msgid "off" -msgstr "" +msgstr "desligado" #: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c msgid "offset is too large" From 81aa14327138c8ba8d6ae72d7aba7f9c92a6f832 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Wed, 15 Jun 2022 08:01:42 +0000 Subject: [PATCH 242/246] Translated using Weblate (Swedish) Currently translated at 100.0% (986 of 986 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index e2a9ccedfa..fb23e98880 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-05-23 14:18+0000\n" +"PO-Revision-Date: 2022-06-16 08:18+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -1398,7 +1398,7 @@ msgstr "Ingen I2C-enhet på adress: 0x%x" #: supervisor/shared/web_workflow/web_workflow.c msgid "No IP" -msgstr "" +msgstr "Ingen IP" #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -2311,7 +2311,7 @@ msgstr "" #: supervisor/shared/web_workflow/web_workflow.c msgid "Wi-Fi: " -msgstr "" +msgstr "Wi-Fi: " #: main.c msgid "Woken up by alarm.\n" @@ -3650,7 +3650,7 @@ msgstr "sträng har udda längd" #: supervisor/shared/web_workflow/web_workflow.c msgid "off" -msgstr "" +msgstr "av" #: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c msgid "offset is too large" From 8ed791060c56a838d15d5e6a460194466a031c92 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 16 Jun 2022 21:10:19 +0200 Subject: [PATCH 243/246] include python executable path in the idf key I noticed that the latest time we needed to switch the idf key was when the environment changed from python 3.10.4 to 3.10.5. I don't know if this is the only cause of needing to change the key, but it seems to be a good idea to make the key include it. I think this is what's going on because when I replaced a virtualenv's "python" with a dangling symlink (same as would occur when python's version gets bumped), I got a similar error. --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6f260117ad..e2d58c1416 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -382,6 +382,7 @@ jobs: if: ${{ needs.test.outputs.boards-espressif != '[]' }} steps: - name: Set up Python 3 + id: py3 uses: actions/setup-python@v2 with: python-version: "3.x" @@ -400,7 +401,7 @@ jobs: id: idf-cache with: path: ${{ github.workspace }}/.idf_tools - key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/espressif/esp-idf/HEAD') }}-20220404 + key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/espressif/esp-idf/HEAD') }}-${{ steps.py3.outputs.python-path }}-20220404 - name: Clone IDF submodules run: | (cd $IDF_PATH && git submodule update --init) From cdc71403185cef54605a3d7afa16b1cd19315ff6 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 16 Jun 2022 14:56:18 -0500 Subject: [PATCH 244/246] Test for a BLE disconnect while reading --- ports/nrf/common-hal/_bleio/__init__.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ports/nrf/common-hal/_bleio/__init__.c b/ports/nrf/common-hal/_bleio/__init__.c index 1d59983896..718b28c7fe 100644 --- a/ports/nrf/common-hal/_bleio/__init__.c +++ b/ports/nrf/common-hal/_bleio/__init__.c @@ -185,7 +185,12 @@ STATIC bool _on_gattc_read_rsp_evt(ble_evt_t *ble_evt, void *param) { } break; } - + case BLE_GAP_EVT_DISCONNECTED: { + read->conn_handle = BLE_CONN_HANDLE_INVALID; + read->done = true; + return false; + break; + } default: // For debugging. // mp_printf(&mp_plat_print, "Unhandled characteristic event: 0x%04x\n", ble_evt->header.evt_id); @@ -219,6 +224,8 @@ size_t common_hal_bleio_gattc_read(uint16_t handle, uint16_t conn_handle, uint8_ while (!read_info.done) { RUN_BACKGROUND_TASKS; } + // Test if we were disconnected while reading + common_hal_bleio_check_connected(read_info.conn_handle); ble_drv_remove_event_handler(_on_gattc_read_rsp_evt, &read_info); check_gatt_status(read_info.status); From da26c9ce829f6d00df96d8f150d39ee8c9e58049 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 17 Jun 2022 16:21:27 +0200 Subject: [PATCH 245/246] use setup-python v4 for python-path support --- .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 e2d58c1416..4a9bd65d8d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -383,7 +383,7 @@ jobs: steps: - name: Set up Python 3 id: py3 - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: "3.x" - uses: actions/checkout@v2.2.0 From 019a160983c92c8ef022b18e6f189ba6a671a9ce Mon Sep 17 00:00:00 2001 From: Matthew McGowan Date: Mon, 20 Jun 2022 14:46:58 -0700 Subject: [PATCH 246/246] exposes `DigitalInOutPin` instances on the board, initialized and reserved. --- ports/stm/boards/swan_r5/board.c | 17 +++++++++++++++++ ports/stm/boards/swan_r5/board.h | 10 ++++++++++ ports/stm/boards/swan_r5/pins.c | 7 +++---- 3 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 ports/stm/boards/swan_r5/board.h diff --git a/ports/stm/boards/swan_r5/board.c b/ports/stm/boards/swan_r5/board.c index bb424eea0b..4f29be35f8 100644 --- a/ports/stm/boards/swan_r5/board.c +++ b/ports/stm/boards/swan_r5/board.c @@ -30,11 +30,27 @@ #include "stm32l4xx.h" #include "stm32l4r5xx.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/digitalio/DigitalInOut.h" +#include "shared-bindings/digitalio/Direction.h" +#include "shared-bindings/digitalio/DriveMode.h" +#include "board.h" + +digitalio_digitalinout_obj_t power_pin = { .base.type = &digitalio_digitalinout_type }; +digitalio_digitalinout_obj_t discharge_pin = { .base.type = &digitalio_digitalinout_type }; + void initialize_discharge_pin(void) { + /* Initialize the 3V3 discharge to be OFF and the output power to be ON */ __HAL_RCC_GPIOE_CLK_ENABLE(); __HAL_RCC_GPIOC_CLK_ENABLE(); + + common_hal_digitalio_digitalinout_construct(&power_pin, &pin_PE04); + common_hal_digitalio_digitalinout_construct(&discharge_pin, &pin_PE06); + common_hal_digitalio_digitalinout_never_reset(&power_pin); + common_hal_digitalio_digitalinout_never_reset(&discharge_pin); + GPIO_InitTypeDef GPIO_InitStruct; /* Set the DISCHARGE pin and the USB_DETECT pin to FLOAT */ GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; @@ -49,6 +65,7 @@ void initialize_discharge_pin(void) { GPIO_InitStruct.Pin = GPIO_PIN_4; HAL_GPIO_Init(GPIOE, &GPIO_InitStruct); HAL_GPIO_WritePin(GPIOE, GPIO_PIN_4, GPIO_PIN_SET); + } void board_init(void) { diff --git a/ports/stm/boards/swan_r5/board.h b/ports/stm/boards/swan_r5/board.h new file mode 100644 index 0000000000..56c62c34a0 --- /dev/null +++ b/ports/stm/boards/swan_r5/board.h @@ -0,0 +1,10 @@ +#ifndef _BOARDS_SWAN_R5_BOARD_H_ +#define _BOARDS_SWAN_R5_BOARD_H_ + +#include "common-hal/digitalio/DigitalInOut.h" + +extern digitalio_digitalinout_obj_t power_pin; +extern digitalio_digitalinout_obj_t discharge_pin; + + +#endif // _BOARDS_SWAN_R5_BOARD_H_ diff --git a/ports/stm/boards/swan_r5/pins.c b/ports/stm/boards/swan_r5/pins.c index 7032eae4c4..cf97c3587a 100644 --- a/ports/stm/boards/swan_r5/pins.c +++ b/ports/stm/boards/swan_r5/pins.c @@ -1,5 +1,6 @@ #include "py/objtuple.h" #include "shared-bindings/board/__init__.h" +#include "board.h" // extended pins STATIC const mp_rom_map_elem_t board_module_carrier_table[] = { @@ -86,10 +87,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_ext), MP_ROM_PTR(&carrier_type) }, - { MP_ROM_QSTR(MP_QSTR_ENABLE_3V3), MP_ROM_PTR(SWAN_R5_ENABLE_3V3) }, - { MP_ROM_QSTR(MP_QSTR_DISCHARGE_3V3), MP_ROM_PTR(SWAN_R5_DISCHARGE_3V3) }, - { MP_ROM_QSTR(MP_QSTR_DISABLE_DISCHARGING), MP_ROM_TRUE }, - { MP_ROM_QSTR(MP_QSTR_ENABLE_DISCHARGING), MP_ROM_FALSE }, + { MP_ROM_QSTR(MP_QSTR_ENABLE_3V3), &power_pin }, + { MP_ROM_QSTR(MP_QSTR_DISCHARGE_3V3), &discharge_pin }, { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA03) }, // PWM, ADC { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA01) }, // PWM, ADC