adc: allow board to not define BOARD_ADC_HIPOWER_5V_OC or BOARD_ADC_PERIPH_5V_OC

This commit is contained in:
Beat Küng 2019-06-28 17:48:34 +02:00
parent 5d8710d539
commit 1112828dcf
1 changed files with 8 additions and 0 deletions

View File

@ -452,9 +452,17 @@ ADC::update_system_power(hrt_abstime now)
system_power.servo_valid = BOARD_ADC_SERVO_VALID;
#ifdef BOARD_ADC_PERIPH_5V_OC
// OC pins are active low
system_power.periph_5v_oc = BOARD_ADC_PERIPH_5V_OC;
#else
system_power.periph_5v_oc = 0;
#endif
#ifdef BOARD_ADC_HIPOWER_5V_OC
system_power.hipower_5v_oc = BOARD_ADC_HIPOWER_5V_OC;
#else
system_power.hipower_5v_oc = 0;
#endif
/* lazily publish */
if (_to_system_power != nullptr) {