diff --git a/firmware/hw_layer/algo/adc_math.h b/firmware/hw_layer/algo/adc_math.h index 0af7edf09e..02f055df61 100644 --- a/firmware/hw_layer/algo/adc_math.h +++ b/firmware/hw_layer/algo/adc_math.h @@ -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_ */