1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 12:55:19 +03:00
Commit graph

64 commits

Author SHA1 Message Date
jflyper
ff16686893 White space tidy 2020-02-17 23:54:57 +13:00
Dominic Clifton
2fead0aedf Log disarm reason. 2020-01-16 20:16:11 +01:00
mikeller
93c708f57d Refactored 'WAS_EVER_ARMED' arming flag to be only enabled on first disarm. 2019-11-30 15:01:55 +13:00
mikeller
4a7904695e Moved 'config.[ch]' into the 'config/' directory. 2019-10-28 11:17:25 +13:00
Tony Cabello
b9360eef4e Simplified logic for recovery delay 2019-04-16 04:27:23 +02:00
Tony Cabello
7480552a62 USE_GPS_RESCUE condition is now used in failsafe.c 2019-04-14 14:15:17 +02:00
Tony Cabello
d829563179 GPS Rescue procedure can be aborted by moving sticks, with a configurable delay after recovering rx 2019-04-14 14:15:17 +02:00
Bruce Luckcuck
330d93eb5b Add CMS failsafe setup menu
Located under the Features top-level menu. Allows configuring the failsafe procedure (like selecting GPS-RESCUE if applicable).

Bounded with `#ifdef USE_CMS_FAILSAFE_MENU` so it can be disabled for space critical targets.
2019-01-10 15:22:36 -05:00
mikeller
0bce8549ee Renamed 'fc/fc_' files to remove the double 'fc'. 2018-08-26 14:07:06 +12:00
s0up
33b752a55c oops, derp 2018-06-22 17:08:48 -07:00
s0up
8627c53c19 failsafe fix potentially 2018-06-22 17:07:45 -07:00
s0up
7621bad1f8 possibly fix failsafe when throttle low delay no exist 2018-06-08 16:54:51 -07:00
Cleric-K
e17abc4063 Failsafe switch choosable behavior #5994
The `failsafe_kill_switch` parameter has been renamed to
`failsafe_switch_mode` and it determines what happens
when the Failsafe mode is activated with an AUX switch.
It takes one of three values:
  0 - simulates RC signal loss - thus activates Stage1 failsafe
      (former behavior when kill switch option was OFF)
  1 - disarms immediately
      (former behavior when kill switch option was ON)
  2 - activates the failsafe procedure (Stage2) immediately (new)
2018-05-29 23:28:09 +03:00
jflyper
041bfb22c6 Create a pg for rxConfig 2018-05-27 09:13:04 +09:00
mikeller
2feae20c32 Replaced instances of '#include <platform.h>' with '#include "platform.h"'. 2018-05-24 23:46:19 +12:00
s0up
cc1bb05a1e revert failsafe removal of else 2018-05-20 19:08:09 -07:00
s0up
ac6b8088c9 add gps rescue mode 2018-05-20 16:28:17 -07:00
blckmn
a9f74cd6df Removed excess trailing spaces before new lines on licenses. 2018-04-25 20:58:00 +10:00
blckmn
46fe22b4bd Direct license replacement 2018-04-22 09:22:46 +10:00
mikeller
b489d0ba9d Renamed 'parameter_group' to 'pg'. 2017-12-19 23:36:31 +13:00
Blaine
9556ea6bf5 Squash and rebase 2017-10-18 00:38:13 -07:00
borisbstyle
a59d09e65e Decrease default failsafe delay 2017-08-07 09:00:47 +02:00
Dan Nixon
312a7d73b9 Disable arming as soon as an RX link is lost 2017-07-30 15:56:23 +01:00
Martin Budden
d180266f7d Improved rx, failsafe and pid structure alignments 2017-07-29 17:35:43 +01:00
Martin Budden
3a179f80e6 Update PG versions 2017-07-19 13:00:49 +01:00
Martin Budden
6869d78941 Better structure alignment to avoid padding 2017-07-18 11:32:05 +01:00
mikeller
31df82db2d Reworked arming conditions. 2017-06-30 08:43:46 +12:00
Dominic Clifton
db006b1585 Merge pull request #2856 from ledvinap/improvement-64bit-boxid
array based box masks
2017-06-19 13:31:08 +12:00
Martin Budden
23f158913e Moved time functions out of system.h into time.h 2017-05-26 14:03:28 +01:00
Martin Budden
50ac13d79b Minor blackbox code tidy 2017-05-02 07:13:55 +01:00
G. Torreilles
398df910f7 Fix #2626
Fix swapped terms in function documentation. #2626
2017-03-11 23:19:52 +01:00
Martin Budden
a94318a75f Added PG config definitions 3 2017-02-25 11:29:55 +00:00
Martin Budden
f6c8319361 Removed a number of static config pointers 2017-02-02 10:41:19 +00:00
Martin Budden
5851b21e4a Removed a number of static config pointers 2017-02-01 12:58:29 +00:00
Martin Budden
79d4b2146d Preparation for conversion to parameter groups 2017-02-01 08:46:19 +00:00
Martin Budden
a771280b50 Moved config.c from config directory to fc directory 2016-10-18 08:57:39 +01:00
Martin Budden
a11d0bdb4d Split escAndServoConfig into motor and servo parts 2016-09-26 19:24:52 +01:00
Martin Budden
541f4d4018 Directory rearrangement to reflect cleanflight changes 2016-08-07 13:44:00 +01:00
Zap Andersson
0fb34a64b5 Fix tabs again 2016-03-20 13:25:40 +01:00
Zap Andersson
c0e01e8d2b Add 'WAS_EVER_ARMED' arming flag 2016-03-19 16:16:49 +01:00
Zap Andersson
ca0fb6c9cf Made the beeper for "RX Lost" shut up if RX was never gained in the 1st place.
Shuts quad up when you just put it down on the ground, or just plug it into USB or whatever.
2016-03-19 13:01:53 +01:00
borisbstyle
99d9d7483f Add failsafe_procedure 2016-02-09 12:06:00 +01:00
Dominic Clifton
4da387e93d More cleanup of MPU driver code. Support MPU INT on CC3D and Naze32
Rev6.

