summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/esp32/mpconfigport.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/ports/esp32/mpconfigport.h b/ports/esp32/mpconfigport.h
index e36d12bc0..bf1f5a186 100644
--- a/ports/esp32/mpconfigport.h
+++ b/ports/esp32/mpconfigport.h
@@ -292,12 +292,17 @@ void *esp_native_code_commit(void *, size_t, void *);
MP_THREAD_GIL_ENTER(); \
} while (0);
#else
+#if CONFIG_IDF_TARGET_ARCH_RISCV
+#define MICROPY_PY_WAIT_FOR_INTERRUPT asm volatile ("wfi\n")
+#else
+#define MICROPY_PY_WAIT_FOR_INTERRUPT asm volatile ("waiti 0\n")
+#endif
#define MICROPY_EVENT_POLL_HOOK \
do { \
extern void mp_handle_pending(bool); \
mp_handle_pending(true); \
MICROPY_PY_SOCKET_EVENTS_HANDLER \
- asm ("waiti 0"); \
+ MICROPY_PY_WAIT_FOR_INTERRUPT; \
} while (0);
#endif