From 53ddb58c7ba588bff484e6072e8d444185028a0b Mon Sep 17 00:00:00 2001
From: rmackay9 <rmackay9@yahoo.com>
Date: Sat, 21 Apr 2012 20:15:55 +0900
Subject: [PATCH] ArduCopter - changed optflow object to be APM2 version if
 necessary

---
 ArduCopter/ArduCopter.pde | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/ArduCopter/ArduCopter.pde b/ArduCopter/ArduCopter.pde
index 4871a93fa..1e39b0abc 100644
--- a/ArduCopter/ArduCopter.pde
+++ b/ArduCopter/ArduCopter.pde
@@ -199,7 +199,11 @@ static AP_Int8                *flight_modes = &g.flight_mode1;
 #endif
 
 #ifdef OPTFLOW_ENABLED
-	AP_OpticalFlow_ADNS3080 optflow(OPTFLOW_CS_PIN);
+	#if CONFIG_APM_HARDWARE == APM_HARDWARE_APM2
+		AP_OpticalFlow_ADNS3080_APM2 optflow(OPTFLOW_CS_PIN);
+	#else
+		AP_OpticalFlow_ADNS3080 optflow(OPTFLOW_CS_PIN);
+	#endif
 #else
     AP_OpticalFlow optflow;
 #endif
-- 
GitLab