1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 08:45:36 +03:00
Commit graph

61 commits

Author SHA1 Message Date
Martin Budden
58c85029d6 Removed unnecessary #includes 2016-10-26 05:15:26 +01:00
Martin Budden
a771280b50 Moved config.c from config directory to fc directory 2016-10-18 08:57:39 +01:00
Martin Budden
c0d87ca657 Improved consistency of update fn naming. GPS update tidy. 2016-10-16 08:18:03 +01:00
Martin Budden
2f9ca4355c currentTime passed in scheduler task call 2016-09-17 16:01:37 +01:00
Martin Budden
a257210b56 Split features into a separate module 2016-09-04 18:48:58 +01:00
Martin Budden
541f4d4018 Directory rearrangement to reflect cleanflight changes 2016-08-07 13:44:00 +01:00
Martin Budden
0de27cf7c2 Used forward declarations to remove #includes from header files 2016-08-07 01:28:17 +02:00
borisbstyle
b581f4c39a Revert "Used forward references to remove #includes from header files" 2016-08-04 01:41:58 +02:00
Martin Budden
f6194f0eb7 Used forward references to remove #includes from header files 2016-08-03 21:19:40 +01:00
Martin Budden
c076bc3e2d Minor build optimisations 2016-07-11 20:11:09 +01:00
Martin Budden
f0f2941bb6 Moved scheduler into separate directory. Moved task declarations into header file. 2016-06-15 07:35:17 +01:00
Martin Budden
825475fd43 Added new debug mode to time pidloop subtasks. 2016-05-05 10:28:26 +01:00
Martin Budden
2bae11d581 Added tasks page to OLED display. 2016-05-04 20:25:19 +01:00
Konstantin Sharlaimov (DigitalEntity)
5df8ca926c Quaternion-based DCM IMU (original code my S.Madgwick)
Restore binaries from merge
2015-10-22 10:45:36 +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
2c79b9777e Large code re-organization which separates some key tasks in the rx
code.

Tested with X8R in SBus and PWM, and Spek Sat, GR-24 PPM, PWM and SUMD,
Spek PPM
2015-08-20 01:46:29 +01:00
Dominic Clifton
402f90cc71 OLED - Use less verbose welcome page. 2015-08-05 04:53:09 +01:00
Michael Hope
5c6760fd82 various: tidy up various things found when building with a C++ compiler.
Remove duplicate consts.
Pull in the include files where functions and variables are declared.
Mark file local but duplicated variables as static.
Mark some variable declarations as extern.
Remove duplicated variable definition.

Signed-off-by: Michael Hope <mlhx@google.com>
2015-06-04 22:32:31 +02:00
Michael Hope
31f933ac21 various: mark more constant data so it goes into flash instead of RAM.
Signed-off-by: Michael Hope <mlhx@google.com>
2015-05-29 05:42:08 +02:00
Sam Cook
593db0ce1e Fix compilation errors when GPS is not #defined 2015-05-07 02:16:21 +01:00
Dominic Clifton
9e705a511a Merge pull request #829 from Pierre-A/micro_update_PA
Just a micro correction
2015-05-04 09:11:13 +01:00
Pierre-A
05176a196a Just a micro correction 2015-04-30 10:16:25 +02:00
Dominic Clifton
407f71ce6e Merge branch 'rework-failsafe' 2015-04-22 21:25:07 +02:00
Dominic Clifton
581b0cd897 Fix compiler warning regarding failsafeIndicator 2015-04-22 21:15:47 +02:00
Dominic Clifton
ebd5475a55 DISPLAY - Allow FC to boot normally if OLED display is not connected at
boot.  FC can detect when the display is unplugged and recovers after
display I2C timeouts.
2015-04-18 20:13:46 +01:00
Dominic Clifton
c8c0c85656 First-cut of a refactored failsafe system.
* fixes issue where indicators would flash when SBus RX entered failsafe
mode.
* fixes bug where turning off a TX for an SBus RX would instantly disarm
when using a switch to arm when the channel went outside the arming
range.
* introduces failsafe phases to make the system more understandable.
* allows the system to ask if rxSignalIsBeing received for all RX
systems: PPM/PWM/SerialRX/MSP.  Also works when a serial data signal is
still being received but the data stream indicates a failsafe condition
- e.g.  SBus failsafe flags.
* failsafe settings are no-longer per-profile.

