Skip to content

Commit 60d9ca9

Browse files
committed
Merge branch 'feat/new_api_to_get_all_wakeup_causes' into 'master'
feat: add new api to get multiple wakeup causes Closes PM-472 See merge request espressif/esp-idf!40139
2 parents 0e92b38 + ed12f89 commit 60d9ca9

File tree

41 files changed

+405
-318
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+405
-318
lines changed

components/driver/test_apps/touch_sensor_v2/main/test_touch_v2.c

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -1935,32 +1935,29 @@ static void test_deep_sleep_init(void)
19351935
gettimeofday(&now, NULL);
19361936
int sleep_time_ms = (now.tv_sec - sleep_enter_time.tv_sec) * 1000 + (now.tv_usec - sleep_enter_time.tv_usec) / 1000;
19371937
printf("RTC_CNTL_SLP_WAKEUP_CAUSE_REG %x\n", REG_READ(RTC_CNTL_SLP_WAKEUP_CAUSE_REG));
1938-
switch (esp_sleep_get_wakeup_cause()) {
1939-
case ESP_SLEEP_WAKEUP_EXT1: {
1940-
uint64_t wakeup_pin_mask = esp_sleep_get_ext1_wakeup_status();
1941-
if (wakeup_pin_mask != 0) {
1942-
int pin = __builtin_ffsll(wakeup_pin_mask) - 1;
1943-
printf("Wake up from GPIO %"PRIu32"\n", pin);
1944-
} else {
1945-
printf("Wake up from GPIO\n");
1946-
}
1947-
break;
1948-
}
1949-
case ESP_SLEEP_WAKEUP_TIMER: {
1950-
printf("Wake up from timer. Time spent in deep sleep: %"PRIu32"ms\n", sleep_time_ms);
1951-
break;
1952-
}
1953-
case ESP_SLEEP_WAKEUP_TOUCHPAD: {
1954-
printf("Wake up from touch on pad %"PRIu32"\n", esp_sleep_get_touchpad_wakeup_status());
1955-
break;
1956-
}
1957-
case ESP_SLEEP_WAKEUP_UNDEFINED:
1958-
default: {
1938+
1939+
uint32_t wakeup_causes = esp_sleep_get_wakeup_causes();
1940+
if (wakeup_causes & BIT(ESP_SLEEP_WAKEUP_UNDEFINED)) {
19591941
printf("Not a deep sleep reset\n");
19601942
ESP_LOGI(TAG, "*********** touch sleep pad wakeup test ********************");
19611943
/* Sleep pad should be init once. */
19621944
test_touch_sleep_pad_interrupt_wakeup_deep_sleep(touch_list[0]);
1963-
}
1945+
} else {
1946+
if (wakeup_causes & BIT(ESP_SLEEP_WAKEUP_EXT1)) {
1947+
uint64_t wakeup_pin_mask = esp_sleep_get_ext1_wakeup_status();
1948+
if (wakeup_pin_mask != 0) {
1949+
int pin = __builtin_ffsll(wakeup_pin_mask) - 1;
1950+
printf("Wake up from GPIO %"PRIu32"\n", pin);
1951+
} else {
1952+
printf("Wake up from GPIO\n");
1953+
}
1954+
}
1955+
if (wakeup_causes & BIT(ESP_SLEEP_WAKEUP_TIMER)) {
1956+
printf("Wake up from timer. Time spent in deep sleep: %"PRIu32"ms\n", sleep_time_ms);
1957+
}
1958+
if (wakeup_causes & BIT(ESP_SLEEP_WAKEUP_TOUCHPAD)) {
1959+
printf("Wake up from touch on pad %"PRIu32"\n", esp_sleep_get_touchpad_wakeup_status());
1960+
}
19641961
}
19651962

19661963
vTaskDelay(100 * SYS_DELAY_TIME_MOM / portTICK_PERIOD_MS);

components/esp_driver_gpio/test_apps/gpio/main/test_gpio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ TEST_CASE("GPIO_light_sleep_wake_up_test", "[gpio][ignore]")
880880
vTaskDelay(1000 / portTICK_PERIOD_MS);
881881
esp_light_sleep_start();
882882
printf("Waked up from light sleep\n");
883-
TEST_ASSERT(esp_sleep_get_wakeup_cause() == ESP_SLEEP_WAKEUP_GPIO);
883+
TEST_ASSERT(esp_sleep_get_wakeup_causes() & BIT(ESP_SLEEP_WAKEUP_GPIO));
884884
}
885885
#endif
886886

