Commit graph

1881 commits

Author SHA1 Message Date
Dominic Clifton d4eb558254 Ensure failsafe does not repeatedly call disarm when landed. 2015-04-18 19:00:20 +01:00
Dominic Clifton a34e8f0bdb Update the failsafe so that an extra cycle is not required between some
phase changes.
2015-04-17 00:10:35 +01:00
Dominic Clifton eb74735ee8 First cut of unit tests for reworked failsafe.
In writing these tests a bug was discovered with RX_SERIAL and RX_MSP
failsafe delay timing - the configured delays are not honoured.
2015-04-16 23:35:56 +01:00
Dominic Clifton a5c2c70541 Fix build for targets that don't use BARO_EOC_GPIO. 2015-04-16 20:56:50 +01:00
Dominic Clifton 6d5b44df7a Fix boot failure on Flip32+ Deluxe Acro.
The problem was the MPU6050 EXTI handler was not registered due to baro
detection taking the only callback handler slot.  When the MPU6050 EXTI
was configured the interrupt flag was never cleared which results in the
CPU being starved.
2015-04-16 20:26:20 +01:00
Dominic Clifton 4b7de19460 Update ALIENWIIF1/F3 specific failsafe configuration to fix broken build 2015-04-16 12:37:30 +01:00
Dominic Clifton 4b4e64e204 Fix unresolved references in unit tests for new failsafe code. 2015-04-16 10:57:27 +01:00
Dominic Clifton 35f78d8680 Update comment regarding rx_min_usec and rx_max_usec 2015-04-16 08:53:26 +01:00
Dominic Clifton 7f42149c30 Fix missing & operator. 2015-04-16 02:02:53 +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 0ecf8be233 Merge pull request #743 from SamuelBrucksch/master
Fixed speed according to frsky protocol
2015-04-14 20:17:59 +01:00
Dominic Clifton 21191c0e14 Merge pull request #762 from bhuism/master
fix voltage calculation for smartport telemetry
2015-04-14 20:14:01 +01:00
Dominic Clifton 6eaca17cbd fix unit test compilation errors caused by 0359a32 2015-04-14 19:54:48 +01:00
Dominic Clifton beef2e87d7 Merge branch 'bugfix-sonar-drift' of git://github.com/nebbian/cleanflight into nebbian-bugfix-sonar-drift 2015-04-14 19:45:54 +01:00
Dominic Clifton 1a2ef223a0 SPARKY - Apply Oneshot/PPM timer clash fix.
Closes #756.
2015-04-14 19:29:11 +01:00
Dominic Clifton 436d2ed591 Disable VBAT feature by defualt unless target has on-board voltage
divider.
2015-04-14 16:37:47 +01:00
Dominic Clifton 0dd84f587f Merge pull request #767 from sherlockflight/mixer-profile-cli
Fix CLI: mixer settings should be master values, not profile values
2015-04-14 16:19:20 +01:00
Dominic Clifton 78a4476506 Fix comment typo in failsafe.c 2015-04-14 13:59:11 +01:00
Dominic Clifton f28158a5a7 Cleanup debug code. 2015-04-14 13:59:11 +01:00
Nicholas Sherlock 645f4a4d3b Fix CLI: mixer settings should be master values, not profile values 2015-04-14 11:49:20 +12:00
Bas Huisman 65b6041d1f fix voltage calculation for smartport telemetry 2015-04-13 10:14:55 +02:00
Ben Hitchcock 0359a3280b Bugfix to stop altitude hold drift, especially noticeable in sonar mode.
This uses the raw stick values instead of the calculated RCCommand values to determine whether or not the stick has moved.  The problem was that the RcCommand variable wasn't being reset to the stick position each loop, and so outputs were being treated as inputs.
2015-04-12 15:06:04 +08:00
Dominic Clifton c11c25514b SPRACING32/NAZE32 - Add support for MPU6050 data ready interrupt.
Currently the interrupt handler is unused.  Later it can be used as a
potential source for watchdog checking or to syncronize the system
around new acc/gyro data availability.

