Skip to content

Commit c1196ca

Browse files
meirarmondpgeorge
authored andcommitted
esp32/modesp32: Fix access to ext0_pin only if defined.
In different functions `machine_rtc_config.ext0_pin` is accessed where SOC_PM_SUPPORT_EXT0_WAKEUP is not defined, fix that. Signed-off-by: Meir Armon <[email protected]>
1 parent b6b7d64 commit c1196ca

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ports/esp32/modesp32.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,11 @@
5050
#if SOC_TOUCH_SENSOR_SUPPORTED
5151
static mp_obj_t esp32_wake_on_touch(const mp_obj_t wake) {
5252

53+
#if SOC_PM_SUPPORT_EXT0_WAKEUP
5354
if (machine_rtc_config.ext0_pin != -1) {
5455
mp_raise_ValueError(MP_ERROR_TEXT("no resources"));
5556
}
57+
#endif
5658

5759
machine_rtc_config.wake_on_touch = mp_obj_is_true(wake);
5860
return mp_const_none;
@@ -137,9 +139,11 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(esp32_wake_on_ext1_obj, 0, esp32_wake_on_ext1)
137139

138140
#if SOC_ULP_SUPPORTED
139141
static mp_obj_t esp32_wake_on_ulp(const mp_obj_t wake) {
142+
#if SOC_PM_SUPPORT_EXT0_WAKEUP
140143
if (machine_rtc_config.ext0_pin != -1) {
141144
mp_raise_ValueError(MP_ERROR_TEXT("no resources"));
142145
}
146+
#endif
143147
machine_rtc_config.wake_on_ulp = mp_obj_is_true(wake);
144148
return mp_const_none;
145149
}

0 commit comments

Comments
 (0)