components/esp_driver_uart/test_apps/uart/main/test_hp_uart_wakeup.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,16 +199,13 @@ static void enter_sleep_and_send_respond(void)
199199
printf("sleep duration: %lld\n", t_after_us - t_before_us);
200200

201201
/* Determine the reason for uart wakeup */
202-
switch (esp_sleep_get_wakeup_cause()) {
203-
case ESP_SLEEP_WAKEUP_UART:
202+
if (esp_sleep_get_wakeup_causes() & (BIT(ESP_SLEEP_WAKEUP_UART + SLAVE_UART_NUM))) {
204203
/* Hang-up for a while to switch and execute the uart task
205-
* Otherwise the chip may fall sleep again before running uart task */
204+
* Otherwise the chip may fall sleep again before running uart task */
206205
vTaskDelay(1);
207206
uart_write_bytes(SLAVE_UART_NUM, "Wakeup OK!", 11);
208-
break;
209-
default:
207+
} else {
210208
uart_write_bytes(SLAVE_UART_NUM, "Wakeup failed!", 15);
211-
break;
212209
}
213210

214211
/* Wait for uart write finish */

components/esp_hw_support/include/esp_sleep.h

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -105,21 +105,23 @@ typedef enum {
105105
* @brief Sleep wakeup cause
106106
*/
107107
typedef enum {
108-
ESP_SLEEP_WAKEUP_UNDEFINED, //!< In case of deep sleep, reset was not caused by exit from deep sleep
109-
ESP_SLEEP_WAKEUP_ALL, //!< Not a wakeup cause, used to disable all wakeup sources with esp_sleep_disable_wakeup_source
110-
ESP_SLEEP_WAKEUP_EXT0, //!< Wakeup caused by external signal using RTC_IO
111-
ESP_SLEEP_WAKEUP_EXT1, //!< Wakeup caused by external signal using RTC_CNTL
112-
ESP_SLEEP_WAKEUP_TIMER, //!< Wakeup caused by timer
113-
ESP_SLEEP_WAKEUP_TOUCHPAD, //!< Wakeup caused by touchpad
114-
ESP_SLEEP_WAKEUP_ULP, //!< Wakeup caused by ULP program
115-
ESP_SLEEP_WAKEUP_GPIO, //!< Wakeup caused by GPIO (light sleep only on ESP32, S2 and S3)
116-
ESP_SLEEP_WAKEUP_UART, //!< Wakeup caused by UART (light sleep only)
108+
ESP_SLEEP_WAKEUP_UNDEFINED, //!< In case of deep sleep, reset was not caused by exit from deep sleep
109+
ESP_SLEEP_WAKEUP_ALL, //!< Not a wakeup cause, used to disable all wakeup sources with esp_sleep_disable_wakeup_source
110+
ESP_SLEEP_WAKEUP_EXT0, //!< Wakeup caused by external signal using RTC_IO
111+
ESP_SLEEP_WAKEUP_EXT1, //!< Wakeup caused by external signal using RTC_CNTL
112+
ESP_SLEEP_WAKEUP_TIMER, //!< Wakeup caused by timer
113+
ESP_SLEEP_WAKEUP_TOUCHPAD, //!< Wakeup caused by touchpad
114+
ESP_SLEEP_WAKEUP_ULP, //!< Wakeup caused by ULP program
115+
ESP_SLEEP_WAKEUP_GPIO, //!< Wakeup caused by GPIO (light sleep only on ESP32, S2 and S3)
116+
ESP_SLEEP_WAKEUP_UART, //!< Wakeup caused by UART0 (light sleep only)
117+
ESP_SLEEP_WAKEUP_UART1, //!< Wakeup caused by UART1 (light sleep only)
118+
ESP_SLEEP_WAKEUP_UART2, //!< Wakeup caused by UART2 (light sleep only)
117119
ESP_SLEEP_WAKEUP_WIFI, //!< Wakeup caused by WIFI (light sleep only)
118120
ESP_SLEEP_WAKEUP_COCPU, //!< Wakeup caused by COCPU int
119121
ESP_SLEEP_WAKEUP_COCPU_TRAP_TRIG, //!< Wakeup caused by COCPU crash
120-
ESP_SLEEP_WAKEUP_BT, //!< Wakeup caused by BT (light sleep only)
121-
ESP_SLEEP_WAKEUP_VAD, //!< Wakeup caused by VAD
122-
ESP_SLEEP_WAKEUP_VBAT_UNDER_VOLT, //!< Wakeup caused by VDD_BAT under voltage.
122+
ESP_SLEEP_WAKEUP_BT, //!< Wakeup caused by BT (light sleep only)
123+
ESP_SLEEP_WAKEUP_VAD, //!< Wakeup caused by VAD
124+
ESP_SLEEP_WAKEUP_VBAT_UNDER_VOLT, //!< Wakeup caused by VDD_BAT under voltage.
123125
} esp_sleep_source_t;
124126

125127
/**
@@ -691,10 +693,20 @@ void esp_deep_sleep_deregister_hook(esp_deep_sleep_cb_t old_dslp_cb);
691693
/**
692694
* @brief Get the wakeup source which caused wakeup from sleep
693695
*
696+
* @note !!! This API will only return one wakeup source. If multiple wakeup sources
697+
* wake up at the same time, the wakeup source information may be lost.
698+
*
694699
* @return cause of wake up from last sleep (deep sleep or light sleep)
695700
*/
696-
esp_sleep_wakeup_cause_t esp_sleep_get_wakeup_cause(void);
701+
esp_sleep_wakeup_cause_t esp_sleep_get_wakeup_cause(void)
702+
__attribute__((deprecated("use esp_sleep_get_wakeup_causes instead")));
697703

704+
/**
705+
* @brief Get all wakeup sources bitmap which caused wakeup from sleep.
706+
*
707+
* @return The bitmap of the wakeup sources of the last wakeup from sleep. (deep sleep or light sleep)
708+
*/
709+
uint32_t esp_sleep_get_wakeup_causes(void);
698710

699711
/**
700712
* @brief Default stub to run on wake from deep sleep.

components/esp_hw_support/sleep_modes.c

Lines changed: 94 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1866,7 +1866,7 @@ esp_err_t esp_sleep_enable_touchpad_wakeup(void)
18661866

18671867
int esp_sleep_get_touchpad_wakeup_status(void)
18681868
{
1869-
if (esp_sleep_get_wakeup_cause() != ESP_SLEEP_WAKEUP_TOUCHPAD) {
1869+
if (!(esp_sleep_get_wakeup_causes() & BIT(ESP_SLEEP_WAKEUP_TOUCHPAD))) {
18701870
return -1;
18711871
}
18721872
uint32_t chan_num;
@@ -2091,7 +2091,7 @@ static void ext1_wakeup_prepare(void)
20912091

20922092
uint64_t esp_sleep_get_ext1_wakeup_status(void)
20932093
{
2094-
if (esp_sleep_get_wakeup_cause() != ESP_SLEEP_WAKEUP_EXT1) {
2094+
if (!(esp_sleep_get_wakeup_causes() & BIT(ESP_SLEEP_WAKEUP_EXT1))) {
20952095
return 0;
20962096
}
20972097
uint32_t status = rtc_hal_ext1_get_wakeup_status();
@@ -2115,7 +2115,7 @@ uint64_t esp_sleep_get_ext1_wakeup_status(void)
21152115
#if SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP && SOC_DEEP_SLEEP_SUPPORTED
21162116
uint64_t esp_sleep_get_gpio_wakeup_status(void)
21172117
{
2118-
if (esp_sleep_get_wakeup_cause() != ESP_SLEEP_WAKEUP_GPIO) {
2118+
if (!(esp_sleep_get_wakeup_causes() & BIT(ESP_SLEEP_WAKEUP_GPIO))) {
21192119
return 0;
21202120
}
21212121
return rtc_hal_gpio_get_wakeup_status();
@@ -2350,6 +2350,97 @@ esp_sleep_wakeup_cause_t esp_sleep_get_wakeup_cause(void)
23502350
}
23512351
}
23522352

2353+
uint32_t esp_sleep_get_wakeup_causes(void)
2354+
{
2355+
uint32_t wakeup_cause = 0;
2356+
2357+
if (esp_rom_get_reset_reason(0) != RESET_REASON_CORE_DEEP_SLEEP && !s_light_sleep_wakeup) {
2358+
wakeup_cause |= BIT(ESP_SLEEP_WAKEUP_UNDEFINED);
2359+
return wakeup_cause;
2360+
}
2361+
2362+
#if SOC_PMU_SUPPORTED
2363+
uint32_t wakeup_cause_raw = pmu_ll_hp_get_wakeup_cause(&PMU);
2364+
#else
2365+
uint32_t wakeup_cause_raw = rtc_cntl_ll_get_wakeup_cause();
2366+
#endif
2367+
2368+
if (wakeup_cause_raw & RTC_TIMER_TRIG_EN) {
2369+
wakeup_cause |= BIT(ESP_SLEEP_WAKEUP_TIMER);
2370+
}
2371+
if (wakeup_cause_raw & RTC_GPIO_TRIG_EN) {
2372+
wakeup_cause |= BIT(ESP_SLEEP_WAKEUP_GPIO);
2373+
}
2374+
if (wakeup_cause_raw & RTC_UART0_TRIG_EN) {
2375+
wakeup_cause |= BIT(ESP_SLEEP_WAKEUP_UART);
2376+
}
2377+
if (wakeup_cause_raw & RTC_UART1_TRIG_EN) {
2378+
wakeup_cause |= BIT(ESP_SLEEP_WAKEUP_UART1);
2379+
}
2380+
#if SOC_PMU_SUPPORTED && (SOC_UART_HP_NUM > 2)
2381+
if (wakeup_cause_raw & RTC_UART2_TRIG_EN) {
2382+
wakeup_cause |= BIT(ESP_SLEEP_WAKEUP_UART2);
2383+
}
2384+
#endif
2385+
#if SOC_PM_SUPPORT_EXT0_WAKEUP
2386+
if (wakeup_cause_raw & RTC_EXT0_TRIG_EN) {
2387+
wakeup_cause |= BIT(ESP_SLEEP_WAKEUP_EXT0);
2388+
}
2389+
#endif
2390+
#if SOC_PM_SUPPORT_EXT1_WAKEUP
2391+
if (wakeup_cause_raw & RTC_EXT1_TRIG_EN) {
2392+
wakeup_cause |= BIT(ESP_SLEEP_WAKEUP_EXT1);
2393+
}
2394+
#endif
2395+
#if SOC_PM_SUPPORT_TOUCH_SENSOR_WAKEUP
2396+
if (wakeup_cause_raw & RTC_TOUCH_TRIG_EN) {
2397+
wakeup_cause |= BIT(ESP_SLEEP_WAKEUP_TOUCHPAD);
2398+
}
2399+
#endif
2400+
#if SOC_ULP_FSM_SUPPORTED
2401+
if (wakeup_cause_raw & RTC_ULP_TRIG_EN) {
2402+
wakeup_cause |= BIT(ESP_SLEEP_WAKEUP_ULP);
2403+
}
2404+
#endif
2405+
#if SOC_PM_SUPPORT_WIFI_WAKEUP
2406+
if (wakeup_cause_raw & RTC_WIFI_TRIG_EN) {
2407+
wakeup_cause |= BIT(ESP_SLEEP_WAKEUP_WIFI);
2408+
}
2409+
#endif
2410+
#if SOC_PM_SUPPORT_BT_WAKEUP
2411+
if (wakeup_cause_raw & RTC_BT_TRIG_EN) {
2412+
wakeup_cause |= BIT(ESP_SLEEP_WAKEUP_BT);
2413+
}
2414+
#endif
2415+
#if SOC_RISCV_COPROC_SUPPORTED
2416+
if (wakeup_cause_raw & RTC_COCPU_TRIG_EN) {
2417+
wakeup_cause |= BIT(ESP_SLEEP_WAKEUP_ULP);
2418+
}
2419+
if (wakeup_cause_raw & RTC_COCPU_TRAP_TRIG_EN) {
2420+
wakeup_cause |= BIT(ESP_SLEEP_WAKEUP_COCPU_TRAP_TRIG);
2421+
}
2422+
#endif
2423+
#if SOC_LP_CORE_SUPPORTED
2424+
if (wakeup_cause_raw & RTC_LP_CORE_TRIG_EN) {
2425+
wakeup_cause |= BIT(ESP_SLEEP_WAKEUP_ULP);
2426+
}
2427+
#endif
2428+
#if SOC_LP_VAD_SUPPORTED
2429+
if (wakeup_cause_raw & RTC_LP_VAD_TRIG_EN) {
2430+
wakeup_cause |= BIT(ESP_SLEEP_WAKEUP_VAD);
2431+
}
2432+
#endif
2433+
#if SOC_VBAT_SUPPORTED
2434+
if (wakeup_cause_raw & RTC_VBAT_UNDER_VOLT_TRIG_EN) {
2435+
wakeup_cause |= BIT(ESP_SLEEP_WAKEUP_VBAT_UNDER_VOLT);
2436+
}
2437+
#endif
2438+
if (wakeup_cause == 0) {
2439+
wakeup_cause |= BIT(ESP_SLEEP_WAKEUP_UNDEFINED);
2440+
}
2441+
return wakeup_cause;
2442+
}
2443+
23532444
esp_err_t esp_sleep_pd_config(esp_sleep_pd_domain_t domain, esp_sleep_pd_option_t option)
23542445
{
23552446
if (domain >= ESP_PD_DOMAIN_MAX || option > ESP_PD_OPTION_AUTO) {

components/esp_hw_support/test_apps/rtc_8md256/main/test_rtc_8md256.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -59,17 +59,7 @@ static void test_lightsleep(bool force_rtc_periph)
5959
/* Enter sleep mode */
6060
esp_light_sleep_start();
6161

62-
/* Determine wake up reason */
63-
const char* wakeup_reason;
64-
switch (esp_sleep_get_wakeup_cause()) {
65-
case ESP_SLEEP_WAKEUP_TIMER:
66-
wakeup_reason = "timer";
67-
break;
68-
default:
69-
wakeup_reason = "other";
70-
break;
71-
}
72-
printf("Returned from light sleep, reason: %s\n", wakeup_reason);
62+
printf("Returned from light sleep, reason: %s\n", (esp_sleep_get_wakeup_causes() & BIT(ESP_SLEEP_WAKEUP_TIMER)) ? "timer" : "other");
7363
vTaskDelay(1000/portTICK_PERIOD_MS);
7464
}
7565
}