Verified on Naze32 rev 3/4/5 and SPRacingF3 targets.
2015-04-11 19:18:11 +01:00
Samuel Brucksch c8a33ab1db Update frsky.c
Changed to a faster calculation
2015-04-08 22:44:44 +02:00
Dominic Clifton d3d9721e91 NAZE - Add support for Naze32_SP (aka PARIS Sirius Air HERO 32). 2015-04-08 20:09:53 +01:00
Dominic Clifton 749160f20e Reset to bootloader after failure mode to allow re-flashing. 2015-04-08 20:07:48 +01:00
Samuel Brucksch 8f165e5224 Update frsky.c
fixed compiling issue
2015-04-08 10:48:22 +02:00
Samuel Brucksch 07294f4d3a Update frsky.c
fixed cast
2015-04-08 09:32:08 +02:00
Samuel Brucksch ce4379af47 Update frsky.c
changed speed from cm/s to knots
2015-04-08 09:26:32 +02:00
Dominic Clifton 599cd68c16 Bump version to 1.9.0. 2015-04-07 21:34:33 +01:00
Dominic Clifton caf253e4f8 Automatically disable pid_at_min_throttle when retarded_arm is
enabled.  Closes #719.
2015-04-07 20:59:38 +01:00
Dominic Clifton 0456444cfb Fix compilation of HoTT telemetry unit test. 2015-04-07 20:33:34 +01:00
Dominic Clifton 7d9fc2699a Merge branch 'PA_update1' of git://github.com/Pierre-A/cleanflight into Pierre-A-PA_update1
Conflicts:
	src/main/config/config.c
	src/main/io/serial_cli.c
	src/main/telemetry/hott.c
	src/main/telemetry/telemetry.h
