From 898ad7432b3b60bb700fa7b2518a736ac091a503 Mon Sep 17 00:00:00 2001 From: priseborough Date: Mon, 3 Nov 2014 18:33:56 +1100 Subject: [PATCH] Plane : Only build optical flow with PX4 board Fixes SITL compile errors --- ArduPlane/config.h | 10 +++------- ArduPlane/system.pde | 3 +++ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/ArduPlane/config.h b/ArduPlane/config.h index 17a5b71b43..b105c64485 100644 --- a/ArduPlane/config.h +++ b/ArduPlane/config.h @@ -80,10 +80,6 @@ #ifndef FRSKY_TELEM_ENABLED # define FRSKY_TELEM_ENABLED DISABLED #endif -#ifndef OPTFLOW -# define OPTFLOW DISABLED -#endif - #endif ////////////////////////////////////////////////////////////////////////////// @@ -144,10 +140,10 @@ // #ifndef OPTFLOW -#if CONFIG_HAL_BOARD == HAL_BOARD_APM1 || CONFIG_HAL_BOARD == HAL_BOARD_APM2 - # define OPTFLOW DISABLED -#else +#if CONFIG_HAL_BOARD == HAL_BOARD_PX4 # define OPTFLOW ENABLED +#else + # define OPTFLOW DISABLED #endif #endif diff --git a/ArduPlane/system.pde b/ArduPlane/system.pde index 5c34cef30c..b3c313794b 100644 --- a/ArduPlane/system.pde +++ b/ArduPlane/system.pde @@ -220,7 +220,10 @@ static void init_ardupilot() reset_control_switch(); // initialise sensor +#if OPTFLOW == ENABLED optflow.init(); +#endif + } //********************************************************************************