Add persistent battery ADC calibration across boards
Add meter-reference calibration with saved ADC corrections, checked persistence and rollback. Preserve existing board coefficients and nRF52 voltage policy, and merge the Mini Repeater feature gates. Validation: 69 focused tests, hosted documentation checks, and four firmware builds passed. Mini Repeater retains calibration and its existing filesystem with 376 flash bytes free; earlier Mini Sensor size failures remain documented.
This commit is contained in:
1 parent
94a3b7e568
commit
ab6412e73c
108 files changed
+1303
-83
No files matched your search
@@ -293,12 +293,24 @@ void NRF52Board::loop() {
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef NRF52_POWER_MANAGEMENT
|
||||
uint16_t NRF52Board::calibrateBatteryMillivolts(uint16_t raw_mv) const {
|
||||
return mesh::power::calibratedMillivolts(
|
||||
raw_mv, mesh::power::configuredAdcPermille());
|
||||
}
|
||||
#ifdef NRF52_POWER_MANAGEMENT
|
||||
if (supportsBatteryCalibration() && mesh::power::voltagePolicySupported()) {
|
||||
return mesh::power::calibratedMillivolts(
|
||||
raw_mv, mesh::power::configuredAdcPermille());
|
||||
}
|
||||
#endif
|
||||
return mesh::MainBoard::calibrateBatteryMillivolts(raw_mv);
|
||||
}
|
||||
|
||||
float NRF52Board::getAdcMultiplier() const {
|
||||
#ifdef NRF52_POWER_MANAGEMENT
|
||||
if (supportsBatteryCalibration() && mesh::power::voltagePolicySupported()) {
|
||||
return mesh::power::configuredAdcPermille() / 1000.0f;
|
||||
}
|
||||
#endif
|
||||
return mesh::MainBoard::getAdcMultiplier();
|
||||
}
|
||||
|
||||
#if NRF52_WATCHDOG_TIMEOUT_SECONDS > 0
|
||||
static void reloadWatchdogChannels() {
|
||||
|
||||
Reference in new issue
Block a user