2015-04-07 20:33:03 +01:00
digitalentity 6e041c57dd Added median filter implementation. Added 3-point median filter to generic barometer code. 2015-04-07 19:58:20 +01:00
Dominic Clifton 9065efed94 BMP085 code cleanup. 2015-04-07 19:50:29 +01:00
digitalentity 0134e19edf Avoid reading data from BMP085 when no EOC event occured 2015-04-07 19:31:43 +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
Petr Ledvina a189d8e7fb fix barometer timing code
Delays between baro calls are modified to always take at least specified amount of time
2015-04-04 01:28:01 +02:00
Dominic Clifton b9664f1e99 Bump version to 1.8.1 2015-04-01 22:13:13 +01:00
Dominic Clifton 7efdcf13e3 Merge pull request #699 from pinkywafer/frsky_RPM_telemetry_fix
FrSky RPM Telemetry Motor_Stop Bugfix
2015-04-01 22:09:36 +01:00
Dominic Clifton 27ea92f36c Merge pull request #690 from ledvinap/fix-sparky-smartport
Fix sparky smartport
2015-04-01 20:18:12 +01:00
Dominic Clifton 8a7edb17ed Merge branch 'softserial-enabled' of git://github.com/sherlockflight/cleanflight-dev into sherlockflight-softserial-enabled 2015-04-01 20:06:08 +01:00
Dominic Clifton 09fe71c256 Removed unneeded check - gpio.h no-longer included by unit tests. 2015-04-01 17:47:43 +01:00
Dominic Clifton de630fea17 SPARKY - Enable autotune 2015-04-01 17:25:46 +01:00
Dominic Clifton 08a3db00a5 Remove unused variable warning. 2015-04-01 14:12:31 +01:00
Dominic Clifton b0b1eaf9c7 Add first unit test for some code in serial.c. Fix compiler warnings in
other tests.
2015-04-01 14:12:24 +01:00
Nicholas Sherlock dce873434b Use SERIAL_PORT_NONE identifier to mark ports which are unavailable 2015-04-02 01:55:13 +13:00
Nicholas Sherlock 86ddf27515 Don't allow softserial ports to be opened if softserial isn't enabled 2015-04-02 00:24:28 +13:00
pinkywafer 7220365575 RPM_Motor_Stop_Bugfix
using calculateThrottleStatus, send 0 as RPM when THROTTLE_LOW and
MOTOR_STOP
2015-03-31 19:06:15 +01:00
Petr Ledvina 3faa8a200b Answer only on one SmartPort ID
Receiver polls all active IDs, then tries one inactive. Answering multiple IDs will starve other devices on bus and it will increase probability of address collision.
With 1 active address poll interval is ~24ms
2015-03-31 15:01:36 +02:00
Petr Ledvina 7f3f53d880 Enable telemetry on SPARKY 2015-03-31 15:01:35 +02:00
Petr Ledvina 4c60f6c795 Fix 303 serial inversion and bidir mode
- USART_HalfDuplexCmd must be called only when USART is disabled
- input should be PullDown for inverted serial
- INVERTED BIDIR mode changed to GPIO_OType_PP (not opendrain) - opendrain won't work well for inverted serial; USART releases pin when transmission is done, so PP is OK
2015-03-31 15:01:28 +02:00
Per Magnus Auby b83b9040f9 Updates sonar so that it can be used together with ADC current meter
Check if ADC current meter is enabled in sonarInit() and change
sonar pins to pwm 5 and 6 if it is. Same as when RX_PARALLEL is enabled.
2015-03-31 13:47:17 +02:00
Dominic Clifton 6e8d081c45 Updating Sparky board with a note regarding LED color differences
between Rev 1 & 2 boards.
2015-03-30 22:03:10 +01:00
Dominic Clifton 766b890896 Remove duplicate defines from SPRacingF3 target.h 2015-03-30 21:32:36 +01:00
Dominic Clifton d33e4e6afd Merge branch 'Battery_monitoring' of git://github.com/MJ666/cleanflight into MJ666-Battery_monitoring 2015-03-30 19:44:33 +01:00
Dominic Clifton 80a6507649 Merge branch 'VCM_motor_stop_fix' of git://github.com/pinkywafer/cleanflight into pinkywafer-VCM_motor_stop_fix 2015-03-30 19:29:40 +01:00
Dominic Clifton 6922857db0 Merge pull request #683 from sherlockflight/flash-N25Q064
Add support for Micron N25Q064 64Mbit SPI flash
2015-03-30 11:35:42 +01:00
Dominic Clifton 20fd7b8491 Merge pull request #565 from mosh1/new_failsafe_defaults
Default failsafe enabled and throttle off when no valid PPM signal is se...
2015-03-30 11:15:25 +01:00
Nicholas Sherlock 7940ac2030 Blackbox: Don't log amperageADC when current meter is virtual
Closes #685
2015-03-30 20:34:36 +13:00
Nicholas Sherlock 85dc16f96d Add support for Micron N25Q064 64-mbit SPI flash 2015-03-30 18:17:56 +13:00
Nicholas Sherlock 01b811cd8c Add support for Winbond 64Mbit SPI flash chip 2015-03-30 12:04:41 +13:00
Dominic Clifton f24782b961 Fix duplicate MSP codes. 2015-03-29 14:23:12 +01:00
Dominic Clifton 60835923c4 Use MSP command IDs in the correct assigned range for MSP_LOOPTIME and
MSP_ARMING_CONFIG.  Rename MSP_ARM_CONFIG to MSP_ARMING_CONFIG.
2015-03-28 20:30:15 +00:00
Dominic Clifton c68d95dd7a Merge pull request #641 from tricopterY/patch-1
Added new MSP codes to serial_msp.c
2015-03-28 20:24:32 +00:00
Dominic Clifton 9837e6a202 Merge pull request #640 from sherlockflight/cli-whitespace
Ignore trailing spaces on CLI commands
2015-03-28 20:23:02 +00: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 01df0b65c2 Fix typos in comments. 2015-03-28 19:16:19 +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 fa12c77d8c Merge branch 'fix-ppmrx-303' of git://github.com/ledvinap/cleanflight into ledvinap-fix-ppmrx-303 2015-03-26 19:08:27 +00:00
Petr Ledvina 68305a3929 Fix timer period on STM32F303 TIM2
TIM2 is 32bit itmer, but we want 16bit period ...
2015-03-26 18:17:21 +01:00
Petr Ledvina a125228d1f Fix PPM in TIM1 2015-03-26 18:07:18 +01:00
Dominic Clifton 004dd0daaf Merge pull request #666 from nebbian/Bugfix-LuxFloat-IntegralTerm-a
^ Multiplying LuxFloat I term by ten to make it tuneable
2015-03-26 15:15:48 +00:00
Dominic Clifton 7a4add47d5 Merge pull request #675 from rimasaviz/strider-fix
fix for missing AUX1-4 signals on PWM5-8 outputs with LED_STRIP on NAZE
2015-03-26 15:11:04 +00:00
Dominic Clifton 507a022e90 Merge branch 'master' into serial-port-options 2015-03-26 01:32:06 +00:00
Dominic Clifton ef50a0648f Allow spcification of flash size on command line. 2015-03-26 01:29:00 +00:00
Rimas Avizienis 56167eb0d2 workaround for AUX1-4 PWM signals missing on PWM5-8 outputs when LED_STRIP is enabled on NAZE32 2015-03-25 12:35:02 -07:00
Nicholas Sherlock 5edfdde942 Restore previous rate limit for yaw of 2.55
Since some people are indeed using yaw > 1.0.
2015-03-26 02:02:32 +13:00
Ben Hitchcock 9e842704c5 ^ Multiplying I term by ten to make it tuneable 2015-03-24 22:54:49 +08:00
Nicholas Sherlock 1b5571e268 Ignore trailing spaces on CLI commands 2015-03-24 01:13:26 +13:00
Dominic Clifton 35abdb89f5 Merge pull request #658 from sherlockflight/rate-limits
Apply the same maximum control rates (1.0) in CLI and MSP
2015-03-23 08:22:12 +00:00
Dominic Clifton 1de9fa4db6 SPRacingF3 - Add sonar support. 2015-03-22 20:55:27 +00:00
Dominic Clifton 07bcf204e1 STM32F3 - Add sonar support. 2015-03-22 20:55:02 +00:00
Dominic Clifton 413e0bde64 STM32F3 - Allow EXTI configuration. 2015-03-22 20:53:42 +00:00
Nicholas Sherlock 828ec550cd Apply the same maximum control rates (1.0) in CLI and MSP
Previously it was possible to set roll/pitch rate > 1.0 using MSP, but
not using the CLI. Roll/pitch rate > 1.0 is meaningless.

