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

800 commits

Author SHA1 Message Date
Martin Budden
818a91b6c1 Fixed baud rate and inversion. Added more tests 2016-11-17 22:36:11 +00:00
Martin Budden
890eab203b First cut of CRSF RX and telemetry code 2016-11-17 22:36:11 +00:00
Raphael Coeffic
19173e1001 MSP/SPORT: added a new PID configuration script (+ minor fix)
First draft version of the PID configuration script. Please note that this script needs to be copied into /SCRIPTS/TELEMETRY/ on the SD card and renamed to something smaller than 6 characters (OpenTX does not support more for telemetry scripts).

Usage:
 - long press “Menu” to get save/reload functions.
 - press short “Menu” to switch pages.
 - press “+”/“-“ to navigate through fields.
 - press “enter” to edit a field.


implements #1311
2016-11-10 12:40:29 +01:00
Martin Budden
2c9d71aeae Added CMS test code 2016-11-07 20:51:08 +00:00
Raphael Coeffic
b8cb115a0b MSP/SPORT: fixed LUA script 2016-11-03 14:56:18 +01:00
Raphael Coeffic
ce0dd3536e LUA improvements (WiP) 2016-10-31 14:11:37 +01:00
Raphael Coeffic
d38d4949e9 a bit more cleanup 2016-10-31 14:11:37 +01:00
Raphael Coeffic
160bfaf907 Added frame re-assembly to LUA script 2016-10-31 14:11:37 +01:00
Raphael Coeffic
1fc6bca61f Added LUA test script
This LUA script is meant to be run a telemetry script in OpenTX 2.2.
2016-10-31 14:11:36 +01:00
Martin Budden
01be3842c8 Added filter unit test and tidied filter code 2016-10-23 10:10:14 +01:00
Anders Hoglund
15d9eaffd4 Added junittest XML test results. 2016-10-16 17:48:31 +02:00
Martin Budden
f6bcbff239 Got alignsensor unit test working 2016-10-16 12:51:30 +01:00
Martin Budden
2e71ac3b84 Got unit tests working by removing non-working tests 2016-10-16 10:12:41 +01:00
blckmn
9c303d6669 VCP improvements to remove need for delay in serial_cli for F4 targets. 2016-08-13 11:23:35 +10:00
Martin Budden
e9a46c6ebb Cleanup of acc device drivers extern usage CF PR#2117 2016-06-16 18:09:05 +01:00
Martin Budden
f0f2941bb6 Moved scheduler into separate directory. Moved task declarations into header file. 2016-06-15 07:35:17 +01:00
borisbstyle
7386d88d0e Merge corrections 2016-03-01 14:55:04 +01:00
Martin Budden
01a19cdc04 Post rebase fixup. 2016-03-01 12:39:37 +01:00
Martin Budden
32c4348357 Some rework before rebase. 2016-03-01 12:39:26 +01:00
Martin Budden
cd3b584879 Added test to check filling up and emptying queue. 2016-03-01 12:39:20 +01:00
Martin Budden
3fa0163713 More test code. Fixed bug in queueAdd. 2016-03-01 12:39:12 +01:00
Martin Budden
63db2d00f3 Stoppd using TASK_BEEPER in tests, since this is undefined. 2016-03-01 12:38:59 +01:00
Martin Budden
757fb54512 Optimised scheduler queue iterators. 2016-03-01 12:14:21 +01:00
Martin Budden
b22610b9e5 Unittests 2016-03-01 12:13:30 +01:00
borisbstyle
83d8a8441c Remove lowpass.c // replace by pt1
unittests fix
2016-02-10 09:31:55 +01:00
Dominic Clifton
e7620727ff Fix led strip unit test compilation warning. 2016-02-02 23:36:22 +01:00
borisbstyle
cb7028b7f1 Merge remote-tracking branch 'prodrone/improved_rx_failsafe_detection' into betaflight
Conflicts:
	src/main/drivers/accgyro_mpu6500.c
	src/main/drivers/accgyro_spi_mpu6000.c
	src/main/drivers/system.c
	src/main/mw.c
	src/main/rx/rx.c
	src/main/sensors/initialisation.c
2015-10-21 09:21:33 +02:00
ProDrone
a64e2c4f1a Improved RX failsafe detection & handling
modified debug output (currently disabled)

To solve problem as indicated here:
https://github.com/cleanflight/cleanflight/issues/1266#issuecomment-135640133

and here:
https://github.com/cleanflight/cleanflight/pull/1340

and here:
https://github.com/cleanflight/cleanflight/pull/1342

Tested on FrSKY X4RSB with latest CPPM firmware (non-EU version).
Firmware filename: X4R-X4RSB_cppm_non-EU_150630

In both SBUS and CPPM mode.

---
Added delay to rxfail detection

All channels are monitored for bad (out of valid range) pulses.
On bad pulses channel data will HOLD the last value for a period of
MAX_INVALID_PULS_TIME (300ms) before starting rxfail substitution.
This should prevent a too aggressive reaction to small dropouts.

---
Init ARM switch rc channel to OFF for safety

Initialize ARM switch to OFF position when arming via switch is defined.
To prevent arming during init when RX is disconnected and/or when RX is
connected but TX is still off.

---
Modified rx_rx_unittest.cc

Adapted because rxInit() parameters changed.
Added tests for ARM switch initialization.
No further tests added.