components/esp_hw_support/test_apps/rtc_power_modes/main/test_rtc_power.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -91,18 +91,7 @@ static void test_lightsleep(void)
9191

9292
/* Enter sleep mode */
9393
esp_light_sleep_start();
94-
95-
/* Determine wake up reason */
96-
const char* wakeup_reason;
97-
switch (esp_sleep_get_wakeup_cause()) {
98-
case ESP_SLEEP_WAKEUP_TIMER:
99-
wakeup_reason = "timer";
100-
break;
101-
default:
102-
wakeup_reason = "other";
103-
break;
104-
}
105-
printf("Returned from light sleep, reason: %s\n", wakeup_reason);
94+
printf("Returned from light sleep, reason: %s\n", (esp_sleep_get_wakeup_causes() & BIT(ESP_SLEEP_WAKEUP_TIMER)) ? "timer" : "other");
10695

10796
vTaskDelay(1000/portTICK_PERIOD_MS);
10897
}

components/esp_hw_support/test_apps/vad_wakeup/main/test_vad_wakeup.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Unlicense OR CC0-1.0
55
*/
@@ -142,19 +142,7 @@ static void s_lp_vad_config(void)
142142
/* Enter sleep mode */
143143
esp_light_sleep_start();
144144

145-
/* Determine wake up reason */
146-
const char* wakeup_reason;
147-
switch (esp_sleep_get_wakeup_cause()) {
148-
case ESP_SLEEP_WAKEUP_VAD:
149-
wakeup_reason = "vad";
150-
break;
151-
default:
152-
wakeup_reason = "other";
153-
TEST_ASSERT(false);
154-
break;
155-
}
156-
157-
ESP_LOGI(TAG, "wakeup, reason: %s", wakeup_reason);
145+
ESP_LOGI(TAG, "wakeup, reason: %s", (esp_sleep_get_wakeup_causes() & BIT(ESP_SLEEP_WAKEUP_VAD)) ? "vad" : "other");
158146
}
159147

