1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-03-16 08:29:15 +01:00

LP-480 CopterControl will expect ADC_Init() only if board revision has analog gyro, so be prepared to get NULL from PIOS_BOARD_HW_DEFS_GetAdcCfg()

This commit is contained in:
Vladimir Zidar 2017-04-16 02:44:07 +02:00
parent 83326eaca3
commit 1548312823

View File

@ -185,7 +185,9 @@ void PIOS_BOARD_Sensors_Configure()
#endif
#ifdef PIOS_INCLUDE_ADC
PIOS_ADC_Init(PIOS_BOARD_HW_DEFS_GetAdcCfg(pios_board_info_blob.board_rev));
const struct pios_adc_cfg *adc_cfg = PIOS_BOARD_HW_DEFS_GetAdcCfg(pios_board_info_blob.board_rev);
if(adc_cfg) {
PIOS_ADC_Init(adc_cfg);
# ifndef PIOS_EXCLUDE_ADVANCED_FEATURES
uint8_t adc_config[HWSETTINGS_ADCROUTING_NUMELEM];
HwSettingsADCRoutingArrayGet(adc_config);
@ -195,6 +197,7 @@ void PIOS_BOARD_Sensors_Configure()
}
}
# endif
}
#endif /* PIOS_INCLUDE_ADC */
// internal bmp280 baro