Skip to content
Snippets Groups Projects
Commit 69d0a78c authored by David Sidrane's avatar David Sidrane Committed by Lorenz Meier
Browse files

Update adc.cpp

parent 9833ef13
No related branches found
No related tags found
No related merge requests found
......@@ -350,12 +350,14 @@ ADC::update_system_power(hrt_abstime now)
system_power.voltage5V_v = 0;
#if defined(ADC_5V_RAIL_SENSE)
for (unsigned i = 0; i < _channel_count; i++) {
if (_samples[i].am_channel == ADC_5V_RAIL_SENSE) {
// it is 2:1 scaled
system_power.voltage5V_v = _samples[i].am_data * (6.6f / 4096);
}
}
#endif
/* Note once the board_config.h provides BOARD_ADC_USB_CONNECTED,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment