1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-15 20:35:33 +03:00
Commit graph

70 commits

Author SHA1 Message Date
Dominic Clifton
2fead0aedf Log disarm reason. 2020-01-16 20:16:11 +01:00
mikeller
5808bfd6f3 Improved tests. 2019-11-21 19:51:53 +13:00
mikeller
a045a9c672 Improved compass calibration. 2019-11-19 01:08:44 +13:00
mikeller
ef556c0f59 Introduced 'baroStartCalibration()' / 'baroSetGroundLevel()' to make barometer code more self contained. 2019-11-17 23:34:10 +13:00
mikeller
a21d0f5d31 Fixed potentially incorrect calculation in ACC calibration if non-default cycle number is used. 2019-11-17 10:58:28 +13:00
mikeller
4a7904695e Moved 'config.[ch]' into the 'config/' directory. 2019-10-28 11:17:25 +13:00
mikeller
0a0d3631a7 Renamed 'rxRuntimeConfig' to 'rxRuntimeState'. 2019-10-22 00:12:51 +13:00
mikeller
56f3788cff Fixed tests for adjustment ranges. 2019-06-05 00:56:41 +12:00
mikeller
75b1c0d4ce Removed 'slots' from the adjustment range configuration. 2019-06-05 00:56:37 +12:00
Krzysztof Matula
a0b410b902 unit tests update 2019-04-06 21:14:17 +02:00
mikeller
b5908f5bab Applied 'USE_ACC' consistently. 2019-02-08 09:51:48 +13:00
Bruce Luckcuck
42af168854 Optimize rc modes activation conditions processing
Analyze the rc modes activation conditions and only process configured entries. Previously the entire possible list was processed even though typically only a handful are configured.

Reduces the RX task processing time by about 25% (~44us to ~33us) with an average setup of 3 modes configured (F405, SBUS). Processing time savings will diminish as the user configures more modes. But typically far fewer than the maximum of 20 will be configured.
2019-02-05 16:05:16 -05:00
mikeller
18496fe745 Fixed unit tests using 'ledstrip.c'. 2019-01-21 01:01:05 +13:00
mikeller
1771ea687f Fixed tests. 2018-12-16 11:28:04 +13:00
mikeller
0bce8549ee Renamed 'fc/fc_' files to remove the double 'fc'. 2018-08-26 14:07:06 +12:00
mikeller
6de1c32d9d Added shadow copies for CLI and MSP. 2018-08-21 00:36:47 +12:00
mikeller
8abf138e2a Fixed tests, SPRACINGF3OSD. 2018-08-21 00:36:31 +12:00
Robert Lacroix
cb792f30d2 Delay allowing sticky modes
On bootup aux channels start out at default and allow sticky modes right away,
although they should only be allowed once they are actually not active.

_Legal disclaimer: I am making my contributions/submissions to this project solely in my personal capacity and am not conveying any rights to any intellectual property of any third parties._
2018-07-16 13:50:55 +02:00
Bruce Luckcuck
1e6e9e719f Add guard time between dshot beacon and arming/disarming
Tries to prevent DSHOT beacon commands from interfering with commands to set the motor direction.

Adds a 2 second delay after disarming before DSHOT beacon commands will be sent. This attempts to prevent the beacon commands from interfering with the motor direction reset that happens after using crash flip mode.

During arming if a DSHOT beacon command has been sent within 2 seconds the arming will be delayed until the 2 seconds have passed. This attempts to prevent interference with the motor direction commands sent at arming.
2018-06-09 18:59:59 -04:00
jflyper
041bfb22c6 Create a pg for rxConfig 2018-05-27 09:13:04 +09:00
Bruce Luckcuck
ff59c37fdb Only allow gyro_to_use = BOTH if both detected gyros are the same type
Since we currently don't have per gyro configuration, trying to use two different gyro types simultaneously may not provide good results or lead to other unforeseen situations like attempting to initialize with settings not applicable to both hardware types.

This logic looks at the detected gyro types and resets to use only the first one if the user selected "BOTH" and they're different hardware types.
2018-05-03 10:34:13 -04:00
Bruce Luckcuck
2610344266 Disable stick command processing while ARMING_DISABLED_RUNAWAY_TAKEOFF is set
Addresses the rare possibility that if runway takeoff triggers and disarms while the pilot has the sticks in some valid stick command configuration. Prevents the stick command from processing until the craft is disarmed and the ARMING_DISABLED_RUNAWAY_TAKEOFF condition is cleared.

