diff --git a/docs/software/gps-todo.txt b/docs/software/gps-todo.txt index e3949ac2..45838fa3 100644 --- a/docs/software/gps-todo.txt +++ b/docs/software/gps-todo.txt @@ -8,8 +8,6 @@ time only mode record power measurements and update spreadsheet -fix uart wake from sleep - fix has_gps based on new logic don't send locations if the user has forbidden that (lie to phone so phone won't either) diff --git a/src/sleep.cpp b/src/sleep.cpp index 9503be32..1cc72e93 100644 --- a/src/sleep.cpp +++ b/src/sleep.cpp @@ -261,12 +261,20 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r // We treat the serial port as a GPIO for a fast/low power way of waking, if we see a rising edge that means // someone started to send something - // Alas - doesn't work reliably, instead need to use the uart specific version (which burns a little power) - // FIXME: gpio 3 is RXD for serialport 0 on ESP32 + // gpio 3 is RXD for serialport 0 on ESP32 // Send a few Z characters to wake the port - gpio_wakeup_enable((gpio_num_t)SERIAL0_RX_GPIO, GPIO_INTR_LOW_LEVEL); - // uart_set_wakeup_threshold(UART_NUM_0, 3); - // esp_sleep_enable_uart_wakeup(0); + + // this doesn't work on TBEAMs when the USB is depowered (causes bogus interrupts) + // So we disable this "wake on serial" feature - because now when a TBEAM (only) has power connected it + // never tries to go to sleep if the user is using the API + // gpio_wakeup_enable((gpio_num_t)SERIAL0_RX_GPIO, GPIO_INTR_LOW_LEVEL); + + // doesn't help - I think the USB-UART chip losing power is pulling the signal llow + // gpio_pullup_en((gpio_num_t)SERIAL0_RX_GPIO); + + // alas - can only work if using the refclock, which is limited to about 9600 bps + // assert(uart_set_wakeup_threshold(UART_NUM_0, 3) == ESP_OK); + // assert(esp_sleep_enable_uart_wakeup(0) == ESP_OK); #endif #ifdef BUTTON_PIN gpio_wakeup_enable((gpio_num_t)BUTTON_PIN, GPIO_INTR_LOW_LEVEL); // when user presses, this button goes low