AP_MSP: fix separate enable of MSP opticalflow

This commit is contained in:
yaapu 2020-09-02 13:16:49 +02:00 committed by Andrew Tridgell
parent 67ed957bf0
commit ed21f9a8c7
1 changed files with 2 additions and 0 deletions

View File

@ -482,11 +482,13 @@ MSPCommandResult AP_MSP_Telem_Backend::msp_process_sensor_command(uint16_t cmd_m
void AP_MSP_Telem_Backend::msp_handle_opflow(const MSP::msp_opflow_sensor_t &pkt)
{
#if HAL_MSP_OPTICALFLOW_ENABLED
OpticalFlow *optflow = AP::opticalflow();
if (optflow == nullptr) {
return;
}
optflow->handle_msp(pkt);
#endif
}
void AP_MSP_Telem_Backend::msp_handle_rangefinder(const MSP::msp_rangefinder_sensor_t &pkt)