From a460410d6a6fed0493ca5b245b8e7d8e7f76f286 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Fri, 10 Feb 2023 22:45:25 +0200 Subject: [PATCH 01/57] First attempt at using alloc --- main.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index d70e718b6d..8376e0b089 100644 --- a/main.c +++ b/main.c @@ -123,7 +123,8 @@ uint8_t value_out = 0; #endif #if MICROPY_ENABLE_PYSTACK -static size_t PLACE_IN_DTCM_BSS(_pystack[CIRCUITPY_PYSTACK_SIZE / sizeof(size_t)]); +size_t *_pystack; +int _pystack_size = CIRCUITPY_PYSTACK_SIZE; #endif static void reset_devices(void) { @@ -160,7 +161,7 @@ STATIC void start_mp(supervisor_allocation *heap) { readline_init0(); #if MICROPY_ENABLE_PYSTACK - mp_pystack_init(_pystack, _pystack + (sizeof(_pystack) / sizeof(size_t))); + mp_pystack_init(_pystack, _pystack + (_pystack_size / sizeof(size_t))); #endif #if MICROPY_ENABLE_GC @@ -912,6 +913,10 @@ STATIC int run_repl(void) { } int __attribute__((used)) main(void) { + + // allocate the pystack + _pystack = (size_t *)allocate_memory(_pystack_size, false, false); + // initialise the cpu and peripherals safe_mode_t safe_mode = port_init(); From 1f1a495e26a94873f7094a59400465171e5558ad Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Mon, 13 Feb 2023 20:57:54 +0200 Subject: [PATCH 02/57] rename _pystack -> pystack --- main.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index 8376e0b089..6f3f2820cd 100644 --- a/main.c +++ b/main.c @@ -123,8 +123,8 @@ uint8_t value_out = 0; #endif #if MICROPY_ENABLE_PYSTACK -size_t *_pystack; -int _pystack_size = CIRCUITPY_PYSTACK_SIZE; +size_t *pystack; +int pystack_size = CIRCUITPY_PYSTACK_SIZE; #endif static void reset_devices(void) { @@ -161,7 +161,7 @@ STATIC void start_mp(supervisor_allocation *heap) { readline_init0(); #if MICROPY_ENABLE_PYSTACK - mp_pystack_init(_pystack, _pystack + (_pystack_size / sizeof(size_t))); + mp_pystack_init(pystack, pystack + (pystack_size / sizeof(size_t))); #endif #if MICROPY_ENABLE_GC @@ -914,8 +914,10 @@ STATIC int run_repl(void) { int __attribute__((used)) main(void) { + #if MICROPY_ENABLE_PYSTACK // allocate the pystack - _pystack = (size_t *)allocate_memory(_pystack_size, false, false); + pystack = (size_t *)allocate_memory(pystack_size, false, false); + #endif // initialise the cpu and peripherals safe_mode_t safe_mode = port_init(); From 422098e1711259d18b4b26077f8435302d1fb1d7 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Wed, 15 Feb 2023 12:30:42 +0200 Subject: [PATCH 03/57] pystack is now a valid supervisor allocation --- main.c | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/main.c b/main.c index 6f3f2820cd..7b9f10d1e3 100644 --- a/main.c +++ b/main.c @@ -122,18 +122,13 @@ uint8_t value_out = 0; #endif -#if MICROPY_ENABLE_PYSTACK -size_t *pystack; -int pystack_size = CIRCUITPY_PYSTACK_SIZE; -#endif - static void reset_devices(void) { #if CIRCUITPY_BLEIO_HCI bleio_reset(); #endif } -STATIC void start_mp(supervisor_allocation *heap) { +STATIC void start_mp(supervisor_allocation *heap, supervisor_allocation *pystack, int pystack_size) { supervisor_workflow_reset(); // Stack limit should be less than real stack size, so we have a chance @@ -161,7 +156,7 @@ STATIC void start_mp(supervisor_allocation *heap) { readline_init0(); #if MICROPY_ENABLE_PYSTACK - mp_pystack_init(pystack, pystack + (pystack_size / sizeof(size_t))); + mp_pystack_init(pystack->ptr, pystack->ptr + (pystack_size / sizeof(size_t))); #endif #if MICROPY_ENABLE_GC @@ -364,7 +359,7 @@ STATIC void print_code_py_status_message(safe_mode_t safe_mode) { } } -STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) { +STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset, supervisor_allocation *pystack, int pystack_size) { bool serial_connected_at_start = serial_connected(); bool printed_safe_mode_message = false; #if CIRCUITPY_AUTORELOAD_DELAY_MS > 0 @@ -403,7 +398,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) { supervisor_allocation *heap = allocate_remaining_memory(); // Prepare the VM state. - start_mp(heap); + start_mp(heap, pystack, pystack_size); #if CIRCUITPY_USB usb_setup_with_vm(); @@ -731,7 +726,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) { vstr_t *boot_output; -STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { +STATIC void run_boot_py(safe_mode_t safe_mode, supervisor_allocation *pystack, int pystack_size) { if (safe_mode == NO_HEAP) { return; } @@ -749,7 +744,7 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { supervisor_allocation *heap = allocate_remaining_memory(); - start_mp(heap); + start_mp(heap, pystack, pystack_size); #if CIRCUITPY_USB // Set up default USB values after boot.py VM starts but before running boot.py. @@ -846,12 +841,12 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { #endif } -STATIC int run_repl(void) { +STATIC int run_repl(supervisor_allocation *pystack, int pystack_size) { int exit_code = PYEXEC_FORCED_EXIT; stack_resize(); filesystem_flush(); supervisor_allocation *heap = allocate_remaining_memory(); - start_mp(heap); + start_mp(heap, pystack, pystack_size); #if CIRCUITPY_USB usb_setup_with_vm(); @@ -915,8 +910,11 @@ STATIC int run_repl(void) { int __attribute__((used)) main(void) { #if MICROPY_ENABLE_PYSTACK + supervisor_allocation *pystack; + int pystack_size = CIRCUITPY_PYSTACK_SIZE; + // allocate the pystack - pystack = (size_t *)allocate_memory(pystack_size, false, false); + pystack = allocate_memory(pystack_size, false, false); #endif // initialise the cpu and peripherals @@ -998,7 +996,7 @@ int __attribute__((used)) main(void) { filesystem_set_internal_concurrent_write_protection(true); filesystem_set_internal_writable_by_usb(CIRCUITPY_USB == 1); - run_boot_py(safe_mode); + run_boot_py(safe_mode, pystack, pystack_size); supervisor_workflow_start(); @@ -1012,7 +1010,7 @@ int __attribute__((used)) main(void) { bool simulate_reset = true; for (;;) { if (!skip_repl) { - exit_code = run_repl(); + exit_code = run_repl(pystack, pystack_size); supervisor_set_run_reason(RUN_REASON_REPL_RELOAD); } if (exit_code == PYEXEC_FORCED_EXIT) { @@ -1023,7 +1021,7 @@ int __attribute__((used)) main(void) { // If code.py did a fake deep sleep, pretend that we // are running code.py for the first time after a hard // reset. This will preserve any alarm information. - skip_repl = run_code_py(safe_mode, &simulate_reset); + skip_repl = run_code_py(safe_mode, &simulate_reset, pystack, pystack_size); } else { skip_repl = false; } From 9e2235d7f716171f8cf1432b59d64edc914c9794 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Wed, 15 Feb 2023 15:23:16 +0200 Subject: [PATCH 04/57] pystack works via settings.toml, stackless not working yet --- main.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 48 insertions(+), 10 deletions(-) diff --git a/main.c b/main.c index 7b9f10d1e3..19bfe85973 100644 --- a/main.c +++ b/main.c @@ -122,6 +122,10 @@ uint8_t value_out = 0; #endif +#if MICROPY_ENABLE_PYSTACK +#include "shared-module/os/__init__.h" +#endif + static void reset_devices(void) { #if CIRCUITPY_BLEIO_HCI bleio_reset(); @@ -156,7 +160,9 @@ STATIC void start_mp(supervisor_allocation *heap, supervisor_allocation *pystack readline_init0(); #if MICROPY_ENABLE_PYSTACK - mp_pystack_init(pystack->ptr, pystack->ptr + (pystack_size / sizeof(size_t))); + if (pystack_size > 0) { + mp_pystack_init(pystack->ptr, pystack->ptr + (pystack_size / sizeof(size_t))); + } #endif #if MICROPY_ENABLE_GC @@ -398,7 +404,10 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset, supervisor_ supervisor_allocation *heap = allocate_remaining_memory(); // Prepare the VM state. + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" // stackless doesn't want allocations. start_mp(heap, pystack, pystack_size); + #pragma GCC diagnostic pop #if CIRCUITPY_USB usb_setup_with_vm(); @@ -743,8 +752,10 @@ STATIC void run_boot_py(safe_mode_t safe_mode, supervisor_allocation *pystack, i // Do USB setup even if boot.py is not run. supervisor_allocation *heap = allocate_remaining_memory(); - + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" // stackless doesn't want allocations. start_mp(heap, pystack, pystack_size); + #pragma GCC diagnostic pop #if CIRCUITPY_USB // Set up default USB values after boot.py VM starts but before running boot.py. @@ -846,7 +857,10 @@ STATIC int run_repl(supervisor_allocation *pystack, int pystack_size) { stack_resize(); filesystem_flush(); supervisor_allocation *heap = allocate_remaining_memory(); + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" // stackless doesn't want allocations. start_mp(heap, pystack, pystack_size); + #pragma GCC diagnostic pop #if CIRCUITPY_USB usb_setup_with_vm(); @@ -909,14 +923,6 @@ STATIC int run_repl(supervisor_allocation *pystack, int pystack_size) { int __attribute__((used)) main(void) { - #if MICROPY_ENABLE_PYSTACK - supervisor_allocation *pystack; - int pystack_size = CIRCUITPY_PYSTACK_SIZE; - - // allocate the pystack - pystack = allocate_memory(pystack_size, false, false); - #endif - // initialise the cpu and peripherals safe_mode_t safe_mode = port_init(); @@ -974,6 +980,38 @@ int __attribute__((used)) main(void) { alarm_reset(); #endif + // Pystack variables have to exist even in stackless for the function calls + supervisor_allocation *pystack; + int pystack_size = CIRCUITPY_PYSTACK_SIZE; // Use build default for now. + #if MICROPY_ENABLE_PYSTACK + // Allocate default at least temporarily, needed for getenv + pystack = allocate_memory(CIRCUITPY_PYSTACK_SIZE, false, false); + + // Fetch value if exists from settings.toml + #if CIRCUITPY_OS_GETENV + // Init needed. + supervisor_allocation *heap = allocate_remaining_memory(); + + // Leaves size to build default on any failure + (void)common_hal_os_getenv_int("CIRCUITPY_PYSTACK_SIZE", &pystack_size); + free_memory(heap); + + // Check if value is valid multiple of size_t else revert + if ((CIRCUITPY_PYSTACK_SIZE != pystack_size) && (pystack_size > 0) && (pystack_size % sizeof(size_t) != 0)) { + pystack_size = CIRCUITPY_PYSTACK_SIZE; // Reset to build default + // TODO: Find a way to inform the user about it. + // Perhaps safemode? + } + + if (CIRCUITPY_PYSTACK_SIZE != pystack_size) { + free_memory(pystack); // Free the temporary + if (pystack_size > 0) { // Allocate new if needed + pystack = allocate_memory(pystack_size, false, false); + } + } + #endif + #endif + // Reset everything and prep MicroPython to run boot.py. reset_port(); // Port-independent devices, like CIRCUITPY_BLEIO_HCI. From 0d5b400b331a05330b31ec29c57d11e5405371dc Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Wed, 15 Feb 2023 16:08:22 +0200 Subject: [PATCH 05/57] swap int for mp_int_t --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 19bfe85973..55f464bc00 100644 --- a/main.c +++ b/main.c @@ -982,7 +982,7 @@ int __attribute__((used)) main(void) { // Pystack variables have to exist even in stackless for the function calls supervisor_allocation *pystack; - int pystack_size = CIRCUITPY_PYSTACK_SIZE; // Use build default for now. + mp_int_t pystack_size = CIRCUITPY_PYSTACK_SIZE; // Use build default for now. #if MICROPY_ENABLE_PYSTACK // Allocate default at least temporarily, needed for getenv pystack = allocate_memory(CIRCUITPY_PYSTACK_SIZE, false, false); From 2077bb9da994c32008bf4b9ce14a7cf6a190b742 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Wed, 15 Feb 2023 17:54:52 +0200 Subject: [PATCH 06/57] pystack_size as multiple of sizeof size_t, no more stackless via settings.toml --- main.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/main.c b/main.c index 55f464bc00..ffd5b80610 100644 --- a/main.c +++ b/main.c @@ -122,7 +122,7 @@ uint8_t value_out = 0; #endif -#if MICROPY_ENABLE_PYSTACK +#if MICROPY_ENABLE_PYSTACK && CIRCUITPY_OS_GETENV #include "shared-module/os/__init__.h" #endif @@ -160,9 +160,7 @@ STATIC void start_mp(supervisor_allocation *heap, supervisor_allocation *pystack readline_init0(); #if MICROPY_ENABLE_PYSTACK - if (pystack_size > 0) { - mp_pystack_init(pystack->ptr, pystack->ptr + (pystack_size / sizeof(size_t))); - } + mp_pystack_init(pystack->ptr, pystack->ptr + (pystack_size / sizeof(size_t))); #endif #if MICROPY_ENABLE_GC @@ -995,9 +993,11 @@ int __attribute__((used)) main(void) { // Leaves size to build default on any failure (void)common_hal_os_getenv_int("CIRCUITPY_PYSTACK_SIZE", &pystack_size); free_memory(heap); + // Convert frame count to allocation size, 384 is the default for 1536 bytes + pystack_size = pystack_size * sizeof(size_t); - // Check if value is valid multiple of size_t else revert - if ((CIRCUITPY_PYSTACK_SIZE != pystack_size) && (pystack_size > 0) && (pystack_size % sizeof(size_t) != 0)) { + // Check if value is valid + if ((CIRCUITPY_PYSTACK_SIZE != pystack_size) && (pystack_size < 1)) { pystack_size = CIRCUITPY_PYSTACK_SIZE; // Reset to build default // TODO: Find a way to inform the user about it. // Perhaps safemode? @@ -1005,9 +1005,7 @@ int __attribute__((used)) main(void) { if (CIRCUITPY_PYSTACK_SIZE != pystack_size) { free_memory(pystack); // Free the temporary - if (pystack_size > 0) { // Allocate new if needed - pystack = allocate_memory(pystack_size, false, false); - } + pystack = allocate_memory(pystack_size, false, false); // Allocate new pystack } #endif #endif From fa302b2e29ff15095871d6cf01e0ad7f010a691e Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Wed, 15 Feb 2023 21:54:53 +0200 Subject: [PATCH 07/57] Now works on reload. --- main.c | 102 +++++++++++++++++++++++++++------------------------------ 1 file changed, 48 insertions(+), 54 deletions(-) diff --git a/main.c b/main.c index ffd5b80610..3f9de99cd9 100644 --- a/main.c +++ b/main.c @@ -122,9 +122,13 @@ uint8_t value_out = 0; #endif -#if MICROPY_ENABLE_PYSTACK && CIRCUITPY_OS_GETENV +#if MICROPY_ENABLE_PYSTACK +supervisor_allocation *pystack; +mp_int_t pystack_size = 0; // 0 indicated 'not allocated' +#if CIRCUITPY_OS_GETENV #include "shared-module/os/__init__.h" #endif +#endif static void reset_devices(void) { #if CIRCUITPY_BLEIO_HCI @@ -132,7 +136,31 @@ static void reset_devices(void) { #endif } -STATIC void start_mp(supervisor_allocation *heap, supervisor_allocation *pystack, int pystack_size) { +#if MICROPY_ENABLE_PYSTACK +STATIC void alloc_pystack(void) { + mp_int_t old_pystack_size = pystack_size; + pystack_size = CIRCUITPY_PYSTACK_SIZE; // Use build default for now. + // Fetch value if exists from settings.toml + #if CIRCUITPY_OS_GETENV + // Leaves size to build default on any failure + (void)common_hal_os_getenv_int("CIRCUITPY_PYSTACK_SIZE", &pystack_size); + // Check if value is valid + if ((CIRCUITPY_PYSTACK_SIZE != pystack_size) && ((pystack_size < 1) || (pystack_size % sizeof(size_t) != 0))) { + pystack_size = CIRCUITPY_PYSTACK_SIZE; // Reset to build default + // TODO: Find a way to inform the user about it. + // Perhaps safemode? Or is it too much? + } + #endif + if (old_pystack_size != pystack_size) { + if (old_pystack_size != 0) { + free_memory(pystack); + } + pystack = allocate_memory(pystack_size, false, false); + } +} +#endif + +STATIC void start_mp(supervisor_allocation *heap) { supervisor_workflow_reset(); // Stack limit should be less than real stack size, so we have a chance @@ -363,7 +391,7 @@ STATIC void print_code_py_status_message(safe_mode_t safe_mode) { } } -STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset, supervisor_allocation *pystack, int pystack_size) { +STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) { bool serial_connected_at_start = serial_connected(); bool printed_safe_mode_message = false; #if CIRCUITPY_AUTORELOAD_DELAY_MS > 0 @@ -399,13 +427,11 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset, supervisor_ }; #endif + #if MICROPY_ENABLE_PYSTACK + alloc_pystack(); + #endif supervisor_allocation *heap = allocate_remaining_memory(); - - // Prepare the VM state. - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" // stackless doesn't want allocations. - start_mp(heap, pystack, pystack_size); - #pragma GCC diagnostic pop + start_mp(heap); #if CIRCUITPY_USB usb_setup_with_vm(); @@ -733,7 +759,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset, supervisor_ vstr_t *boot_output; -STATIC void run_boot_py(safe_mode_t safe_mode, supervisor_allocation *pystack, int pystack_size) { +STATIC void run_boot_py(safe_mode_t safe_mode) { if (safe_mode == NO_HEAP) { return; } @@ -749,11 +775,11 @@ STATIC void run_boot_py(safe_mode_t safe_mode, supervisor_allocation *pystack, i // Do USB setup even if boot.py is not run. + #if MICROPY_ENABLE_PYSTACK + alloc_pystack(); + #endif supervisor_allocation *heap = allocate_remaining_memory(); - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" // stackless doesn't want allocations. - start_mp(heap, pystack, pystack_size); - #pragma GCC diagnostic pop + start_mp(heap); #if CIRCUITPY_USB // Set up default USB values after boot.py VM starts but before running boot.py. @@ -850,15 +876,15 @@ STATIC void run_boot_py(safe_mode_t safe_mode, supervisor_allocation *pystack, i #endif } -STATIC int run_repl(supervisor_allocation *pystack, int pystack_size) { +STATIC int run_repl(void) { int exit_code = PYEXEC_FORCED_EXIT; stack_resize(); filesystem_flush(); + #if MICROPY_ENABLE_PYSTACK + alloc_pystack(); + #endif supervisor_allocation *heap = allocate_remaining_memory(); - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" // stackless doesn't want allocations. - start_mp(heap, pystack, pystack_size); - #pragma GCC diagnostic pop + start_mp(heap); #if CIRCUITPY_USB usb_setup_with_vm(); @@ -978,38 +1004,6 @@ int __attribute__((used)) main(void) { alarm_reset(); #endif - // Pystack variables have to exist even in stackless for the function calls - supervisor_allocation *pystack; - mp_int_t pystack_size = CIRCUITPY_PYSTACK_SIZE; // Use build default for now. - #if MICROPY_ENABLE_PYSTACK - // Allocate default at least temporarily, needed for getenv - pystack = allocate_memory(CIRCUITPY_PYSTACK_SIZE, false, false); - - // Fetch value if exists from settings.toml - #if CIRCUITPY_OS_GETENV - // Init needed. - supervisor_allocation *heap = allocate_remaining_memory(); - - // Leaves size to build default on any failure - (void)common_hal_os_getenv_int("CIRCUITPY_PYSTACK_SIZE", &pystack_size); - free_memory(heap); - // Convert frame count to allocation size, 384 is the default for 1536 bytes - pystack_size = pystack_size * sizeof(size_t); - - // Check if value is valid - if ((CIRCUITPY_PYSTACK_SIZE != pystack_size) && (pystack_size < 1)) { - pystack_size = CIRCUITPY_PYSTACK_SIZE; // Reset to build default - // TODO: Find a way to inform the user about it. - // Perhaps safemode? - } - - if (CIRCUITPY_PYSTACK_SIZE != pystack_size) { - free_memory(pystack); // Free the temporary - pystack = allocate_memory(pystack_size, false, false); // Allocate new pystack - } - #endif - #endif - // Reset everything and prep MicroPython to run boot.py. reset_port(); // Port-independent devices, like CIRCUITPY_BLEIO_HCI. @@ -1032,7 +1026,7 @@ int __attribute__((used)) main(void) { filesystem_set_internal_concurrent_write_protection(true); filesystem_set_internal_writable_by_usb(CIRCUITPY_USB == 1); - run_boot_py(safe_mode, pystack, pystack_size); + run_boot_py(safe_mode); supervisor_workflow_start(); @@ -1046,7 +1040,7 @@ int __attribute__((used)) main(void) { bool simulate_reset = true; for (;;) { if (!skip_repl) { - exit_code = run_repl(pystack, pystack_size); + exit_code = run_repl(); supervisor_set_run_reason(RUN_REASON_REPL_RELOAD); } if (exit_code == PYEXEC_FORCED_EXIT) { @@ -1057,7 +1051,7 @@ int __attribute__((used)) main(void) { // If code.py did a fake deep sleep, pretend that we // are running code.py for the first time after a hard // reset. This will preserve any alarm information. - skip_repl = run_code_py(safe_mode, &simulate_reset, pystack, pystack_size); + skip_repl = run_code_py(safe_mode, &simulate_reset); } else { skip_repl = false; } From cf6afe250c6865671bfab20841729fc369a04cee Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Wed, 15 Feb 2023 22:00:52 +0200 Subject: [PATCH 08/57] re-add attribute --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 3f9de99cd9..bc86d9182d 100644 --- a/main.c +++ b/main.c @@ -759,7 +759,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) { vstr_t *boot_output; -STATIC void run_boot_py(safe_mode_t safe_mode) { +STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { if (safe_mode == NO_HEAP) { return; } From c3b9567641728000e617252559b7194012d2d449 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Wed, 15 Feb 2023 22:27:37 +0200 Subject: [PATCH 09/57] using vm cleanup and no globals --- main.c | 48 +++++++++++++++++++++--------------------------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/main.c b/main.c index bc86d9182d..fd1e508fc7 100644 --- a/main.c +++ b/main.c @@ -122,13 +122,9 @@ uint8_t value_out = 0; #endif -#if MICROPY_ENABLE_PYSTACK -supervisor_allocation *pystack; -mp_int_t pystack_size = 0; // 0 indicated 'not allocated' -#if CIRCUITPY_OS_GETENV +#if MICROPY_ENABLE_PYSTACK && CIRCUITPY_OS_GETENV #include "shared-module/os/__init__.h" #endif -#endif static void reset_devices(void) { #if CIRCUITPY_BLEIO_HCI @@ -137,30 +133,24 @@ static void reset_devices(void) { } #if MICROPY_ENABLE_PYSTACK -STATIC void alloc_pystack(void) { - mp_int_t old_pystack_size = pystack_size; - pystack_size = CIRCUITPY_PYSTACK_SIZE; // Use build default for now. - // Fetch value if exists from settings.toml +STATIC mp_int_t fetch_pystack_size(void) { + mp_int_t pystack_size = CIRCUITPY_PYSTACK_SIZE; #if CIRCUITPY_OS_GETENV + // Fetch value if exists from settings.toml // Leaves size to build default on any failure (void)common_hal_os_getenv_int("CIRCUITPY_PYSTACK_SIZE", &pystack_size); // Check if value is valid if ((CIRCUITPY_PYSTACK_SIZE != pystack_size) && ((pystack_size < 1) || (pystack_size % sizeof(size_t) != 0))) { - pystack_size = CIRCUITPY_PYSTACK_SIZE; // Reset to build default + pystack_size = CIRCUITPY_PYSTACK_SIZE; // Reset // TODO: Find a way to inform the user about it. // Perhaps safemode? Or is it too much? } #endif - if (old_pystack_size != pystack_size) { - if (old_pystack_size != 0) { - free_memory(pystack); - } - pystack = allocate_memory(pystack_size, false, false); - } + return pystack_size; } #endif -STATIC void start_mp(supervisor_allocation *heap) { +STATIC void start_mp(supervisor_allocation *heap, supervisor_allocation *pystack, mp_int_t pystack_size) { supervisor_workflow_reset(); // Stack limit should be less than real stack size, so we have a chance @@ -292,7 +282,7 @@ STATIC void count_strn(void *data, const char *str, size_t len) { *(size_t *)data += len; } -STATIC void cleanup_after_vm(supervisor_allocation *heap, mp_obj_t exception) { +STATIC void cleanup_after_vm(supervisor_allocation *heap, supervisor_allocation *pystack, mp_obj_t exception) { // Get the traceback of any exception from this run off the heap. // MP_OBJ_SENTINEL means "this run does not contribute to traceback storage, don't touch it" // MP_OBJ_NULL (=0) means "this run completed successfully, clear any stored traceback" @@ -373,6 +363,7 @@ STATIC void cleanup_after_vm(supervisor_allocation *heap, mp_obj_t exception) { filesystem_flush(); stop_mp(); free_memory(heap); + free_memory(pystack); supervisor_move_memory(); // Let the workflows know we've reset in case they want to restart. @@ -428,10 +419,11 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) { #endif #if MICROPY_ENABLE_PYSTACK - alloc_pystack(); + mp_int_t pystack_size = fetch_pystack_size(); + supervisor_allocation *pystack = allocate_memory(pystack_size, false, false); #endif supervisor_allocation *heap = allocate_remaining_memory(); - start_mp(heap); + start_mp(heap, pystack, pystack_size); #if CIRCUITPY_USB usb_setup_with_vm(); @@ -479,7 +471,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) { // Finished executing python code. Cleanup includes filesystem flush and a board reset. - cleanup_after_vm(heap, _exec_result.exception); + cleanup_after_vm(heap, pystack, _exec_result.exception); _exec_result.exception = NULL; // If a new next code file was set, that is a reason to keep it (obviously). Stuff this into @@ -776,10 +768,11 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { // Do USB setup even if boot.py is not run. #if MICROPY_ENABLE_PYSTACK - alloc_pystack(); + mp_int_t pystack_size = fetch_pystack_size(); + supervisor_allocation *pystack = allocate_memory(pystack_size, false, false); #endif supervisor_allocation *heap = allocate_remaining_memory(); - start_mp(heap); + start_mp(heap, pystack, pystack_size); #if CIRCUITPY_USB // Set up default USB values after boot.py VM starts but before running boot.py. @@ -865,7 +858,7 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { port_post_boot_py(true); - cleanup_after_vm(heap, _exec_result.exception); + cleanup_after_vm(heap, pystack, _exec_result.exception); _exec_result.exception = NULL; port_post_boot_py(false); @@ -881,10 +874,11 @@ STATIC int run_repl(void) { stack_resize(); filesystem_flush(); #if MICROPY_ENABLE_PYSTACK - alloc_pystack(); + mp_int_t pystack_size = fetch_pystack_size(); + supervisor_allocation *pystack = allocate_memory(pystack_size, false, false); #endif supervisor_allocation *heap = allocate_remaining_memory(); - start_mp(heap); + start_mp(heap, pystack, pystack_size); #if CIRCUITPY_USB usb_setup_with_vm(); @@ -927,7 +921,7 @@ STATIC int run_repl(void) { exit_code = PYEXEC_DEEP_SLEEP; } #endif - cleanup_after_vm(heap, MP_OBJ_SENTINEL); + cleanup_after_vm(heap, pystack, MP_OBJ_SENTINEL); // Also reset bleio. The above call omits it in case workflows should continue. In this case, // we're switching straight to another VM so we want to reset. From 818d1d4cb15832e90b79bc9f9f2f495fa68d3334 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Wed, 15 Feb 2023 22:43:57 +0200 Subject: [PATCH 10/57] Discard pystack_size --- main.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/main.c b/main.c index fd1e508fc7..599c80eb45 100644 --- a/main.c +++ b/main.c @@ -133,24 +133,25 @@ static void reset_devices(void) { } #if MICROPY_ENABLE_PYSTACK -STATIC mp_int_t fetch_pystack_size(void) { +STATIC supervisor_allocation __attribute__ ((noinline)) * alloc_pystack(void) { mp_int_t pystack_size = CIRCUITPY_PYSTACK_SIZE; #if CIRCUITPY_OS_GETENV // Fetch value if exists from settings.toml // Leaves size to build default on any failure (void)common_hal_os_getenv_int("CIRCUITPY_PYSTACK_SIZE", &pystack_size); // Check if value is valid - if ((CIRCUITPY_PYSTACK_SIZE != pystack_size) && ((pystack_size < 1) || (pystack_size % sizeof(size_t) != 0))) { + if ((CIRCUITPY_PYSTACK_SIZE != pystack_size) && ((pystack_size < 384) || (pystack_size % sizeof(size_t) != 0))) { pystack_size = CIRCUITPY_PYSTACK_SIZE; // Reset // TODO: Find a way to inform the user about it. // Perhaps safemode? Or is it too much? } #endif - return pystack_size; + supervisor_allocation *pystack = allocate_memory(pystack_size, false, false); + return pystack; } #endif -STATIC void start_mp(supervisor_allocation *heap, supervisor_allocation *pystack, mp_int_t pystack_size) { +STATIC void start_mp(supervisor_allocation *heap, supervisor_allocation *pystack) { supervisor_workflow_reset(); // Stack limit should be less than real stack size, so we have a chance @@ -178,7 +179,7 @@ STATIC void start_mp(supervisor_allocation *heap, supervisor_allocation *pystack readline_init0(); #if MICROPY_ENABLE_PYSTACK - mp_pystack_init(pystack->ptr, pystack->ptr + (pystack_size / sizeof(size_t))); + mp_pystack_init(pystack->ptr, pystack->ptr + (get_allocation_length(pystack) / sizeof(size_t))); #endif #if MICROPY_ENABLE_GC @@ -419,11 +420,10 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) { #endif #if MICROPY_ENABLE_PYSTACK - mp_int_t pystack_size = fetch_pystack_size(); - supervisor_allocation *pystack = allocate_memory(pystack_size, false, false); + supervisor_allocation *pystack = alloc_pystack(); #endif supervisor_allocation *heap = allocate_remaining_memory(); - start_mp(heap, pystack, pystack_size); + start_mp(heap, pystack); #if CIRCUITPY_USB usb_setup_with_vm(); @@ -768,11 +768,10 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { // Do USB setup even if boot.py is not run. #if MICROPY_ENABLE_PYSTACK - mp_int_t pystack_size = fetch_pystack_size(); - supervisor_allocation *pystack = allocate_memory(pystack_size, false, false); + supervisor_allocation *pystack = alloc_pystack(); #endif supervisor_allocation *heap = allocate_remaining_memory(); - start_mp(heap, pystack, pystack_size); + start_mp(heap, pystack); #if CIRCUITPY_USB // Set up default USB values after boot.py VM starts but before running boot.py. @@ -874,11 +873,10 @@ STATIC int run_repl(void) { stack_resize(); filesystem_flush(); #if MICROPY_ENABLE_PYSTACK - mp_int_t pystack_size = fetch_pystack_size(); - supervisor_allocation *pystack = allocate_memory(pystack_size, false, false); + supervisor_allocation *pystack = alloc_pystack(); #endif supervisor_allocation *heap = allocate_remaining_memory(); - start_mp(heap, pystack, pystack_size); + start_mp(heap, pystack); #if CIRCUITPY_USB usb_setup_with_vm(); From 133045a95a74287206e62bb20900b8be699991b4 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Wed, 15 Feb 2023 23:15:21 +0200 Subject: [PATCH 11/57] Add error message and guardrail --- locale/circuitpython.pot | 14 ++++++++++++++ main.c | 7 +++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 72ee60cc0c..299c1d5985 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -35,6 +35,20 @@ msgid "" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" +#: main.c +msgid "" +"\n" +"WARNING: Allocating pystack failed, defaulting back to build value. \n" +"\n" +msgstr "" + +#: main.c +msgid "" +"\n" +"WARNING: Invalid CIRCUITPY_PYSTACK_SIZE, defaulting back to build value.\n" +"\n" +msgstr "" + #: py/obj.c msgid " File \"%q\"" msgstr "" diff --git a/main.c b/main.c index 599c80eb45..64251e88a7 100644 --- a/main.c +++ b/main.c @@ -141,12 +141,15 @@ STATIC supervisor_allocation __attribute__ ((noinline)) * alloc_pystack(void) { (void)common_hal_os_getenv_int("CIRCUITPY_PYSTACK_SIZE", &pystack_size); // Check if value is valid if ((CIRCUITPY_PYSTACK_SIZE != pystack_size) && ((pystack_size < 384) || (pystack_size % sizeof(size_t) != 0))) { + serial_write_compressed(translate("\nWARNING: Invalid CIRCUITPY_PYSTACK_SIZE, defaulting back to build value.\n\n")); pystack_size = CIRCUITPY_PYSTACK_SIZE; // Reset - // TODO: Find a way to inform the user about it. - // Perhaps safemode? Or is it too much? } #endif supervisor_allocation *pystack = allocate_memory(pystack_size, false, false); + if (pystack == NULL) { + serial_write_compressed(translate("\nWARNING: Allocating pystack failed, defaulting back to build value. \n\n")); + pystack = allocate_memory(CIRCUITPY_PYSTACK_SIZE, false, false); + } return pystack; } #endif From 8216aa48909b256417177173289f856971be3032 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Thu, 16 Feb 2023 00:41:49 +0200 Subject: [PATCH 12/57] struct stacks --- main.c | 63 ++++++++++++++++++++++++++++++---------------------------- 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/main.c b/main.c index 64251e88a7..1a85c01199 100644 --- a/main.c +++ b/main.c @@ -126,6 +126,13 @@ uint8_t value_out = 0; #include "shared-module/os/__init__.h" #endif +typedef struct { + #if MICROPY_ENABLE_PYSTACK + supervisor_allocation *pystack; + #endif + supervisor_allocation *heap; +} stacks; + static void reset_devices(void) { #if CIRCUITPY_BLEIO_HCI bleio_reset(); @@ -133,28 +140,33 @@ static void reset_devices(void) { } #if MICROPY_ENABLE_PYSTACK -STATIC supervisor_allocation __attribute__ ((noinline)) * alloc_pystack(void) { +STATIC stacks __attribute__ ((noinline)) alloc_stacks(void) { + stacks res; + #if MICROPY_ENABLE_PYSTACK mp_int_t pystack_size = CIRCUITPY_PYSTACK_SIZE; #if CIRCUITPY_OS_GETENV // Fetch value if exists from settings.toml // Leaves size to build default on any failure (void)common_hal_os_getenv_int("CIRCUITPY_PYSTACK_SIZE", &pystack_size); // Check if value is valid - if ((CIRCUITPY_PYSTACK_SIZE != pystack_size) && ((pystack_size < 384) || (pystack_size % sizeof(size_t) != 0))) { + pystack_size = pystack_size - pystack_size % sizeof(size_t); // Round down to multiple of 4. + if ((CIRCUITPY_PYSTACK_SIZE != pystack_size) && (pystack_size < 384)) { serial_write_compressed(translate("\nWARNING: Invalid CIRCUITPY_PYSTACK_SIZE, defaulting back to build value.\n\n")); pystack_size = CIRCUITPY_PYSTACK_SIZE; // Reset } #endif - supervisor_allocation *pystack = allocate_memory(pystack_size, false, false); - if (pystack == NULL) { + res.pystack = allocate_memory(pystack_size, false, false); + if (res.pystack == NULL) { serial_write_compressed(translate("\nWARNING: Allocating pystack failed, defaulting back to build value. \n\n")); - pystack = allocate_memory(CIRCUITPY_PYSTACK_SIZE, false, false); + res.pystack = allocate_memory(CIRCUITPY_PYSTACK_SIZE, false, false); } - return pystack; + #endif + res.heap = allocate_remaining_memory(); + return res; } #endif -STATIC void start_mp(supervisor_allocation *heap, supervisor_allocation *pystack) { +STATIC void start_mp(stacks combo) { supervisor_workflow_reset(); // Stack limit should be less than real stack size, so we have a chance @@ -182,11 +194,11 @@ STATIC void start_mp(supervisor_allocation *heap, supervisor_allocation *pystack readline_init0(); #if MICROPY_ENABLE_PYSTACK - mp_pystack_init(pystack->ptr, pystack->ptr + (get_allocation_length(pystack) / sizeof(size_t))); + mp_pystack_init(combo.pystack->ptr, combo.pystack->ptr + get_allocation_length(combo.pystack) / sizeof(size_t)); #endif #if MICROPY_ENABLE_GC - gc_init(heap->ptr, heap->ptr + get_allocation_length(heap) / 4); + gc_init(combo.heap->ptr, combo.heap->ptr + get_allocation_length(combo.heap) / 4); #endif mp_init(); mp_obj_list_init((mp_obj_list_t *)mp_sys_path, 0); @@ -286,7 +298,7 @@ STATIC void count_strn(void *data, const char *str, size_t len) { *(size_t *)data += len; } -STATIC void cleanup_after_vm(supervisor_allocation *heap, supervisor_allocation *pystack, mp_obj_t exception) { +STATIC void cleanup_after_vm(stacks combo, mp_obj_t exception) { // Get the traceback of any exception from this run off the heap. // MP_OBJ_SENTINEL means "this run does not contribute to traceback storage, don't touch it" // MP_OBJ_NULL (=0) means "this run completed successfully, clear any stored traceback" @@ -366,8 +378,8 @@ STATIC void cleanup_after_vm(supervisor_allocation *heap, supervisor_allocation // Free the heap last because other modules may reference heap memory and need to shut down. filesystem_flush(); stop_mp(); - free_memory(heap); - free_memory(pystack); + free_memory(combo.heap); + free_memory(combo.pystack); supervisor_move_memory(); // Let the workflows know we've reset in case they want to restart. @@ -422,11 +434,8 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) { }; #endif - #if MICROPY_ENABLE_PYSTACK - supervisor_allocation *pystack = alloc_pystack(); - #endif - supervisor_allocation *heap = allocate_remaining_memory(); - start_mp(heap, pystack); + stacks combo = alloc_stacks(); + start_mp(combo); #if CIRCUITPY_USB usb_setup_with_vm(); @@ -474,7 +483,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) { // Finished executing python code. Cleanup includes filesystem flush and a board reset. - cleanup_after_vm(heap, pystack, _exec_result.exception); + cleanup_after_vm(combo, _exec_result.exception); _exec_result.exception = NULL; // If a new next code file was set, that is a reason to keep it (obviously). Stuff this into @@ -770,11 +779,8 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { // Do USB setup even if boot.py is not run. - #if MICROPY_ENABLE_PYSTACK - supervisor_allocation *pystack = alloc_pystack(); - #endif - supervisor_allocation *heap = allocate_remaining_memory(); - start_mp(heap, pystack); + stacks combo = alloc_stacks(); + start_mp(combo); #if CIRCUITPY_USB // Set up default USB values after boot.py VM starts but before running boot.py. @@ -860,7 +866,7 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { port_post_boot_py(true); - cleanup_after_vm(heap, pystack, _exec_result.exception); + cleanup_after_vm(combo, _exec_result.exception); _exec_result.exception = NULL; port_post_boot_py(false); @@ -875,11 +881,8 @@ STATIC int run_repl(void) { int exit_code = PYEXEC_FORCED_EXIT; stack_resize(); filesystem_flush(); - #if MICROPY_ENABLE_PYSTACK - supervisor_allocation *pystack = alloc_pystack(); - #endif - supervisor_allocation *heap = allocate_remaining_memory(); - start_mp(heap, pystack); + stacks combo = alloc_stacks(); + start_mp(combo); #if CIRCUITPY_USB usb_setup_with_vm(); @@ -922,7 +925,7 @@ STATIC int run_repl(void) { exit_code = PYEXEC_DEEP_SLEEP; } #endif - cleanup_after_vm(heap, pystack, MP_OBJ_SENTINEL); + cleanup_after_vm(combo, MP_OBJ_SENTINEL); // Also reset bleio. The above call omits it in case workflows should continue. In this case, // we're switching straight to another VM so we want to reset. From 659adb717235cd841738da03d0e9cdf83a93252a Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Thu, 16 Feb 2023 00:45:41 +0200 Subject: [PATCH 13/57] fix for stackless --- main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.c b/main.c index 1a85c01199..74f61d846d 100644 --- a/main.c +++ b/main.c @@ -379,7 +379,9 @@ STATIC void cleanup_after_vm(stacks combo, mp_obj_t exception) { filesystem_flush(); stop_mp(); free_memory(combo.heap); + #if MICROPY_ENABLE_PYSTACK free_memory(combo.pystack); + #endif supervisor_move_memory(); // Let the workflows know we've reset in case they want to restart. From 8061e8e7c647b9a509bd4812f91e88de8ec6d9da Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Thu, 16 Feb 2023 11:05:29 +0200 Subject: [PATCH 14/57] Names changed to better fit mp style --- main.c | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/main.c b/main.c index 06ddc0aa6d..dc5e015da7 100644 --- a/main.c +++ b/main.c @@ -131,7 +131,7 @@ typedef struct { supervisor_allocation *pystack; #endif supervisor_allocation *heap; -} stacks; +} vm_memory_t; static void reset_devices(void) { #if CIRCUITPY_BLEIO_HCI @@ -139,9 +139,8 @@ static void reset_devices(void) { #endif } -#if MICROPY_ENABLE_PYSTACK -STATIC stacks __attribute__ ((noinline)) alloc_stacks(void) { - stacks res; +STATIC vm_memory_t allocate_vm_memory(void) { + vm_memory_t res; #if MICROPY_ENABLE_PYSTACK mp_int_t pystack_size = CIRCUITPY_PYSTACK_SIZE; #if CIRCUITPY_OS_GETENV @@ -164,9 +163,8 @@ STATIC stacks __attribute__ ((noinline)) alloc_stacks(void) { res.heap = allocate_remaining_memory(); return res; } -#endif -STATIC void start_mp(stacks combo) { +STATIC void start_mp(vm_memory_t vm_memory) { supervisor_workflow_reset(); // Stack limit should be less than real stack size, so we have a chance @@ -194,11 +192,11 @@ STATIC void start_mp(stacks combo) { readline_init0(); #if MICROPY_ENABLE_PYSTACK - mp_pystack_init(combo.pystack->ptr, combo.pystack->ptr + get_allocation_length(combo.pystack) / sizeof(size_t)); + mp_pystack_init(vm_memory.pystack->ptr, vm_memory.pystack->ptr + get_allocation_length(vm_memory.pystack) / sizeof(size_t)); #endif #if MICROPY_ENABLE_GC - gc_init(combo.heap->ptr, combo.heap->ptr + get_allocation_length(combo.heap) / 4); + gc_init(vm_memory.heap->ptr, vm_memory.heap->ptr + get_allocation_length(vm_memory.heap) / 4); #endif mp_init(); mp_obj_list_init((mp_obj_list_t *)mp_sys_path, 0); @@ -298,7 +296,7 @@ STATIC void count_strn(void *data, const char *str, size_t len) { *(size_t *)data += len; } -STATIC void cleanup_after_vm(stacks combo, mp_obj_t exception) { +STATIC void cleanup_after_vm(vm_memory_t vm_memory, mp_obj_t exception) { // Get the traceback of any exception from this run off the heap. // MP_OBJ_SENTINEL means "this run does not contribute to traceback storage, don't touch it" // MP_OBJ_NULL (=0) means "this run completed successfully, clear any stored traceback" @@ -378,9 +376,9 @@ STATIC void cleanup_after_vm(stacks combo, mp_obj_t exception) { // Free the heap last because other modules may reference heap memory and need to shut down. filesystem_flush(); stop_mp(); - free_memory(combo.heap); + free_memory(vm_memory.heap); #if MICROPY_ENABLE_PYSTACK - free_memory(combo.pystack); + free_memory(vm_memory.pystack); #endif supervisor_move_memory(); @@ -436,8 +434,8 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) { }; #endif - stacks combo = alloc_stacks(); - start_mp(combo); + vm_memory_t vm_memory = allocate_vm_memory(); + start_mp(vm_memory); #if CIRCUITPY_USB usb_setup_with_vm(); @@ -485,7 +483,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) { // Finished executing python code. Cleanup includes filesystem flush and a board reset. - cleanup_after_vm(combo, _exec_result.exception); + cleanup_after_vm(vm_memory, _exec_result.exception); _exec_result.exception = NULL; // If a new next code file was set, that is a reason to keep it (obviously). Stuff this into @@ -781,8 +779,8 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { // Do USB setup even if boot.py is not run. - stacks combo = alloc_stacks(); - start_mp(combo); + vm_memory_t vm_memory = allocate_vm_memory(); + start_mp(vm_memory); #if CIRCUITPY_USB // Set up default USB values after boot.py VM starts but before running boot.py. @@ -868,7 +866,7 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { port_post_boot_py(true); - cleanup_after_vm(combo, _exec_result.exception); + cleanup_after_vm(vm_memory, _exec_result.exception); _exec_result.exception = NULL; port_post_boot_py(false); @@ -883,8 +881,8 @@ STATIC int run_repl(void) { int exit_code = PYEXEC_FORCED_EXIT; stack_resize(); filesystem_flush(); - stacks combo = alloc_stacks(); - start_mp(combo); + vm_memory_t vm_memory = allocate_vm_memory(); + start_mp(vm_memory); #if CIRCUITPY_USB usb_setup_with_vm(); @@ -927,7 +925,7 @@ STATIC int run_repl(void) { exit_code = PYEXEC_DEEP_SLEEP; } #endif - cleanup_after_vm(combo, MP_OBJ_SENTINEL); + cleanup_after_vm(vm_memory, MP_OBJ_SENTINEL); // Also reset bleio. The above call omits it in case workflows should continue. In this case, // we're switching straight to another VM so we want to reset. From c920dbb81c267f2f56b64a045f49cac3a3422796 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Thu, 16 Feb 2023 11:50:35 +0200 Subject: [PATCH 15/57] Skip unecessary check for space --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index dc5e015da7..82b0a54fd6 100644 --- a/main.c +++ b/main.c @@ -149,7 +149,7 @@ STATIC vm_memory_t allocate_vm_memory(void) { (void)common_hal_os_getenv_int("CIRCUITPY_PYSTACK_SIZE", &pystack_size); // Check if value is valid pystack_size = pystack_size - pystack_size % sizeof(size_t); // Round down to multiple of 4. - if ((CIRCUITPY_PYSTACK_SIZE != pystack_size) && (pystack_size < 384)) { + if (pystack_size < 384) { serial_write_compressed(translate("\nWARNING: Invalid CIRCUITPY_PYSTACK_SIZE, defaulting back to build value.\n\n")); pystack_size = CIRCUITPY_PYSTACK_SIZE; // Reset } From f6e7edc9000acf6462c119a07c5ffffd274c0dee Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Thu, 16 Feb 2023 12:34:48 +0200 Subject: [PATCH 16/57] Size reductions --- locale/circuitpython.pot | 24 +++++++++++++++--------- main.c | 8 ++++++-- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index f44f69dfde..8e9a929db9 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -38,15 +38,7 @@ msgstr "" #: main.c msgid "" "\n" -"WARNING: Allocating pystack failed, defaulting back to build value. \n" -"\n" -msgstr "" - -#: main.c -msgid "" -"\n" -"WARNING: Invalid CIRCUITPY_PYSTACK_SIZE, defaulting back to build value.\n" -"\n" +"WARNING: " msgstr "" #: py/obj.c @@ -390,6 +382,12 @@ msgstr "" msgid "*x must be assignment target" msgstr "" +#: main.c +msgid "" +", defaulting back to build value.\n" +"\n" +msgstr "" + #: py/obj.c msgid ", in %q\n" msgstr "" @@ -496,6 +494,10 @@ msgstr "" msgid "All timers in use" msgstr "" +#: main.c +msgid "Allocating pystack failed" +msgstr "" + #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Already advertising." @@ -1244,6 +1246,10 @@ msgstr "" msgid "Invalid BSSID" msgstr "" +#: main.c +msgid "Invalid CIRCUITPY_PYSTACK_SIZE" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "" diff --git a/main.c b/main.c index 82b0a54fd6..ad91b50434 100644 --- a/main.c +++ b/main.c @@ -150,13 +150,17 @@ STATIC vm_memory_t allocate_vm_memory(void) { // Check if value is valid pystack_size = pystack_size - pystack_size % sizeof(size_t); // Round down to multiple of 4. if (pystack_size < 384) { - serial_write_compressed(translate("\nWARNING: Invalid CIRCUITPY_PYSTACK_SIZE, defaulting back to build value.\n\n")); + serial_write_compressed(translate("\nWARNING: ")); + serial_write_compressed(translate("Invalid CIRCUITPY_PYSTACK_SIZE")); + serial_write_compressed(translate(", defaulting back to build value.\n\n")); pystack_size = CIRCUITPY_PYSTACK_SIZE; // Reset } #endif res.pystack = allocate_memory(pystack_size, false, false); if (res.pystack == NULL) { - serial_write_compressed(translate("\nWARNING: Allocating pystack failed, defaulting back to build value. \n\n")); + serial_write_compressed(translate("\nWARNING: ")); + serial_write_compressed(translate("Allocating pystack failed")); + serial_write_compressed(translate(", defaulting back to build value.\n\n")); res.pystack = allocate_memory(CIRCUITPY_PYSTACK_SIZE, false, false); } #endif From a61a9f4bde75ad981aca73191837f5b476bab757 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Thu, 16 Feb 2023 13:12:21 +0200 Subject: [PATCH 17/57] Size reductions (attempts, at the very least) --- locale/circuitpython.pot | 12 +++++------- main.c | 9 ++++++--- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 8e9a929db9..ab9df4aa37 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -35,12 +35,6 @@ msgid "" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" -#: main.c -msgid "" -"\n" -"WARNING: " -msgstr "" - #: py/obj.c msgid " File \"%q\"" msgstr "" @@ -2369,7 +2363,7 @@ msgid "Voltage read timed out" msgstr "" #: main.c -msgid "WARNING: Your code filename has two extensions\n" +msgid "WARNING: " msgstr "" #: ports/atmel-samd/common-hal/watchdog/WatchDogTimer.c @@ -2430,6 +2424,10 @@ msgid "" "You pressed the reset button during boot. Press again to exit safe mode." msgstr "" +#: main.c +msgid "Your code filename has two extensions\n" +msgstr "" + #: supervisor/shared/micropython.c msgid "[truncated due to length]" msgstr "" diff --git a/main.c b/main.c index ad91b50434..d94f1501e3 100644 --- a/main.c +++ b/main.c @@ -150,7 +150,8 @@ STATIC vm_memory_t allocate_vm_memory(void) { // Check if value is valid pystack_size = pystack_size - pystack_size % sizeof(size_t); // Round down to multiple of 4. if (pystack_size < 384) { - serial_write_compressed(translate("\nWARNING: ")); + serial_write("\n"); + serial_write_compressed(translate("WARNING: ")); serial_write_compressed(translate("Invalid CIRCUITPY_PYSTACK_SIZE")); serial_write_compressed(translate(", defaulting back to build value.\n\n")); pystack_size = CIRCUITPY_PYSTACK_SIZE; // Reset @@ -158,7 +159,8 @@ STATIC vm_memory_t allocate_vm_memory(void) { #endif res.pystack = allocate_memory(pystack_size, false, false); if (res.pystack == NULL) { - serial_write_compressed(translate("\nWARNING: ")); + serial_write("\n"); + serial_write_compressed(translate("WARNING: ")); serial_write_compressed(translate("Allocating pystack failed")); serial_write_compressed(translate(", defaulting back to build value.\n\n")); res.pystack = allocate_memory(CIRCUITPY_PYSTACK_SIZE, false, false); @@ -469,7 +471,8 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) { if (!found_main) { found_main = maybe_run_list(double_extension_filenames, MP_ARRAY_SIZE(double_extension_filenames)); if (found_main) { - serial_write_compressed(translate("WARNING: Your code filename has two extensions\n")); + serial_write_compressed(translate("WARNING: ")); + serial_write_compressed(translate("Your code filename has two extensions\n")); } } #else From 6dc179dc4a3ec54a26f0c50bca0af2ded9cfc640 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Thu, 16 Feb 2023 13:33:37 +0200 Subject: [PATCH 18/57] Removed old supervisor stack setting code and revert some 'optimisations' --- locale/circuitpython.pot | 34 ++++++++++++---------------- main.c | 13 +++-------- shared-bindings/supervisor/Runtime.c | 21 ----------------- 3 files changed, 18 insertions(+), 50 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index ab9df4aa37..a5906ca6e7 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -35,6 +35,20 @@ msgid "" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" +#: main.c +msgid "" +"\n" +"WARNING: Allocating pystack failed, defaulting back to build value.\n" +"\n" +msgstr "" + +#: main.c +msgid "" +"\n" +"WARNING: Invalid CIRCUITPY_PYSTACK_SIZE, defaulting back to build value.\n" +"\n" +msgstr "" + #: py/obj.c msgid " File \"%q\"" msgstr "" @@ -376,12 +390,6 @@ msgstr "" msgid "*x must be assignment target" msgstr "" -#: main.c -msgid "" -", defaulting back to build value.\n" -"\n" -msgstr "" - #: py/obj.c msgid ", in %q\n" msgstr "" @@ -488,10 +496,6 @@ msgstr "" msgid "All timers in use" msgstr "" -#: main.c -msgid "Allocating pystack failed" -msgstr "" - #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Already advertising." @@ -1240,10 +1244,6 @@ msgstr "" msgid "Invalid BSSID" msgstr "" -#: main.c -msgid "Invalid CIRCUITPY_PYSTACK_SIZE" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "" @@ -2363,7 +2363,7 @@ msgid "Voltage read timed out" msgstr "" #: main.c -msgid "WARNING: " +msgid "WARNING: Your code filename has two extensions\n" msgstr "" #: ports/atmel-samd/common-hal/watchdog/WatchDogTimer.c @@ -2424,10 +2424,6 @@ msgid "" "You pressed the reset button during boot. Press again to exit safe mode." msgstr "" -#: main.c -msgid "Your code filename has two extensions\n" -msgstr "" - #: supervisor/shared/micropython.c msgid "[truncated due to length]" msgstr "" diff --git a/main.c b/main.c index d94f1501e3..09f507867f 100644 --- a/main.c +++ b/main.c @@ -150,19 +150,13 @@ STATIC vm_memory_t allocate_vm_memory(void) { // Check if value is valid pystack_size = pystack_size - pystack_size % sizeof(size_t); // Round down to multiple of 4. if (pystack_size < 384) { - serial_write("\n"); - serial_write_compressed(translate("WARNING: ")); - serial_write_compressed(translate("Invalid CIRCUITPY_PYSTACK_SIZE")); - serial_write_compressed(translate(", defaulting back to build value.\n\n")); + serial_write_compressed(translate("\nWARNING: Invalid CIRCUITPY_PYSTACK_SIZE, defaulting back to build value.\n\n")); pystack_size = CIRCUITPY_PYSTACK_SIZE; // Reset } #endif res.pystack = allocate_memory(pystack_size, false, false); if (res.pystack == NULL) { - serial_write("\n"); - serial_write_compressed(translate("WARNING: ")); - serial_write_compressed(translate("Allocating pystack failed")); - serial_write_compressed(translate(", defaulting back to build value.\n\n")); + serial_write_compressed(translate("\nWARNING: Allocating pystack failed, defaulting back to build value.\n\n")); res.pystack = allocate_memory(CIRCUITPY_PYSTACK_SIZE, false, false); } #endif @@ -471,8 +465,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) { if (!found_main) { found_main = maybe_run_list(double_extension_filenames, MP_ARRAY_SIZE(double_extension_filenames)); if (found_main) { - serial_write_compressed(translate("WARNING: ")); - serial_write_compressed(translate("Your code filename has two extensions\n")); + serial_write_compressed(translate("WARNING: Your code filename has two extensions\n")); } } #else diff --git a/shared-bindings/supervisor/Runtime.c b/shared-bindings/supervisor/Runtime.c index 4d8ddbacc7..d250ae89c0 100644 --- a/shared-bindings/supervisor/Runtime.c +++ b/shared-bindings/supervisor/Runtime.c @@ -168,26 +168,6 @@ MP_PROPERTY_GETSET(supervisor_runtime_ble_workflow_obj, (mp_obj_t)&supervisor_runtime_get_ble_workflow_obj, (mp_obj_t)&supervisor_runtime_set_ble_workflow_obj); -//| next_stack_limit: int -//| """The size of the stack for the next vm run. If its too large, the default will be used.""" -//| -STATIC mp_obj_t supervisor_runtime_get_next_stack_limit(mp_obj_t self) { - return mp_obj_new_int(get_next_stack_size()); -} -MP_DEFINE_CONST_FUN_OBJ_1(supervisor_runtime_get_next_stack_limit_obj, supervisor_runtime_get_next_stack_limit); - -STATIC mp_obj_t supervisor_runtime_set_next_stack_limit(mp_obj_t self, mp_obj_t size_obj) { - mp_int_t size = mp_obj_get_int(size_obj); - mp_arg_validate_int_min(size, 256, MP_QSTR_size); - set_next_stack_size(size); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_2(supervisor_runtime_set_next_stack_limit_obj, supervisor_runtime_set_next_stack_limit); - -MP_PROPERTY_GETSET(supervisor_runtime_next_stack_limit_obj, - (mp_obj_t)&supervisor_runtime_get_next_stack_limit_obj, - (mp_obj_t)&supervisor_runtime_set_next_stack_limit_obj); - //| rgb_status_brightness: int //| """Set brightness of status RGB LED from 0-255. This will take effect //| after the current code finishes and the status LED is used to show @@ -220,7 +200,6 @@ STATIC const mp_rom_map_elem_t supervisor_runtime_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_run_reason), MP_ROM_PTR(&supervisor_runtime_run_reason_obj) }, { MP_ROM_QSTR(MP_QSTR_autoreload), MP_ROM_PTR(&supervisor_runtime_autoreload_obj) }, { MP_ROM_QSTR(MP_QSTR_ble_workflow), MP_ROM_PTR(&supervisor_runtime_ble_workflow_obj) }, - { MP_ROM_QSTR(MP_QSTR_next_stack_limit), MP_ROM_PTR(&supervisor_runtime_next_stack_limit_obj) }, { MP_ROM_QSTR(MP_QSTR_rgb_status_brightness), MP_ROM_PTR(&supervisor_runtime_rgb_status_brightness_obj) }, }; From 54ae7ced827089694f1a94ac551daf425b39b77c Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Thu, 16 Feb 2023 23:10:11 +0200 Subject: [PATCH 19/57] Updated to requested changes --- locale/circuitpython.pot | 22 +++++------- main.c | 77 ++++++++++++++++++++++------------------ 2 files changed, 51 insertions(+), 48 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index a5906ca6e7..79899735de 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -28,6 +28,14 @@ msgid "" "Code stopped by auto-reload. Reloading soon.\n" msgstr "" +#: main.c +msgid "" +"\n" +"Invalid CIRCUITPY_PYSTACK_SIZE\n" +"\n" +"\r" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "\n" @@ -35,20 +43,6 @@ msgid "" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" -#: main.c -msgid "" -"\n" -"WARNING: Allocating pystack failed, defaulting back to build value.\n" -"\n" -msgstr "" - -#: main.c -msgid "" -"\n" -"WARNING: Invalid CIRCUITPY_PYSTACK_SIZE, defaulting back to build value.\n" -"\n" -msgstr "" - #: py/obj.c msgid " File \"%q\"" msgstr "" diff --git a/main.c b/main.c index 09f507867f..1d67424e28 100644 --- a/main.c +++ b/main.c @@ -126,45 +126,36 @@ uint8_t value_out = 0; #include "shared-module/os/__init__.h" #endif -typedef struct { - #if MICROPY_ENABLE_PYSTACK - supervisor_allocation *pystack; - #endif - supervisor_allocation *heap; -} vm_memory_t; - static void reset_devices(void) { #if CIRCUITPY_BLEIO_HCI bleio_reset(); #endif } -STATIC vm_memory_t allocate_vm_memory(void) { - vm_memory_t res; - #if MICROPY_ENABLE_PYSTACK +#if MICROPY_ENABLE_PYSTACK +STATIC supervisor_allocation *allocate_pystack(void) { mp_int_t pystack_size = CIRCUITPY_PYSTACK_SIZE; - #if CIRCUITPY_OS_GETENV + #if CIRCUITPY_OS_GETENV && CIRCUITPY_SETTABLE_PYSTACK // Fetch value if exists from settings.toml // Leaves size to build default on any failure (void)common_hal_os_getenv_int("CIRCUITPY_PYSTACK_SIZE", &pystack_size); // Check if value is valid pystack_size = pystack_size - pystack_size % sizeof(size_t); // Round down to multiple of 4. if (pystack_size < 384) { - serial_write_compressed(translate("\nWARNING: Invalid CIRCUITPY_PYSTACK_SIZE, defaulting back to build value.\n\n")); + serial_write_compressed(translate("\nInvalid CIRCUITPY_PYSTACK_SIZE\n\n\r")); pystack_size = CIRCUITPY_PYSTACK_SIZE; // Reset } #endif - res.pystack = allocate_memory(pystack_size, false, false); - if (res.pystack == NULL) { - serial_write_compressed(translate("\nWARNING: Allocating pystack failed, defaulting back to build value.\n\n")); - res.pystack = allocate_memory(CIRCUITPY_PYSTACK_SIZE, false, false); + supervisor_allocation *pystack = allocate_memory(pystack_size, false, false); + if (pystack == NULL) { + serial_write_compressed(translate("\nInvalid CIRCUITPY_PYSTACK_SIZE\n\n\r")); + pystack = allocate_memory(CIRCUITPY_PYSTACK_SIZE, false, false); } - #endif - res.heap = allocate_remaining_memory(); - return res; + return pystack; } +#endif -STATIC void start_mp(vm_memory_t vm_memory) { +STATIC void start_mp(supervisor_allocation *heap, supervisor_allocation *pystack) { supervisor_workflow_reset(); // Stack limit should be less than real stack size, so we have a chance @@ -192,11 +183,11 @@ STATIC void start_mp(vm_memory_t vm_memory) { readline_init0(); #if MICROPY_ENABLE_PYSTACK - mp_pystack_init(vm_memory.pystack->ptr, vm_memory.pystack->ptr + get_allocation_length(vm_memory.pystack) / sizeof(size_t)); + mp_pystack_init(pystack->ptr, pystack->ptr + get_allocation_length(pystack) / sizeof(size_t)); #endif #if MICROPY_ENABLE_GC - gc_init(vm_memory.heap->ptr, vm_memory.heap->ptr + get_allocation_length(vm_memory.heap) / 4); + gc_init(heap->ptr, heap->ptr + get_allocation_length(heap) / 4); #endif mp_init(); mp_obj_list_init((mp_obj_list_t *)mp_sys_path, 0); @@ -296,7 +287,7 @@ STATIC void count_strn(void *data, const char *str, size_t len) { *(size_t *)data += len; } -STATIC void cleanup_after_vm(vm_memory_t vm_memory, mp_obj_t exception) { +STATIC void cleanup_after_vm(supervisor_allocation *heap, supervisor_allocation *pystack, mp_obj_t exception) { // Get the traceback of any exception from this run off the heap. // MP_OBJ_SENTINEL means "this run does not contribute to traceback storage, don't touch it" // MP_OBJ_NULL (=0) means "this run completed successfully, clear any stored traceback" @@ -376,9 +367,9 @@ STATIC void cleanup_after_vm(vm_memory_t vm_memory, mp_obj_t exception) { // Free the heap last because other modules may reference heap memory and need to shut down. filesystem_flush(); stop_mp(); - free_memory(vm_memory.heap); + free_memory(heap); #if MICROPY_ENABLE_PYSTACK - free_memory(vm_memory.pystack); + free_memory(pystack); #endif supervisor_move_memory(); @@ -434,8 +425,14 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) { }; #endif - vm_memory_t vm_memory = allocate_vm_memory(); - start_mp(vm_memory); + supervisor_allocation *pystack; + #if MICROPY_ENABLE_PYSTACK + pystack = allocate_pystack(); + #else + pystack = NULL; + #endif + supervisor_allocation *heap = allocate_remaining_memory(); + start_mp(heap, pystack); #if CIRCUITPY_USB usb_setup_with_vm(); @@ -483,7 +480,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) { // Finished executing python code. Cleanup includes filesystem flush and a board reset. - cleanup_after_vm(vm_memory, _exec_result.exception); + cleanup_after_vm(heap, pystack, _exec_result.exception); _exec_result.exception = NULL; // If a new next code file was set, that is a reason to keep it (obviously). Stuff this into @@ -779,8 +776,14 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { // Do USB setup even if boot.py is not run. - vm_memory_t vm_memory = allocate_vm_memory(); - start_mp(vm_memory); + supervisor_allocation *pystack; + #if MICROPY_ENABLE_PYSTACK + pystack = allocate_pystack(); + #else + pystack = NULL; + #endif + supervisor_allocation *heap = allocate_remaining_memory(); + start_mp(heap, pystack); #if CIRCUITPY_USB // Set up default USB values after boot.py VM starts but before running boot.py. @@ -866,7 +869,7 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { port_post_boot_py(true); - cleanup_after_vm(vm_memory, _exec_result.exception); + cleanup_after_vm(heap, pystack, _exec_result.exception); _exec_result.exception = NULL; port_post_boot_py(false); @@ -881,8 +884,14 @@ STATIC int run_repl(void) { int exit_code = PYEXEC_FORCED_EXIT; stack_resize(); filesystem_flush(); - vm_memory_t vm_memory = allocate_vm_memory(); - start_mp(vm_memory); + supervisor_allocation *pystack; + #if MICROPY_ENABLE_PYSTACK + pystack = allocate_pystack(); + #else + pystack = NULL; + #endif + supervisor_allocation *heap = allocate_remaining_memory(); + start_mp(heap, pystack); #if CIRCUITPY_USB usb_setup_with_vm(); @@ -925,7 +934,7 @@ STATIC int run_repl(void) { exit_code = PYEXEC_DEEP_SLEEP; } #endif - cleanup_after_vm(vm_memory, MP_OBJ_SENTINEL); + cleanup_after_vm(heap, pystack, MP_OBJ_SENTINEL); // Also reset bleio. The above call omits it in case workflows should continue. In this case, // we're switching straight to another VM so we want to reset. From a37dad61fb3d72e5ab2ad993baac2494d4438c12 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Thu, 16 Feb 2023 23:10:30 +0200 Subject: [PATCH 20/57] CIRCUITPY_SETTABLE_PYSTACK --- py/circuitpy_mpconfig.h | 1 + 1 file changed, 1 insertion(+) diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 8bfb69297a..95a95fa12f 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -145,6 +145,7 @@ extern void common_hal_mcu_enable_interrupts(void); #define MICROPY_REPL_AUTO_INDENT (1) #define MICROPY_REPL_EVENT_DRIVEN (0) #define MICROPY_ENABLE_PYSTACK (1) +#define CIRCUITPY_SETTABLE_PYSTACK (1) #define MICROPY_STACK_CHECK (1) #define MICROPY_STREAMS_NON_BLOCK (1) #ifndef MICROPY_USE_INTERNAL_PRINTF From 4bb0b0acdfc7f2a67d8312c11fe19c253c6d9297 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Thu, 16 Feb 2023 23:37:37 +0200 Subject: [PATCH 21/57] volatile to skip optimisation --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 1d67424e28..4a1201f56c 100644 --- a/main.c +++ b/main.c @@ -776,7 +776,7 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { // Do USB setup even if boot.py is not run. - supervisor_allocation *pystack; + volatile supervisor_allocation *pystack; #if MICROPY_ENABLE_PYSTACK pystack = allocate_pystack(); #else From c003b8817a8243968b166e8a6c7fca05fa8f81cb Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Thu, 16 Feb 2023 23:40:49 +0200 Subject: [PATCH 22/57] Put on all and preinit with NULL --- main.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/main.c b/main.c index 4a1201f56c..2f3f9bc969 100644 --- a/main.c +++ b/main.c @@ -425,11 +425,9 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) { }; #endif - supervisor_allocation *pystack; + volatile supervisor_allocation *pystack = NULL; #if MICROPY_ENABLE_PYSTACK pystack = allocate_pystack(); - #else - pystack = NULL; #endif supervisor_allocation *heap = allocate_remaining_memory(); start_mp(heap, pystack); @@ -776,11 +774,9 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { // Do USB setup even if boot.py is not run. - volatile supervisor_allocation *pystack; + volatile supervisor_allocation *pystack = NULL; #if MICROPY_ENABLE_PYSTACK pystack = allocate_pystack(); - #else - pystack = NULL; #endif supervisor_allocation *heap = allocate_remaining_memory(); start_mp(heap, pystack); @@ -884,11 +880,9 @@ STATIC int run_repl(void) { int exit_code = PYEXEC_FORCED_EXIT; stack_resize(); filesystem_flush(); - supervisor_allocation *pystack; + volatile supervisor_allocation *pystack = NULL; #if MICROPY_ENABLE_PYSTACK pystack = allocate_pystack(); - #else - pystack = NULL; #endif supervisor_allocation *heap = allocate_remaining_memory(); start_mp(heap, pystack); From 66215f7983b05ebe7e9018495e02100af8908a55 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Thu, 16 Feb 2023 23:57:47 +0200 Subject: [PATCH 23/57] gcc is evil, I respond with fake pointer --- main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index 2f3f9bc969..1a622a9858 100644 --- a/main.c +++ b/main.c @@ -425,7 +425,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) { }; #endif - volatile supervisor_allocation *pystack = NULL; + supervisor_allocation *pystack = (supervisor_allocation *)1; #if MICROPY_ENABLE_PYSTACK pystack = allocate_pystack(); #endif @@ -774,7 +774,7 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { // Do USB setup even if boot.py is not run. - volatile supervisor_allocation *pystack = NULL; + supervisor_allocation *pystack = (supervisor_allocation *)1; #if MICROPY_ENABLE_PYSTACK pystack = allocate_pystack(); #endif @@ -880,7 +880,7 @@ STATIC int run_repl(void) { int exit_code = PYEXEC_FORCED_EXIT; stack_resize(); filesystem_flush(); - volatile supervisor_allocation *pystack = NULL; + supervisor_allocation *pystack = (supervisor_allocation *)1; #if MICROPY_ENABLE_PYSTACK pystack = allocate_pystack(); #endif From 8abce77971c47297526437bec5260ba7e005beb7 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Fri, 17 Feb 2023 00:52:13 +0200 Subject: [PATCH 24/57] fix safemode --- main.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/main.c b/main.c index aa58dcf45f..19ef60f2e1 100644 --- a/main.c +++ b/main.c @@ -425,7 +425,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) { }; #endif - supervisor_allocation *pystack = (supervisor_allocation *)1; + supervisor_allocation *pystack = NULL; #if MICROPY_ENABLE_PYSTACK pystack = allocate_pystack(); #endif @@ -767,8 +767,12 @@ STATIC void __attribute__ ((noinline)) run_safemode_py(safe_mode_t safe_mode) { return; } + supervisor_allocation *pystack = NULL; + #if MICROPY_ENABLE_PYSTACK + pystack = allocate_pystack(); + #endif supervisor_allocation *heap = allocate_remaining_memory(); - start_mp(heap); + start_mp(heap, pystack); static const char *const safemode_py_filenames[] = {"safemode.py", "safemode.txt"}; maybe_run_list(safemode_py_filenames, MP_ARRAY_SIZE(safemode_py_filenames)); @@ -779,7 +783,7 @@ STATIC void __attribute__ ((noinline)) run_safemode_py(safe_mode_t safe_mode) { set_safe_mode(SAFE_MODE_SAFEMODE_PY_ERROR); } - cleanup_after_vm(heap, _exec_result.exception); + cleanup_after_vm(heap, pystack, _exec_result.exception); _exec_result.exception = NULL; } #endif @@ -800,7 +804,7 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { // Do USB setup even if boot.py is not run. - supervisor_allocation *pystack = (supervisor_allocation *)1; + supervisor_allocation *pystack = NULL; #if MICROPY_ENABLE_PYSTACK pystack = allocate_pystack(); #endif @@ -906,7 +910,7 @@ STATIC int run_repl(void) { int exit_code = PYEXEC_FORCED_EXIT; stack_resize(); filesystem_flush(); - supervisor_allocation *pystack = (supervisor_allocation *)1; + supervisor_allocation *pystack = NULL; #if MICROPY_ENABLE_PYSTACK pystack = allocate_pystack(); #endif From f05c730a01b55b779547e80bea79ac0d54a1cfec Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Fri, 17 Feb 2023 15:14:09 +0200 Subject: [PATCH 25/57] settable pystack = 0 for kicksat-sprite --- ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h index eb7f1c62e3..7bcff4ad73 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h @@ -21,3 +21,8 @@ #define IGNORE_PIN_PA25 1 #define MICROPY_FATFS_EXFAT 0 + +#ifdef CIRCUITPY_SETTABLE_PYSTACK +#undef CIRCUITPY_SETTABLE_PYSTACK +#endif +#define CIRCUITPY_SETTABLE_PYSTACK (0) From 17e2598fa1b9f9bec2b1cd6df566f44e9e40145c Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Fri, 17 Feb 2023 15:23:01 +0200 Subject: [PATCH 26/57] Revert "settable pystack = 0 for kicksat-sprite" This reverts commit f05c730a01b55b779547e80bea79ac0d54a1cfec. --- ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h index 7bcff4ad73..eb7f1c62e3 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h @@ -21,8 +21,3 @@ #define IGNORE_PIN_PA25 1 #define MICROPY_FATFS_EXFAT 0 - -#ifdef CIRCUITPY_SETTABLE_PYSTACK -#undef CIRCUITPY_SETTABLE_PYSTACK -#endif -#define CIRCUITPY_SETTABLE_PYSTACK (0) From 388279d9c15332f247ce92eeda0c303bb503f529 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Fri, 17 Feb 2023 15:24:27 +0200 Subject: [PATCH 27/57] Disable rainbowio instead. --- ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk index 9bc50ab429..51b4371675 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk @@ -25,6 +25,7 @@ CIRCUITPY_KEYPAD = 0 CIRCUITPY_MSGPACK = 0 CIRCUITPY_PS2IO = 0 CIRCUITPY_RGBMATRIX = 0 +CIRCUITPY_RAINBOWIO = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_USB_HID = 0 From 8a4a408707256a563764afd050be992594178b99 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Fri, 17 Feb 2023 16:35:16 +0200 Subject: [PATCH 28/57] Disable settable-pystack too to make more space --- ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h index eb7f1c62e3..bdc3fc5890 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h @@ -21,3 +21,8 @@ #define IGNORE_PIN_PA25 1 #define MICROPY_FATFS_EXFAT 0 + +#ifdef CIRCUITPY_SETTABLE_PYSTACK +#undef CIRCUITPY_SETTABLE_PYSTACK +#endif +#define CIRCUITPY_SETTABLE_PYSTACK 0 From d7e6a78ef447d592feb37486a644de8fce1089b2 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Fri, 17 Feb 2023 17:40:55 +0200 Subject: [PATCH 29/57] safemode prevent dynamic stack alloc --- main.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/main.c b/main.c index 19ef60f2e1..5889ae5a67 100644 --- a/main.c +++ b/main.c @@ -133,17 +133,19 @@ static void reset_devices(void) { } #if MICROPY_ENABLE_PYSTACK -STATIC supervisor_allocation *allocate_pystack(void) { +STATIC supervisor_allocation *allocate_pystack(safe_mode_t safe_mode) { mp_int_t pystack_size = CIRCUITPY_PYSTACK_SIZE; #if CIRCUITPY_OS_GETENV && CIRCUITPY_SETTABLE_PYSTACK // Fetch value if exists from settings.toml // Leaves size to build default on any failure - (void)common_hal_os_getenv_int("CIRCUITPY_PYSTACK_SIZE", &pystack_size); - // Check if value is valid - pystack_size = pystack_size - pystack_size % sizeof(size_t); // Round down to multiple of 4. - if (pystack_size < 384) { - serial_write_compressed(translate("\nInvalid CIRCUITPY_PYSTACK_SIZE\n\n\r")); - pystack_size = CIRCUITPY_PYSTACK_SIZE; // Reset + if (safe_mode == SAFE_MODE_NONE || safe_mode == SAFE_MODE_USER) { + (void)common_hal_os_getenv_int("CIRCUITPY_PYSTACK_SIZE", &pystack_size); + // Check if value is valid + pystack_size = pystack_size - pystack_size % sizeof(size_t); // Round down to multiple of 4. + if (pystack_size < 384) { + serial_write_compressed(translate("\nInvalid CIRCUITPY_PYSTACK_SIZE\n\n\r")); + pystack_size = CIRCUITPY_PYSTACK_SIZE; // Reset + } } #endif supervisor_allocation *pystack = allocate_memory(pystack_size, false, false); @@ -427,7 +429,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) { supervisor_allocation *pystack = NULL; #if MICROPY_ENABLE_PYSTACK - pystack = allocate_pystack(); + pystack = allocate_pystack(safe_mode); #endif supervisor_allocation *heap = allocate_remaining_memory(); start_mp(heap, pystack); @@ -769,7 +771,7 @@ STATIC void __attribute__ ((noinline)) run_safemode_py(safe_mode_t safe_mode) { supervisor_allocation *pystack = NULL; #if MICROPY_ENABLE_PYSTACK - pystack = allocate_pystack(); + pystack = allocate_pystack(safe_mode); #endif supervisor_allocation *heap = allocate_remaining_memory(); start_mp(heap, pystack); @@ -806,7 +808,7 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { supervisor_allocation *pystack = NULL; #if MICROPY_ENABLE_PYSTACK - pystack = allocate_pystack(); + pystack = allocate_pystack(safe_mode); #endif supervisor_allocation *heap = allocate_remaining_memory(); start_mp(heap, pystack); @@ -906,13 +908,13 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { #endif } -STATIC int run_repl(void) { +STATIC int run_repl(safe_mode_t safe_mode) { int exit_code = PYEXEC_FORCED_EXIT; stack_resize(); filesystem_flush(); supervisor_allocation *pystack = NULL; #if MICROPY_ENABLE_PYSTACK - pystack = allocate_pystack(); + pystack = allocate_pystack(safe_mode); #endif supervisor_allocation *heap = allocate_remaining_memory(); start_mp(heap, pystack); @@ -1078,7 +1080,7 @@ int __attribute__((used)) main(void) { bool simulate_reset = true; for (;;) { if (!skip_repl) { - exit_code = run_repl(); + exit_code = run_repl(get_safe_mode()); supervisor_set_run_reason(RUN_REASON_REPL_RELOAD); } if (exit_code == PYEXEC_FORCED_EXIT) { From dc80133d7e60a24441d5b432505f9a8ca12ea4d1 Mon Sep 17 00:00:00 2001 From: MicroDev <70126934+MicroDev1@users.noreply.github.com> Date: Sat, 18 Feb 2023 16:29:59 +0530 Subject: [PATCH 30/57] re-enable changes per commit --- .github/workflows/build.yml | 21 ++++++++++----------- tools/ci_changes_per_commit.py | 30 ++++++++++++++---------------- tools/ci_set_matrix.py | 3 +++ 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 00c7f8749f..7029cc4897 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,17 +54,16 @@ jobs: uses: ./.github/actions/deps/external with: action: cache - # Disabled: Needs to be updated - # - name: Get last commit with checks - # id: get-last-commit-with-checks - # if: github.event_name == 'pull_request' - # working-directory: tools - # run: python3 -u ci_changes_per_commit.py - # env: - # REPO: ${{ github.repository }} - # PULL: ${{ github.event.number }} - # GITHUB_TOKEN: ${{ github.token }} - # EXCLUDE_COMMIT: ${{ github.event.after }} + - name: Get last commit with checks + id: get-last-commit-with-checks + if: github.event_name == 'pull_request' + working-directory: tools + run: python3 -u ci_changes_per_commit.py + env: + REPO: ${{ github.repository }} + PULL: ${{ github.event.number }} + GITHUB_TOKEN: ${{ github.token }} + EXCLUDE_COMMIT: ${{ github.event.after }} - name: Set up mpy-cross uses: ./.github/actions/mpy_cross with: diff --git a/tools/ci_changes_per_commit.py b/tools/ci_changes_per_commit.py index 4d71f8e38c..6452f241c0 100644 --- a/tools/ci_changes_per_commit.py +++ b/tools/ci_changes_per_commit.py @@ -166,26 +166,14 @@ def get_commit_depth_and_check_suite(query_commits): return [None, None] -def append_runs_to_list(runs, bad_runs_by_matrix): - regex_matrix = re.compile("^build-[^ ]+") - regex_board = re.compile("\([^ ]+\)$") - for run in runs["nodes"]: - name = run["name"] - res_matrix = regex_matrix.search(name) - if res_matrix: - matrix = res_matrix.group() - if matrix not in bad_runs_by_matrix: - bad_runs_by_matrix[matrix] = [] - res_board = regex_board.search(name) - if res_board: - bad_runs_by_matrix[matrix].append(res_board.group()[1:-1]) - - def get_bad_check_runs(query_check_runs): more_pages = True bad_runs_by_matrix = {} + run_types = ["failed", "incomplete"] + regex_matrix = re.compile("^[^\n ]+ \/ (build|run) \([^\n ]+\)$") + while more_pages: check_runs = query_check_runs.fetch()["data"]["node"] more_pages = False @@ -194,7 +182,17 @@ def get_bad_check_runs(query_check_runs): run_type_camel = run_type.capitalize() + "Run" run_type = run_type + "Runs" - append_runs_to_list(check_runs[run_type], bad_runs_by_matrix) + for check_run in check_runs[run_type]["nodes"]: + name = check_run["name"] + res_matrix = regex_matrix.search(name) + if res_matrix: + matrix = name.split(" /", 1)[0] + matrix_job = name.split(" (", 1)[1][:-1] + bad_runs_by_matrix.setdefault(matrix, []).append(matrix_job) + elif name != "scheduler": + bad_runs_by_matrix[name] = True + else: + return {} if query_check_runs.paginate( check_runs[run_type]["pageInfo"], "after" + run_type_camel diff --git a/tools/ci_set_matrix.py b/tools/ci_set_matrix.py index 6e7a4f1229..8c248d8fd7 100755 --- a/tools/ci_set_matrix.py +++ b/tools/ci_set_matrix.py @@ -92,6 +92,9 @@ def set_output(name: str, value): def set_boards_to_build(build_all: bool): + if "mpy_cross" in last_failed_jobs or "tests" in last_failed_jobs: + build_all = True + # Get boards in json format boards_info_json = build_board_info.get_board_mapping() all_board_ids = set() From b4ff08d185389e5b540a8e468c00895e1ae83927 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Sat, 18 Feb 2023 23:56:06 +0200 Subject: [PATCH 31/57] Prohibit too big a size --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 5889ae5a67..18f145c334 100644 --- a/main.c +++ b/main.c @@ -142,7 +142,7 @@ STATIC supervisor_allocation *allocate_pystack(safe_mode_t safe_mode) { (void)common_hal_os_getenv_int("CIRCUITPY_PYSTACK_SIZE", &pystack_size); // Check if value is valid pystack_size = pystack_size - pystack_size % sizeof(size_t); // Round down to multiple of 4. - if (pystack_size < 384) { + if ((pystack_size < 384) || (pystack_size > 900000)) { serial_write_compressed(translate("\nInvalid CIRCUITPY_PYSTACK_SIZE\n\n\r")); pystack_size = CIRCUITPY_PYSTACK_SIZE; // Reset } From 30a8e8bbcdba454b0af3c4acbe1cd6401fc92aa4 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Tue, 21 Feb 2023 13:26:57 +0200 Subject: [PATCH 32/57] Revert next_stack_size --- shared-bindings/supervisor/Runtime.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/shared-bindings/supervisor/Runtime.c b/shared-bindings/supervisor/Runtime.c index 4d94172205..c3418c6437 100644 --- a/shared-bindings/supervisor/Runtime.c +++ b/shared-bindings/supervisor/Runtime.c @@ -168,6 +168,26 @@ STATIC mp_obj_t supervisor_runtime_get_ble_workflow(mp_obj_t self) { } MP_DEFINE_CONST_FUN_OBJ_1(supervisor_runtime_get_ble_workflow_obj, supervisor_runtime_get_ble_workflow); +//| next_stack_limit: int +//| """The size of the stack for the next vm run. If its too large, the default will be used.""" +//| +STATIC mp_obj_t supervisor_runtime_get_next_stack_limit(mp_obj_t self) { + return mp_obj_new_int(get_next_stack_size()); +} +MP_DEFINE_CONST_FUN_OBJ_1(supervisor_runtime_get_next_stack_limit_obj, supervisor_runtime_get_next_stack_limit); + +STATIC mp_obj_t supervisor_runtime_set_next_stack_limit(mp_obj_t self, mp_obj_t size_obj) { + mp_int_t size = mp_obj_get_int(size_obj); + mp_arg_validate_int_min(size, 256, MP_QSTR_size); + set_next_stack_size(size); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(supervisor_runtime_set_next_stack_limit_obj, supervisor_runtime_set_next_stack_limit); + +MP_PROPERTY_GETSET(supervisor_runtime_next_stack_limit_obj, + (mp_obj_t)&supervisor_runtime_get_next_stack_limit_obj, + (mp_obj_t)&supervisor_runtime_set_next_stack_limit_obj); + STATIC mp_obj_t supervisor_runtime_set_ble_workflow(mp_obj_t self, mp_obj_t state_in) { #if CIRCUITPY_BLE_FILE_SERVICE && CIRCUITPY_SERIAL_BLE if (mp_obj_is_true(state_in)) { @@ -219,6 +239,7 @@ STATIC const mp_rom_map_elem_t supervisor_runtime_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_safe_mode_reason), MP_ROM_PTR(&supervisor_runtime_safe_mode_reason_obj) }, { MP_ROM_QSTR(MP_QSTR_autoreload), MP_ROM_PTR(&supervisor_runtime_autoreload_obj) }, { MP_ROM_QSTR(MP_QSTR_ble_workflow), MP_ROM_PTR(&supervisor_runtime_ble_workflow_obj) }, + { MP_ROM_QSTR(MP_QSTR_next_stack_limit), MP_ROM_PTR(&supervisor_runtime_next_stack_limit_obj) }, { MP_ROM_QSTR(MP_QSTR_rgb_status_brightness), MP_ROM_PTR(&supervisor_runtime_rgb_status_brightness_obj) }, }; From d42aa41c70635c877c014fb6bfc2b654ede72bbd Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Tue, 21 Feb 2023 13:29:39 +0200 Subject: [PATCH 33/57] Revert it with more passion --- shared-bindings/supervisor/Runtime.c | 38 ++++++++++++++-------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/shared-bindings/supervisor/Runtime.c b/shared-bindings/supervisor/Runtime.c index c3418c6437..db3d8d1e4d 100644 --- a/shared-bindings/supervisor/Runtime.c +++ b/shared-bindings/supervisor/Runtime.c @@ -168,6 +168,24 @@ STATIC mp_obj_t supervisor_runtime_get_ble_workflow(mp_obj_t self) { } MP_DEFINE_CONST_FUN_OBJ_1(supervisor_runtime_get_ble_workflow_obj, supervisor_runtime_get_ble_workflow); +STATIC mp_obj_t supervisor_runtime_set_ble_workflow(mp_obj_t self, mp_obj_t state_in) { + #if CIRCUITPY_BLE_FILE_SERVICE && CIRCUITPY_SERIAL_BLE + if (mp_obj_is_true(state_in)) { + supervisor_bluetooth_enable_workflow(); + } else { + supervisor_bluetooth_disable_workflow(); + } + #else + mp_raise_NotImplementedError(NULL); + #endif + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(supervisor_runtime_set_ble_workflow_obj, supervisor_runtime_set_ble_workflow); + +MP_PROPERTY_GETSET(supervisor_runtime_ble_workflow_obj, + (mp_obj_t)&supervisor_runtime_get_ble_workflow_obj, + (mp_obj_t)&supervisor_runtime_set_ble_workflow_obj); + //| next_stack_limit: int //| """The size of the stack for the next vm run. If its too large, the default will be used.""" //| @@ -188,24 +206,6 @@ MP_PROPERTY_GETSET(supervisor_runtime_next_stack_limit_obj, (mp_obj_t)&supervisor_runtime_get_next_stack_limit_obj, (mp_obj_t)&supervisor_runtime_set_next_stack_limit_obj); -STATIC mp_obj_t supervisor_runtime_set_ble_workflow(mp_obj_t self, mp_obj_t state_in) { - #if CIRCUITPY_BLE_FILE_SERVICE && CIRCUITPY_SERIAL_BLE - if (mp_obj_is_true(state_in)) { - supervisor_bluetooth_enable_workflow(); - } else { - supervisor_bluetooth_disable_workflow(); - } - #else - mp_raise_NotImplementedError(NULL); - #endif - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_2(supervisor_runtime_set_ble_workflow_obj, supervisor_runtime_set_ble_workflow); - -MP_PROPERTY_GETSET(supervisor_runtime_ble_workflow_obj, - (mp_obj_t)&supervisor_runtime_get_ble_workflow_obj, - (mp_obj_t)&supervisor_runtime_set_ble_workflow_obj); - //| rgb_status_brightness: int //| """Set brightness of status RGB LED from 0-255. This will take effect //| after the current code finishes and the status LED is used to show @@ -239,7 +239,7 @@ STATIC const mp_rom_map_elem_t supervisor_runtime_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_safe_mode_reason), MP_ROM_PTR(&supervisor_runtime_safe_mode_reason_obj) }, { MP_ROM_QSTR(MP_QSTR_autoreload), MP_ROM_PTR(&supervisor_runtime_autoreload_obj) }, { MP_ROM_QSTR(MP_QSTR_ble_workflow), MP_ROM_PTR(&supervisor_runtime_ble_workflow_obj) }, - { MP_ROM_QSTR(MP_QSTR_next_stack_limit), MP_ROM_PTR(&supervisor_runtime_next_stack_limit_obj) }, + { MP_ROM_QSTR(MP_QSTR_next_stack_limit), MP_ROM_PTR(&supervisor_runtime_next_stack_limit_obj) }, { MP_ROM_QSTR(MP_QSTR_rgb_status_brightness), MP_ROM_PTR(&supervisor_runtime_rgb_status_brightness_obj) }, }; From 5dba32ed073f3cb00e961335ee7aaa1d74a9eaa8 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Tue, 21 Feb 2023 17:42:08 +0200 Subject: [PATCH 34/57] Try to pass ci with rainbowio --- ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk index 51b4371675..9bc50ab429 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk @@ -25,7 +25,6 @@ CIRCUITPY_KEYPAD = 0 CIRCUITPY_MSGPACK = 0 CIRCUITPY_PS2IO = 0 CIRCUITPY_RGBMATRIX = 0 -CIRCUITPY_RAINBOWIO = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_USB_HID = 0 From 650c4c5d92f9f15ea1b29422caab323780b3a2a2 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Tue, 21 Feb 2023 20:50:07 +0200 Subject: [PATCH 35/57] pystack+ rainbow- --- ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h | 5 ----- ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk | 1 + 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h index bdc3fc5890..eb7f1c62e3 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h @@ -21,8 +21,3 @@ #define IGNORE_PIN_PA25 1 #define MICROPY_FATFS_EXFAT 0 - -#ifdef CIRCUITPY_SETTABLE_PYSTACK -#undef CIRCUITPY_SETTABLE_PYSTACK -#endif -#define CIRCUITPY_SETTABLE_PYSTACK 0 diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk index 9bc50ab429..51b4371675 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk @@ -25,6 +25,7 @@ CIRCUITPY_KEYPAD = 0 CIRCUITPY_MSGPACK = 0 CIRCUITPY_PS2IO = 0 CIRCUITPY_RGBMATRIX = 0 +CIRCUITPY_RAINBOWIO = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_USB_HID = 0 From 7e6e824d5655026906b6515070aeb604d2ef3426 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 21 Feb 2023 13:38:29 -0600 Subject: [PATCH 36/57] Correctly raise OS error in socketpool_socket_recv_into() --- ports/raspberrypi/common-hal/socketpool/Socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/raspberrypi/common-hal/socketpool/Socket.c b/ports/raspberrypi/common-hal/socketpool/Socket.c index fe12f461fb..e2b82264ba 100644 --- a/ports/raspberrypi/common-hal/socketpool/Socket.c +++ b/ports/raspberrypi/common-hal/socketpool/Socket.c @@ -1109,7 +1109,7 @@ int socketpool_socket_recv_into(socketpool_socket_obj_t *socket, break; } if (ret == (unsigned)-1) { - return -_errno; + mp_raise_OSError(_errno); } return ret; } From 7c717a54f3b345d96dac606b0866ad2f04a75bc6 Mon Sep 17 00:00:00 2001 From: RetiredWizard Date: Tue, 21 Feb 2023 22:10:36 -0500 Subject: [PATCH 37/57] Switch to "unmeasured" core clock speed check --- ports/broadcom/common-hal/busio/I2C.c | 2 +- ports/broadcom/common-hal/busio/SPI.c | 5 ++++- ports/broadcom/common-hal/busio/UART.c | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ports/broadcom/common-hal/busio/I2C.c b/ports/broadcom/common-hal/busio/I2C.c index 3142fda145..64187f434b 100644 --- a/ports/broadcom/common-hal/busio/I2C.c +++ b/ports/broadcom/common-hal/busio/I2C.c @@ -98,7 +98,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, self->sda_pin = sda; self->scl_pin = scl; - uint32_t source_clock = vcmailbox_get_clock_rate_measured(VCMAILBOX_CLOCK_CORE); + uint32_t source_clock = vcmailbox_get_clock_rate(VCMAILBOX_CLOCK_CORE); uint16_t clock_divider = source_clock / frequency; self->peripheral->DIV_b.CDIV = clock_divider; diff --git a/ports/broadcom/common-hal/busio/SPI.c b/ports/broadcom/common-hal/busio/SPI.c index 017674dfc0..6b9354313b 100644 --- a/ports/broadcom/common-hal/busio/SPI.c +++ b/ports/broadcom/common-hal/busio/SPI.c @@ -87,6 +87,8 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, mp_raise_NotImplementedError(translate("Half duplex SPI is not implemented")); } + // BCM_VERSION != 2711 have 3 SPI but as listed in peripherals/gen/pins.c two are on + // index 0, once one index 0 SPI is found the other will throw an invalid_pins error. for (size_t i = 0; i < NUM_SPI; i++) { if (spi_in_use[i]) { continue; @@ -157,6 +159,7 @@ void common_hal_busio_spi_deinit(busio_spi_obj_t *self) { common_hal_reset_pin(self->MOSI); common_hal_reset_pin(self->MISO); self->clock = NULL; + spi_in_use[self->index] = false; if (self->index == 1 || self->index == 2) { @@ -198,7 +201,7 @@ bool common_hal_busio_spi_configure(busio_spi_obj_t *self, SPI0_Type *p = spi[self->index]; p->CS = polarity << SPI0_CS_CPOL_Pos | phase << SPI0_CS_CPHA_Pos; - uint32_t source_clock = vcmailbox_get_clock_rate_measured(VCMAILBOX_CLOCK_CORE); + uint32_t source_clock = vcmailbox_get_clock_rate(VCMAILBOX_CLOCK_CORE); uint16_t clock_divider = source_clock / baudrate; if (source_clock % baudrate > 0) { clock_divider += 2; diff --git a/ports/broadcom/common-hal/busio/UART.c b/ports/broadcom/common-hal/busio/UART.c index 9f51f15acb..4d60866c04 100644 --- a/ports/broadcom/common-hal/busio/UART.c +++ b/ports/broadcom/common-hal/busio/UART.c @@ -460,7 +460,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 (self->uart_id == 1) { - uint32_t source_clock = vcmailbox_get_clock_rate_measured(VCMAILBOX_CLOCK_CORE); + uint32_t source_clock = vcmailbox_get_clock_rate(VCMAILBOX_CLOCK_CORE); UART1->BAUD = ((source_clock / (baudrate * 8)) - 1); } else { ARM_UART_PL011_Type *pl011 = uart[self->uart_id]; From 1d12014ec76fda494b777aae29de0d1ee5762046 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Wed, 22 Feb 2023 13:31:15 +0200 Subject: [PATCH 38/57] disable pixelmap --- ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk index 51b4371675..9ca9259747 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk @@ -20,6 +20,7 @@ CIRCUITPY_BLEIO_HCI = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FLOPPYIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 +CIRCUITPY_PIXELMAP = 0 CIRCUITPY_GETPASS = 0 CIRCUITPY_KEYPAD = 0 CIRCUITPY_MSGPACK = 0 From 592fea682297177cd5710f4a507fcd33eec5ab96 Mon Sep 17 00:00:00 2001 From: MicroDev <70126934+MicroDev1@users.noreply.github.com> Date: Wed, 22 Feb 2023 20:08:13 +0530 Subject: [PATCH 39/57] split `atmel-samd` instead of `raspberrypi` --- .github/workflows/build.yml | 22 +++++++++++----------- tools/ci_set_matrix.py | 15 +++++++-------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7029cc4897..b275a6d86d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,9 +24,9 @@ jobs: build-boards: ${{ steps.set-matrix.outputs.build-boards }} boards-aarch: ${{ steps.set-matrix.outputs.boards-aarch }} boards-arm: ${{ steps.set-matrix.outputs.boards-arm }} + boards-atmel: ${{ steps.set-matrix.outputs.boards-atmel }} boards-esp: ${{ steps.set-matrix.outputs.boards-esp }} boards-riscv: ${{ steps.set-matrix.outputs.boards-riscv }} - boards-rpi: ${{ steps.set-matrix.outputs.boards-rpi }} cp-version: ${{ steps.set-up-submodules.outputs.version }} steps: - name: Dump GitHub context @@ -238,6 +238,16 @@ jobs: boards: ${{ needs.scheduler.outputs.boards-arm }} cp-version: ${{ needs.scheduler.outputs.cp-version }} + atmel: + needs: [scheduler, mpy-cross, tests] + if: ${{ needs.scheduler.outputs.boards-atmel != '[]' }} + uses: ./.github/workflows/build-boards.yml + secrets: inherit + with: + platform: arm + boards: ${{ needs.scheduler.outputs.boards-atmel }} + cp-version: ${{ needs.scheduler.outputs.cp-version }} + esp: needs: [scheduler, mpy-cross, tests] if: ${{ needs.scheduler.outputs.boards-esp != '[]' }} @@ -257,13 +267,3 @@ jobs: platform: riscv boards: ${{ needs.scheduler.outputs.boards-riscv }} cp-version: ${{ needs.scheduler.outputs.cp-version }} - - rpi: - needs: [scheduler, mpy-cross, tests] - if: ${{ needs.scheduler.outputs.boards-rpi != '[]' }} - uses: ./.github/workflows/build-boards.yml - secrets: inherit - with: - platform: arm - boards: ${{ needs.scheduler.outputs.boards-rpi }} - cp-version: ${{ needs.scheduler.outputs.cp-version }} diff --git a/tools/ci_set_matrix.py b/tools/ci_set_matrix.py index 8c248d8fd7..374e2f0c2b 100755 --- a/tools/ci_set_matrix.py +++ b/tools/ci_set_matrix.py @@ -43,14 +43,14 @@ from shared_bindings_matrix import ( ) PORT_TO_ARCH = { - "atmel-samd": "arm", + "atmel-samd": "atmel", "broadcom": "aarch", "cxd56": "arm", "espressif": "esp", "litex": "riscv", "mimxrt10xx": "arm", "nrf": "arm", - "raspberrypi": "rpi", + "raspberrypi": "arm", "stm": "arm", } @@ -92,7 +92,7 @@ def set_output(name: str, value): def set_boards_to_build(build_all: bool): - if "mpy_cross" in last_failed_jobs or "tests" in last_failed_jobs: + if last_failed_jobs.get("mpy_cross") or last_failed_jobs.get("tests"): build_all = True # Get boards in json format @@ -207,13 +207,12 @@ def set_boards_to_build(build_all: bool): break # Split boards by architecture. - arch_to_boards = {"aarch": [], "arm": [], "esp": [], "riscv": [], "rpi": []} + arch_to_boards = {"aarch": [], "arm": [], "atmel": [], "esp": [], "riscv": []} # Append previously failed boards for arch in arch_to_boards: - arch_to_job = f"build-{arch}" - if arch_to_job in last_failed_jobs: - for board in last_failed_jobs[arch_to_job]: + if arch in last_failed_jobs: + for board in last_failed_jobs[arch]: if not board in boards_to_build: boards_to_build.append(board) @@ -238,7 +237,7 @@ def set_boards_to_build(build_all: bool): def set_docs_to_build(build_doc: bool): if not build_doc: - if "build-doc" in last_failed_jobs: + if last_failed_jobs.get("build-doc"): build_doc = True else: doc_pattern = re.compile( From 1ea21cc8fc210f9a16f92c77c632a8bd40812671 Mon Sep 17 00:00:00 2001 From: MicroDev <70126934+MicroDev1@users.noreply.github.com> Date: Wed, 22 Feb 2023 20:11:38 +0530 Subject: [PATCH 40/57] refactor and simplify fetching port deps --- .github/actions/deps/ports/action.yml | 24 +++++++++++++++++++++++ .github/workflows/build-boards-custom.yml | 19 +++++++----------- .github/workflows/build-boards.yml | 5 +++-- 3 files changed, 34 insertions(+), 14 deletions(-) create mode 100644 .github/actions/deps/ports/action.yml diff --git a/.github/actions/deps/ports/action.yml b/.github/actions/deps/ports/action.yml new file mode 100644 index 0000000000..2aa50a1cc2 --- /dev/null +++ b/.github/actions/deps/ports/action.yml @@ -0,0 +1,24 @@ +name: Fetch port deps + +inputs: + board: + required: true + type: string + +outputs: + port: + value: ${{ steps.board-to-port.outputs.port }} + +runs: + using: composite + steps: + - name: Board to port + id: board-to-port + run: | + PORT=$(find ports/*/boards/ -type d -name ${{ inputs.board }} | sed 's/^ports\///g;s/\/boards.*//g') + if [ -z $PORT ]; then (exit 1); else echo >> $GITHUB_OUTPUT "port=$PORT"; fi + shell: bash + + - name: Set up espressif port + if: steps.board-to-port.outputs.port == 'espressif' + uses: ./.github/actions/deps/ports/espressif diff --git a/.github/workflows/build-boards-custom.yml b/.github/workflows/build-boards-custom.yml index 22ba0f62f4..df8197d9ae 100644 --- a/.github/workflows/build-boards-custom.yml +++ b/.github/workflows/build-boards-custom.yml @@ -51,20 +51,15 @@ jobs: if: inputs.debug || inputs.flags != '' run: | > custom-build && git add custom-build - - name: Get port - id: get-port - run: | - PORT=$(find ports/*/boards/ -type d -name ${{ inputs.board }} | sed 's/^ports\///g;s/\/boards.*//g') - if [ -z $PORT ]; then (exit 1); else echo >> $GITHUB_OUTPUT "port=$PORT"; fi - - name: Port to platform - run: echo >> $GITHUB_ENV "PLATFORM=${{ env[format('PLATFORM_{0}', steps.get-port.outputs.port)] }}" - name: Set up python uses: actions/setup-python@v4 with: python-version: 3.x - name: Set up port - if: env.PLATFORM == 'esp' - uses: ./.github/actions/deps/ports/espressif + id: set-up-port + uses: ./.github/actions/deps/ports + with: + board: ${{ inputs.board }} - name: Set up submodules id: set-up-submodules uses: ./.github/actions/deps/submodules @@ -75,7 +70,7 @@ jobs: uses: ./.github/actions/deps/external with: action: cache - platform: ${{ env.PLATFORM }} + platform: ${{ env[format('PLATFORM_{0}', steps.set-up-port.outputs.port)] }} - name: Set up mpy-cross if: steps.set-up-submodules.outputs.frozen == 'True' uses: ./.github/actions/mpy_cross @@ -96,9 +91,9 @@ jobs: mkfs.fat --version || true - name: Build board run: make -j2 ${{ inputs.flags }} BOARD=${{ inputs.board }} DEBUG=${{ inputs.debug && '1' || '0' }} TRANSLATION=${{ inputs.language }} - working-directory: ports/${{ steps.get-port.outputs.port }} + working-directory: ports/${{ steps.set-up-port.outputs.port }} - name: Upload artifact uses: actions/upload-artifact@v3 with: name: ${{ inputs.board }}-${{ inputs.language }}-${{ inputs.version }}${{ inputs.flags != '' && '-custom' || '' }}${{ inputs.debug && '-debug' || '' }} - path: ports/${{ steps.get-port.outputs.port }}/build-${{ inputs.board }}/firmware.* + path: ports/${{ steps.set-up-port.outputs.port }}/build-${{ inputs.board }}/firmware.* diff --git a/.github/workflows/build-boards.yml b/.github/workflows/build-boards.yml index 457fce5b98..b975c131ee 100644 --- a/.github/workflows/build-boards.yml +++ b/.github/workflows/build-boards.yml @@ -38,8 +38,9 @@ jobs: with: python-version: 3.x - name: Set up port - if: inputs.platform == 'esp' - uses: ./.github/actions/deps/ports/espressif + uses: ./.github/actions/deps/ports + with: + board: ${{ matrix.board }} - name: Set up submodules id: set-up-submodules uses: ./.github/actions/deps/submodules From f4f95ada79808ab95ba51f3b0fd0535ea0906921 Mon Sep 17 00:00:00 2001 From: MicroDev <70126934+MicroDev1@users.noreply.github.com> Date: Wed, 22 Feb 2023 20:30:21 +0530 Subject: [PATCH 41/57] fix empty exclude commit --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b275a6d86d..453804a26a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,6 +54,10 @@ jobs: uses: ./.github/actions/deps/external with: action: cache + - name: Set up mpy-cross + uses: ./.github/actions/mpy_cross + with: + download: false - name: Get last commit with checks id: get-last-commit-with-checks if: github.event_name == 'pull_request' @@ -63,14 +67,10 @@ jobs: REPO: ${{ github.repository }} PULL: ${{ github.event.number }} GITHUB_TOKEN: ${{ github.token }} - EXCLUDE_COMMIT: ${{ github.event.after }} - - name: Set up mpy-cross - uses: ./.github/actions/mpy_cross - with: - download: false + EXCLUDE_COMMIT: ${{ github.event.pull_request.head.sha }} - name: Set head sha if: github.event_name == 'pull_request' - run: echo "HEAD_SHA=$(git show -s --format=%s $GITHUB_SHA | grep -o -P "(?<=Merge ).*(?= into)")" >> $GITHUB_ENV + run: echo "HEAD_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV - name: Set base sha if: github.event_name == 'pull_request' run: | From d1f50041213d91be4b5823bd2a096d2b7abf3fb0 Mon Sep 17 00:00:00 2001 From: Dennis Field Date: Tue, 21 Feb 2023 15:43:12 -0500 Subject: [PATCH 42/57] Add ESP32-LyraT board --- locale/circuitpython.pot | 4 ++ .../boards/espressif_esp32_lyrat/board.c | 34 +++++++++++ .../espressif_esp32_lyrat/mpconfigboard.h | 50 +++++++++++++++++ .../espressif_esp32_lyrat/mpconfigboard.mk | 10 ++++ .../boards/espressif_esp32_lyrat/pins.c | 56 +++++++++++++++++++ .../boards/espressif_esp32_lyrat/sdkconfig | 37 ++++++++++++ 6 files changed, 191 insertions(+) create mode 100644 ports/espressif/boards/espressif_esp32_lyrat/board.c create mode 100644 ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.h create mode 100644 ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.mk create mode 100644 ports/espressif/boards/espressif_esp32_lyrat/pins.c create mode 100644 ports/espressif/boards/espressif_esp32_lyrat/sdkconfig diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index abadd83b6a..2343144dfa 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -2391,6 +2391,10 @@ msgstr "" msgid "You pressed the GPIO0 button at start up." msgstr "" +#: ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.h +msgid "You pressed the Rec button at start up." +msgstr "" + #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "You pressed the SW38 button at start up." msgstr "" diff --git a/ports/espressif/boards/espressif_esp32_lyrat/board.c b/ports/espressif/boards/espressif_esp32_lyrat/board.c new file mode 100644 index 0000000000..8c0c8b8b0b --- /dev/null +++ b/ports/espressif/boards/espressif_esp32_lyrat/board.c @@ -0,0 +1,34 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2023 Radio Sound, 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 "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" + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.h b/ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.h new file mode 100644 index 0000000000..7835e93f21 --- /dev/null +++ b/ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.h @@ -0,0 +1,50 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2023 Radio Sound, 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. + */ + +// Micropython setup + +#define MICROPY_HW_BOARD_NAME "Espressif ESP32-LyraT" +#define MICROPY_HW_MCU_NAME "ESP32" + +#define MICROPY_HW_LED_STATUS (&pin_GPIO22) + +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO23, .sda = &pin_GPIO18}} + +#define CIRCUITPY_BOARD_SPI (1) +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO14, .mosi = &pin_GPIO13, .miso = &pin_GPIO12}} + +#define CIRCUITPY_BOARD_UART (0) + +// For entering safe mode, use Rec button +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO36) + +// Explanation of how a user got into safe mode +#define BOARD_USER_SAFE_MODE_ACTION translate("You pressed the Rec button at start up.") + +// UART pins attached to the USB-serial converter chip +#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO1) +#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO3) diff --git a/ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.mk b/ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.mk new file mode 100644 index 0000000000..e9fcd24e61 --- /dev/null +++ b/ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.mk @@ -0,0 +1,10 @@ +CIRCUITPY_CREATOR_ID = 0x000C303A +CIRCUITPY_CREATION_ID = 0x0032A000 + +IDF_TARGET = esp32 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB + +CIRCUITPY_ESPCAMERA = 0 diff --git a/ports/espressif/boards/espressif_esp32_lyrat/pins.c b/ports/espressif/boards/espressif_esp32_lyrat/pins.c new file mode 100644 index 0000000000..afef90e480 --- /dev/null +++ b/ports/espressif/boards/espressif_esp32_lyrat/pins.c @@ -0,0 +1,56 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + // External pins are in silkscreen order, from top to bottom, left side, then right side + { MP_ROM_QSTR(MP_QSTR_CS0), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO15) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO14) }, + + { 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_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO23) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO35) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO22) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_REC), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_SW36), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_MODE), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_SW39), MP_ROM_PTR(&pin_GPIO39) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) } +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/espressif_esp32_lyrat/sdkconfig b/ports/espressif/boards/espressif_esp32_lyrat/sdkconfig new file mode 100644 index 0000000000..4b2981ba62 --- /dev/null +++ b/ports/espressif/boards/espressif_esp32_lyrat/sdkconfig @@ -0,0 +1,37 @@ +CONFIG_ESP32_SPIRAM_SUPPORT=y +# SPI RAM config +# +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=4194304 +CONFIG_SPIRAM_SPEED_40M=y +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +CONFIG_SPIRAM_IGNORE_NOTFOUND=y +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY is not set +CONFIG_SPIRAM_CACHE_WORKAROUND=y + +# Uncomment (remove ###) to send ESP_LOG output to TX/RX pins +### # +### # ESP System Settings +### # +### CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y +### # CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set +### CONFIG_ESP_CONSOLE_UART_CUSTOM=y +### # CONFIG_ESP_CONSOLE_NONE is not set +### CONFIG_ESP_CONSOLE_UART=y +### CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_0=y +### # CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_1 is not set +### CONFIG_ESP_CONSOLE_UART_NUM=0 +### CONFIG_ESP_CONSOLE_UART_TX_GPIO=8 +### CONFIG_ESP_CONSOLE_UART_RX_GPIO=7 +### CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 +### # CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is not set +### # end of ESP System Settings From c73f0086883030d0f2025c05b5f6acdbe6f4ef03 Mon Sep 17 00:00:00 2001 From: RetiredWizard Date: Wed, 22 Feb 2023 11:58:13 -0500 Subject: [PATCH 43/57] Make vcmailbox call change for AUX SPI instances --- ports/broadcom/common-hal/busio/SPI.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/broadcom/common-hal/busio/SPI.c b/ports/broadcom/common-hal/busio/SPI.c index 6b9354313b..5780ebe801 100644 --- a/ports/broadcom/common-hal/busio/SPI.c +++ b/ports/broadcom/common-hal/busio/SPI.c @@ -183,7 +183,7 @@ bool common_hal_busio_spi_configure(busio_spi_obj_t *self, if (self->index == 1 || self->index == 2) { SPI1_Type *p = aux_spi[self->index]; - uint32_t source_clock = vcmailbox_get_clock_rate_measured(VCMAILBOX_CLOCK_CORE); + uint32_t source_clock = vcmailbox_get_clock_rate(VCMAILBOX_CLOCK_CORE); uint16_t clock_divider = source_clock / baudrate; if (source_clock % baudrate > 0) { clock_divider += 2; From 4722b5277116d1b1097ab1d2a69897bc9109ab89 Mon Sep 17 00:00:00 2001 From: Jose David M Date: Tue, 21 Feb 2023 23:15:47 +0000 Subject: [PATCH 44/57] Translated using Weblate (Spanish) Currently translated at 100.0% (998 of 998 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/es.po b/locale/es.po index e5a89fbd53..d32f6d4d06 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2023-02-20 03:39+0000\n" +"PO-Revision-Date: 2023-02-22 18:34+0000\n" "Last-Translator: Jose David M \n" "Language-Team: \n" "Language: es\n" @@ -2469,7 +2469,7 @@ msgstr "Usted presionó el boton BOOT al iniciar" #: ports/espressif/boards/adafruit_huzzah32_breakout/mpconfigboard.h msgid "You pressed the GPIO0 button at start up." -msgstr "" +msgstr "Presionaste el botón GPIO0 al inicio." #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "You pressed the SW38 button at start up." From ea4fa2402eee478f88aabfb162e373e228303ce9 Mon Sep 17 00:00:00 2001 From: Neradoc Date: Tue, 21 Feb 2023 19:53:44 +0000 Subject: [PATCH 45/57] Translated using Weblate (French) Currently translated at 98.9% (988 of 998 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/fr/ --- locale/fr.po | 112 +++++++++++++++++++++++++++------------------------ 1 file changed, 59 insertions(+), 53 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 9d7e737659..aece2bd6d7 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-12-27 18:02+0000\n" -"Last-Translator: Blinka CircuitPython \n" +"PO-Revision-Date: 2023-02-22 18:34+0000\n" +"Last-Translator: Neradoc \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.15.1-dev\n" +"X-Generator: Weblate 4.16-dev\n" #: main.c msgid "" @@ -46,12 +46,16 @@ msgid "" "\n" "Press reset to exit safe mode.\n" msgstr "" +"\n" +"Appuyer sur reset pour sortir du mode sûr.\n" #: supervisor/shared/safe_mode.c msgid "" "\n" "You are in safe mode because:\n" msgstr "" +"\n" +"Le mode sûr est actif:\n" #: py/obj.c msgid " File \"%q\"" @@ -127,7 +131,7 @@ msgstr "Échec de %q : %d" #: py/argcheck.c msgid "%q in %q must be of type %q, not %q" -msgstr "" +msgstr "%q dans %q doit être de type %q, pas %q" #: ports/espressif/common-hal/espulp/ULP.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c @@ -150,7 +154,7 @@ msgstr "" #: ports/raspberrypi/common-hal/wifi/Radio.c msgid "%q is read-only for this board" -msgstr "" +msgstr "%q est en lecture seule sur cette carte" #: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" @@ -190,7 +194,7 @@ msgstr "%q doit être >= %d" #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" -msgstr "" +msgstr "%q doit être un bytearray ou matrice de type 'H' ou 'B'" #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" @@ -199,11 +203,11 @@ msgstr "%q doit être a bytearray ou array de type 'h', 'H', 'b', ou 'B'" #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" -msgstr "" +msgstr "%q doit être de type %q ou %q, pas %q" #: py/argcheck.c py/obj.c py/objstrunicode.c msgid "%q must be of type %q, not %q" -msgstr "" +msgstr "%q doit être de type %q, pas %q" #: ports/atmel-samd/common-hal/busio/UART.c msgid "%q must be power of 2" @@ -228,7 +232,7 @@ msgstr "broche %q invalide" #: py/objrange.c py/objslice.c shared-bindings/random/__init__.c msgid "%q step cannot be zero" -msgstr "" +msgstr "le pas ne peut être zéro dans %q" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" @@ -429,7 +433,7 @@ msgstr "L'adresse doit être longue de %d octets" #: ports/espressif/common-hal/memorymap/AddressRange.c msgid "Address range not allowed" -msgstr "" +msgstr "Plage d'adresses non autorisée" #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" @@ -524,7 +528,7 @@ msgstr "Déjà à la recherche des réseaux wifi" #: shared-module/os/getenv.c #, c-format msgid "An error occurred while retrieving '%s':\n" -msgstr "" +msgstr "Erreur survenue en récupérant '%s':\n" #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" @@ -921,7 +925,7 @@ msgstr "" #: py/obj.c msgid "During handling of the above exception, another exception occurred:" -msgstr "" +msgstr "Pendant la gestion de cette exception, un autre s'est produite:" #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" @@ -950,7 +954,7 @@ msgstr "Erreur dans l'expression régulière" #: supervisor/shared/safe_mode.c msgid "Error in safemode.py." -msgstr "" +msgstr "Erreur dans safemode.py." #: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c msgid "Error: Failure to bind" @@ -958,7 +962,7 @@ msgstr "Erreur : Impossible de lier" #: shared-bindings/alarm/__init__.c msgid "Expected a kind of %q" -msgstr "" +msgstr "Argument de type %q attendu" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c @@ -1035,7 +1039,7 @@ msgstr "Le fichier existe" #: shared-module/os/getenv.c msgid "File not found" -msgstr "" +msgstr "Fichier non trouvé" #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/espressif/common-hal/canio/Listener.c @@ -1123,12 +1127,12 @@ msgstr "Matériel utilisé, essayez d'autres broches" #: supervisor/shared/safe_mode.c msgid "Heap allocation when VM not running." -msgstr "" +msgstr "Allocation du tas en dehors de la MV." #: supervisor/shared/safe_mode.c msgid "" "Heap was corrupted because the stack was too small. Increase stack size." -msgstr "" +msgstr "Tas corrompu parce que la pile était trop petite. Augmenter la pile." #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" @@ -1141,7 +1145,7 @@ msgstr "Erreur d'initialisation I2C" #: ports/raspberrypi/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "I2C peripheral in use" -msgstr "périphérique I2C utilisé" +msgstr "Périphérique I2C utilisé" #: shared-bindings/audiobusio/I2SOut.c msgid "I2SOut not available" @@ -1258,7 +1262,7 @@ msgstr "Le minuteur du watchdog interne a expiré." #: supervisor/shared/safe_mode.c msgid "Interrupt error." -msgstr "" +msgstr "Erreur d'interruption." #: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c msgid "Invalid %q" @@ -1297,7 +1301,7 @@ msgstr "Bits par valeur invalides" #: shared-module/os/getenv.c #, c-format msgid "Invalid byte %.*s" -msgstr "" +msgstr "Octet invalide %.*s" #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format @@ -1327,7 +1331,7 @@ msgstr "État invalide" #: shared-module/os/getenv.c msgid "Invalid unicode escape" -msgstr "" +msgstr "Séquence unicode invalide" #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" @@ -1335,7 +1339,7 @@ msgstr "La clé doit comporter 16, 24 ou 32 octets" #: shared-module/os/getenv.c msgid "Key not found" -msgstr "" +msgstr "Clé non trouvée" #: shared-module/is31fl3741/FrameBuffer.c msgid "LED mappings must match display size" @@ -1448,7 +1452,7 @@ msgstr "Erreur NVS" #: shared-bindings/socketpool/SocketPool.c msgid "Name or service not known" -msgstr "" +msgstr "Nom ou service inconnu" #: py/qstr.c msgid "Name too long" @@ -1693,7 +1697,7 @@ msgstr "Une seul %q autorisée en sommeil profond." #: ports/espressif/common-hal/espulp/ULPAlarm.c msgid "Only one %q can be set." -msgstr "" +msgstr "Un seul %q peut être défini." #: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c @@ -1729,7 +1733,7 @@ msgstr "Timeout de l'opération" #: ports/raspberrypi/common-hal/mdns/Server.c msgid "Out of MDNS service slots" -msgstr "" +msgstr "À cours de services MDNS" #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" @@ -1865,7 +1869,7 @@ msgstr "Taille du programme invalide" #: ports/espressif/common-hal/espulp/ULP.c msgid "Program too long" -msgstr "" +msgstr "Programme trop long" #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." @@ -2047,7 +2051,7 @@ msgstr "Canal stéréo droit doit être sur le canal PWM B" #: ports/raspberrypi/common-hal/wifi/Radio.c msgid "Stopping AP is not supported." -msgstr "" +msgstr "Stopper n'est pas supporté." #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" @@ -2067,11 +2071,11 @@ msgstr "Délais de lecture de température dépassée" #: supervisor/shared/safe_mode.c msgid "The `microcontroller` module was used to boot into safe mode." -msgstr "" +msgstr "Le module microcontroller a été utilisé pour démarrer en mode sûr." #: py/obj.c msgid "The above exception was the direct cause of the following exception:" -msgstr "" +msgstr "L'exception précédente est la cause directe de l'exception suivante:" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" @@ -2079,7 +2083,7 @@ msgstr "La taille de rgb_pins doit être 6, 12, 18, 24 ou 30" #: supervisor/shared/safe_mode.c msgid "The power dipped. Make sure you are providing enough power." -msgstr "" +msgstr "La puissance a chu. Assurez vous de fournir assez de puissance." #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" @@ -2100,7 +2104,7 @@ msgstr "Le signe de l'échantillon ne correspond pas à celui du mixer" #: supervisor/shared/safe_mode.c msgid "Third-party firmware fatal error." -msgstr "" +msgstr "Erreur fatale de logiciel système tierce partie." #: shared-module/imagecapture/ParallelImageCapture.c msgid "This microcontroller does not support continuous capture." @@ -2182,7 +2186,7 @@ msgstr "Initialisation UART" #: ports/raspberrypi/common-hal/busio/UART.c msgid "UART peripheral in use" -msgstr "" +msgstr "Périphérique UART utilisé" #: ports/stm/common-hal/busio/UART.c msgid "UART re-init" @@ -2237,7 +2241,7 @@ msgstr "Impossible d'allouer des tampons pour une conversion signée" #: supervisor/shared/safe_mode.c msgid "Unable to allocate the heap." -msgstr "" +msgstr "Impossible d'allouer le tas." #: ports/espressif/common-hal/busio/I2C.c msgid "Unable to create lock" @@ -2268,7 +2272,7 @@ msgstr "Impossible de lancer la requête mDNS" #: shared-bindings/memorymap/AddressRange.c msgid "Unable to write to address." -msgstr "" +msgstr "L'écriture a échoué." #: shared-bindings/nvm/ByteArray.c msgid "Unable to write to nvm." @@ -2437,15 +2441,15 @@ msgstr "Wi-Fi : " #: ports/raspberrypi/common-hal/wifi/Radio.c msgid "Wifi is in access point mode." -msgstr "" +msgstr "Wifi en mode point d'accès." #: ports/raspberrypi/common-hal/wifi/Radio.c msgid "Wifi is in station mode." -msgstr "" +msgstr "Wifi en mode station." #: ports/raspberrypi/common-hal/wifi/Radio.c msgid "Wifi is not enabled" -msgstr "" +msgstr "Le wifi n'est pas activé" #: main.c msgid "Woken up by alarm.\n" @@ -2461,48 +2465,48 @@ msgstr "Écritures non supporté vers les Characteristic" #: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h #: ports/atmel-samd/boards/meowmeow/mpconfigboard.h msgid "You pressed both buttons at start up." -msgstr "" +msgstr "Vous avez appuyé les deux boutons au démarrage." #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h #: ports/espressif/boards/m5stack_stick_c/mpconfigboard.h msgid "You pressed button A at start up." -msgstr "" +msgstr "Vous avez appuyé le bouton A au démarrage." #: supervisor/shared/safe_mode.c msgid "You pressed the BOOT button at start up" -msgstr "" +msgstr "Vous avez appuyé le bouton BOOT au démarrage" #: ports/espressif/boards/adafruit_huzzah32_breakout/mpconfigboard.h msgid "You pressed the GPIO0 button at start up." -msgstr "" +msgstr "Vous avez appuyé le bouton GPIO0 au démarrage." #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "You pressed the SW38 button at start up." -msgstr "" +msgstr "Vous avez appuyé le bouton SW38 au démarrage." #: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h msgid "You pressed the VOLUME button at start up." -msgstr "" +msgstr "Vous avez appuyé le bouton VOLUME au démarrage." #: ports/espressif/boards/m5stack_atom_echo/mpconfigboard.h #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h #: ports/espressif/boards/m5stack_atom_matrix/mpconfigboard.h #: ports/espressif/boards/m5stack_atom_u/mpconfigboard.h msgid "You pressed the central button at start up." -msgstr "" +msgstr "Vous avez appuyé le bouton central au démarrage." #: ports/nrf/boards/aramcon2_badge/mpconfigboard.h msgid "You pressed the left button at start up." -msgstr "" +msgstr "Vous avez appuyé le bouton gauche au démarrage." #: supervisor/shared/safe_mode.c msgid "You pressed the reset button during boot." -msgstr "" +msgstr "Vous avez appuyé le bouton reset au démarrage." #: supervisor/shared/micropython.c msgid "[truncated due to length]" -msgstr "" +msgstr "[taille limite atteinte]" #: py/objtype.c msgid "__init__() should return None" @@ -2575,7 +2579,7 @@ msgstr "la tableau à trop de dimensions" #: extmod/ulab/code/ndarray.c msgid "array is too big" -msgstr "" +msgstr "matrice trop grande" #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/memorymap/AddressRange.c shared-bindings/nvm/ByteArray.c @@ -2802,7 +2806,7 @@ msgstr "attribut non modifiable" #: py/runtime.c msgid "can't set attribute '%q'" -msgstr "" +msgstr "attribut '%q' non modifiable" #: py/emitnative.c msgid "can't store '%q'" @@ -3068,6 +3072,8 @@ msgid "" "espcamera.Camera requires reserved PSRAM to be configured. See the " "documentation for instructions." msgstr "" +"espcamera.Camera a besoin de PSRAM réservée. Voir la documentation pour les " +"instructions." #: py/runtime.c msgid "exceptions must derive from BaseException" @@ -3285,7 +3291,7 @@ msgstr "l'index est hors limites" #: shared-bindings/_pixelmap/PixelMap.c msgid "index must be tuple or int" -msgstr "" +msgstr "l'index doit être un tuple ou entier" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c #: ports/espressif/common-hal/pulseio/PulseIn.c @@ -3671,7 +3677,7 @@ msgstr "compte de décalage négatif" #: shared-bindings/_pixelmap/PixelMap.c msgid "nested index must be int" -msgstr "" +msgstr "sous index doit être entier" #: shared-module/sdcardio/SDCard.c msgid "no SD card" @@ -3843,7 +3849,7 @@ msgstr "seul bit_depth = 16 est pris en charge" #: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only mono is supported" -msgstr "" +msgstr "seul mono est supporté" #: extmod/ulab/code/numpy/create.c msgid "only ndarrays can be concatenated" @@ -3851,7 +3857,7 @@ msgstr "" #: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only oversample=64 is supported" -msgstr "" +msgstr "seul oversample=64 supporté" #: ports/nrf/common-hal/audiobusio/PDMIn.c #: ports/stm/common-hal/audiobusio/PDMIn.c From fa787bd2d58a6b04144abd5d8bd81f5f8b01ef79 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Wed, 22 Feb 2023 12:43:36 +0000 Subject: [PATCH 46/57] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (998 of 998 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 04aab50246..51bdae63a0 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: 2023-02-20 03:39+0000\n" +"PO-Revision-Date: 2023-02-22 18:34+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -2466,7 +2466,7 @@ msgstr "Você pressionou o botão BOOT na inicialização" #: ports/espressif/boards/adafruit_huzzah32_breakout/mpconfigboard.h msgid "You pressed the GPIO0 button at start up." -msgstr "" +msgstr "Você pressionou o botão GPIO0 durante a inicialização." #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "You pressed the SW38 button at start up." From c0f495756f37187bbbb1fff2b0dab25a7d42b870 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Tue, 21 Feb 2023 12:13:08 +0000 Subject: [PATCH 47/57] Translated using Weblate (Swedish) Currently translated at 100.0% (998 of 998 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 1ec9ce4033..e72ec10045 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: 2023-02-20 03:39+0000\n" +"PO-Revision-Date: 2023-02-22 18:34+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -2439,7 +2439,7 @@ msgstr "Du tryckte ner BOOT-knappen vid start" #: ports/espressif/boards/adafruit_huzzah32_breakout/mpconfigboard.h msgid "You pressed the GPIO0 button at start up." -msgstr "" +msgstr "Du tryckte på GPIO0-knappen vid start." #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "You pressed the SW38 button at start up." From 6b0367f9eb77bbce35aedf608cb6a8e7f903dd51 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Wed, 22 Feb 2023 19:34:49 +0100 Subject: [PATCH 48/57] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 12 ++++++++++++ locale/cs.po | 12 ++++++++++++ locale/de_DE.po | 12 ++++++++++++ locale/el.po | 12 ++++++++++++ locale/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, 228 insertions(+) diff --git a/locale/ID.po b/locale/ID.po index 490d3ecbba..61d2ce3308 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -30,6 +30,14 @@ msgid "" "Code stopped by auto-reload. Reloading soon.\n" msgstr "" +#: main.c +msgid "" +"\n" +"Invalid CIRCUITPY_PYSTACK_SIZE\n" +"\n" +"\r" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "\n" @@ -2419,6 +2427,10 @@ msgstr "" msgid "You pressed the GPIO0 button at start up." msgstr "" +#: ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.h +msgid "You pressed the Rec button at start up." +msgstr "" + #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "You pressed the SW38 button at start up." msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 13723a2be8..aabc3f2c78 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -32,6 +32,14 @@ msgstr "" "\n" "Kód byl zastaven kvůli automatickému načtení. K načtení dojde brzy.\n" +#: main.c +msgid "" +"\n" +"Invalid CIRCUITPY_PYSTACK_SIZE\n" +"\n" +"\r" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "\n" @@ -2406,6 +2414,10 @@ msgstr "" msgid "You pressed the GPIO0 button at start up." msgstr "" +#: ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.h +msgid "You pressed the Rec button at start up." +msgstr "" + #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "You pressed the SW38 button at start up." msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 620bf7dcfc..9629e6e36a 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -31,6 +31,14 @@ msgstr "" "\n" "Code wurde durch automatisches Neuladen gestoppt. Wird bald neu geladen.\n" +#: main.c +msgid "" +"\n" +"Invalid CIRCUITPY_PYSTACK_SIZE\n" +"\n" +"\r" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "\n" @@ -2455,6 +2463,10 @@ msgstr "" msgid "You pressed the GPIO0 button at start up." msgstr "" +#: ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.h +msgid "You pressed the Rec button at start up." +msgstr "" + #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "You pressed the SW38 button at start up." msgstr "" diff --git a/locale/el.po b/locale/el.po index 1e7a7c9813..ad3d815961 100644 --- a/locale/el.po +++ b/locale/el.po @@ -35,6 +35,14 @@ msgstr "" "Ο κώδικας σταμάτησε λόγω της αυτόματης επαναφόρτωσης. Η επαναφόρτωση θα " "γίνει σύντομα.\n" +#: main.c +msgid "" +"\n" +"Invalid CIRCUITPY_PYSTACK_SIZE\n" +"\n" +"\r" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "\n" @@ -2414,6 +2422,10 @@ msgstr "" msgid "You pressed the GPIO0 button at start up." msgstr "" +#: ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.h +msgid "You pressed the Rec button at start up." +msgstr "" + #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "You pressed the SW38 button at start up." msgstr "" diff --git a/locale/en_GB.po b/locale/en_GB.po index e26be76d6d..122300a5ed 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -34,6 +34,14 @@ msgstr "" "\n" "Code stopped by auto-reload. Reloading soon.\n" +#: main.c +msgid "" +"\n" +"Invalid CIRCUITPY_PYSTACK_SIZE\n" +"\n" +"\r" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "\n" @@ -2414,6 +2422,10 @@ msgstr "" msgid "You pressed the GPIO0 button at start up." msgstr "" +#: ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.h +msgid "You pressed the Rec button at start up." +msgstr "" + #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "You pressed the SW38 button at start up." msgstr "" diff --git a/locale/es.po b/locale/es.po index d32f6d4d06..1219be52f8 100644 --- a/locale/es.po +++ b/locale/es.po @@ -34,6 +34,14 @@ msgstr "" "\n" "Código detenido por la auto-recarga. Recargando pronto.\n" +#: main.c +msgid "" +"\n" +"Invalid CIRCUITPY_PYSTACK_SIZE\n" +"\n" +"\r" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "\n" @@ -2471,6 +2479,10 @@ msgstr "Usted presionó el boton BOOT al iniciar" msgid "You pressed the GPIO0 button at start up." msgstr "Presionaste el botón GPIO0 al inicio." +#: ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.h +msgid "You pressed the Rec button at start up." +msgstr "" + #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "You pressed the SW38 button at start up." msgstr "Usted presionó el boton SW38 al iniciar." diff --git a/locale/fil.po b/locale/fil.po index 99ca28a5b0..ad46137e27 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -29,6 +29,14 @@ msgid "" "Code stopped by auto-reload. Reloading soon.\n" msgstr "" +#: main.c +msgid "" +"\n" +"Invalid CIRCUITPY_PYSTACK_SIZE\n" +"\n" +"\r" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "\n" @@ -2409,6 +2417,10 @@ msgstr "" msgid "You pressed the GPIO0 button at start up." msgstr "" +#: ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.h +msgid "You pressed the Rec button at start up." +msgstr "" + #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "You pressed the SW38 button at start up." msgstr "" diff --git a/locale/fr.po b/locale/fr.po index aece2bd6d7..d06595c001 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -34,6 +34,14 @@ msgstr "" "Le code a été arrêté par l'actualisation automatique. Rechargement " "prochain.\n" +#: main.c +msgid "" +"\n" +"Invalid CIRCUITPY_PYSTACK_SIZE\n" +"\n" +"\r" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "\n" @@ -2481,6 +2489,10 @@ msgstr "Vous avez appuyé le bouton BOOT au démarrage" msgid "You pressed the GPIO0 button at start up." msgstr "Vous avez appuyé le bouton GPIO0 au démarrage." +#: ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.h +msgid "You pressed the Rec button at start up." +msgstr "" + #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "You pressed the SW38 button at start up." msgstr "Vous avez appuyé le bouton SW38 au démarrage." diff --git a/locale/hi.po b/locale/hi.po index fe1f7cfa95..97c730de83 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -28,6 +28,14 @@ msgid "" "Code stopped by auto-reload. Reloading soon.\n" msgstr "" +#: main.c +msgid "" +"\n" +"Invalid CIRCUITPY_PYSTACK_SIZE\n" +"\n" +"\r" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "\n" @@ -2391,6 +2399,10 @@ msgstr "" msgid "You pressed the GPIO0 button at start up." msgstr "" +#: ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.h +msgid "You pressed the Rec button at start up." +msgstr "" + #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "You pressed the SW38 button at start up." msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index a941c39ed9..413fceead6 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -31,6 +31,14 @@ msgid "" "Code stopped by auto-reload. Reloading soon.\n" msgstr "" +#: main.c +msgid "" +"\n" +"Invalid CIRCUITPY_PYSTACK_SIZE\n" +"\n" +"\r" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "\n" @@ -2416,6 +2424,10 @@ msgstr "" msgid "You pressed the GPIO0 button at start up." msgstr "" +#: ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.h +msgid "You pressed the Rec button at start up." +msgstr "" + #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "You pressed the SW38 button at start up." msgstr "" diff --git a/locale/ja.po b/locale/ja.po index 47a9602b14..19eed77eb3 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -34,6 +34,14 @@ msgstr "" "\n" "オートリロードでコード実行は中止された。まもなくリロードする。\n" +#: main.c +msgid "" +"\n" +"Invalid CIRCUITPY_PYSTACK_SIZE\n" +"\n" +"\r" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "\n" @@ -2408,6 +2416,10 @@ msgstr "" msgid "You pressed the GPIO0 button at start up." msgstr "" +#: ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.h +msgid "You pressed the Rec button at start up." +msgstr "" + #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "You pressed the SW38 button at start up." msgstr "" diff --git a/locale/ko.po b/locale/ko.po index 26bff6a610..86a1e30538 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -29,6 +29,14 @@ msgid "" "Code stopped by auto-reload. Reloading soon.\n" msgstr "" +#: main.c +msgid "" +"\n" +"Invalid CIRCUITPY_PYSTACK_SIZE\n" +"\n" +"\r" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "\n" @@ -2395,6 +2403,10 @@ msgstr "" msgid "You pressed the GPIO0 button at start up." msgstr "" +#: ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.h +msgid "You pressed the Rec button at start up." +msgstr "" + #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "You pressed the SW38 button at start up." msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 616c469595..a7b2aed3e3 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -28,6 +28,14 @@ msgid "" "Code stopped by auto-reload. Reloading soon.\n" msgstr "" +#: main.c +msgid "" +"\n" +"Invalid CIRCUITPY_PYSTACK_SIZE\n" +"\n" +"\r" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "\n" @@ -2418,6 +2426,10 @@ msgstr "" msgid "You pressed the GPIO0 button at start up." msgstr "" +#: ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.h +msgid "You pressed the Rec button at start up." +msgstr "" + #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "You pressed the SW38 button at start up." msgstr "" diff --git a/locale/pl.po b/locale/pl.po index e773fec6b1..a952e22b0a 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -30,6 +30,14 @@ msgid "" "Code stopped by auto-reload. Reloading soon.\n" msgstr "" +#: main.c +msgid "" +"\n" +"Invalid CIRCUITPY_PYSTACK_SIZE\n" +"\n" +"\r" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "\n" @@ -2399,6 +2407,10 @@ msgstr "" msgid "You pressed the GPIO0 button at start up." msgstr "" +#: ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.h +msgid "You pressed the Rec button at start up." +msgstr "" + #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "You pressed the SW38 button at start up." msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 51bdae63a0..cdb69ec484 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -32,6 +32,14 @@ msgstr "" "\n" "O código parou pela recarga automática. Recarregando em breve.\n" +#: main.c +msgid "" +"\n" +"Invalid CIRCUITPY_PYSTACK_SIZE\n" +"\n" +"\r" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "\n" @@ -2468,6 +2476,10 @@ msgstr "Você pressionou o botão BOOT na inicialização" msgid "You pressed the GPIO0 button at start up." msgstr "Você pressionou o botão GPIO0 durante a inicialização." +#: ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.h +msgid "You pressed the Rec button at start up." +msgstr "" + #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "You pressed the SW38 button at start up." msgstr "Você pressionou o botão SW38 na inicialização." diff --git a/locale/ru.po b/locale/ru.po index 334b0420fa..824a8180f6 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -34,6 +34,14 @@ msgstr "" "\n" "Программа остановлена автоматической перезагрузкой. Скоро перезагрузка.\n" +#: main.c +msgid "" +"\n" +"Invalid CIRCUITPY_PYSTACK_SIZE\n" +"\n" +"\r" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "\n" @@ -2454,6 +2462,10 @@ msgstr "" msgid "You pressed the GPIO0 button at start up." msgstr "" +#: ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.h +msgid "You pressed the Rec button at start up." +msgstr "" + #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "You pressed the SW38 button at start up." msgstr "" diff --git a/locale/sv.po b/locale/sv.po index e72ec10045..c4b3a36166 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -32,6 +32,14 @@ msgstr "" "\n" "Koden stoppades av automatisk laddning. Omladdning sker strax.\n" +#: main.c +msgid "" +"\n" +"Invalid CIRCUITPY_PYSTACK_SIZE\n" +"\n" +"\r" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "\n" @@ -2441,6 +2449,10 @@ msgstr "Du tryckte ner BOOT-knappen vid start" msgid "You pressed the GPIO0 button at start up." msgstr "Du tryckte på GPIO0-knappen vid start." +#: ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.h +msgid "You pressed the Rec button at start up." +msgstr "" + #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "You pressed the SW38 button at start up." msgstr "Du tryckte ned SW38-knappen vid start." diff --git a/locale/tr.po b/locale/tr.po index 4f17c5d33d..988db77b4c 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -34,6 +34,14 @@ msgstr "" "Program otomatik yeniden yükleme tarafından durduruldu. Birazdan tekrar " "yüklenecek.\n" +#: main.c +msgid "" +"\n" +"Invalid CIRCUITPY_PYSTACK_SIZE\n" +"\n" +"\r" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "\n" @@ -2413,6 +2421,10 @@ msgstr "" msgid "You pressed the GPIO0 button at start up." msgstr "" +#: ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.h +msgid "You pressed the Rec button at start up." +msgstr "" + #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "You pressed the SW38 button at start up." msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 79b895afe4..53ac3eb84d 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -34,6 +34,14 @@ msgstr "" "dài mǎ yīn zì dòng chóng xīn jiā zǎi ér tíng zhǐ. jí jiāng chóng xīn jiā " "zǎi.\n" +#: main.c +msgid "" +"\n" +"Invalid CIRCUITPY_PYSTACK_SIZE\n" +"\n" +"\r" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "\n" @@ -2439,6 +2447,10 @@ msgstr "" msgid "You pressed the GPIO0 button at start up." msgstr "" +#: ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.h +msgid "You pressed the Rec button at start up." +msgstr "" + #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "You pressed the SW38 button at start up." msgstr "" From 9cc27be0bf98fec7a6867242a17c98ec50e047b8 Mon Sep 17 00:00:00 2001 From: RetiredWizard Date: Wed, 22 Feb 2023 20:00:53 -0500 Subject: [PATCH 49/57] Removed broadcom-peripherals --- .gitmodules | 4 ---- ports/broadcom/peripherals | 1 - 2 files changed, 5 deletions(-) delete mode 160000 ports/broadcom/peripherals diff --git a/.gitmodules b/.gitmodules index dfd718630c..00f774cba7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -187,10 +187,6 @@ [submodule "frozen/Adafruit_CircuitPython_APDS9960"] path = frozen/Adafruit_CircuitPython_APDS9960 url = https://github.com/adafruit/Adafruit_CircuitPython_APDS9960 -[submodule "ports/broadcom/peripherals"] - path = ports/broadcom/peripherals - url = https://github.com/adafruit/broadcom-peripherals.git - branch = main-build [submodule "rpi-firmware"] path = ports/broadcom/firmware url = https://github.com/raspberrypi/rpi-firmware.git diff --git a/ports/broadcom/peripherals b/ports/broadcom/peripherals deleted file mode 160000 index 0837008608..0000000000 --- a/ports/broadcom/peripherals +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 08370086080759ed54ac1136d62d2ad24c6fa267 From c8dd0369a46009d1dc17073bcb9bf2c43944ca76 Mon Sep 17 00:00:00 2001 From: RetiredWizard Date: Wed, 22 Feb 2023 20:12:39 -0500 Subject: [PATCH 50/57] Added broadcom-peripherals back in --- .gitmodules | 4 ++++ ports/broadcom/peripherals | 1 + 2 files changed, 5 insertions(+) create mode 160000 ports/broadcom/peripherals diff --git a/.gitmodules b/.gitmodules index 00f774cba7..3de3c6a51e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -324,3 +324,7 @@ [submodule "frozen/Adafruit_CircuitPython_SSD1680"] path = frozen/Adafruit_CircuitPython_SSD1680 url = https://github.com/adafruit/Adafruit_CircuitPython_SSD1680 +[submodule "ports/broadcom/peripherals"] + path = ports/broadcom/peripherals + url = https://github.com/adafruit/broadcom-peripherals.git + branch = main-build diff --git a/ports/broadcom/peripherals b/ports/broadcom/peripherals new file mode 160000 index 0000000000..3e95941bff --- /dev/null +++ b/ports/broadcom/peripherals @@ -0,0 +1 @@ +Subproject commit 3e95941bff4409ee20374b3bbe30d0cdfbf073ba From 7cfc689f72c9eb9bbab4d2338bec0614f0eec843 Mon Sep 17 00:00:00 2001 From: RetiredWizard Date: Wed, 22 Feb 2023 22:59:55 -0500 Subject: [PATCH 51/57] Removed peripherals submodule --- .gitmodules | 4 ---- ports/broadcom/peripherals | 1 - 2 files changed, 5 deletions(-) delete mode 160000 ports/broadcom/peripherals diff --git a/.gitmodules b/.gitmodules index 3de3c6a51e..00f774cba7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -324,7 +324,3 @@ [submodule "frozen/Adafruit_CircuitPython_SSD1680"] path = frozen/Adafruit_CircuitPython_SSD1680 url = https://github.com/adafruit/Adafruit_CircuitPython_SSD1680 -[submodule "ports/broadcom/peripherals"] - path = ports/broadcom/peripherals - url = https://github.com/adafruit/broadcom-peripherals.git - branch = main-build diff --git a/ports/broadcom/peripherals b/ports/broadcom/peripherals deleted file mode 160000 index 3e95941bff..0000000000 --- a/ports/broadcom/peripherals +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3e95941bff4409ee20374b3bbe30d0cdfbf073ba From 08ac95a2eb671181a15f2314b20a3c82953a4e22 Mon Sep 17 00:00:00 2001 From: RetiredWizard Date: Wed, 22 Feb 2023 23:03:53 -0500 Subject: [PATCH 52/57] Added updated submodule back --- .gitmodules | 4 ++++ ports/broadcom/peripherals | 1 + 2 files changed, 5 insertions(+) create mode 160000 ports/broadcom/peripherals diff --git a/.gitmodules b/.gitmodules index 00f774cba7..3de3c6a51e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -324,3 +324,7 @@ [submodule "frozen/Adafruit_CircuitPython_SSD1680"] path = frozen/Adafruit_CircuitPython_SSD1680 url = https://github.com/adafruit/Adafruit_CircuitPython_SSD1680 +[submodule "ports/broadcom/peripherals"] + path = ports/broadcom/peripherals + url = https://github.com/adafruit/broadcom-peripherals.git + branch = main-build diff --git a/ports/broadcom/peripherals b/ports/broadcom/peripherals new file mode 160000 index 0000000000..d3a6b50a21 --- /dev/null +++ b/ports/broadcom/peripherals @@ -0,0 +1 @@ +Subproject commit d3a6b50a21e7dd49ba4bfa0374da3407594caa50 From ea8dd95931027a1a06ad3363074763da4e0f2d3b Mon Sep 17 00:00:00 2001 From: RetiredWizard Date: Wed, 22 Feb 2023 23:04:41 -0500 Subject: [PATCH 53/57] Update common-hal routines with new params --- ports/broadcom/common-hal/busio/UART.c | 22 +++++++++---------- ports/broadcom/common-hal/sdioio/SDCard.c | 26 +++++++++++------------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/ports/broadcom/common-hal/busio/UART.c b/ports/broadcom/common-hal/busio/UART.c index 4d60866c04..5be098cf03 100644 --- a/ports/broadcom/common-hal/busio/UART.c +++ b/ports/broadcom/common-hal/busio/UART.c @@ -124,7 +124,7 @@ void pl011_IRQHandler(uint8_t index) { // Clear the interrupt in case we weren't able to clear it by emptying the // FIFO. (This won't clear the FIFO.) ARM_UART_PL011_Type *pl011 = uart[index]; - pl011->ICR = UART0_ICR_RXIC_Msk; + pl011->ICR = ARM_UART_PL011_ICR_RXIC_Msk; } void UART0_IRQHandler(void) { @@ -258,31 +258,31 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, common_hal_busio_uart_set_baudrate(self, baudrate); - uint32_t line_control = UART0_LCR_H_FEN_Msk; - line_control |= (bits - 5) << UART0_LCR_H_WLEN_Pos; + uint32_t line_control = ARM_UART_PL011_LCR_H_FEN_Msk; + line_control |= (bits - 5) << ARM_UART_PL011_LCR_H_WLEN_Pos; if (stop == 2) { - line_control |= UART0_LCR_H_STP2_Msk; + line_control |= ARM_UART_PL011_LCR_H_STP2_Msk; } if (parity != BUSIO_UART_PARITY_NONE) { - line_control |= UART0_LCR_H_PEN_Msk; + line_control |= ARM_UART_PL011_LCR_H_PEN_Msk; } if (parity == BUSIO_UART_PARITY_EVEN) { - line_control |= UART0_LCR_H_EPS_Msk; + line_control |= ARM_UART_PL011_LCR_H_EPS_Msk; } pl011->LCR_H = line_control; - uint32_t control = UART0_CR_UARTEN_Msk; + uint32_t control = ARM_UART_PL011_CR_UARTEN_Msk; if (tx != NULL) { - control |= UART0_CR_TXE_Msk; + control |= ARM_UART_PL011_CR_TXE_Msk; } if (rx != NULL) { - control |= UART0_CR_RXE_Msk; + control |= ARM_UART_PL011_CR_RXE_Msk; } if (cts != NULL) { - control |= UART0_CR_CTSEN_Msk; + control |= ARM_UART_PL011_CR_CTSEN_Msk; } if (rts != NULL) { - control |= UART0_CR_RTSEN_Msk; + control |= ARM_UART_PL011_CR_RTSEN_Msk; } pl011->CR = control; } diff --git a/ports/broadcom/common-hal/sdioio/SDCard.c b/ports/broadcom/common-hal/sdioio/SDCard.c index 27b36041de..cf8bfb1faa 100644 --- a/ports/broadcom/common-hal/sdioio/SDCard.c +++ b/ports/broadcom/common-hal/sdioio/SDCard.c @@ -122,27 +122,27 @@ STATIC sdmmc_err_t _do_transaction(int slot, sdmmc_command_t *cmdinfo) { if (EMMC->STATUS_b.DAT_INHIBIT) { return SDMMC_ERR_BUSY; } - cmd_flags = EMMC_CMDTM_TM_BLKCNT_EN_Msk | EMMC_CMDTM_CMD_ISDATA_Msk; + cmd_flags = Arasan_EMMC_Distributor_CMDTM_TM_BLKCNT_EN_Msk | Arasan_EMMC_Distributor_CMDTM_CMD_ISDATA_Msk; if (cmdinfo->datalen > cmdinfo->blklen) { - cmd_flags |= EMMC_CMDTM_TM_MULTI_BLOCK_Msk; + cmd_flags |= Arasan_EMMC_Distributor_CMDTM_TM_MULTI_BLOCK_Msk; if ((cmdinfo->flags & SCF_AUTO_STOP) != 0) { - cmd_flags |= 1 << EMMC_CMDTM_TM_AUTO_CMD_EN_Pos; + cmd_flags |= 1 << Arasan_EMMC_Distributor_CMDTM_TM_AUTO_CMD_EN_Pos; } } if (read) { - cmd_flags |= EMMC_CMDTM_TM_DAT_DIR_Msk; + cmd_flags |= Arasan_EMMC_Distributor_CMDTM_TM_DAT_DIR_Msk; } - EMMC->BLKSIZECNT = (cmdinfo->datalen / cmdinfo->blklen) << EMMC_BLKSIZECNT_BLKCNT_Pos | - cmdinfo->blklen << EMMC_BLKSIZECNT_BLKSIZE_Pos; + EMMC->BLKSIZECNT = (cmdinfo->datalen / cmdinfo->blklen) << Arasan_EMMC_Distributor_BLKSIZECNT_BLKCNT_Pos | + cmdinfo->blklen << Arasan_EMMC_Distributor_BLKSIZECNT_BLKSIZE_Pos; } uint32_t response_type = EMMC_CMDTM_CMD_RSPNS_TYPE_RESPONSE_48BITS; uint32_t crc = 0; if ((cmdinfo->flags & SCF_RSP_CRC) != 0) { - crc |= EMMC_CMDTM_CMD_CRCCHK_EN_Msk; + crc |= Arasan_EMMC_Distributor_CMDTM_CMD_CRCCHK_EN_Msk; } if ((cmdinfo->flags & SCF_RSP_IDX) != 0) { - crc |= EMMC_CMDTM_CMD_IXCHK_EN_Msk; + crc |= Arasan_EMMC_Distributor_CMDTM_CMD_IXCHK_EN_Msk; } if ((cmdinfo->flags & SCF_RSP_136) != 0) { response_type = EMMC_CMDTM_CMD_RSPNS_TYPE_RESPONSE_136BITS; @@ -152,8 +152,8 @@ STATIC sdmmc_err_t _do_transaction(int slot, sdmmc_command_t *cmdinfo) { response_type = EMMC_CMDTM_CMD_RSPNS_TYPE_RESPONSE_NONE; } uint32_t full_cmd = cmd_flags | crc | - cmdinfo->opcode << EMMC_CMDTM_CMD_INDEX_Pos | - response_type << EMMC_CMDTM_CMD_RSPNS_TYPE_Pos; + cmdinfo->opcode << Arasan_EMMC_Distributor_CMDTM_CMD_INDEX_Pos | + response_type << Arasan_EMMC_Distributor_CMDTM_CMD_RSPNS_TYPE_Pos; EMMC->CMDTM = full_cmd; // Wait for an interrupt to indicate completion of the command. @@ -170,7 +170,7 @@ STATIC sdmmc_err_t _do_transaction(int slot, sdmmc_command_t *cmdinfo) { } return SDMMC_ERR_TIMEOUT; } else { - EMMC->INTERRUPT = EMMC_INTERRUPT_CMD_DONE_Msk; + EMMC->INTERRUPT = Arasan_EMMC_Distributor_INTERRUPT_CMD_DONE_Msk; } // Transfer the data. @@ -197,7 +197,7 @@ STATIC sdmmc_err_t _do_transaction(int slot, sdmmc_command_t *cmdinfo) { EMMC->DATA = ((uint32_t *)cmdinfo->data)[i]; } } - uint32_t data_done_mask = EMMC_INTERRUPT_ERR_Msk | EMMC_INTERRUPT_DATA_DONE_Msk; + uint32_t data_done_mask = Arasan_EMMC_Distributor_INTERRUPT_ERR_Msk | Arasan_EMMC_Distributor_INTERRUPT_DATA_DONE_Msk; start_ticks = port_get_raw_ticks(NULL); while ((EMMC->INTERRUPT & data_done_mask) == 0 && (port_get_raw_ticks(NULL) - start_ticks) < (size_t)cmdinfo->timeout_ms) { } @@ -282,7 +282,7 @@ void common_hal_sdioio_sdcard_construct(sdioio_sdcard_obj_t *self, } // Set max timeout - EMMC->CONTROL1 |= EMMC_CONTROL1_CLK_INTLEN_Msk | (0xe << EMMC_CONTROL1_DATA_TOUNIT_Pos); + EMMC->CONTROL1 |= Arasan_EMMC_Distributor_CONTROL1_CLK_INTLEN_Msk | (0xe << Arasan_EMMC_Distributor_CONTROL1_DATA_TOUNIT_Pos); EMMC->IRPT_MASK = 0xffffffff; From 60a9c7e5b2570a84c07c6c0c78f73c63322937f0 Mon Sep 17 00:00:00 2001 From: MicroDev <70126934+MicroDev1@users.noreply.github.com> Date: Thu, 23 Feb 2023 12:49:34 +0530 Subject: [PATCH 54/57] move windows workflow to build ci and more --- .github/workflows/build.yml | 69 +++++++++++++++++ .github/workflows/ports_windows.yml | 111 ---------------------------- tools/ci_changes_per_commit.py | 2 +- tools/ci_fetch_deps.py | 8 +- tools/ci_set_matrix.py | 50 +++++++++++-- 5 files changed, 118 insertions(+), 122 deletions(-) delete mode 100644 .github/workflows/ports_windows.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 453804a26a..0c8b927de8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,6 +22,7 @@ jobs: outputs: build-doc: ${{ steps.set-matrix.outputs.build-doc }} build-boards: ${{ steps.set-matrix.outputs.build-boards }} + build-windows: ${{ steps.set-matrix.outputs.build-windows }} boards-aarch: ${{ steps.set-matrix.outputs.boards-aarch }} boards-arm: ${{ steps.set-matrix.outputs.boards-arm }} boards-atmel: ${{ steps.set-matrix.outputs.boards-atmel }} @@ -218,6 +219,74 @@ jobs: [ -z "$TWINE_USERNAME" ] || echo "Uploading dev release to PyPi" [ -z "$TWINE_USERNAME" ] || twine upload circuitpython-stubs/dist/* + build-windows: + runs-on: windows-2022 + needs: scheduler + if: ${{ needs.scheduler.outputs.build-windows == 'True' }} + env: + CP_VERSION: ${{ needs.scheduler.outputs.cp-version }} + defaults: + run: + # We define a custom shell script here, although `msys2.cmd` does neither exist nor is it available in the PATH yet + shell: msys2 {0} + steps: + # We want to change the configuration of the git command that actions/checkout will be using + # (since it is not possible to set autocrlf through the action yet, see actions/checkout#226). + - run: git config --global core.autocrlf input + shell: bash + - name: Check python coding (cmd) + run: python -c "import sys, locale; print(sys.getdefaultencoding(), locale.getpreferredencoding(False))" + shell: cmd + # We use a JS Action, which calls the system terminal or other custom terminals directly, if required + - uses: msys2/setup-msys2@v2 + with: + install: base-devel git wget unzip gcc python-pip + # The goal of this was to test how things worked when the default file encoding (locale.getpreferedencoding()) + # was not UTF-8. However, msys2 python does use utf-8 as the preferred file encoding, and using actions/setup-python + # python3.8 gave a broken build, so we're not really testing what we wanted to test. + # However, commandline length limits are being tested so that does some good. + - name: Check python coding (msys2) + run: | + locale -v + which python; python --version + python -c "import sys, locale; print(sys.getdefaultencoding(), locale.getpreferredencoding(False))" + which python3; python3 --version + python3 -c "import sys, locale; print(sys.getdefaultencoding(), locale.getpreferredencoding(False))" + - name: Install dependencies + run: | + wget --no-verbose -O gcc-arm.zip https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-win32.zip + unzip -q -d /tmp gcc-arm.zip + tar -C /tmp/gcc-arm-none-* -cf - . | tar -C /usr/local -xf - + pip install wheel + # requirements_dev.txt doesn't install on windows. (with msys2 python) + # instead, pick a subset for what we want to do + pip install cascadetoml jinja2 typer click intelhex + # check that installed packages work....? + which python; python --version; python -c "import cascadetoml" + which python3; python3 --version; python3 -c "import cascadetoml" + - name: Set up repository + uses: actions/checkout@v3 + with: + submodules: false + fetch-depth: 1 + - name: Set up submodules + uses: ./.github/actions/deps/submodules + - name: build mpy-cross + run: make -j2 -C mpy-cross + - name: build rp2040 + run: make -j2 -C ports/raspberrypi BOARD=adafruit_feather_rp2040 TRANSLATION=de_DE + - name: build samd21 + run: make -j2 -C ports/atmel-samd BOARD=feather_m0_express TRANSLATION=zh_Latn_pinyin + - name: build samd51 + run: make -j2 -C ports/atmel-samd BOARD=feather_m4_express TRANSLATION=es + - name: build nrf + run: make -j2 -C ports/nrf BOARD=feather_nrf52840_express TRANSLATION=fr + - name: build stm + run: make -j2 -C ports/stm BOARD=feather_stm32f405_express TRANSLATION=pt_BR + # I gave up trying to do esp builds on windows when I saw + # ERROR: Platform MINGW64_NT-10.0-17763-x86_64 appears to be unsupported + # https://github.com/espressif/esp-idf/issues/7062 + aarch: needs: [scheduler, mpy-cross, tests] if: ${{ needs.scheduler.outputs.boards-aarch != '[]' }} diff --git a/.github/workflows/ports_windows.yml b/.github/workflows/ports_windows.yml deleted file mode 100644 index ba2042660a..0000000000 --- a/.github/workflows/ports_windows.yml +++ /dev/null @@ -1,111 +0,0 @@ -name: windows port - -on: - push: - pull_request: - paths: - - '.github/workflows/ports_windows.yml' - - 'extmod/**' - - 'lib/**' - - 'mpy-cross/**' - - 'ports/unix/**' - - 'ports/windows/**' - - 'py/**' - - 'requirements*.txt' - - 'tools/**' - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - windows: - runs-on: windows-2022 - defaults: - run: - # We define a custom shell script here, although `msys2.cmd` does neither exist nor is it available in the PATH yet - shell: msys2 {0} - steps: - - # We want to change the configuration of the git command that actions/checkout will be using (since it is not possible to set autocrlf through the action yet, see actions/checkout#226). - - run: git config --global core.autocrlf input - shell: bash - - - name: Check python coding (cmd) - run: python -c "import sys, locale; print(sys.getdefaultencoding(), locale.getpreferredencoding(False))" - shell: cmd - - # We use a JS Action, which calls the system terminal or other custom terminals directly, if required - - uses: msys2/setup-msys2@v2 - with: - update: true - install: base-devel git wget unzip gcc python-pip - - # The goal of this was to test how things worked when the default file - # encoding (locale.getpreferedencoding()) was not UTF-8. However, msys2 - # python does use utf-8 as the preferred file encoding, and using - # actions/setup-python python3.8 gave a broken build, so we're not really - # testing what we wanted to test. - # - # however, commandline length limits are being tested so that does some - # good. - - name: Check python coding (msys2) - run: | - locale -v - which python; python --version - python -c "import sys, locale; print(sys.getdefaultencoding(), locale.getpreferredencoding(False))" - which python3; python3 --version - python3 -c "import sys, locale; print(sys.getdefaultencoding(), locale.getpreferredencoding(False))" - - - name: Install dependencies - run: | - wget --no-verbose -O gcc-arm.zip https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-win32.zip - unzip -q -d /tmp gcc-arm.zip - tar -C /tmp/gcc-arm-none-* -cf - . | tar -C /usr/local -xf - - pip install wheel - # requirements_dev.txt doesn't install on windows. (with msys2 python) - # instead, pick a subset for what we want to do - pip install cascadetoml jinja2 typer click intelhex - # check that installed packages work....? - which python; python --version; python -c "import cascadetoml" - which python3; python3 --version; python3 -c "import cascadetoml" - - - name: Set up repository - uses: actions/checkout@v3 - with: - submodules: false - fetch-depth: 1 - - - name: Set up submodules - uses: ./.github/actions/deps/submodules - with: - version: true - - - name: build mpy-cross - run: make -j2 -C mpy-cross - - - name: build rp2040 - run: make -j2 -C ports/raspberrypi BOARD=adafruit_feather_rp2040 TRANSLATION=de_DE - - - name: build samd21 - run: make -j2 -C ports/atmel-samd BOARD=feather_m0_express TRANSLATION=zh_Latn_pinyin - - - name: build samd51 - run: make -j2 -C ports/atmel-samd BOARD=feather_m4_express TRANSLATION=es - - - name: build nrf - run: make -j2 -C ports/nrf BOARD=feather_nrf52840_express TRANSLATION=fr - - - name: build stm - run: make -j2 -C ports/stm BOARD=feather_stm32f405_express TRANSLATION=pt_BR - -# I gave up trying to do esp32 builds on windows when I saw -# ERROR: Platform MINGW64_NT-10.0-17763-x86_64 appears to be unsupported -# https://github.com/espressif/esp-idf/issues/7062 -# -# - name: prepare esp -# run: ports/espressif/esp-idf/install.bat -# shell: cmd -# -# - name: build esp -# run: . ports/espressif/esp-idf/export.sh && make -j2 -C ports/espressif BOARD=adafruit_metro_esp32s2 diff --git a/tools/ci_changes_per_commit.py b/tools/ci_changes_per_commit.py index 6452f241c0..d5f621d263 100644 --- a/tools/ci_changes_per_commit.py +++ b/tools/ci_changes_per_commit.py @@ -172,7 +172,7 @@ def get_bad_check_runs(query_check_runs): run_types = ["failed", "incomplete"] - regex_matrix = re.compile("^[^\n ]+ \/ (build|run) \([^\n ]+\)$") + regex_matrix = re.compile(r"^\S+ \/ (build|run) \(\S+\)$") while more_pages: check_runs = query_check_runs.fetch()["data"]["node"] diff --git a/tools/ci_fetch_deps.py b/tools/ci_fetch_deps.py index bdf2967af8..3b495f8758 100644 --- a/tools/ci_fetch_deps.py +++ b/tools/ci_fetch_deps.py @@ -80,14 +80,16 @@ def main(): submodules = ["extmod/ulab", "lib/", "tools/"] elif TARGET == "build-doc": # used in .readthedocs.yml to generate RTD - submodules = ["extmod/ulab", "frozen/"] + submodules = ["extmod/ulab"] + submodules_tags = ["frozen/"] elif TARGET == "mpy-cross" or TARGET == "mpy-cross-mac": submodules = ["tools/"] # for huffman - elif TARGET == "windows": + elif TARGET == "build-windows": # This builds one board from a number of ports so fill out a bunch of submodules submodules = ["extmod/ulab", "lib/", "tools/", "ports/", "data/nvm.toml"] elif TARGET == "website": - submodules = ["tools/adabot/", "frozen/"] + submodules = ["tools/adabot/"] + submodules_tags = ["frozen/"] elif TARGET == "pre-commit": submodules = ["extmod/ulab"] else: diff --git a/tools/ci_set_matrix.py b/tools/ci_set_matrix.py index 374e2f0c2b..43a9790160 100755 --- a/tools/ci_set_matrix.py +++ b/tools/ci_set_matrix.py @@ -62,6 +62,24 @@ IGNORE = [ # Files in these directories never influence board builds IGNORE_DIRS = ["tests", "docs", ".devcontainer"] +PATTERN_DOCS = ( + r"^(?:\.github|docs|extmod\/ulab)|" + r"^(?:(?:ports\/\w+\/bindings|shared-bindings)\S+\.c|tools\/extract_pyi\.py|conf\.py|requirements-doc\.txt)$|" + r"(?:-stubs|\.(?:md|MD|rst|RST))$" +) + +PATTERN_WINDOWS = [ + ".github/", + "extmod/", + "lib/", + "mpy-cross/", + "ports/unix/", + "ports/windows/", + "py/", + "requirements", + "tools/", +] + if len(sys.argv) > 1: print("Using files list on commandline") changed_files = sys.argv[1:] @@ -240,21 +258,19 @@ def set_docs_to_build(build_doc: bool): if last_failed_jobs.get("build-doc"): build_doc = True else: - doc_pattern = re.compile( - r"^(?:\.github\/workflows\/|docs|extmod\/ulab|(?:(?:ports\/\w+\/bindings|shared-bindings)\S+\.c|conf\.py|tools\/extract_pyi\.py|requirements-doc\.txt)$)|(?:-stubs|\.(?:md|MD|rst|RST))$" - ) + doc_pattern = re.compile(PATTERN_DOCS) github_workspace = os.environ.get("GITHUB_WORKSPACE") or "" github_workspace = github_workspace and github_workspace + "/" - for p in changed_files: - if doc_pattern.search(p) and ( + for file in changed_files: + if doc_pattern.search(file) and ( ( subprocess.run( - f"git diff -U0 $BASE_SHA...$HEAD_SHA {github_workspace + p} | grep -o -m 1 '^[+-]\/\/|'", + f"git diff -U0 $BASE_SHA...$HEAD_SHA {github_workspace + file} | grep -o -m 1 '^[+-]\/\/|'", capture_output=True, shell=True, ).stdout ) - if p.endswith(".c") + if file.endswith(".c") else True ): build_doc = True @@ -265,6 +281,25 @@ def set_docs_to_build(build_doc: bool): set_output("build-doc", build_doc) +def set_windows_to_build(build_windows): + if not build_windows: + if last_failed_jobs.get("build-windows"): + build_windows = True + else: + for file in changed_files: + for pattern in PATTERN_WINDOWS: + if file.startswith(pattern): + build_windows = True + break + else: + continue + break + + # Set the step outputs + print("Building windows:", build_windows) + set_output("build-windows", build_windows) + + def check_changed_files(): if not changed_files: print("Building all docs/boards") @@ -277,6 +312,7 @@ def check_changed_files(): def main(): build_all = check_changed_files() set_docs_to_build(build_all) + set_windows_to_build(build_all) set_boards_to_build(build_all) From 8322caa1785b078732cda0c7920a0c4654295b1a Mon Sep 17 00:00:00 2001 From: Luis Ruiz San Segundo Date: Thu, 23 Feb 2023 07:23:23 +0000 Subject: [PATCH 55/57] Translated using Weblate (Spanish) Currently translated at 99.9% (999 of 1000 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 98 +++++++++++++++++++++++++++------------------------- 1 file changed, 51 insertions(+), 47 deletions(-) diff --git a/locale/es.po b/locale/es.po index 1219be52f8..4cab30cf90 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2023-02-22 18:34+0000\n" -"Last-Translator: Jose David M \n" +"PO-Revision-Date: 2023-02-23 17:53+0000\n" +"Last-Translator: Luis Ruiz San Segundo \n" "Language-Team: \n" "Language: es\n" "MIME-Version: 1.0\n" @@ -35,12 +35,17 @@ msgstr "" "Código detenido por la auto-recarga. Recargando pronto.\n" #: main.c +#, fuzzy msgid "" "\n" "Invalid CIRCUITPY_PYSTACK_SIZE\n" "\n" "\r" msgstr "" +"\n" +"CIRCUITPY_PYSTACK_SIZE no válido\n" +"\n" +"\n" #: supervisor/shared/safe_mode.c msgid "" @@ -58,7 +63,7 @@ msgid "" "Press reset to exit safe mode.\n" msgstr "" "\n" -"Presione reset para salir de safe mode.\n" +"Presione reset para salir del modo seguro.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -66,7 +71,7 @@ msgid "" "You are in safe mode because:\n" msgstr "" "\n" -"Estas in safe mode porque:\n" +"Estas en modo seguro porque:\n" #: py/obj.c msgid " File \"%q\"" @@ -153,7 +158,7 @@ msgstr "%q está siendo utilizado" #: py/objstr.c py/objstrunicode.c msgid "%q index out of range" -msgstr "%q indice fuera de rango" +msgstr "%q índice fuera de rango" #: shared-module/bitbangio/SPI.c msgid "%q init failed" @@ -169,19 +174,19 @@ msgstr "%q es solamente de lectura en esta tarjeta" #: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" -msgstr "%q tamaño debe ser %d" +msgstr "%q longitud debe ser %d" #: py/argcheck.c msgid "%q length must be %d-%d" -msgstr "%q tamaño debe ser %d-%d" +msgstr "%q longitud debe ser %d-%d" #: py/argcheck.c msgid "%q length must be <= %d" -msgstr "%q tamaño debe ser <= %d" +msgstr "%q longitud debe ser <= %d" #: py/argcheck.c msgid "%q length must be >= %d" -msgstr "%q tamaño debe ser >= %d" +msgstr "%q longitud debe ser >= %d" #: py/argcheck.c msgid "%q must be %d" @@ -205,7 +210,7 @@ msgstr "%q debe ser >= %d" #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" -msgstr "%q debe ser un byte-matriz o matriz de tipo 'H' o 'B'" +msgstr "%q debe ser un bytearray o array de tipo 'H' o 'B'" #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" @@ -251,7 +256,7 @@ msgstr "%q() toma %d argumentos posicionales pero %d fueron dados" #: shared-bindings/usb_hid/Device.c msgid "%q, %q, and %q must all be the same length" -msgstr "%q, %q, y %q deben tener el mismo largo" +msgstr "%q, %q, y %q deben tener la misma longitud" #: py/objint.c shared-bindings/storage/__init__.c msgid "%q=%q" @@ -357,7 +362,7 @@ msgstr "'=' alineación no permitida en el especificador string format" #: shared-module/struct/__init__.c msgid "'S' and 'O' are not supported format types" -msgstr "'S' y 'O' no son compatibles con los tipos de formato" +msgstr "'S' y 'O' no son tipos de formato soportados" #: py/compile.c msgid "'align' requires 1 argument" @@ -431,7 +436,7 @@ msgstr "tipos de 64 bit" #: 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 "El canal EXTINT ya está siendo utilizado" +msgstr "Un canal de interrupción por hardware ya está en uso" #: ports/espressif/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" @@ -440,7 +445,7 @@ msgstr "ADC2 está siendo usado por WiFi" #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" -msgstr "La dirección debe tener %d bytes de largo" +msgstr "La dirección debe tener %d bytes de longitud" #: ports/espressif/common-hal/memorymap/AddressRange.c msgid "Address range not allowed" @@ -454,7 +459,7 @@ msgstr "Todos los periféricos CAN están en uso" #: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" -msgstr "Todos los periféricos I2C están siendo usados" +msgstr "Todos los periféricos I2C están en uso" #: ports/espressif/common-hal/countio/Counter.c #: ports/espressif/common-hal/frequencyio/FrequencyIn.c @@ -470,36 +475,36 @@ msgstr "Todos los FIFOs de RX en uso" #: ports/espressif/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" -msgstr "Todos los periféricos SPI están siendo usados" +msgstr "Todos los periféricos SPI están en uso" #: ports/espressif/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "All UART peripherals are in use" -msgstr "Todos los periféricos UART están siendo usados" +msgstr "Todos los periféricos UART están en uso" #: 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 "Todos los canales esta en uso" +msgstr "Todos los canales están en uso" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "All event channels in use" -msgstr "Todos los canales de eventos estan siendo usados" +msgstr "Todos los canales de eventos están en uso" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "All state machines in use" -msgstr "Todas las máquinas de estado en uso" +msgstr "Todas las máquinas de estado están en uso" #: ports/atmel-samd/audio_dma.c msgid "All sync event channels in use" msgstr "" "Todos los canales de eventos de sincronización (sync event channels) están " -"siendo utilizados" +"en uso" #: shared-bindings/pwmio/PWMOut.c msgid "All timers for this pin are in use" -msgstr "Todos los timers para este pin están siendo utilizados" +msgstr "Todos los timers para este pin están en uso" #: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -568,7 +573,7 @@ msgstr "Tratando de localizar %d bloques" #: ports/raspberrypi/audio_dma.c msgid "Audio conversion not implemented" -msgstr "Conversión de audio no esta implementada" +msgstr "Conversión de audio no está implementada" #: shared-bindings/wifi/Radio.c msgid "AuthMode.OPEN is not used with password" @@ -587,12 +592,12 @@ msgid "" "Auto-reload is on. Simply save files over USB to run them or enter REPL to " "disable.\n" msgstr "" -"Auto-reload habilitado. Simplemente guarda los archivos via USB para " -"ejecutarlos o entra al REPL para desabilitarlos.\n" +"Auto-reload habilitado. Simplemente guarda los archivos vía USB para " +"ejecutarlos o entra al REPL para deshabilitarlo.\n" #: ports/espressif/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" -msgstr "El periférico no maneja el Baudrate" +msgstr "Baudrate no soportado por el periférico" #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c @@ -613,7 +618,7 @@ msgstr "Bits depth debe ser múltiplo de 8." #: shared-bindings/bitmaptools/__init__.c msgid "Bitmap size and bits per value must match" -msgstr "El tamaño del mapa de bits y los bits por valor deben cotejar" +msgstr "El tamaño del mapa de bits y los bits por valor deben coincidir" #: supervisor/shared/safe_mode.c msgid "Boot device must be first (interface #0)." @@ -642,44 +647,43 @@ msgstr "El brillo no se puede ajustar" #: shared-bindings/_bleio/UUID.c #, c-format msgid "Buffer + offset too small %d %d %d" -msgstr "Búfer + compensado muy pequeños %d %d %d" +msgstr "Buffer + offset muy pequeños %d %d %d" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c 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" +msgstr "Los elementos del buffer deben tener una longitud de 4 bytes o menos" #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." -msgstr "Búfer no es un bytearray." +msgstr "Buffer no es un bytearray." #: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" -msgstr "Búfer es muy pequeño" +msgstr "Buffer es muy pequeño" #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" -msgstr "Longitud del búfer %d es demasiado grande. Tiene que ser menor a %d" +msgstr "La longitud del buffer %d es demasiado grande. Tiene que ser menor a %d" #: ports/atmel-samd/common-hal/sdioio/SDCard.c #: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" -msgstr "El tamaño del búfer debe ser múltiplo de 512" +msgstr "El tamaño del buffer debe ser múltiplo de 512" #: ports/stm/common-hal/sdioio/SDCard.c shared-bindings/floppyio/__init__.c msgid "Buffer must be a multiple of 512 bytes" -msgstr "Búfer deber ser un múltiplo de 512 bytes" +msgstr "El buffer deber ser un múltiplo de 512 bytes" #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" -msgstr "Búfer muy corto por %d bytes" +msgstr "Buffer muy corto por %d bytes" #: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c msgid "Buffers must be same size" -msgstr "Búferes deben ser del mismo tamaño" +msgstr "Los buffers deben ser del mismo tamaño" #: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c @@ -766,7 +770,7 @@ msgstr "" #: 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." +msgstr "No puede hacer pull en un pin de solo entrada." #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" @@ -1852,7 +1856,7 @@ msgstr "" #: main.c msgid "Pretending to deep sleep until alarm, CTRL-C or file write.\n" msgstr "" -"Pretendiendo ir a deep sleep hasta la alarma, CTRL-C or una escritura de " +"Pretendiendo ir a deep sleep hasta la alarma, CTRL-C o una escritura de " "archivo\n" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c @@ -2469,11 +2473,11 @@ msgstr "Usted presionó ambos botones al iniciar." #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h #: ports/espressif/boards/m5stack_stick_c/mpconfigboard.h msgid "You pressed button A at start up." -msgstr "Usted presionó el boton A al iniciar." +msgstr "Usted presionó el botón A al iniciar." #: supervisor/shared/safe_mode.c msgid "You pressed the BOOT button at start up" -msgstr "Usted presionó el boton BOOT al iniciar" +msgstr "Usted presionó el botón BOOT al iniciar" #: ports/espressif/boards/adafruit_huzzah32_breakout/mpconfigboard.h msgid "You pressed the GPIO0 button at start up." @@ -2481,30 +2485,30 @@ msgstr "Presionaste el botón GPIO0 al inicio." #: ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.h msgid "You pressed the Rec button at start up." -msgstr "" +msgstr "Presionó el botón Rec al inicio." #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "You pressed the SW38 button at start up." -msgstr "Usted presionó el boton SW38 al iniciar." +msgstr "Usted presionó el botón SW38 al iniciar." #: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h msgid "You pressed the VOLUME button at start up." -msgstr "Usted presionó el boton de Volumén al iniciar." +msgstr "Usted presionó el botón de volumen al iniciar." #: ports/espressif/boards/m5stack_atom_echo/mpconfigboard.h #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h #: ports/espressif/boards/m5stack_atom_matrix/mpconfigboard.h #: ports/espressif/boards/m5stack_atom_u/mpconfigboard.h msgid "You pressed the central button at start up." -msgstr "Usted presionó el boton central al iniciar." +msgstr "Usted presionó el botón central al iniciar." #: ports/nrf/boards/aramcon2_badge/mpconfigboard.h msgid "You pressed the left button at start up." -msgstr "Usted presionó el boton izquierdo al iniciar." +msgstr "Usted presionó el botón izquierdo al iniciar." #: supervisor/shared/safe_mode.c msgid "You pressed the reset button during boot." -msgstr "Usted presionó el boton izquierdo al iniciar." +msgstr "Presionó el botón de reinicio durante el arranque." #: supervisor/shared/micropython.c msgid "[truncated due to length]" From 2f78fff1a689e29dc9f9d1b7d11c7b2e5f2729fc Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Wed, 22 Feb 2023 20:05:14 +0000 Subject: [PATCH 56/57] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (1000 of 1000 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index cdb69ec484..1464311003 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: 2023-02-22 18:34+0000\n" +"PO-Revision-Date: 2023-02-23 17:53+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -39,6 +39,10 @@ msgid "" "\n" "\r" msgstr "" +"\n" +"CIRCUITPY_PYSTACK_SIZE inválido\n" +"\n" +"\n" #: supervisor/shared/safe_mode.c msgid "" @@ -2478,7 +2482,7 @@ msgstr "Você pressionou o botão GPIO0 durante a inicialização." #: ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.h msgid "You pressed the Rec button at start up." -msgstr "" +msgstr "Você pressionou o botão Rec durante a inicialização." #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "You pressed the SW38 button at start up." From d4f4da279e4484c2cd121e413750a02bd0cfc5d3 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Wed, 22 Feb 2023 18:38:24 +0000 Subject: [PATCH 57/57] Translated using Weblate (Swedish) Currently translated at 100.0% (1000 of 1000 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index c4b3a36166..d6642c8a93 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: 2023-02-22 18:34+0000\n" +"PO-Revision-Date: 2023-02-23 17:53+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -39,6 +39,10 @@ msgid "" "\n" "\r" msgstr "" +"\n" +"Ogiltig CIRCUITPY_PYSTACK_SIZE\n" +"\n" +"\n" #: supervisor/shared/safe_mode.c msgid "" @@ -2451,7 +2455,7 @@ msgstr "Du tryckte på GPIO0-knappen vid start." #: ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.h msgid "You pressed the Rec button at start up." -msgstr "" +msgstr "Du tryckte ned Rec-knappen vid start." #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "You pressed the SW38 button at start up."