From 2af5ff896de9d509a078b4887207d59fe959048b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 11 Oct 2012 11:51:15 +1100 Subject: [PATCH] ACM-HIL: fixed optflow declaration --- ArduCopter/ArduCopter.pde | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ArduCopter/ArduCopter.pde b/ArduCopter/ArduCopter.pde index a14491bd24..e73e1f05f0 100644 --- a/ArduCopter/ArduCopter.pde +++ b/ArduCopter/ArduCopter.pde @@ -303,9 +303,13 @@ AP_GPS_HIL g_gps_driver(NULL); AP_Compass_HIL compass; // never used AP_Baro_BMP085_HIL barometer; AP_InertialSensor_Stub ins; - #ifdef OPTFLOW_ENABLED -AP_OpticalFlow_ADNS3080 optflow(OPTFLOW_CS_PIN); - #endif +#ifdef OPTFLOW_ENABLED +#if CONFIG_APM_HARDWARE == APM_HARDWARE_APM2 +AP_OpticalFlow_ADNS3080 optflow(&spi3_semaphore,OPTFLOW_CS_PIN); +#else +AP_OpticalFlow_ADNS3080 optflow(NULL,OPTFLOW_CS_PIN); +#endif +#endif #ifdef DESKTOP_BUILD #include SITL sitl;