Skip to content

Commit 6007f3e

Browse files
agattidpgeorge
authored andcommitted
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 <[email protected]>
1 parent 4a134d2 commit 6007f3e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ports/esp32/mpconfigport.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818

1919
// object representation and NLR handling
2020
#define MICROPY_OBJ_REPR (MICROPY_OBJ_REPR_A)
21+
#if !CONFIG_IDF_TARGET_ESP32C3
2122
#define MICROPY_NLR_SETJMP (1)
22-
#if CONFIG_IDF_TARGET_ESP32C3
23-
#define MICROPY_GCREGS_SETJMP (1)
2423
#endif
2524

2625
// memory allocation policies
@@ -44,6 +43,8 @@
4443
#define MICROPY_PERSISTENT_CODE_LOAD (1)
4544
#if !CONFIG_IDF_TARGET_ESP32C3
4645
#define MICROPY_EMIT_XTENSAWIN (1)
46+
#else
47+
#define MICROPY_EMIT_RV32 (1)
4748
#endif
4849

4950
// workaround for xtensa-esp32-elf-gcc esp-2020r3, which can generate wrong code for loops

0 commit comments

Comments
 (0)