Skip to content

Commit 7411293

Browse files
author
OSi (Ondrej Sienczak)
committed
modmachine, modesp32: Fixed wake-up RTC pins chck.
There have been incorrect test of used EXT1 (GPIO) wake-up capable (RTC) pins for ESP32-C3. Signed-off-by: Ondrej Sienczak <ondrej.sienczak@gmail.com>
1 parent 848805e commit 7411293

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

ports/esp32/modesp32.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,19 @@
3030
)
3131
#define RTC_LAST_EXT_PIN 21
3232

33+
#elif CONFIG_IDF_TARGET_ESP32C3
34+
35+
#define RTC_VALID_EXT_PINS \
36+
( \
37+
(1ll << 0) | \
38+
(1ll << 1) | \
39+
(1ll << 2) | \
40+
(1ll << 3) | \
41+
(1ll << 4) | \
42+
(1ll << 5) \
43+
)
44+
#define RTC_LAST_EXT_PIN 5
45+
3346
#else
3447

3548
#define RTC_VALID_EXT_PINS \

ports/esp32/modmachine.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,7 @@ STATIC mp_obj_t machine_sleep_helper(wake_type_t wake_type, size_t n_args, const
139139
if (machine_rtc_config.ext1_pins != 0) {
140140
for (int i = 0; i < GPIO_NUM_MAX; ++i) {
141141
uint64_t bm = 1ULL << i;
142-
143142
if (machine_rtc_config.ext1_pins & bm) {
144-
if (!esp_sleep_is_valid_wakeup_gpio((gpio_num_t)i)) {
145-
mp_raise_ValueError(MP_ERROR_TEXT("invalid wake-up port"));
146-
}
147143
gpio_sleep_set_direction((gpio_num_t)i, GPIO_MODE_INPUT);
148144
}
149145
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy