From 4bf7987f0abfde47b0bac4e2e8546979802ba3c6 Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 27 Nov 2023 11:51:36 +1100 Subject: [PATCH] cc3200/mods/modmachine: Use common implementation of disable/enable_irq. This commit changes the cc3200 port to use the common machine implementation of machine.disable_irq() and machine.enable_irq(). This eliminates its dependency on the stm32 port's code. The behaviour of cc3200 for these functions is changed: - disable_irq() now returns an (opaque) integer rather than a bool - enable_irq(state) must be passed and argument, which is the return value of disable_irq() rather than a bool Signed-off-by: Damien George --- ports/cc3200/application.mk | 1 - ports/cc3200/mods/modmachine.c | 6 ------ ports/cc3200/mpconfigport.h | 1 + 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/ports/cc3200/application.mk b/ports/cc3200/application.mk index 9fc58553cd..4a6828ea86 100644 --- a/ports/cc3200/application.mk +++ b/ports/cc3200/application.mk @@ -153,7 +153,6 @@ APP_SHARED_SRC_C = $(addprefix shared/,\ APP_STM_SRC_C = $(addprefix ports/stm32/,\ bufhelper.c \ - irq.c \ ) OBJ = $(PY_O) $(addprefix $(BUILD)/, $(APP_FATFS_SRC_C:.c=.o) $(APP_RTOS_SRC_C:.c=.o) $(APP_FTP_SRC_C:.c=.o) $(APP_HAL_SRC_C:.c=.o) $(APP_MISC_SRC_C:.c=.o)) diff --git a/ports/cc3200/mods/modmachine.c b/ports/cc3200/mods/modmachine.c index 5eb7e2ef15..6e50553365 100644 --- a/ports/cc3200/mods/modmachine.c +++ b/ports/cc3200/mods/modmachine.c @@ -62,9 +62,6 @@ { MP_ROM_QSTR(MP_QSTR_sleep), MP_ROM_PTR(&machine_lightsleep_obj) }, \ { MP_ROM_QSTR(MP_QSTR_wake_reason), MP_ROM_PTR(&machine_wake_reason_obj) }, \ \ - { MP_ROM_QSTR(MP_QSTR_disable_irq), MP_ROM_PTR(&machine_disable_irq_obj) }, \ - { MP_ROM_QSTR(MP_QSTR_enable_irq), MP_ROM_PTR(&machine_enable_irq_obj) }, \ - \ { MP_ROM_QSTR(MP_QSTR_RTC), MP_ROM_PTR(&pyb_rtc_type) }, \ { MP_ROM_QSTR(MP_QSTR_Pin), MP_ROM_PTR(&pin_type) }, \ { MP_ROM_QSTR(MP_QSTR_ADC), MP_ROM_PTR(&pyb_adc_type) }, \ @@ -93,9 +90,6 @@ extern OsiTaskHandle svTaskHandle; extern OsiTaskHandle xSimpleLinkSpawnTaskHndl; #endif -MP_DECLARE_CONST_FUN_OBJ_0(machine_disable_irq_obj); -MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(machine_enable_irq_obj); - /******************************************************************************/ // MicroPython bindings; diff --git a/ports/cc3200/mpconfigport.h b/ports/cc3200/mpconfigport.h index 7c52732459..64098c3fc0 100644 --- a/ports/cc3200/mpconfigport.h +++ b/ports/cc3200/mpconfigport.h @@ -123,6 +123,7 @@ #define MICROPY_PY_MACHINE (1) #define MICROPY_PY_MACHINE_INCLUDEFILE "ports/cc3200/mods/modmachine.c" #define MICROPY_PY_MACHINE_BARE_METAL_FUNCS (1) +#define MICROPY_PY_MACHINE_DISABLE_IRQ_ENABLE_IRQ (1) #define MICROPY_PY_MACHINE_WDT (1) #define MICROPY_PY_MACHINE_WDT_INCLUDEFILE "ports/cc3200/mods/machine_wdt.c"