File tree Expand file tree Collapse file tree 3 files changed +17
-17
lines changed
libraries/ESP32/examples/DeepSleep Expand file tree Collapse file tree 3 files changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -36,12 +36,12 @@ void print_wakeup_reason(){
3636
3737 switch (wakeup_reason)
3838 {
39- case 1 : Serial.println (" Wakeup caused by external signal using RTC_IO" ); break ;
40- case 2 : Serial.println (" Wakeup caused by external signal using RTC_CNTL" ); break ;
41- case 3 : Serial.println (" Wakeup caused by timer" ); break ;
42- case 4 : Serial.println (" Wakeup caused by touchpad" ); break ;
43- case 5 : Serial.println (" Wakeup caused by ULP program" ); break ;
44- default : Serial.println (" Wakeup was not caused by deep sleep" ); break ;
39+ case ESP_SLEEP_WAKEUP_EXT0 : Serial.println (" Wakeup caused by external signal using RTC_IO" ); break ;
40+ case ESP_SLEEP_WAKEUP_EXT1 : Serial.println (" Wakeup caused by external signal using RTC_CNTL" ); break ;
41+ case ESP_SLEEP_WAKEUP_TIMER : Serial.println (" Wakeup caused by timer" ); break ;
42+ case ESP_SLEEP_WAKEUP_TOUCHPAD : Serial.println (" Wakeup caused by touchpad" ); break ;
43+ case ESP_SLEEP_WAKEUP_ULP : Serial.println (" Wakeup caused by ULP program" ); break ;
44+ default : Serial.printf (" Wakeup was not caused by deep sleep: %d \n " ,wakeup_reason ); break ;
4545 }
4646}
4747
Original file line number Diff line number Diff line change @@ -35,11 +35,11 @@ void print_wakeup_reason(){
3535
3636 switch (wakeup_reason)
3737 {
38- case 1 : Serial.println (" Wakeup caused by external signal using RTC_IO" ); break ;
39- case 2 : Serial.println (" Wakeup caused by external signal using RTC_CNTL" ); break ;
40- case 3 : Serial.println (" Wakeup caused by timer" ); break ;
41- case 4 : Serial.println (" Wakeup caused by touchpad" ); break ;
42- case 5 : Serial.println (" Wakeup caused by ULP program" ); break ;
38+ case ESP_SLEEP_WAKEUP_EXT0 : Serial.println (" Wakeup caused by external signal using RTC_IO" ); break ;
39+ case ESP_SLEEP_WAKEUP_EXT1 : Serial.println (" Wakeup caused by external signal using RTC_CNTL" ); break ;
40+ case ESP_SLEEP_WAKEUP_TIMER : Serial.println (" Wakeup caused by timer" ); break ;
41+ case ESP_SLEEP_WAKEUP_TOUCHPAD : Serial.println (" Wakeup caused by touchpad" ); break ;
42+ case ESP_SLEEP_WAKEUP_ULP : Serial.println (" Wakeup caused by ULP program" ); break ;
4343 default : Serial.printf (" Wakeup was not caused by deep sleep: %d\n " ,wakeup_reason); break ;
4444 }
4545}
Original file line number Diff line number Diff line change @@ -26,12 +26,12 @@ void print_wakeup_reason(){
2626
2727 switch (wakeup_reason)
2828 {
29- case 1 : Serial.println (" Wakeup caused by external signal using RTC_IO" ); break ;
30- case 2 : Serial.println (" Wakeup caused by external signal using RTC_CNTL" ); break ;
31- case 3 : Serial.println (" Wakeup caused by timer" ); break ;
32- case 4 : Serial.println (" Wakeup caused by touchpad" ); break ;
33- case 5 : Serial.println (" Wakeup caused by ULP program" ); break ;
34- default : Serial.println (" Wakeup was not caused by deep sleep" ); break ;
29+ case ESP_SLEEP_WAKEUP_EXT0 : Serial.println (" Wakeup caused by external signal using RTC_IO" ); break ;
30+ case ESP_SLEEP_WAKEUP_EXT1 : Serial.println (" Wakeup caused by external signal using RTC_CNTL" ); break ;
31+ case ESP_SLEEP_WAKEUP_TIMER : Serial.println (" Wakeup caused by timer" ); break ;
32+ case ESP_SLEEP_WAKEUP_TOUCHPAD : Serial.println (" Wakeup caused by touchpad" ); break ;
33+ case ESP_SLEEP_WAKEUP_ULP : Serial.println (" Wakeup caused by ULP program" ); break ;
34+ default : Serial.printf (" Wakeup was not caused by deep sleep: %d \n " ,wakeup_reason ); break ;
3535 }
3636}
3737
You can’t perform that action at this time.
0 commit comments