For example, if the pilot was mid throttle and went full yaw right and runway takeoff triggered, then camera control would have be entered.
2018-02-24 09:29:19 -05:00
Bruce Luckcuck
a32b05c284 Initial implementation of Runaway Takeoff Prevention (anti-taz)
Detects runaway pidSum values on takeoff and auto-disarms to prevent the "Tasmanian Devil" caused by incorrect props, wrong motor order/direction, incorrect flight controller orientation, etc.  After a successful takeoff and normal flight is detected the feature is disabled for the remainder of the battery.
2018-01-31 07:36:16 -05:00
Martin Budden
7acebf8b34 Increased number of rate profiles to 6 2018-01-31 09:21:53 +00:00
mikeller
ee65eba88d Added selectable RaceFlight rates. 2018-01-19 00:38:14 +13:00
mikeller
b489d0ba9d Renamed 'parameter_group' to 'pg'. 2017-12-19 23:36:31 +13:00
Martin Budden
f527455d34 Blackbox header tidy 2017-11-23 18:24:09 +00:00
Martin Budden
36957d6075 When in ACRO mode use trim sticks to adjust RATE profile 2017-11-17 12:25:14 +00:00
jirif
cbefe71a73 Fast stick commands (#4208)
Implemented time-based stick command handling
2017-09-26 13:36:54 +03:00
jflyper
4a2ef89ea8 Revert left stick constraints and introduce context 2017-07-30 19:12:22 +09:00
mikeller
67acc6c7ec Added beeps to indicate the reason for arming being disabled. 2017-07-04 01:38:04 +12:00
mikeller
31df82db2d Reworked arming conditions. 2017-06-30 08:43:46 +12:00
Dominic Clifton
32fa109a64 Merge pull request #2852 from azolyoung/add-runcam-split-support
Add runcam split support
2017-06-23 08:48:07 +12:00
Michael Keller
f380c3d774 Fixed unit tests. 2017-06-19 13:33:29 +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
2e71ac3b84 Got unit tests working by removing non-working tests 2016-10-16 10:12:41 +01:00
Stephen Willey
38dd09f9b5 Floating point inflight adjustments adjust by 0.01 instead of 0.1 2015-09-18 13:13:31 -07:00
Dominic Clifton
0070573420 Fix unit tests - the tests cannot use a common library of production
since when compiling some test code the idea is to stub out production
functionality rather than call production code.
2015-09-10 02:06:14 +01: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
DarkVegetableMatter
942c89237e Battery auto-detect and LPF for battery monitoring 2015-08-04 03:04:12 +01:00
Dominic Clifton
36c8b482d1 Re-order initialisers to be the same as the structure declation to avoid
GCC compilation error.

Error message is: "sorry, unimplemented: non-trivial designated
initializers not supported"
2015-05-29 19:49:01 +01:00
Dominic Clifton
704dcf46ba Fix all warnings when compiling unit tests.
Use C++11 for the C++ unit test code to make the tests easier to read.
Previously we were using a 17 year old standard (!) (g++98)

GoogleTest is compiled with some additional flags to avoid some specific
warnings.  Consider enabling the warnings when upgrading GoogleTest.

See https://code.google.com/p/googletest/issues/detail?id=433

Closes #941
2015-05-29 15:26:10 +01:00
Dominic Clifton
0df22f8049 Remove some test duplication in RcControls unit rest by using test
fixture classes.
2015-05-29 14:41:27 +01:00
Dominic Clifton
b63e074d0c Fix unit test compilation failure. 2015-04-25 11:00:32 +02:00
Dominic Clifton
519586a5ce Merge branch 'refactoredBeeperCode_181_1' of
git://github.com/ethomas997/cleanflight into
ethomas997-refactoredBeeperCode_181_1

Conflicts:
	src/main/flight/failsafe.c
	src/main/io/beeper.c
	src/main/mw.c
2015-04-23 01:21:27 +02:00
Dominic Clifton
4b4e64e204 Fix unresolved references in unit tests for new failsafe code. 2015-04-16 10:57:27 +01:00
E Thomas
f02d7403af Port of refactored beeper code 181_1
This the "Port of refactored beeper code #669" modification applied to
version 1.8.1 (4/4/2015) of the code.
2015-04-04 17:54:44 -04:00
Dominic Clifton
60a95f1d22 Removing noise from unit tests. 2015-03-09 23:19:21 +01:00
Dominic Clifton
9d0e464aaf Updating unit tests to match roll/pid/yaw rate decoupling. 2015-03-08 00:51:29 +00:00
Dominic Clifton
774abcfab8 Update unit tests. 2015-02-22 14:56:15 +00:00