mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Allow more precise input voltage divider calibration. (#359)
Finer input voltage calibration Settings divisor is stored as uint16_t, not uint8_t. * Allow more precise input voltage divider calibration. The existing code changed the input voltage by multiple tenths of a volt per adjustment, which is way too coarse. This commit simply multiplies the ADC value (and its divisor) by 4, which allows for finer calibration adjustments. Unfortunately, for safety reasons this requires a settings version bump. While old stored divider values can be detected and multiplied by 4 on startup to update them, if the user downgrades firmware it will happily read the new higher value and cause all sorts of problems (which could be either reading higher *or* lower depending on how getInputVoltageX10's parameter wraps around in old firmware due to incorrect type.
This commit is contained in:
committed by
Ben V. Brown
parent
54ec20cd9f
commit
0c7be326e5
@@ -54,7 +54,7 @@ enum TipType {
|
||||
|
||||
uint16_t getHandleTemperature();
|
||||
uint16_t getTipRawTemp(uint8_t instant);
|
||||
uint16_t getInputVoltageX10(uint8_t divisor);
|
||||
uint16_t getInputVoltageX10(uint16_t divisor);
|
||||
uint16_t getTipInstantTemperature();
|
||||
uint8_t getTipPWM();
|
||||
void setTipPWM(uint8_t pulse);
|
||||
|
||||
Reference in New Issue
Block a user