diff options
| author | Damien George <damien.p.george@gmail.com> | 2020-02-07 12:11:22 +1100 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2020-02-07 16:08:31 +1100 |
| commit | f4641b2378121470747f52bd1eab9219ac933506 (patch) | |
| tree | fd43d2f0fe4132e006653e054603d53bd940cf90 /ports/esp32/uart.c | |
| parent | 8d0421c3cf25e3faae03c936f889a31fd02c3ce7 (diff) | |
esp32/uart: Use core-provided mp_keyboard_interrupt, placed in IRAM.
Diffstat (limited to 'ports/esp32/uart.c')
| -rw-r--r-- | ports/esp32/uart.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/ports/esp32/uart.c b/ports/esp32/uart.c index 10a4ba462..381be7f4f 100644 --- a/ports/esp32/uart.c +++ b/ports/esp32/uart.c @@ -30,7 +30,7 @@ #include "driver/uart.h" -#include "py/mpstate.h" +#include "py/runtime.h" #include "py/mphal.h" STATIC void uart_irq_handler(void *arg); @@ -50,13 +50,7 @@ STATIC void IRAM_ATTR uart_irq_handler(void *arg) { while (uart->status.rxfifo_cnt) { uint8_t c = uart->fifo.rw_byte; if (c == mp_interrupt_char) { - // inline version of mp_keyboard_interrupt(); - MP_STATE_VM(mp_pending_exception) = MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)); - #if MICROPY_ENABLE_SCHEDULER - if (MP_STATE_VM(sched_state) == MP_SCHED_IDLE) { - MP_STATE_VM(sched_state) = MP_SCHED_PENDING; - } - #endif + mp_keyboard_interrupt(); } else { // this is an inline function so will be in IRAM ringbuf_put(&stdin_ringbuf, c); |
