-
Notifications
You must be signed in to change notification settings - Fork 964
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: device sleep (part 1) #3590
Conversation
Tested with tbeam, t3s3, heltec v3 and heltec wireless paper. Now all wake up from router mode. In case you still experience issues in sleep mode (e.g unresponsive, noise) you'll have to do a factory reset, there may be some wrong setting. |
#endif | ||
#ifdef RF95_IRQ | ||
gpio_wakeup_enable((gpio_num_t)RF95_IRQ, GPIO_INTR_HIGH_LEVEL); // RF95 interrupt, active high | ||
#if defined(RF95_IRQ) && (RF95_IRQ != RADIOLIB_NC) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call. Technically we have targets like the T-Beam that have RF95 macros for the SX1276 and also SX126X ones, so runtime discrimination probably heads off some potential issues there hopefully.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I've tested that already. Working as expected.
This PR fixes some issues introduced in #3251 (e.g. router/repeater/powersave wakeup issues) and does a few debug cosmetics:
The function enableLoraInterrupt() assumes that all LORA/DIO1/CS/RESET GPIOs are RTC GPIOs which is not true (e.g. only RTC GPIOs can be used for ext0).
As a result there are error messages in the log and all devices where the DIO1 pin is not an RTC GPIO will fail to wake up from sleep when a LoRa packet is received (one packet is received though, but processed on the next scheduled wakeup).
This PR replaces the RTC GPIO functions by generic functions which check for RTC GPIO internally and does a check for the validity of RTC GPIOs for DIO1.