diff options
| author | Meir Armon <meirarmon@gmail.com> | 2025-05-30 17:22:53 +0300 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2025-06-16 14:18:02 +1000 |
| commit | 171d751242ba7c9fd32b86852a1383bc23c6fda1 (patch) | |
| tree | a894720a287650f609d3cfb3c982cc4974b8332b /ports/esp32/modesp32.c | |
| parent | 4697a06fdb9d2639975e049463c2a3d776238aec (diff) | |
esp32/modesp32: Make wake_on_ext1 available only on SoCs supporting it.
The `esp32.wake_on_ext1()` method should only be available on boards that
have SOC_PM_SUPPORT_EXT1_WAKEUP=y. And update docs to reflect this.
Signed-off-by: Meir Armon <meirarmon@gmail.com>
Diffstat (limited to 'ports/esp32/modesp32.c')
| -rw-r--r-- | ports/esp32/modesp32.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ports/esp32/modesp32.c b/ports/esp32/modesp32.c index 4a42ebef9..26a39d445 100644 --- a/ports/esp32/modesp32.c +++ b/ports/esp32/modesp32.c @@ -97,6 +97,7 @@ static mp_obj_t esp32_wake_on_ext0(size_t n_args, const mp_obj_t *pos_args, mp_m static MP_DEFINE_CONST_FUN_OBJ_KW(esp32_wake_on_ext0_obj, 0, esp32_wake_on_ext0); #endif +#if SOC_PM_SUPPORT_EXT1_WAKEUP static mp_obj_t esp32_wake_on_ext1(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum {ARG_pins, ARG_level}; const mp_arg_t allowed_args[] = { @@ -132,6 +133,7 @@ static mp_obj_t esp32_wake_on_ext1(size_t n_args, const mp_obj_t *pos_args, mp_m return mp_const_none; } static MP_DEFINE_CONST_FUN_OBJ_KW(esp32_wake_on_ext1_obj, 0, esp32_wake_on_ext1); +#endif #if SOC_ULP_SUPPORTED static mp_obj_t esp32_wake_on_ulp(const mp_obj_t wake) { @@ -272,7 +274,9 @@ static const mp_rom_map_elem_t esp32_module_globals_table[] = { #if SOC_PM_SUPPORT_EXT0_WAKEUP { MP_ROM_QSTR(MP_QSTR_wake_on_ext0), MP_ROM_PTR(&esp32_wake_on_ext0_obj) }, #endif + #if SOC_PM_SUPPORT_EXT1_WAKEUP { MP_ROM_QSTR(MP_QSTR_wake_on_ext1), MP_ROM_PTR(&esp32_wake_on_ext1_obj) }, + #endif #if SOC_ULP_SUPPORTED { MP_ROM_QSTR(MP_QSTR_wake_on_ulp), MP_ROM_PTR(&esp32_wake_on_ulp_obj) }, #endif |
