mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-04 04:40:50 +00:00
Merge pull request #2040 from D4rk4/master
Disable deep sleep for nRF and force shutdown for RAK463x on discharged battery
This commit is contained in:
commit
05f81922e6
@ -291,8 +291,11 @@ void Power::readPowerStatus()
|
||||
if (batteryLevel->getBattVoltage() < MIN_BAT_MILLIVOLTS) {
|
||||
low_voltage_counter++;
|
||||
DEBUG_MSG("Warning RAK4631 Low voltage counter: %d/10\n", low_voltage_counter);
|
||||
if (low_voltage_counter > 10)
|
||||
powerFSM.trigger(EVENT_LOW_BATTERY);
|
||||
if (low_voltage_counter > 10) {
|
||||
// We can't trigger deep sleep on NRF52, it's freezing the board
|
||||
//powerFSM.trigger(EVENT_LOW_BATTERY);
|
||||
DEBUG_MSG("Low voltage detected, but not triggering deep sleep\n");
|
||||
}
|
||||
} else {
|
||||
low_voltage_counter = 0;
|
||||
}
|
||||
@ -565,11 +568,15 @@ bool Power::axpChipInit()
|
||||
}
|
||||
DEBUG_MSG("=======================================================================\n");
|
||||
|
||||
|
||||
|
||||
// We can safely ignore this approach for most (or all) boards because MCU turned off
|
||||
// earlier than battery discharged to 2.6V.
|
||||
//
|
||||
// Unfortanly for now we can't use this killswitch for RAK4630-based boards because they have a bug with
|
||||
// battery voltage measurement. Probably it sometimes drops to low values.
|
||||
#ifndef RAK4630
|
||||
// Set PMU shutdown voltage at 2.6V to maximize battery utilization
|
||||
PMU->setSysPowerDownVoltage(2600);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PMU_IRQ
|
||||
|
Loading…
Reference in New Issue
Block a user