Skip to content

Commit

Permalink
Flush serial in DeepSleep example to allow print before sleep (#1791)
Browse files Browse the repository at this point in the history
* Add delay into example to allow print before sleep

* Changed to Serial.flush()
  • Loading branch information
lbernstone authored and me-no-dev committed Sep 17, 2018
1 parent c8fe873 commit f9f995b
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -40,7 +40,7 @@ void print_wakeup_reason(){
case 3 : Serial.println("Wakeup caused by timer"); break;
case 4 : Serial.println("Wakeup caused by touchpad"); break;
case 5 : Serial.println("Wakeup caused by ULP program"); break;
default : Serial.println("Wakeup was not caused by deep sleep"); break;
default : Serial.printf("Wakeup was not caused by deep sleep: %d\n",wakeup_reason); break;
}
}

Expand Down Expand Up @@ -84,6 +84,7 @@ void setup(){
reset occurs.
*/
Serial.println("Going to sleep now");
Serial.flush();
esp_deep_sleep_start();
Serial.println("This will never be printed");
}
Expand Down

0 comments on commit f9f995b

Please sign in to comment.