Fix #115: wake from light sleep if a character arrives on the serial port

Note - we do this not by using the uart wake feature, but by the lower
power GPIO edge feature.  Recommend sending "Z" 0x5A - because that has
many edges.  Send the character 4 times to make sure the device is awake
This commit is contained in:
geeksville
2020-06-10 14:36:11 -07:00
parent ddfdae64bf
commit 8ccd59a7d8
3 changed files with 20 additions and 1 deletions

View File

@@ -62,8 +62,13 @@ static void lsIdle()
secsSlept += sleepTime;
// DEBUG_MSG("sleeping, flash led!\n");
}
if (wakeCause == ESP_SLEEP_WAKEUP_UART) {
// Not currently used (because uart triggers in hw have problems)
powerFSM.trigger(EVENT_SERIAL_CONNECTED);
} else {
// We woke for some other reason (button press, uart, device interrupt)
//uint64_t status = esp_sleep_get_ext1_wakeup_status();
DEBUG_MSG("wakeCause %d\n", wakeCause);
#ifdef BUTTON_PIN