Skip to content

Commit 47a1329

Browse files
committed
fix
1 parent 068b212 commit 47a1329

File tree

2 files changed

+2
-60
lines changed

2 files changed

+2
-60
lines changed

tests/validation/sleep/sleep.ino

+1-56
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,7 @@
1717
#define THRESHOLD 0 /* Lower the value, more the sensitivity */
1818
#endif
1919

20-
// External wakeup
21-
#define BUTTON_PIN_BITMASK(GPIO) (1ULL << GPIO) // 2 ^ GPIO_NUMBER in hex
22-
23-
#if CONFIG_IDF_TARGET_ESP32H2
24-
#define WAKEUP_GPIO GPIO_NUM_7 // Only RTC IO are allowed
25-
#define TARGET_FREQ 32
26-
#else
27-
#define WAKEUP_GPIO GPIO_NUM_4 // Only RTC IO are allowed
28-
#define TARGET_FREQ 40
29-
#endif
20+
#define TARGET_FREQ CONFIG_XTAL_FREQ
3021

3122
RTC_DATA_ATTR int boot_count = 0;
3223
uint32_t orig_freq = 0;
@@ -60,30 +51,6 @@ void setup_touchpad() {
6051
#endif
6152
}
6253

63-
void setup_rtc_io() {
64-
#if SOC_RTCIO_WAKE_SUPPORTED && SOC_PM_SUPPORT_EXT0_WAKEUP
65-
esp_sleep_enable_ext0_wakeup(WAKEUP_GPIO, 1);
66-
rtc_gpio_pullup_en(WAKEUP_GPIO);
67-
rtc_gpio_pulldown_dis(WAKEUP_GPIO);
68-
#endif
69-
}
70-
71-
void setup_rtc_cntl() {
72-
#if SOC_RTCIO_WAKE_SUPPORTED && SOC_PM_SUPPORT_EXT1_WAKEUP
73-
esp_sleep_enable_ext1_wakeup_io(BUTTON_PIN_BITMASK(WAKEUP_GPIO), ESP_EXT1_WAKEUP_ANY_HIGH);
74-
rtc_gpio_pulldown_dis(WAKEUP_GPIO);
75-
rtc_gpio_pullup_en(WAKEUP_GPIO);
76-
#endif
77-
}
78-
79-
void setup_gpio() {
80-
esp_sleep_pd_config(ESP_PD_DOMAIN_VDDSDIO, ESP_PD_OPTION_ON);
81-
gpio_pullup_dis(WAKEUP_GPIO);
82-
gpio_pulldown_en(WAKEUP_GPIO);
83-
gpio_wakeup_enable(WAKEUP_GPIO, GPIO_INTR_LOW_LEVEL);
84-
esp_sleep_enable_gpio_wakeup();
85-
}
86-
8754
void setup_uart() {
8855
uart_set_wakeup_threshold(UART_NUM_0, 9); // wake up with "aaa" string (9 positive edges)
8956
esp_sleep_enable_uart_wakeup(UART_NUM_0);
@@ -126,18 +93,6 @@ void loop() {
12693
esp_deep_sleep_start();
12794
Serial.println("FAIL");
12895
while(1);
129-
} else if (command == "rtc_io_deep") {
130-
// Test external wakeup from deep sleep using RTC IO
131-
setup_rtc_io();
132-
esp_deep_sleep_start();
133-
Serial.println("FAIL");
134-
while(1);
135-
} else if (command == "rtc_cntl_deep") {
136-
// Test external wakeup from deep sleep using RTC controller
137-
setup_rtc_cntl();
138-
esp_deep_sleep_start();
139-
Serial.println("FAIL");
140-
while(1);
14196
} else if (command == "timer_light") {
14297
// Test timer wakeup from light sleep
14398
setup_timer();
@@ -148,15 +103,6 @@ void loop() {
148103
} else if (command == "touchpad_light") {
149104
// Test touchpad wakeup from light sleep
150105
setup_touchpad();
151-
} else if (command == "rtc_io_light") {
152-
// Test external wakeup from light sleep using RTC IO
153-
setup_rtc_io();
154-
} else if (command == "rtc_cntl_light") {
155-
// Test external wakeup from light sleep using RTC controller
156-
setup_rtc_cntl();
157-
} else if (command == "gpio_light") {
158-
// Test external wakeup from light sleep using GPIO
159-
setup_gpio();
160106
} else if (command == "uart_light") {
161107
// Test external wakeup from light sleep using UART
162108
setup_uart();
@@ -169,7 +115,6 @@ void loop() {
169115
Serial.println("Woke up from light sleep");
170116
print_wakeup_reason();
171117
Serial.flush();
172-
gpio_hold_dis(WAKEUP_GPIO);
173118
setCpuFrequencyMhz(orig_freq);
174119
}
175120
}

tests/validation/sleep/test_sleep.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
capabilities = {
55
"timer": ["esp32", "esp32s2", "esp32s3", "esp32c3", "esp32c6", "esp32h2"],
66
"touchpad": ["esp32", "esp32s2", "esp32s3"],
7-
"rtc_io": ["esp32", "esp32s2", "esp32s3", "esp32c6"],
8-
"rtc_cntl": ["esp32", "esp32s2", "esp32s3", "esp32c6"],
9-
"gpio": ["esp32", "esp32s2", "esp32s3"],
107
"uart": ["esp32", "esp32s2", "esp32s3", "esp32c3", "esp32c6", "esp32h2"]
118
}
129

@@ -19,7 +16,7 @@ def test_sleep(dut):
1916
dut.expect_exact("Wakeup reason: power_up")
2017

2118
for capability, devices in capabilities.items():
22-
if dut.app.target in devices and capability not in ["gpio", "uart"]:
19+
if dut.app.target in devices and capability != "uart":
2320
LOGGER.info("Testing {} deep sleep capability".format(capability))
2421
boot_count += 1
2522
dut.write("{}_deep".format(capability))

0 commit comments

Comments
 (0)