From 74d5b1b841b87e323c1047b18c74cfe7bef6c1a5 Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Tue, 9 Oct 2012 11:39:39 -0700 Subject: [PATCH] ArduCopter: Provide AP_Semaphore instance for SPI3 bus on APM2. --- ArduCopter/ArduCopter.pde | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ArduCopter/ArduCopter.pde b/ArduCopter/ArduCopter.pde index 16510e32cc..a14491bd24 100644 --- a/ArduCopter/ArduCopter.pde +++ b/ArduCopter/ArduCopter.pde @@ -172,7 +172,8 @@ APM_RC_APM1 APM_RC; // Dataflash //////////////////////////////////////////////////////////////////////////////// #if CONFIG_APM_HARDWARE == APM_HARDWARE_APM2 -DataFlash_APM2 DataFlash; +AP_Semaphore spi3_semaphore; +DataFlash_APM2 DataFlash(&spi3_semaphore); #else DataFlash_APM1 DataFlash; #endif @@ -225,7 +226,11 @@ AP_Compass_HMC5843 compass; #endif #ifdef OPTFLOW_ENABLED -AP_OpticalFlow_ADNS3080 optflow(OPTFLOW_CS_PIN); + #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 #else AP_OpticalFlow optflow; #endif