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 20:20:44 -05:00
committed by GitHub
co-authored by GitHub Ben Meadors
parent 09ea198205
commit dd552a99e1
4 changed files with 87 additions and 83 deletions
+4 -1
View File
@@ -40,6 +40,9 @@ extern "C" {
#define NUM_ANALOG_INPUTS (6)
#define NUM_ANALOG_OUTPUTS (0)
// Use the native nrf52 usb power detection
#define NRF_APM
#define PIN_3V3_EN (32 + 6) // P1.6, Power to Sensors
#define PIN_3V3_ACC_EN (32 + 7) // P1.7, Power to Acc
@@ -147,4 +150,4 @@ extern "C" {
* Arduino objects - C++ only
*----------------------------------------------------------------------------*/
#endif // _VARIANT_TRACKER_T1000_E_
#endif // _VARIANT_TRACKER_T1000_E_
+4 -1
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_