fix(nrf52): enable USB/charge detection on Seeed Wio Tracker L1 (#10941)
isCharging()/getHasUSB() were hard-compiled to always return false on this board: the nrfx_power_usbstatus_get() block in Power.cpp that derives them is gated behind #ifdef NRF_APM, and this board's variant.h never defined it - unlike tracker-t1000-e and wio-tracker-wm1110, which do. Confirmed on hardware: before this change, `Battery: usbPower=0, isCharging=0` regardless of actual USB/charge state; after, `usbPower=1, isCharging=1` while genuinely on USB power with a battery attached. Same underlying gap as #4367, fixed for tracker-t1000-e and wio-tracker-wm1110 in #4376 (which also fixed a deeper bug where PowerStatus notifications were gated behind a battery-level null check - that part is already fixed generically in Power.cpp today, so this board only needed the define). Looks like a simple oversight from when this board was added, since it's newer than the two boards #4376 touched. Assisted-by: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Andrew Yong <me@ndoo.sg>
This commit is contained in:
@@ -112,6 +112,8 @@ static const uint8_t SCL = PIN_WIRE_SCL;
|
||||
#define ADC_MULTIPLIER 2.0
|
||||
#define BATTERY_PIN PIN_VBAT // PIN_A7
|
||||
#define AREF_VOLTAGE 3.6
|
||||
// We rely on the nrf52840 USB controller to tell us if we are hooked to a power supply
|
||||
#define NRF_APM
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// GPS L76KB
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
Reference in New Issue
Block a user