TPA is also limited to 1.0.
2015-03-22 20:38:15 +13:00
Dominic Clifton 4154afcb63 Adding a unit test for quad X motor mixers. 2015-03-21 11:30:03 +01:00
Dominic Clifton 730d0fe45c Ensure serial runtime data structures are set before they are used.
Fixes #636
2015-03-20 18:37:50 +01:00
Nicholas Sherlock 3c543d36c8 Change port mode MODE_BIDIR into a port option instead 2015-03-19 13:42:13 +13:00
Nicholas Sherlock 344e8fbf04 Make serial port option checks consistent 2015-03-19 12:56:11 +13:00
Nicholas Sherlock 159f57f583 Add new serial port options field (inversion, stop bits, etc) 2015-03-19 12:56:11 +13:00
Dominic Clifton 84c7c985ab First unit test for tricoper servo mixer. 2015-03-19 00:23:57 +01:00
tricopterY 330db9587b Added new MSP codes to serial_msp.c
New codes: MSP_SET_ARM_CONFIG, MSP_ARM_CONFIG, MSP_SET_LOOP_TIME, MSP_LOOP_TIME
Incremented minor version to 8.
2015-03-18 12:12:27 +11:00
Dominic Clifton c1a0ae16b7 Make it easier to correlate the size for MSP_MISC against the serialized
values.
2015-03-18 00:15:23 +01:00
Dominic Clifton 03b1adb042 Add the more unit tests for the mixer.
Closes #16
2015-03-17 23:56:59 +01:00
Michael Jakob 5fccedd5f3 Deactivate BlackBox and GPS for ALIENWIIF3 2015-03-17 21:35:11 +01:00
Michael Jakob 0c0b2e8461 Enable battery monitoring for Sparky and ALIENWII F3 2015-03-17 21:35:10 +01:00
Nicholas Sherlock 3e8ce5833f Simplify blackbox header writing using new printf() 2015-03-17 22:52:05 +13:00
Nicholas Sherlock bcadd0803a Merge pull request #624 from ledvinap/improvement-blackbox
Simplify Blackbox code by improving printf() and using that instead of longer more specialised code
2015-03-17 22:30:21 +13:00
Petr Ledvina 35ef95cec7 blackbox - support arrays greater that 10 elements / use printf to print numbers 2015-03-17 09:34:52 +01:00
Petr Ledvina 8d2dc82f4b blackboxPrintf - return number of characters written
change fmt to `const char*`
2015-03-17 09:33:16 +01:00
Petr Ledvina c90231f35c printf - implement '%n' 2015-03-17 09:27:54 +01:00
Petr Ledvina ae67870db1 Modify prinf-like functions to return number of characters written 2015-03-17 09:27:19 +01:00
Dominic Clifton 8e6570754c Add the first unit test for the mixer.
See #16
2015-03-16 22:56:14 +01:00
Jenny 1ff8c177ce Update battery_unittest.cc
additions for feature and calculateThrottleStatus
2015-03-16 15:03:46 +00:00
Jenny 3160677e1c Merge remote-tracking branch 'upstream/master' into VCM_motor_stop_fix 2015-03-16 14:58:57 +00:00
Dominic Clifton 1e7fb08b9d Ensure failsafe is not reset when using stale serial rx channel data. 2015-03-15 22:05:54 +01:00
Dominic Clifton e08c83fdc9 Use the same pattern for cleaning the frame complete flag in spektrum
and xbus driver as used in sbus/sumd/sumh drivers.

