Update adc.cpp

This commit is contained in:
David Sidrane
2016-06-01 08:36:58 +02: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; system_power.voltage5V_v = 0;
#if defined(ADC_5V_RAIL_SENSE) #if defined(ADC_5V_RAIL_SENSE)
for (unsigned i = 0; i < _channel_count; i++) { for (unsigned i = 0; i < _channel_count; i++) {
if (_samples[i].am_channel == ADC_5V_RAIL_SENSE) { if (_samples[i].am_channel == ADC_5V_RAIL_SENSE) {
// it is 2:1 scaled // it is 2:1 scaled
system_power.voltage5V_v = _samples[i].am_data * (6.6f / 4096); system_power.voltage5V_v = _samples[i].am_data * (6.6f / 4096);
} }
} }
#endif #endif
/* Note once the board_config.h provides BOARD_ADC_USB_CONNECTED, /* Note once the board_config.h provides BOARD_ADC_USB_CONNECTED,