Update adc.cpp

This commit is contained in:
David Sidrane
2016-05-31 17:14:51 -10:00
committed by Lorenz Meier
parent 9833ef13fb
commit 69d0a78c54
+2
View File
@@ -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,