Very minor performance optimization too since the flag is only checked
once per main loop instead of once per channel read.
2015-03-15 00:02:45 +01:00
Dominic Clifton 7d6e4aa390 Updating the SerialRX drivers so they can report back a failsafe
condition.  Improve SumD driver, when a failsafe is detected the values
from the frame will be used (same behaviour as SBus when SBus RX reports
failsafe).
2015-03-14 23:28:38 +01:00
Dominic Clifton 6059089bb6 Fix disabling of acc and mag sensors.
Closes #623
2015-03-14 21:01:19 +01:00
Dominic Clifton 4cf6fe6571 Rename 'frsky_hiprec_vfas' to 'frsky_vfas_precision' and introduce enum
for FRSKY_VFAS_PRECISION_LOW and FRSKY_VFAS_PRECISION_HIGH.

Improves naming for humans.  'hiprec' was meaningless and
untranslatable. See
https://cleancoders.com/episode/clean-code-episode-2/show
2015-03-13 23:49:24 +01:00
Dominic Clifton d82fc6b9be Merge pull request #477 from projectkk2glider/projectkk2glider/issue_316_frsky_voltages
Fixes #316: better arithmetics for FrSky CELL voltages, VFAS battery vol...
2015-03-13 23:40:24 +01:00
Dominic Clifton 626bd29dae Merge pull request #592 from sherlockflight/blackbox-serial-baud
Support new 230400 baud rate which allows >750Hz Blackbox logging
2015-03-13 23:24:57 +01:00
Dominic Clifton ccb1698ba5 Add human readable versions of the serial functions bitmask values to
help non-developers understand.
2015-03-13 22:28:10 +01:00
Dominic Clifton 3b77626dd8 Only enable VBat ADC when VBat feature is enabled.
Fixes #612
2015-03-13 22:28:10 +01:00
Dominic Clifton 8fcffa1454 Merge pull request #616 from ledvinap/fix-small-angle
Fix small_angle type to match CLI
2015-03-13 13:52:06 +01:00
Petr Ledvina 59df4e502b Fix small_angle type to match CLI
int8_t small_angle prevents using angles>128deg (and thus disabling it with small_angle=180)
2015-03-12 15:25:30 +01:00
Dominic Clifton fce1d5a680 Bump MSP API version for recent MSP_RC_TUNING changes. 2015-03-11 22:40:10 +01:00
Jenny 40cc7697fe Update to Virtual Current Meter fix
now using rc_controls/calculateThrottleStatus()
unneeded dependencies removed.
2015-03-11 20:03:25 +00:00
Dominic Clifton f62b5c883d Merge pull request #601 from tricopterY/tricopterY-patch-1
Update serial_msp.c
2015-03-11 20:15:24 +01:00
Jenny 7c2a2a1732 Merge remote-tracking branch 'upstream/master' into VCM_motor_stop_fix 2015-03-11 18:43:29 +00:00
Dominic Clifton 2c79d777bc Merge pull request #605 from ledvinap/fix-batterytest-merge
Fix incorrect merge in battery_unittest
2015-03-11 08:35:06 +01:00
Nicholas Sherlock cee021706b Merge remote-tracking branch 'upstream/master' into blackbox-serial-baud 2015-03-11 13:31:30 +13: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
Petr Ledvina f1a0972002 Fix incorrect merge in battery_unittest
batteryConfig initialization was merged twice, removing one version
2015-03-10 08:32:36 +01:00
tricopterY ced280acb9 Update serial_msp.c
Enhanced MSP_RC_TUNING and MSP_SET_RC_TUNING. Configurator's PID Tuning tab can be enabled to update TPA Breakpoint.  
PID Tuning tab must be enhanced for this feature. Agnostic if older versions of Configurator are used.
2015-03-10 10:40:56 +11:00
Dominic Clifton bc8e53a9d8 Rename some PID controller methods.
See #461.
2015-03-09 23:26:52 +00:00
Dominic Clifton d8cd9f239c Merge pull request #437 from tracernz/nmea-satdata
Add NMEA Signal Quality
2015-03-10 00:18:47 +01:00
Dominic Clifton c0c2f8e285 Remove a suprious newline. 2015-03-09 23:04:54 +00:00
Dominic Clifton 4a12d00d1e Moving mixer config out of the profile. It doesn't really make sense. 2015-03-09 23:00:44 +00:00
Dominic Clifton ed434fe47b Use a positive named setting and variable instead of a negative one to
simplify the logic and aid understanding.
2015-03-09 22:50:27 +00:00
Dominic Clifton acabbf41db Previously, at minimum throttle, the quad would do absolutely no self-leveling
and simply run the motors at constant minthrottle.  This allowed the chance
for the quad to lose control during flight if the throttle was set to minimum,
say, to drop from a high altitude to a lower one.

