From 3991f9eff37d1b285342c0b61a8f514c18b87eca Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 29 Oct 2011 18:42:18 +1100 Subject: [PATCH] move g_rc_function[] to RC_Channel library libraries should not rely on data declared in the main program. This caused a build error for the Desktop build for ArduCopter under cygwin --- ArduPlane/ArduPlane.pde | 1 - libraries/RC_Channel/RC_Channel_aux.cpp | 2 +- libraries/RC_Channel/RC_Channel_aux.h | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ArduPlane/ArduPlane.pde b/ArduPlane/ArduPlane.pde index 2ceb2ff77a..55d2e2b93a 100644 --- a/ArduPlane/ArduPlane.pde +++ b/ArduPlane/ArduPlane.pde @@ -402,7 +402,6 @@ static unsigned long nav_loopTimer; // used to track the elapsed time for GP static unsigned long dTnav; // Delta Time in milliseconds for navigation computations static float load; // % MCU cycles used -RC_Channel_aux* g_rc_function[RC_Channel_aux::k_nr_aux_servo_functions]; // the aux. servo ch. assigned to each function AP_Relay relay; //////////////////////////////////////////////////////////////////////////////// diff --git a/libraries/RC_Channel/RC_Channel_aux.cpp b/libraries/RC_Channel/RC_Channel_aux.cpp index 3a2f1e6a7d..79de67e375 100644 --- a/libraries/RC_Channel/RC_Channel_aux.cpp +++ b/libraries/RC_Channel/RC_Channel_aux.cpp @@ -3,7 +3,7 @@ #include #include "RC_Channel_aux.h" -extern RC_Channel_aux* g_rc_function[RC_Channel_aux::k_nr_aux_servo_functions]; // the aux. servo ch. assigned to each function +RC_Channel_aux* g_rc_function[RC_Channel_aux::k_nr_aux_servo_functions]; // the aux. servo ch. assigned to each function // map a function to a servo channel and output it void diff --git a/libraries/RC_Channel/RC_Channel_aux.h b/libraries/RC_Channel/RC_Channel_aux.h index 7e091bf18f..2b7b2724cc 100644 --- a/libraries/RC_Channel/RC_Channel_aux.h +++ b/libraries/RC_Channel/RC_Channel_aux.h @@ -44,5 +44,6 @@ public: }; void update_aux_servo_function(RC_Channel_aux* rc_5, RC_Channel_aux* rc_6, RC_Channel_aux* rc_7, RC_Channel_aux* rc_8); +extern RC_Channel_aux* g_rc_function[RC_Channel_aux::k_nr_aux_servo_functions]; // the aux. servo ch. assigned to each function #endif /* RC_CHANNEL_AUX_H_ */