Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Failsafe routine
- if (feature(FEATURE_FAILSAFE) || feature(FEATURE_FW_FAILSAFE_RTH)) {
- if (failsafeCnt > (5 * cfg.failsafe_delay) && f.ARMED) { // Stabilize, and set Throttle to specified level
- for (i = 0; i < 3; i++)
- rcData[i] = mcfg.midrc; // after specified guard time after RC signal is lost (in 0.1sec)
- rcData[THROTTLE] = cfg.failsafe_throttle;
- buzzer(BUZZER_TX_LOST_ARMED);
- if ((failsafeCnt > 5 * (cfg.failsafe_delay + cfg.failsafe_off_delay)) && !f.FW_FAILSAFE_RTH_ENABLE) { // Turn OFF motors after specified Time (in 0.1sec)
- mwDisarm(); // This will prevent the copter to automatically rearm if failsafe shuts it down and prevents
- f.OK_TO_ARM = 0; // to restart accidentely by just reconnect to the tx - you will have to switch off first to rearm
- buzzer(BUZZER_TX_LOST);
- }
- failsafeEvents++;
- }
- if (failsafeCnt > (5 * cfg.failsafe_delay) && !f.ARMED) { // Turn off "Ok To arm to prevent the motors from spinning after repowering the RX with low throttle and aux to arm
- mwDisarm(); // This will prevent the copter to automatically rearm if failsafe shuts it down and prevents
- f.OK_TO_ARM = 0; // to restart accidentely by just reconnect to the tx - you will have to switch off first to rearm
- buzzer(BUZZER_TX_LOST);
- }
- failsafeCnt++;
- }
- // end of failsafe routine - next change is made with RcOptions setting
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement