Skip to content

Commit

Permalink
moved ADC offset to be on the volts measured
Browse files Browse the repository at this point in the history
  • Loading branch information
avtoku committed Jul 18, 2024
1 parent d06b1cf commit 63b73b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/drivers/Adc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ void Adc::endDma(ADC_HandleTypeDef * hadc)

for (int i = 0; i < ADC_CHANNELS; i++)
p.volts[i] =
(double) adc_counts[i] * (p.vRef / 65535.0) * cfg_[i].scaleFactor - cfg_[i].offset;
((double) adc_counts[i] * (p.vRef / 65535.0)- cfg_[i].offset) * cfg_[i].scaleFactor;

p.timestamp = time64.Us();
p.drdy = drdy_;
Expand Down

0 comments on commit 63b73b0

Please sign in to comment.