160148
TEST_CASE_MULTIPLE_DEVICES("test LP VAD wakeup", "[vad][ignore][manual]", s_hp_i2s_config, s_lp_vad_config);

components/esp_hw_support/test_apps/wakeup_tests/main/src/io_wakeup_cmd.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,13 @@ static int process_get_wakeup_cause(int argc, char **argv)
362362
return 1;
363363
}
364364

365-
switch (esp_sleep_get_wakeup_cause()) {
366-
case ESP_SLEEP_WAKEUP_EXT1: {
365+
uint32_t causes = esp_sleep_get_wakeup_causes();
366+
if (causes & BIT(ESP_SLEEP_WAKEUP_UNDEFINED)) {
367+
printf("Wakeup cause err\n");
368+
return 0;
369+
}
370+
371+
if (causes & BIT(ESP_SLEEP_WAKEUP_EXT1)) {
367372
#if SOC_PM_SUPPORT_EXT1_WAKEUP && SOC_RTCIO_PIN_COUNT > 0
368373
uint64_t wakeup_pin_mask = esp_sleep_get_ext1_wakeup_status();
369374
if (wakeup_pin_mask != 0) {
@@ -374,9 +379,9 @@ static int process_get_wakeup_cause(int argc, char **argv)
374379
{
375380
printf("Wake up from EXT1 triggered, but unknown wake-up IO\n");
376381
}
377-
break;
378382
}
379-
case ESP_SLEEP_WAKEUP_GPIO: {
383+
384+
if (causes & BIT(ESP_SLEEP_WAKEUP_GPIO)) {
380385
if (esp_reset_reason() == ESP_RST_DEEPSLEEP) {
381386
#if SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP
382387
uint64_t wakeup_pin_mask = esp_sleep_get_gpio_wakeup_status();
@@ -409,11 +414,6 @@ static int process_get_wakeup_cause(int argc, char **argv)
409414
gpio_ll_clear_intr_status(&GPIO, 0xFFFFFFFF);
410415
gpio_ll_clear_intr_status_high(&GPIO, 0xFFFFFFFF);
411416
}
412-
break;
413-
}
414-
default: {
415-
printf("Wakeup cause err\n");
416-
}
417417
}
418418
return 0;
419419
}

0 commit comments

Comments
 (0)