Untested: Sumd/Sumh/XBus/MSP (!)
Tested: SBus X8R, Lemon RX Sat, X8R in PWM, Spektrum PPM.
2015-04-16 01:31:12 +01:00
Dominic Clifton
a6dc7148c4 Change Profile display page so things fit better. 2015-03-28 19:20:21 +00:00
Dominic Clifton
74c605ab9b Change Delta to 'Dt' on display so that larger delta times fit. 2015-03-28 19:16:51 +00:00
Dominic Clifton
704ace82ec Reduce display update frequency to allow more CPU time for GPS frame
processing when unarmed.
2015-03-28 18:55:18 +00:00
Dominic Clifton
4746b336b9 Tweak to GPS page to show when Space Vehicle updates are received via a
ticker next to the bargraphs which updates each time SV info is
received.

Some code-size improvements optimizations could be done.
2015-03-10 23:01:06 +00:00
Dominic Clifton
b595b49ca8 Decouple roll and pitch rates. MSP clients take note of updated
MSP_RC_TUNING/MSP_SET_RC_TUNING commands.
2015-03-07 15:11:20 +00:00
Dominic Clifton
b4e4684ac7 Avoid resetting page cycle index when re-enabling page cycling so that
it is possible to stop on a page, inspect it, and then resume cycling at
the point that it was stopped.
2015-02-22 14:42:43 +00:00
Dominic Clifton
e554f73f5c Update the sensors page to show inclination, heading, estimated G and
the value for small angle.  The latter is to help get field reports to
help with a problem where sometimes the aircraft won't arm because the
FC thinks it's tilted over too much.
2015-02-18 19:29:47 +00:00
Dominic Clifton
6de42dd0de Display version on the OLED display. 2015-02-02 22:30:59 +00:00
Dominic Clifton
55cac2bdeb Finally rename flight.c/.h to pid.c/.h. Cleanup some dependencies.
Relocate more code.
2015-02-01 00:39:38 +01:00
Dominic Clifton
8cc9e8ca37 More relocation of variables. 2015-02-01 00:03:46 +01:00
Pierre Hugo
be03ed95fa Renamed min, max and abs macros to MIN MAX and ABS. 2015-01-23 22:40:00 -08:00
Dominic Clifton
947bb0d918 Minor code size reduction. Adding some const correctness. 2015-01-15 10:48:54 +00:00
Dominic Clifton
183c5f8e16 Add MPU9150 mag support and mag autodetection. Add AK8975 mag driver.
Note: not working on the sparky, MPU9150 needs passthough enabling but
when enabled the mag and gyro won't ack on the default addresses.  Needs
further investigation.
2014-12-21 23:40:48 +00:00
Dominic Clifton
d8b5f6c60c GPS - Add satellite strength bargraphs to OLED display. 2014-12-13 21:58:54 +00:00
Dominic Clifton
9cc7a5aab1 DISPLAY - Skip GPS page if GPS is not enabled. 2014-12-13 19:40:19 +00:00
Dominic Clifton
9bcc0acd18 DISPLAY - Only compile in GPS page if GPS is enabled. 2014-12-13 19:37:27 +00:00
Dominic Clifton
ce6582b88a GPS - remove temporary hack for fixing the OLED page to the GPS page.
Fix incorrect flag usage.
2014-12-13 03:45:39 +00:00
Dominic Clifton
27ae6fdb72 GPS - move debug code for gps OLED page around. 2014-12-13 02:19:49 +00:00
Dominic Clifton
20f32d632c GPS - differenciate between timeouts and crc errors. Improve packet
logging.  Cleanup UBLOX packet parsing.
2014-12-12 18:26:38 +00:00
Dominic Clifton
1d5c2fb13e GPS - fix ubox maximum packet size comparisons. Increase UBlox buffer
size to work with Glonass MSG-SVINFO packets.  Skip data from packets
that are too large to process without attempting to process a large
payout as packet data.  Ignore GPS presence check when enabling
passthrough mode so that it is possible to configure a GPS unit via the
FC without the GPS unit actually having communicated to the FC first.
2014-12-12 16:32:26 +00:00
Dominic Clifton
6ce288063e GPS - Add packet logging to the OLED display. Allow autobauding to be
enabled/disabled via cli (disabled by default now).  Fix missing rate
configuration for UBLOX SVINFO which would have resulted in missing
satallite counts.
2014-12-12 14:43:59 +00:00
Dominic Clifton
2778ad0c5d Fix gps error counter so that it is meaningful, it was being reset each
time the gps unit was reinitialised leading users to think there were no
GPS errors.
2014-12-11 16:31:14 +00:00
Dominic Clifton
80acc39a46 GPS page on the display to aid GPS outdoor testing. 2014-12-11 15:41:18 +00:00
Dominic Clifton
c364d971a0 Some OLED displays do not respond on the first initialisation so refresh
the display when the page changes in the hopes the hardware responds.
This also allows the user to power off/on the display or connect it
while powered.
2014-11-14 00:48:33 +00:00