diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c index a5c491ee7d..f888152af1 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c +++ b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c @@ -119,8 +119,3 @@ void claim_pin(const mcu_pin_obj_t *pin) { void common_hal_mcu_pin_reset_number(uint8_t pin_no) { common_hal_reset_pin((mcu_pin_obj_t *)(mcu_pin_globals.map.table[pin_no].value)); } - -// The 'data' pointers may be to gc objects, they must be kept alive. -void pin_gc_collect() { - gc_collect_root((void **)&pcid, sizeof(pcid) / sizeof(void *)); -} diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.c index 1f2d5321e9..d052711033 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.c @@ -1,5 +1,10 @@ #include "peripherals/mimxrt10xx/pins.h" +typedef struct { + gpio_change_interrupt_t *func; + void *data; +} pin_change_interrupt_data; + /* Array of GPIO peripheral base address. */ static GPIO_Type *const s_gpioBases[] = GPIO_BASE_PTRS; static uint32_t GPIO_GetInstance(GPIO_Type *base) { @@ -23,7 +28,7 @@ static uint32_t GPIO_GetInstance(GPIO_Type *base) { static const IRQn_Type low_irqs[] = GPIO_COMBINED_LOW_IRQS; static const IRQn_Type high_irqs[] = GPIO_COMBINED_HIGH_IRQS; -volatile pin_change_interrupt_data pcid[MP_ARRAY_SIZE(s_gpioBases)][32]; +static volatile pin_change_interrupt_data pcid[MP_ARRAY_SIZE(s_gpioBases)][32]; void enable_pin_change_interrupt(const mcu_pin_obj_t *pin, gpio_change_interrupt_t func, void *data) { int instance = GPIO_GetInstance(pin->gpio); diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.h index 76a8d03e08..0457a09a1a 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.h @@ -73,12 +73,6 @@ typedef struct { } typedef void (gpio_change_interrupt_t)(void *data); -typedef struct { - gpio_change_interrupt_t *func; - void *data; -} pin_change_interrupt_data; -extern volatile pin_change_interrupt_data pcid[MP_ARRAY_SIZE((GPIO_Type *const[])GPIO_BASE_PTRS)][32]; - void disable_pin_change_interrupt(const mcu_pin_obj_t *pin); void enable_pin_change_interrupt(const mcu_pin_obj_t *pin, gpio_change_interrupt_t func, void *data); diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index 1e46159829..55bf72352d 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -555,10 +555,6 @@ void port_idle_until_interrupt(void) { common_hal_mcu_enable_interrupts(); } -void port_gc_collect(void) { - pin_gc_collect(); -} - // Catch faults where the memory access violates MPU settings. void MemManage_Handler(void); __attribute__((used)) void PLACE_IN_ITCM(MemManage_Handler)(void) {