From 2d1e02fadacf8dcf28d4ce3106e211a34a294414 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Wed, 27 Mar 2019 13:49:42 +0900 Subject: [PATCH] AP_OpticalFlow: support cx-of on all boards --- libraries/AP_OpticalFlow/OpticalFlow.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/AP_OpticalFlow/OpticalFlow.cpp b/libraries/AP_OpticalFlow/OpticalFlow.cpp index 20d8dd4ede..3dd5f2e0d5 100644 --- a/libraries/AP_OpticalFlow/OpticalFlow.cpp +++ b/libraries/AP_OpticalFlow/OpticalFlow.cpp @@ -103,9 +103,6 @@ void OpticalFlow::init(void) if (backend == nullptr) { backend = AP_OpticalFlow_PX4Flow::detect(*this); } - if (backend == nullptr) { - backend = AP_OpticalFlow_CXOF::detect(*this); - } #elif CONFIG_HAL_BOARD == HAL_BOARD_SITL backend = new AP_OpticalFlow_SITL(*this); #elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BEBOP @@ -115,6 +112,9 @@ void OpticalFlow::init(void) #elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_CHIBIOS_SKYVIPER_F412 backend = AP_OpticalFlow_Pixart::detect("pixartflow", *this); #endif + if (backend == nullptr) { + backend = AP_OpticalFlow_CXOF::detect(*this); + } } if (backend != nullptr) {