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 <damien@micropython.org>
This commit is contained in:
Damien George 2023-11-27 11:51:36 +11:00
parent f523b86541
commit 4bf7987f0a
3 changed files with 1 additions and 7 deletions

View File

@ -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))

View File

@ -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;

View File

@ -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"