Skip to content
Snippets Groups Projects
Commit c0786207 authored by Alberto Nidasio's avatar Alberto Nidasio
Browse files

[InternalADC] Fixed cppcheck error for `V_DDA_VOLTAGE`

parent 360bf70a
Branches
Tags
1 merge request!102[stm32f7] Add support for stm32f7 microcontrollers
...@@ -137,7 +137,9 @@ InternalADCData InternalADC::sampleImpl() ...@@ -137,7 +137,9 @@ InternalADCData InternalADC::sampleImpl()
{ {
newData.voltage[i] = readChannel(static_cast<Channel>(i)); newData.voltage[i] = readChannel(static_cast<Channel>(i));
newData.voltage[i] = newData.voltage[i] =
newData.voltage[i] * V_DDA_VOLTAGE / ADC_RESOLUTION; newData.voltage[i] *
V_DDA_VOLTAGE // cppcheck-suppress ConfigurationNotChecked
/ ADC_RESOLUTION;
} }
} }
...@@ -161,7 +163,9 @@ InternalADCData InternalADC::sampleImpl() ...@@ -161,7 +163,9 @@ InternalADCData InternalADC::sampleImpl()
if (temperatureRawValue != 0) if (temperatureRawValue != 0)
{ {
newData.temperature = newData.temperature =
temperatureRawValue * V_DDA_VOLTAGE / ADC_RESOLUTION; temperatureRawValue *
V_DDA_VOLTAGE // cppcheck-suppress ConfigurationNotChecked
/ ADC_RESOLUTION;
#ifdef WITHOUT_CALIBRATION #ifdef WITHOUT_CALIBRATION
// Default conversion // Default conversion
...@@ -185,9 +189,10 @@ InternalADCData InternalADC::sampleImpl() ...@@ -185,9 +189,10 @@ InternalADCData InternalADC::sampleImpl()
auto vbatVoltageRawValue = readChannel(static_cast<Channel>(VBAT_CH)); auto vbatVoltageRawValue = readChannel(static_cast<Channel>(VBAT_CH));
ADC->CCR &= ~ADC_CCR_VBATE; ADC->CCR &= ~ADC_CCR_VBATE;
// Conversion
newData.vBat = newData.vBat =
vbatVoltageRawValue * V_DDA_VOLTAGE / ADC_RESOLUTION * VBAT_DIV; vbatVoltageRawValue *
V_DDA_VOLTAGE // cppcheck-suppress ConfigurationNotChecked
/ ADC_RESOLUTION * VBAT_DIV;
} }
return newData; return newData;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment