From e7ab4752766100a022d8fab4b947675a440b11b6 Mon Sep 17 00:00:00 2001 From: Damien George Date: Sun, 27 Jan 2019 16:15:47 +1100 Subject: [PATCH] esp32: Don't put py/scheduler.o in iRAM, it's no longer needed. ISR's no longer need to be in iRAM, and the ESP IDF provides an option to specify that they are in iRAM if an application needs lower latency when handling them. But we don't use this feature for user interrupts: both timer and gpio ISR routines are registered without the ESP_INTR_FLAG_IRAM option, and so the scheduling code no longer needs to be in iRAM. --- ports/esp32/esp32.custom_common.ld | 1 - ports/esp32/machine_pin.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ports/esp32/esp32.custom_common.ld b/ports/esp32/esp32.custom_common.ld index 9762c0d29d..d28d5e26c6 100644 --- a/ports/esp32/esp32.custom_common.ld +++ b/ports/esp32/esp32.custom_common.ld @@ -108,7 +108,6 @@ SECTIONS *spi_flash/spi_flash_rom_patch.o(.literal .text .literal.* .text.*) *libgcov.a:(.literal .text .literal.* .text.*) INCLUDE esp32.spiram.rom-functions-iram.ld - *py/scheduler.o*(.literal .text .literal.* .text.*) _iram_text_end = ABSOLUTE(.); _iram_end = ABSOLUTE(.); } > iram0_0_seg diff --git a/ports/esp32/machine_pin.c b/ports/esp32/machine_pin.c index 1f4226474b..a899fa62ad 100644 --- a/ports/esp32/machine_pin.c +++ b/ports/esp32/machine_pin.c @@ -112,7 +112,7 @@ void machine_pins_deinit(void) { } } -STATIC void IRAM_ATTR machine_pin_isr_handler(void *arg) { +STATIC void machine_pin_isr_handler(void *arg) { machine_pin_obj_t *self = arg; mp_obj_t handler = MP_STATE_PORT(machine_pin_irq_handler)[self->id]; mp_sched_schedule(handler, MP_OBJ_FROM_PTR(self));