This commit is contained in:
rusefi 2019-06-15 19:46:50 -04:00
parent fb36ef4708
commit 6dac13a2f8
1 changed files with 2 additions and 0 deletions

View File

@ -17,8 +17,10 @@
#define voltsToAdc(volts) ((volts) * (ADC_MAX_VALUE / (engineConfiguration->adcVcc)))
// voltage in MCU universe, from zero to VDD
#define getVoltage(msg, hwChannel) (adcToVolts(getAdcValue(msg, hwChannel)))
// Board voltage, with divider coefficient accounted for
#define getVoltageDivided(msg, hwChannel) (getVoltage(msg, hwChannel) * engineConfiguration->analogInputDividerCoefficient)
#endif /* ADC_MATH_H_ */