With this edit, the quad will still self-level at minimum throttle when armed,
allowing for safe decents from altitude.  To prevent motors spinning when
arming/disarming, the yaw input is ignored if the throttle is at minimum and
we're using the sticks to arm/disarm.

Conflicts:
	src/main/flight/mixer.c
2015-03-09 23:44:53 +01:00
Dominic Clifton 1b1163da10 Previously, at minimum throttle, the quad would do absolutely no self-leveling
and simply run the motors at constant minthrottle.  This allowed the chance
for the quad to lose control during flight if the throttle was set to minimum,
say, to drop from a high altitude to a lower one.

With this edit, the quad will still self-level at minimum throttle when armed,
allowing for safe decents from altitude.  To prevent motors spinning when
arming/disarming, the yaw input is ignored if the throttle is at minimum and
we're using the sticks to arm/disarm.

Conflicts:
	src/main/flight/mixer.c

added cli command disable_pid_at_min_throttle

(same as previous)
2015-03-09 23:42:42 +01:00
Dominic Clifton 5e3734946e # This is a combination of 2 commits.
# The first commit's message is:

Previously, at minimum throttle, the quad would do absolutely no self-leveling
and simply run the motors at constant minthrottle.  This allowed the chance
for the quad to lose control during flight if the throttle was set to minimum,
say, to drop from a high altitude to a lower one.

With this edit, the quad will still self-level at minimum throttle when armed,
allowing for safe decents from altitude.  To prevent motors spinning when
arming/disarming, the yaw input is ignored if the throttle is at minimum and
we're using the sticks to arm/disarm.

Conflicts:
	src/main/flight/mixer.c

# This is the 2nd commit message:

added cli command disable_pid_at_min_throttle
2015-03-09 23:36:54 +01:00
Dominic Clifton e40a3663d2 Remove failsafe vtable usage. 2015-03-09 23:19:21 +01:00
Dominic Clifton 60a95f1d22 Removing noise from unit tests. 2015-03-09 23:19:21 +01:00
Dominic Clifton bce6c6722c Merge branch 'port-changes' of https://github.com/ledvinap/cleanflight into ledvinap-port-changes
Conflicts:
	src/main/blackbox/blackbox.c
	src/main/io/serial.c