---
Move smoothing of rcData to rcCommand

Commit from @borisbstyle pr #1418
rc_smoothing function has changed to leave rcData unchanged in #1418
2015-10-21 01:50:59 +02:00
Dominic Clifton
ddc5a5f15f Add IRQn_Type to tests to fix compilation errors. 2015-10-16 10:40:59 +02:00
Dominic Clifton
526f4777a2 Add IRQn_Type to tests to fix compilation errors. 2015-10-16 08:24:19 +01:00
borisbstyle
4b3ba927e9 Merge branch 'master' into betaflight
Conflicts:
	src/main/blackbox/blackbox_io.c
	src/main/drivers/serial_usb_vcp.c
	src/main/flight/imu.c
	src/main/mw.c
	src/main/target/CC3D/target.h
2015-10-12 23:53:43 +02:00
Dominic Clifton
a319394f6b Merge branch 'blackbox-serial-budget' of https://github.com/sherlockflight/cleanflight-dev into sherlockflight-blackbox-serial-budget
Conflicts:
	src/main/blackbox/blackbox.c
2015-10-12 20:14:20 +01:00
Petr Ledvina
8f3d9fae9a unify typedef struct name_s {} name_t; naming convention 2015-10-12 19:58:12 +01:00
borisbstyle
12c9f65f43 Merge branch 'master' into betaflight
Conflicts:
	Makefile
	docs/Cli.md
	src/main/config/config.c
	src/main/drivers/accgyro_mpu3050.c
	src/main/drivers/accgyro_mpu6050.c
	src/main/drivers/accgyro_mpu6050.h
	src/main/drivers/accgyro_spi_mpu6000.c
	src/main/drivers/accgyro_spi_mpu6000.h
	src/main/drivers/accgyro_spi_mpu6500.c
	src/main/drivers/accgyro_spi_mpu6500.h
	src/main/drivers/barometer_bmp280.c
	src/main/drivers/sensor.h
	src/main/flight/pid.c
	src/main/mw.c
	src/main/rx/rx.c
	src/main/sensors/initialisation.c
	src/main/target/CC3D/target.h
2015-10-07 17:12:54 +02:00
Sean Vig
456396b25a Use fixed point calculation for BMP280 barometer
Substitute the floating point calculation for the comparably much faster
64-bit calculation recommended for a Cortex-M3 (floating point is
recommended only in PC applications with FPU) [1]. Even if we have an
FPU, we round the temperature to the nearest 1/100th of a degree and the
pressure to the nearest 1 Pa, both of which are within the limits of the
fixed-point algorithm's accuracy.

Conflicts:
	src/main/drivers/barometer_bmp280.c
2015-10-06 18:33:23 +01:00
Sean Vig
e5f3f1794f Add tests for BMP280 barometer
Also get rid of the curved quotes for normal quotes (") and make
compensation computations static.
2015-10-06 18:25:59 +01:00
Nicholas Sherlock
6e504ca52a Ability to see how many Tx bytes are free in serial port buffer 2015-10-01 16:48:56 +13:00
borisbstyle
0ea5a99e2b Merge remote-tracking branch 'prodrone/betaflight' into alphaflight 2015-09-19 16:44:11 +02:00
Konstantin Sharlaimov (DigitalEntity)
45a4f11f92 Added #define for imu debug output (+16 squashed commit)
Squashed local commits:

from       : e4265d4a13f63f82d5cf55eea2c091622f96660b
up to (inc): 72416dc74745fa8bae1aded79aa4b9ed0e389076
2015-09-19 14:50:53 +02: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
6706abdb2e Merge branch 'issue_8_sensors_align' of
https://github.com/drtunes/cleanflight into
drtunes-issue_8_sensors_align

Conflicts:
	src/test/Makefile
2015-09-10 02:38:58 +01:00
Dominic Clifton
c4680b3b3d More test code cleanup. 2015-09-10 02:06:15 +01: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
Dominic Clifton
4737f33b19 revert "tests: simplify the build config by building as a library" 2015-09-10 02:06:13 +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
Dominic Clifton
718729504e Allow FC to reverse input channels by using rxrange.
Just reverse the min/max arguments.

Unit tested.

Fixes #1132.
2015-08-20 02:46:03 +01: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
Phillip Jones
f239eb3f35 This addresses issue #8 by adding unit tests for sensorsAlign().
The test file includes a simple independent implementation of
vector rotation. Each of the following sensor_align_e types are
tested:
 * CW0_DEG
 * CW90_DEG
 * CW180_DEG
 * CW270_DEG
 * CW0_DEG_FLIP
 * CW90_DEG_FLIP
 * CW180_DEG_FLIP
 * CW270_DEG_FLIP

For each test, three unit vectors and a random vector are tested.
 * {1, 0, 0}
 * {0, 1, 0}
 * {0, 0, 1}
 * {R, R, R} (where R is a random number)

The vector under test is rotated using the functions defined in the
test file. The output of the test function is compared to the
output of the sensorsAlign() function. The outputs match for all
test conditions.
2015-08-18 14:00:37 -06:00
Dominic Clifton
3878a7ea2c make the rollover pattern tests less verbose 2015-08-18 19:08:37 +01:00
EvilBadger
3879b6c566 Modified VBatt functionality to enable better precision. 2015-08-05 21:34:44 +01:00