fix #4367 make USB power detection work correctly on seeed trackers (#4376)

for wio tracker 1110 and 1000-E and possibly other nrf52 boards.
The problem was that nrf52 power stuff wasn't generating regular
powerstatus notifications (because that code was guarded by a batteryLevel
check which was null for those boards).  So I've cleaned up the battery status stuff
a bit and we now have fewer special cases.
Tested on a 1000-E, tracker 1110 and a rak4631 board.

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
geeksville
2024-08-02 18:20:44 -07:00
committed by GitHub
parent 09ea198205
commit dd552a99e1
4 changed files with 87 additions and 83 deletions

View File

@@ -43,6 +43,9 @@ extern "C" {
#define WIRE_INTERFACES_COUNT 1
// We rely on the nrf52840 USB controller to tell us if we are hooked to a power supply
#define NRF_APM
#define PIN_3V3_EN (32 + 1) // P1.01, Power to Sensors
#define PIN_WIRE_SDA (0 + 5) // P0.05
@@ -108,4 +111,4 @@ extern "C" {
* Arduino objects - C++ only
*----------------------------------------------------------------------------*/
#endif // _VARIANT_WIO_TRACKER_WM1110_
#endif // _VARIANT_WIO_TRACKER_WM1110_