MPU6050 Correction From merge
2015-10-16 10:40:54 +02:00
borisbstyle
4b7fd5a2de Restore Original CF Failsafe 2015-10-12 23:38:52 +02:00
borisbstyle
52172ef50f Betaflight simplified Failsafe // Fixes failsafe issues 2015-10-02 23:32:45 +02:00
ProDrone
5ca5c2d161 Adapted RX suspend & resume on EEPROM read & write
Modified to make mechanism use time instead of counters for call
frequency independency.
Skipping RC samples uses a counter for time independency.

Also LED and beeper patterns were changed by previous implementation.
Corrected with RX supend/resume feedback to failsafe system.
2015-09-07 14:19:12 +02:00
ProDrone
f0681de53d Updates and feature additions to failsafe system.
- Added failsafe flightmode and rc control box.

To make failsafe procedure a separate flight mode and make it possible
to trigger failsafe with an AUX switch.

- Failsafe mode is activated when failsafe is active.

RC link lost is simulated with the failsafe AUX switch.
When NOT armed: failsafe switch to failsafe mode is shown in GUI (mode
tab).

- Activate failsafe mode with AUX switch.

- Prevent arming when failsafe via AUX switch is active (safety issue).

- Make failsafe disarm if motors armed and throttle was LOW (2D & 3D)
for `failsafe_throttle_low_delay` time (__JustDisarmEvent__).

Applied code changes to effectively add pull request: Make failsafe
disarm if motors armed and throttle low #717.

- Use failsafeIsMonitoring() to actually start monitoring.

- Added `failsafe_kill_switch` to code.

When set to 1 (0 is default), the failsafe switch will instantly disarm
(__KillswitchEvent__) instead of executing the landings procedure.
Arming is NOT locked after
this, so the craft could be re-armed if needed.
This is intended for racing quads where damage and danger must be
minimized in case of a pilot error.

- Added `failsafe_throttle_low_delay`, adapted documentation.

Used to adjust the time throttle level must have been LOW
to _only disarm_ instead of _full failsafe procedure_
(__JustDisarmEvent__).

- Updated the failsafe documentation.

- Re-enable arming at end of failsafe procedure.

At the end of a handled failsafe event, that means: auto-landing,
__JustDisarmEvent__ or __KillswitchEvent__, the RX link is monitored for
valid data.
Monitoring is a part of the failsafe handling, which means the craft is
still in failsafe mode while this is done.
Arming is re-enabled (allowed) when there is a valid RX link for more
then XX seconds, where XX depends on the handled event like this:
1. XX = 30 seconds after auto landing.
2. XX = 3 seconds after __JustDisarmEvent__.
3. XX = 0 seconds after __KillswitchEvent__.

NOTE: When armed via an AUX switch, you will have to switch to the
disarmed position at the very end to be able to re-arm.
The failsafe mode will not end until you do.

- __KillswitchEvent__ has now priority over __JustDisarmEvent__

- Apply rxfail values instantly when failsafe switch is ON

- Added missing cases to display.c

Show M when failsafe is monitoring for RX recovery (AND disarming when
armed with a switch).

===

Reworked the code from counter-based to time-based.

- AUX failsafe switch now has identical behavior to RX loss.

- Added RX failure and RX recovery timing.

- __KillswitchEvent__ skips RX failure detection delay (direct disarm).

===

[UNIT TESTS]

Adapted failsafe related unittests from counter-based to time-based

- Added failsafeOnValidDataFailed() to some tests

- Removed duplicate test setup from rc_controls_unittest.cc

- Removed magic numbers from rx_ranges_unittest.cc and rx_rx_unittest.cc

- Reworked all test-cases for flight_failsafe_unittest.cc
2015-09-04 16:55:40 +02:00
Dominic Clifton
064de090a0 Even more cleanups to the new beeper code. Seperate beeper mode and
priority via simpler static declaration - removes giant switch
statement.  Use a new method when beeping out GPS status.  Lower memory
usage. Smaller code size.  Beeper priority now only handled in a single
place.
2015-04-25 10:39:14 +02:00
Dominic Clifton
bad0b1b04d Fix random RX loss beep when using Serial RX receivers. 2015-04-23 16:36:56 +02:00
Dominic Clifton
7266d42466 Cleanup failsafe beeper code and update failsafe unit tests. 2015-04-23 15:55:04 +02:00