2015-03-09 22:23:04 +01:00
Damjan Adamic 517d38c94f Re #316: Battery voltage calculation converted to integer arithmetic, unit tests updated to account for proper rounding of voltage
Added frsky_hiprec_vfas configuration option that selects how VFAS is sent
Better arithmetics for FrSky CELL voltages, VFAS battery voltage send with other ID that allows 0.1V resolution
2015-03-09 20:43:04 +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 2e5fe06a6a Update AlienWii32 defaults for pitch/roll/yaw rates 2015-03-08 00:48:47 +00:00
Dominic Clifton e4a6886266 Allow independent in-flight adjustment of roll and pitch. 2015-03-07 15:14:52 +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 26bb86898e Updating comment in mixer.c 2015-03-07 14:15:38 +00:00
Nicholas Sherlock 3b5d2b6a16 Change recommended Blackbox baudrate to 250000
This is because the AVR's 230400 baudrate is very inaccurate, while the
250000 baudrate is spot-on.
2015-03-07 13:07:03 +13:00
Dominic Clifton 4d1060f87b Merge pull request #591 from nebbian/bugfix-tricopter-3d
Bugfix for 3D inverted flight using a tricopter.
2015-03-06 16:49:52 +00:00
Dominic Clifton e9742c124c Merge pull request #594 from sherlockflight/mag-limit
Fix upper limit on mag_hardware and acc_hardware CLI variables
2015-03-06 16:42:54 +00:00
Nicholas Sherlock 5e917090b6 Merge remote-tracking branch 'upstream/master' into blackbox-serial-baud 2015-03-07 02:01:03 +13:00
Nicholas Sherlock 0c8adf25c2 Use defines for MAG_MAX and ACC_MAX 2015-03-07 01:57:45 +13:00
Nicholas Sherlock 8a541a9fa2 Fix upper limit on mag_hardware and acc_hardware CLI variables 2015-03-07 01:18:05 +13:00
Nicholas Sherlock 99fe3465b2 Support configurable Blackbox baud rates, allows >750Hz logging 2015-03-06 20:08:05 +13:00
Nicholas Sherlock cbaa67f1d0 Add 230400 & 250000 baud rates, 2 stop-bits port mode 2015-03-06 20:07:07 +13:00
Pierre-A 3a8725997b update of the corrections 2015-03-05 20:07:48 +01:00
Jenny 0d1ca47617 bigfix virtual current meter 2015-03-05 18:24:23 +00:00
Dominic Clifton d51a2fbd88 Fix release of MSP port when MSP and MSP telemetry are used on the same
port.
2015-03-05 11:04:25 +00:00
Dominic Clifton 0b1de28e95 Merge remote-tracking branch 'cleanflight/sbus-rx-failsafe' 2015-03-04 20:37:47 +00:00
Pierre-A af2cd4087a new version including corrections 2015-03-04 15:53:09 +01:00
Dominic Clifton 3e73b3de53 Add some const correctness to mag initialisation.
See #582.
2015-03-04 09:04:59 +00:00
Dominic Clifton 3a35bfbabf Merge pull request #582 from sherlockflight/compass-init
Fix invalid memory read during compass initialisation
2015-03-04 08:57:57 +00:00
Nicholas Sherlock b6991b57a0 Fix invalid memory read during compass initialisation 2015-03-04 20:46:13 +13:00
Dominic Clifton 1c9ebf9437 Use received Serial RX data even when serial rx reports failsafe. 2015-03-03 23:17:25 +00:00
Dominic Clifton b7f21ae6dd CC3D - Allow MSP, CLI, etc on VCP and USART1 by default. 2015-03-03 22:41:22 +00:00
Dominic Clifton 946f65601f Cleanup some enum values - using topic_type instead of type_topic. 2015-03-03 22:35:40 +00:00
Dominic Clifton 31a00d6b4d Fix size check for MSP_SET_CF_SERIAL_CONFIG. 2015-03-03 22:17:43 +00:00
Dominic Clifton a156d915f4 Only index into the configurable baud rate list when needed. 2015-03-03 17:30:35 +00:00
Dominic Clifton dca984ff88 Merge branch 'master' into serial-cleanup
Conflicts:
	src/main/telemetry/hott.c
2015-03-03 17:21:43 +00:00
Dominic Clifton 94fdaed8d2 Merge pull request #428 from Pierre-A/update_pa
HoTT check serial data improvement
2015-03-03 10:58:33 +00:00
Dominic Clifton aa7abec7f4 Merge pull request #570 from fusterjj/debug_cleanup
Disable debug vars by default
2015-03-03 10:56:37 +00:00
Ben Hitchcock 97fae94053 Bugfix for 3D inverted flight using a tricopter. The yaw servo now should reverse when the throttle is lower than the midpoint. 2015-03-03 11:47:35 +08:00
Dominic Clifton 266fe45b7e Temporarily disable autotune on the CC3D OPBL binary. 2015-03-02 11:50:15 +00:00
Joel Fuster 095b21b027 Disable debug vars by default 2015-02-28 19:26:59 -05:00
Moshen Chan d24d4699db Default failsafe enabled and throttle off when no valid PPM signal is seen for 1 second #488 2015-02-27 19:33:23 -08:00
Nicholas Sherlock a60cdf157a Fix initialisation of SPI2 2015-02-28 00:56:28 +13:00
Nicholas Sherlock af68517dda Merge remote-tracking branch 'upstream/master' into cc3d 2015-02-28 00:19:03 +13:00
Dominic Clifton 1a8500c768 Transition to new per-port & per-function baud rate configuration. 2015-02-27 01:05:37 +00:00
Dominic Clifton b6509dd1eb Merge branch 'master' into serial-cleanup
Conflicts:
	src/main/blackbox/blackbox_io.c
	src/main/config/config.c
