Allow enabling async on samd21

It was just disabled, possibly because of size considerations, but it's
useful to be able to enable it explicitly for selected boards.

This requires some of the settings to use ?= instead of =, and fixing
a bug in the traceback module, where the chain variable is unused if
exception chaining is not enabled.
This commit is contained in:
Radomir Dopieralski 2023-08-27 19:28:44 +02:00
parent acc4ee9c39
commit 55fbbdcb52
2 changed files with 4 additions and 3 deletions

View File

@ -48,7 +48,7 @@ CIRCUITPY_RE ?= 0
CIRCUITPY_SDCARDIO ?= 0
CIRCUITPY_SYNTHIO ?= 0
CIRCUITPY_TOUCHIO_USE_NATIVE ?= 1
CIRCUITPY_TRACEBACK = 0
CIRCUITPY_TRACEBACK ?= 0
CIRCUITPY_ULAB = 0
CIRCUITPY_VECTORIO = 0
CIRCUITPY_ZLIB = 0
@ -61,7 +61,7 @@ CIRCUITPY_SAFEMODE_PY ?= 0
CIRCUITPY_USB_IDENTIFICATION ?= 0
endif
MICROPY_PY_ASYNC_AWAIT = 0
MICROPY_PY_ASYNC_AWAIT ?= 0
# We don't have room for the fonts for terminalio for certain languages,
# so turn off terminalio, and if it's off and displayio is on,

View File

@ -59,7 +59,6 @@ STATIC void traceback_exception_common(bool is_print_exception, mp_print_t *prin
}
mp_obj_t tb_obj = args[ARG_tb].u_obj;
mp_obj_t limit_obj = args[ARG_limit].u_obj;
bool chain = args[ARG_chain].u_bool;
if (args[ARG_file].u_obj != mp_const_none) {
if (!is_print_exception) {
@ -93,6 +92,8 @@ STATIC void traceback_exception_common(bool is_print_exception, mp_print_t *prin
mp_obj_exception_t *exc = mp_obj_exception_get_native(value);
mp_obj_traceback_t *trace_backup = exc->traceback;
#if MICROPY_CPYTHON_EXCEPTION_CHAIN
bool chain = args[ARG_chain].u_bool;
mp_obj_exception_t *context_backup = exc->context;
mp_obj_exception_t *cause_backup = exc->cause;