From 8a314487097c9732761843b3e483403e1dd127c4 Mon Sep 17 00:00:00 2001 From: Siddharth Purohit Date: Sun, 31 May 2020 18:06:07 +0530 Subject: [PATCH] AP_OpticalFlow: move to using CANManager library --- libraries/AP_OpticalFlow/AP_OpticalFlow_HereFlow.cpp | 8 +++----- libraries/AP_OpticalFlow/AP_OpticalFlow_HereFlow.h | 4 ++-- libraries/AP_OpticalFlow/OpticalFlow.cpp | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/libraries/AP_OpticalFlow/AP_OpticalFlow_HereFlow.cpp b/libraries/AP_OpticalFlow/AP_OpticalFlow_HereFlow.cpp index bf01addbd6..bf80ca230c 100644 --- a/libraries/AP_OpticalFlow/AP_OpticalFlow_HereFlow.cpp +++ b/libraries/AP_OpticalFlow/AP_OpticalFlow_HereFlow.cpp @@ -1,18 +1,16 @@ #include -#if HAL_WITH_UAVCAN +#if HAL_ENABLE_LIBUAVCAN_DRIVERS #include "AP_OpticalFlow_HereFlow.h" -#include +#include #include #include extern const AP_HAL::HAL& hal; -#define debug_flow_uavcan(level_debug, can_driver, fmt, args...) do { if ((level_debug) <= AP::can().get_debug_level_driver(can_driver)) { hal.console->printf(fmt, ##args); }} while (0) - //UAVCAN Frontend Registry Binder UC_REGISTRY_BINDER(MeasurementCb, com::hex::equipment::flow::Measurement); @@ -103,5 +101,5 @@ void AP_OpticalFlow_HereFlow::_push_state(void) new_data = false; } -#endif // HAL_WITH_UAVCAN +#endif // HAL_ENABLE_LIBUAVCAN_DRIVERS diff --git a/libraries/AP_OpticalFlow/AP_OpticalFlow_HereFlow.h b/libraries/AP_OpticalFlow/AP_OpticalFlow_HereFlow.h index 3777f38c20..6675481c15 100644 --- a/libraries/AP_OpticalFlow/AP_OpticalFlow_HereFlow.h +++ b/libraries/AP_OpticalFlow/AP_OpticalFlow_HereFlow.h @@ -1,7 +1,7 @@ #pragma once #include "OpticalFlow_backend.h" -#if HAL_WITH_UAVCAN +#if HAL_ENABLE_LIBUAVCAN_DRIVERS #include @@ -32,4 +32,4 @@ private: void _push_state(void); }; -#endif //HAL_WITH_UAVCAN +#endif //HAL_ENABLE_LIBUAVCAN_DRIVERS diff --git a/libraries/AP_OpticalFlow/OpticalFlow.cpp b/libraries/AP_OpticalFlow/OpticalFlow.cpp index 018eacbd39..a4c718c7e7 100644 --- a/libraries/AP_OpticalFlow/OpticalFlow.cpp +++ b/libraries/AP_OpticalFlow/OpticalFlow.cpp @@ -131,7 +131,7 @@ void OpticalFlow::init(uint32_t log_bit) backend = AP_OpticalFlow_MAV::detect(*this); break; case OpticalFlowType::UAVCAN: -#if HAL_WITH_UAVCAN +#if HAL_ENABLE_LIBUAVCAN_DRIVERS backend = new AP_OpticalFlow_HereFlow(*this); #endif break;