8000 Flush serial in DeepSleep example to allow print before sleep (#1791) · lamarrr/arduino-esp32@f9f995b · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f9f995b

Browse files
lbernstoneme-no-dev
authored andcommitted
Flush serial in DeepSleep example to allow print before sleep (espressif#1791)
* Add delay into example to allow print before sleep * Changed to Serial.flush()
1 parent c8fe873 commit f9f995b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libraries/ESP32/examples/DeepSleep/TimerWakeUp/TimerWakeUp.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void print_wakeup_reason(){
4040
case 3 : Serial.println("Wakeup caused by timer"); break;
4141
case 4 : Serial.println("Wakeup caused by touchpad"); break;
4242
case 5 : Serial.println("Wakeup caused by ULP program"); break;
43-
default : Serial.println("Wakeup was not caused by deep sleep"); break;
43+
default : Serial.printf("Wakeup was not caused by deep sleep: %d\n",wakeup_reason); break;
4444
}
4545
}
4646

@@ -84,6 +84,7 @@ void setup(){
8484
reset occurs.
8585
*/
8686
Serial.println("Going to sleep now");
87+
Serial.flush();
8788
esp_deep_sleep_start();
8889
Serial.println("This will never be printed");
8990
}

0 commit comments

Comments
 (0)
0