2015-02-26 22:43:29 +00:00
Dominic Clifton ed434dd169 Cleanup ACC hardware enum so that 'None' is always '1' and doesn't
change every time a new sensor is added.  All the sensor enum values are
now aligned.
2015-02-26 22:31:38 +00:00
Dominic Clifton 88bc3c3f5d Merge pull request #543 from sherlockflight/master
Save around 300 bytes of flash by improving Blackbox field name storage
2015-02-26 21:06:24 +00:00
Dominic Clifton 55d9994ff8 Reset adjustment states when switching profiles.
Fixes #544.
2015-02-26 13:58:03 +00:00
Dominic Clifton 05b1b5a9b2 Ensure motor[0] is used, see 46a0054d784ba638435257ee6b75e5cea43f0983 2015-02-26 12:15:15 +00:00
Dominic Clifton 8282bc76d2 Mixer code readability and code size improvement.
Naze target size before: 113412, after: 113388

Closes #551
2015-02-26 12:05:03 +00:00
Nicholas Sherlock 451d3d7ba2 Move zigzag encoding function to new common/encoding.c file, add tests 2015-02-26 13:27:09 +13:00
Nicholas Sherlock 57fcde05a3 Blackbox dataflash: Experimental CC3D support 2015-02-25 00:52:25 +13:00
Nicholas Sherlock aae9141120 Fix blackbox compile bug on targets without flash 2015-02-24 10:19:11 +13:00
Nicholas Sherlock ff28846829 Save around 300 bytes of flash by improving Blackbox field name storage
Also add a bit more Blackbox code documentation
2015-02-24 09:42:38 +13:00
Dominic Clifton b9e1283809 Ensure motors are stopped before a reboot. Ensure hard fault handler
doesn't use potentially unitialised data to update the motors.  Pause
for 50ms before rebooting after updating disabling the motors to ensure
the timer hardware and ESCs havea chance to react.

This commit might help with #123
2015-02-23 14:02:47 +00:00
Petr Ledvina 737fbe02ed Fix battery unittest
New code uses divition to get cell count, so nonzero vbatmaxcellvoltage is neccessary. Also added remaining fields to avoid future problems (and g++ doesn't support non-trivial initializers)
2015-02-23 09:18:51 +01:00
Petr Ledvina a96a12bd47 compile some GPS code conditionally 2015-02-23 09:18:51 +01:00
Petr Ledvina a67d2f8a9e Whitespace fixes 2015-02-23 09:18:51 +01:00
Petr Ledvina f1ac4f8461 fix #ifdef typo 2015-02-23 09:17:06 +01:00
Petr Ledvina 1ecbdf3dae Minor code cleanup 2015-02-23 09:17:06 +01:00
Petr Ledvina 6b37b96048 Simplify #ifdef nesting 2015-02-23 09:17:06 +01:00
Petr Ledvina 9dd7faeefa Remove unneeded volatile 2015-02-23 09:17:06 +01:00
Petr Ledvina 7875b97aae Compile serial code conditionally on stm32f303 2015-02-23 09:17:06 +01:00
Petr Ledvina 7c62ec9755 Move internal serial interface into separate header file
Declaring function from other file is quite dangerous - there is no warning if interfaces get out of sync
2015-02-23 09:17:06 +01:00
Petr Ledvina 7c263254b2 improve loop readability 2015-02-23 09:17:06 +01:00
Petr Ledvina fd355caca6 Modify some macros so they evaluate to single statement
Require macros to be followed with semicolon, empty version expands to dummy statement.

Fixes dangling-else problem:

```
if(1)
        INVERTER_ON;
else
        INVERTER_OFF;
```
2015-02-23 09:17:06 +01:00
Petr Ledvina f9f40fb98f Handle possible problem with unintentional I2C interrupt handler triggering
Error handler may be called repeatedly during I2C unstucking. Not sure if this change is necessary, but it is safe
2015-02-23 09:17:06 +01:00
Petr Ledvina 5129403c83 minor I2C cleanup 2015-02-23 09:17:06 +01:00
Petr Ledvina d3324a9f0d Move ADC internal interface into new header file 2015-02-23 09:17:06 +01:00
Petr Ledvina 6b0fea5952 simplify #ifdefs 2015-02-23 09:17:06 +01:00