bug #376: disable the "wake on serial" feature, because it causes

bogus wakes on TBEAMS because the USB->SERIAL chip pulls the RX input
to ground.  This feature is no longer needed because in !isRouter
nodes we force the node to never sleep anyways when on USB power.

    // 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);
This commit is contained in:
Kevin Hester 2020-10-06 14:24:08 +08:00
parent 7854a22fbf
commit 4ccd03623f
2 changed files with 13 additions and 7 deletions

View File

@ -8,8 +8,6 @@ time only mode
record power measurements and update spreadsheet record power measurements and update spreadsheet
fix uart wake from sleep
fix has_gps based on new logic 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) don't send locations if the user has forbidden that (lie to phone so phone won't either)

View File

@ -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 // 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 // someone started to send something
// Alas - doesn't work reliably, instead need to use the uart specific version (which burns a little power) // gpio 3 is RXD for serialport 0 on ESP32
// FIXME: gpio 3 is RXD for serialport 0 on ESP32
// Send a few Z characters to wake the port // 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); // this doesn't work on TBEAMs when the USB is depowered (causes bogus interrupts)
// esp_sleep_enable_uart_wakeup(0); // 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 #endif
#ifdef BUTTON_PIN #ifdef BUTTON_PIN
gpio_wakeup_enable((gpio_num_t)BUTTON_PIN, GPIO_INTR_LOW_LEVEL); // when user presses, this button goes low gpio_wakeup_enable((gpio_num_t)BUTTON_PIN, GPIO_INTR_LOW_LEVEL); // when user presses, this button goes low