From 9833ef13fb3836f632651b06af808ad4c5a9bd99 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Tue, 31 May 2016 16:47:46 -1000 Subject: [PATCH] Update adc.cpp --- src/drivers/stm32/adc/adc.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/drivers/stm32/adc/adc.cpp b/src/drivers/stm32/adc/adc.cpp index 18d1d2c218..1a8753d0ad 100644 --- a/src/drivers/stm32/adc/adc.cpp +++ b/src/drivers/stm32/adc/adc.cpp @@ -349,12 +349,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, * It must provide the true logic GPIO BOARD_ADC_xxxx macros.