summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Gatti <a.gatti@frob.it>2024-07-02 22:49:47 +0200
committerDamien George <damien@micropython.org>2024-07-26 12:13:03 +1000
commit6007f3e2062cc65fc8416f241c682e37eb956c11 (patch)
tree137a78e460cfca91291c106ed2f91b1db95149d4
parent4a134d212e74fa6da7cc2d91ec4026e6f5218f0e (diff)
esp32/mpconfigport: Enable the RV32 emitter for ESP32C3 targets.
The RV32 code emitter assumed that the arch-specific NLR was used instead of the setjmp/longjmp based NLR code. If the latter NLR provider was chosen, the emitter would allocate space on the stack for the NLR buffer but would not fill it in. This change turns off setjmp()-based NLR and GCREGS for the ESP32C3 target, in favour of more platform-tailored alternatives. As setjmp() NLR is now disabled by default, the RV32 emitter can be safely enabled by default as well for the target in question. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
-rw-r--r--ports/esp32/mpconfigport.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/ports/esp32/mpconfigport.h b/ports/esp32/mpconfigport.h
index 558fa6b8c..b9e53a4fa 100644
--- a/ports/esp32/mpconfigport.h
+++ b/ports/esp32/mpconfigport.h
@@ -18,9 +18,8 @@
// object representation and NLR handling
#define MICROPY_OBJ_REPR (MICROPY_OBJ_REPR_A)
+#if !CONFIG_IDF_TARGET_ESP32C3
#define MICROPY_NLR_SETJMP (1)
-#if CONFIG_IDF_TARGET_ESP32C3
-#define MICROPY_GCREGS_SETJMP (1)
#endif
// memory allocation policies
@@ -44,6 +43,8 @@
#define MICROPY_PERSISTENT_CODE_LOAD (1)
#if !CONFIG_IDF_TARGET_ESP32C3
#define MICROPY_EMIT_XTENSAWIN (1)
+#else
+#define MICROPY_EMIT_RV32 (1)
#endif
// workaround for xtensa-esp32-elf-gcc esp-2020r3, which can generate wrong code for loops