Skip to content

Commit e8a724c

Browse files
committed
esp32: Convert to use core-provided KeyboardInterrupt exception.
1 parent 63d2c44 commit e8a724c

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

esp32/main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ void mp_task(void *pvParameter) {
6464
mp_stack_set_limit(MP_TASK_STACK_SIZE - 512);
6565
gc_init(mp_task_heap, mp_task_heap + sizeof(mp_task_heap));
6666
mp_init();
67-
MP_STATE_PORT(mp_kbd_exception) = mp_obj_new_exception(&mp_type_KeyboardInterrupt);
6867
mp_obj_list_init(mp_sys_path, 0);
6968
mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR_));
7069
mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR__slash_flash_slash_lib));

esp32/mpconfigport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#define MICROPY_ENABLE_FINALISER (1)
3030
#define MICROPY_STACK_CHECK (1)
3131
#define MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF (1)
32+
#define MICROPY_KBD_EXCEPTION (1)
3233
#define MICROPY_HELPER_REPL (1)
3334
#define MICROPY_REPL_EMACS_KEYS (1)
3435
#define MICROPY_REPL_AUTO_INDENT (1)
@@ -190,7 +191,6 @@ extern const struct _mp_obj_module_t mp_module_network;
190191

191192
#define MICROPY_PORT_ROOT_POINTERS \
192193
const char *readline_hist[8]; \
193-
mp_obj_t mp_kbd_exception; \
194194
mp_obj_t machine_pin_irq_handler[40]; \
195195

196196
// type definitions for the specific machine

esp32/uart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ STATIC void IRAM_ATTR uart_irq_handler(void *arg) {
5151
uint8_t c = uart->fifo.rw_byte;
5252
if (c == mp_interrupt_char) {
5353
// inline version of mp_keyboard_interrupt();
54-
MP_STATE_VM(mp_pending_exception) = MP_STATE_PORT(mp_kbd_exception);
54+
MP_STATE_VM(mp_pending_exception) = MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception));
5555
#if MICROPY_ENABLE_SCHEDULER
5656
if (MP_STATE_VM(sched_state) == MP_SCHED_IDLE) {
5757
MP_STATE_VM(sched_state) = MP_SCHED_PENDING;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy