ArduCopter: Provide AP_Semaphore instance for SPI3 bus on APM2.

This commit is contained in:
Pat Hickey 2012-10-09 11:39:39 -07:00
parent 0c44d02239
commit 74d5b1b841
1 changed files with 7 additions and 2 deletions

View File

@ -172,7 +172,8 @@ APM_RC_APM1 APM_RC;
// Dataflash // Dataflash
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#if CONFIG_APM_HARDWARE == APM_HARDWARE_APM2 #if CONFIG_APM_HARDWARE == APM_HARDWARE_APM2
DataFlash_APM2 DataFlash; AP_Semaphore spi3_semaphore;
DataFlash_APM2 DataFlash(&spi3_semaphore);
#else #else
DataFlash_APM1 DataFlash; DataFlash_APM1 DataFlash;
#endif #endif
@ -225,7 +226,11 @@ AP_Compass_HMC5843 compass;
#endif #endif
#ifdef OPTFLOW_ENABLED #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 #else
AP_OpticalFlow optflow; AP_OpticalFlow optflow;
#endif #endif