diff --git a/ports/litex/boards/fomu/fomu-spi.ld b/ports/litex/boards/fomu/fomu-spi.ld index 9b6443c673..e7db25b0c5 100644 --- a/ports/litex/boards/fomu/fomu-spi.ld +++ b/ports/litex/boards/fomu/fomu-spi.ld @@ -51,6 +51,11 @@ SECTIONS *(.text.tu_edpt_dir) *(.text.tu_fifo_empty) *(.text.usbd_edpt_busy) + *(.text.usb_irq_handler) + *(.text.supervisor_tick) + *(.text.port_get_raw_ticks) + *(.text.__modsi3) + *(.text.__udivsi3) *(.text.irq_getmask) *(.text.irq_setmask) *(.text.irq_pending) diff --git a/ports/litex/common-hal/microcontroller/__init__.c b/ports/litex/common-hal/microcontroller/__init__.c index 3c91661144..522a41e2e3 100644 --- a/ports/litex/common-hal/microcontroller/__init__.c +++ b/ports/litex/common-hal/microcontroller/__init__.c @@ -59,12 +59,15 @@ void common_hal_mcu_delay_us(uint32_t delay) { volatile uint32_t nesting_count = 0; +__attribute__((section(".ramtext"))) void common_hal_mcu_disable_interrupts(void) { - irq_setie(0); - // __DMB(); + if (nesting_count == 0) { + irq_setie(0); + } nesting_count++; } +__attribute__((section(".ramtext"))) void common_hal_mcu_enable_interrupts(void) { if (nesting_count == 0) { // This is very very bad because it means there was mismatched disable/enables so we