From 9c19ff1a2c756716cbd3062b51efab88c9a871da Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 12 Jul 2012 10:59:32 +1000 Subject: [PATCH] Failsafe: added COMPETITION_MODE --- Tools/Failsafe/Failsafe.pde | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Tools/Failsafe/Failsafe.pde b/Tools/Failsafe/Failsafe.pde index bb456b7d99..5f698aca5b 100644 --- a/Tools/Failsafe/Failsafe.pde +++ b/Tools/Failsafe/Failsafe.pde @@ -23,6 +23,8 @@ Arduino_Mega_ISR_Registry isr_registry; #define HEARTBEAT_PIN A0 #define FAILSAFE_PIN A1 +#define COMPETITION_MODE 0 + void setup() { Serial.begin(115200, 256, 256); isr_registry.init(); @@ -80,11 +82,19 @@ void loop() last_print = tnow; } if (failsafe_enabled || heartbeat_failure) { +#if COMPETITION_MODE + // if we are in failover, send receiver input straight + // to the servos + for (uint8_t ch=0; ch<4; ch++) { + APM_RC.OutputCh(ch, 1000); + } +#else // if we are in failover, send receiver input straight // to the servos for (uint8_t ch=0; ch<4; ch++) { APM_RC.OutputCh(ch, pwm[ch+4]); } +#endif } else { // otherwise send autopilot output to the servos for (uint8_t ch=0; ch<4; ch++) {