Commit graph

1881 commits

Author SHA1 Message Date
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
Petr Ledvina e56f46a756 Move utility macros to common/utils.h 2015-02-23 09:17:05 +01:00
Dominic Clifton 0da270351a Merge pull request #537 from MJ666/Harakiri_PID_fix
Harakiri PID controller fix
2015-02-22 21:55:54 +00:00
Dominic Clifton a02cedd8d2 Fix blackbox compilation when included but not enabled. 2015-02-22 21:49:54 +00:00
Dominic Clifton 070b556a07 Enable blackbox flash logging only on SPRacingF3 and Naze rev5 targets. 2015-02-22 21:49:53 +00:00
Dominic Clifton 5d49451916 Cleanup SPI on STM32F3 targets. 2015-02-22 21:49:45 +00:00
Dominic Clifton 2f09b7d1d9 Merge branch 'blackbox-flash' of https://github.com/sherlockflight/cleanflight-dev into sherlockflight-blackbox-flash 2015-02-22 17:24:39 +00:00
Pierre-A 39160a785a to solve the unreference compiling issue 2015-02-22 17:49:01 +01:00
Dominic Clifton 9057d70410 Allow excluding of servo code at compilation time.
This is in preparation for backbox on CJMCU/64k.

Flight tested on CJMCU.
2015-02-22 16:21:03 +00:00
Dominic Clifton 5a15c3b271 Merge branch 'master' into fusterjj-lowpass 2015-02-22 15:24:11 +00:00
Dominic Clifton df2f0e850f Bump version to 1.8.0 in preparation for new features. 2015-02-22 15:22:40 +00:00
Dominic Clifton f88bbf4676 Avoid usage of methods for targets that don't use the display. 2015-02-22 15:22:17 +00:00
Dominic Clifton f4112a67c6 Bump config version. 2015-02-22 15:21:45 +00:00
Dominic Clifton debd72485b Avoid updating servos to servo middle every loop iteration. 2015-02-22 15:21:21 +00:00
Dominic Clifton 774abcfab8 Update unit tests. 2015-02-22 14:56:15 +00:00
Dominic Clifton a1b01807cf Merge branch 'lowpass' of https://github.com/fusterjj/cleanflight into fusterjj-lowpass
Conflicts:
	src/main/flight/mixer.c
2015-02-22 14:55:04 +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 4a1b27443f Enable/Disable LCD page cycling using stick combos. 2015-02-22 14:01:38 +00:00
Pierre-A 83aa49a812 battery alarm sound for Hott telemetry binary mode 2015-02-22 09:47:22 +01:00
Nicholas Sherlock c6d71f148d Don't try to compile blackbox if BLACKBOX define isn't set
Just in case you link against blackbox.c but aren't using the BLACKBOX
define in target.h.
2015-02-22 12:01:14 +13:00
Michael Jakob a4e074816d Harakiri PID controller fix
integer constrain function is limiting accuracy in Angel and Horizon
mode ITerm value
2015-02-21 14:51:53 +01:00
Nicholas Sherlock f6c9f7cc4a Merge remote-tracking branch 'upstream/master' into blackbox-flash 2015-02-21 12:52:26 +13:00
Dominic Clifton 523980fc7b Merge remote-tracking branch 'cleanflight/master' into serial-cleanup 2015-02-20 20:15:09 +00:00
Dominic Clifton f6408cd355 CJMCU disable cli servos command to save flash space.
At some point in the future it might be an idea to use a define for
USE_SERVOS so that more code could be excluded. (Servo tilt, etc).
2015-02-20 18:51:50 +00:00
Dominic Clifton 1a7fe33e16 Merge pull request #511 from MJ666/AlienWii
ALIENWII F3/F1 target cleanup and documentation update
2015-02-20 16:41:08 +00:00
Dominic Clifton 5a079063c0 Merge pull request #517 from sherlockflight/servo-cli
Add "servo" CLI command to get/set servo conf, and include in dump
2015-02-20 13:21:07 +00:00
Michael Jakob 91b4cafbfa ALIENWII F3/F1 target cleanup and documentation update 2015-02-20 07:36:52 +01:00
Nicholas Sherlock 092b4fe62b Merge remote-tracking branch 'upstream/master' 2015-02-20 13:37:53 +13:00
Nicholas Sherlock 6c30f879be Merge remote-tracking branch 'upstream/master' into servo-cli 2015-02-20 13:37:01 +13:00
Nicholas Sherlock e636d8b945 Merge remote-tracking branch 'upstream/master' into blackbox-flash 2015-02-20 13:34:59 +13:00
Dominic Clifton 021496b244 Merge branch 'master' into serial-cleanup 2015-02-19 21:57:54 +00:00
Dominic Clifton 242a7e65a8 Merge pull request #526 from MJ666/Harakiri_PID
Fix for Harakiri PID drift.
2015-02-19 21:57:19 +00:00
Dominic Clifton 1de72b11ce Update the cli status command to show all detected sensors (Except on
CJMCU).

Further cleanup of sensor initialisation.
2015-02-19 21:08:30 +00:00
Michael Jakob 257c7e092e Harakiri PID controller variables cleanup
Flight tested
2015-02-19 21:28:26 +01:00
Dominic Clifton c45efac812 Cleanup sensor detection. Less code required and a similar pattern is used for each type of sensor. 2015-02-19 16:15:14 +00:00
Konstantin Sharlaimov 77e5be5002 Fixed external barometer & magnetometer detection 2015-02-19 13:43:47 +00:00
Michael Jakob cd94377651 Latest Crashpilot1000 update 2015-02-19 09:00:20 +01:00
Michael Jakob 6548c90ca8 Align Harakiri PID with Crashpilot1000 updates 2015-02-19 08:30:41 +01:00
Dominic Clifton e0b8803503 Removing unneeded serial port references. 2015-02-19 00:46:19 +00:00
Dominic Clifton 00f04e0ea2 Fix frsky telemetry which was needlessly checking for incoming data.
Maybe it needs to check that the serial port has SENT the data?
2015-02-19 00:34:24 +00:00
Dominic Clifton 06a8d0c8cf Update blackbox to use new serial port sharing api.
Fix infinite loop in serial port allocation when disarming. (arming with
new serial port code was not tested until now).
2015-02-19 00:03:18 +00:00
Dominic Clifton 7dcc7b2fb5 Multiple telemtry providers can now be active at the same time on any
serial port. 
MSP telemetry can now be at any baud rate.

A pattern is emerging in each telemetry provider, code is duplicated to
get things working, refactoring can come later.
2015-02-18 23:10:36 +00:00
Michael Jakob 6c92ea8ee8 Harakiri PID fix
Change errorGyroI and errorAngleI from int32 to float
2015-02-18 22:55:05 +01:00
Dominic Clifton 3e64ce883c Merge branch 'master' into serial-cleanup
Conflicts:
	src/main/main.c
	src/main/rx/sbus.c
	src/main/version.h
2015-02-18 19:41:53 +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 8c1d9c37d9 Add comment regarding observations made on the Futaba SBus receivers. 2015-02-18 00:36:05 +00:00
Nicholas Sherlock 155a369491 Reduce code size of serial_cli by 104 bytes with some small tweaks:
Avoid calling strlen() just to check if a string is empty
Shorter error messages and reuse messages for cliServo
Use cliPrint rather than printf when not using placeholders
2015-02-18 13:07:26 +13:00
Nicholas Sherlock 716ee9f5c4 Add "servo" CLI command to get/set servo conf, and include in dump 2015-02-17 23:33:12 +13:00
Nicholas Sherlock 1bd091a031 Avoid reading uninitialised memory during battery unit tests 2015-02-17 22:50:10 +13:00
Dominic Clifton 70fbeb22ba Disable SBUS debug on CJMCU to reduce code size. 2015-02-16 23:06:46 +00:00
Dominic Clifton c05b4c639b Ensure sbus debug output is reset after failsafe/signal loss conditions. 2015-02-16 23:02:14 +00:00
Dominic Clifton 24ce82b280 Improve SBus compatibility by timing the entire frame instead of the gap
between received bytes of data.  Add support for the two SBus digital
channels.
2015-02-16 22:50:39 +00:00
Dominic Clifton 6e258a62ac Disable alt-hold debugging. 2015-02-16 22:45:47 +00:00
Dominic Clifton 36c7d5d30d SPRACINGF3 - Fix typo in UART3 configuration. 2015-02-16 19:42:24 +00:00
Nicholas Sherlock 5f29eed017 Minor fix for flushing behaviour on dataflash 2015-02-16 22:20:53 +13:00
Nicholas Sherlock d628bc6dcd Merge remote-tracking branch 'upstream/master' into blackbox-flash 2015-02-16 21:50:33 +13:00
Nicholas Sherlock 892f1698d9 Rename flash_ident command to flash_info 2015-02-16 18:07:58 +13:00
Nicholas Sherlock d6911e8b86 Avoid synchronous flushes to flash during Blackbox shutdown 2015-02-15 23:23:53 +13:00
Dominic Clifton 02166a4fd0 Ensure mixer is configured so that PWM initialisation is correct.
The isMixerUsingServos() was returing the wrong value in 9a7de3cf3c
2015-02-15 09:20:33 +00:00
Dominic Clifton cd73c25352 PORT103R - Update default hardware support. 2015-02-14 23:50:51 +00:00
Dominic Clifton 9a7de3cf3c Improve ESC compatibility by enabling PWM output as soon as possible.
A user reported a problem where if the board was powered up before
connecting the main battery the ESCs would work, however when the board
and ESCs were powered at the same time the ESCs would not initialise
correctly.
2015-02-14 23:49:55 +00:00
Nicholas Sherlock acd4745a4e Merge remote-tracking branch 'upstream/master' into blackbox-flash 2015-02-15 01:54:50 +13:00
Nicholas Sherlock 6423ac7db1 Rename FLASHFS to USE_FLASHFS 2015-02-14 09:45:56 +13:00
Nicholas Sherlock 3b8e05fb46 Stop Blackbox logging when flash fills up 2015-02-13 21:56:36 +13:00
Nicholas Sherlock 80ea5e4419 Add flash ready state to MSP response, add flash async block write 2015-02-13 20:28:19 +13:00
Dominic Clifton 6064a3d692 More serial port cleanup to get build passing. 2015-02-12 02:03:57 +00:00
Dominic Clifton d12d1952eb Fix PWM/UART2 clash on F1 targets caused by using wrong #define value. 2015-02-12 01:58:59 +00:00
Dominic Clifton 5163bef0b2 Refactor serial port configuration, stage 1.
Tested and working:
* multiple MSP ports at different baud rates.
* cli on any MSP port.
* GPS
* gps passthough on currently active cli port.

Example config used for testing:

feature SOFTSERIAL
feature GPS
feature RX_PPM
serial_port_1_functions = 1
serial_port_1_baudrate = 115200
serial_port_2_functions = 128
serial_port_2_baudrate = 115200
serial_port_3_functions = 1
serial_port_3_baudrate = 19200
serial_port_4_functions = 0
serial_port_4_baudrate = 0

Known broken:
* Telemetry and shared serial ports
* Telemetry when unarmed.

Probably broken:
* Blackbox on shared port.

Untested.
* Serial RX.
* Blackbox.
2015-02-12 01:28:53 +00:00
tricopterY 3272b44410 Update inverter.c
Fixes #494
2015-02-11 19:06:34 +00:00
Nicholas Sherlock 5651e65a0b Add support for discovering beginning of free space on flash chip 2015-02-10 13:44:18 +13:00
Dominic Clifton b4b16fa28c SPRACINGF3 - Set sensor alignments. 2015-02-05 17:49:32 +00:00
Dominic Clifton 012e8fac31 SPRACINGF3 - Configure beeper GPIO correctly. 2015-02-05 17:06:32 +00:00
Dominic Clifton ed51428989 SPRACINGF3 - Enable DISPLAY. Specify serial port I/O in target.h. 2015-02-05 02:08:37 +00:00
Dominic Clifton fdb81ed3b9 SPRACINGF3 - Enable ADC for VBAT, Current and RSSI. 2015-02-04 21:51:23 +00:00
Dominic Clifton 430ccd2338 STM32F3DISCOVERY/CHEBUZZF3 - Move ADC pin definitions to target.h files 2015-02-04 21:51:04 +00:00
Dominic Clifton 8aee0b25e2 Fix bug where current meter didn't work unless VBAT feature was enabled. 2015-02-03 16:20:14 +00:00
Dominic Clifton 6de42dd0de Display version on the OLED display. 2015-02-02 22:30:59 +00:00
Dominic Clifton 395a1bb9a3 Update cli version command to show the version number now that there is
one available.
2015-02-02 22:05:30 +00:00
Dominic Clifton 973efdd5fc Temporary workaround for CC3D non-functional VCP when using OpenPilot
bootloader that some users have reported. This allows MSP connection via
USART so the board can be reconfigured.
2015-02-02 00:31:35 +00:00
Dominic Clifton 5512ff08c3 Allow thrust color to be combined with throttle. 2015-02-01 18:34:37 +00:00
Dominic Clifton 0fd7a2568c Fix for BaroAlt resetting to 0.
This needs a little more investigation since it only seems to happen on
the Sparky (F3 target).  The BaroAlt resets to 0 because of floating
point divide by 0 when calculating accZ_tmp which results in accAlt
becoming not-a-number (NaN).
2015-02-01 17:18:20 +01:00
Joel Fuster 302701772c Add missing function declaration 2015-01-31 20:47:41 -05: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
Dominic Clifton 53406a7ac7 Relocate some structures and code to the right places.
This cleans up the include file order somewhat and fixes a couple of
dependencies.

The goal of this is to rename flight.c/flight.h to pid.c/pid.h.
2015-01-31 23:47:51 +01:00
Dominic Clifton a9b2c39872 printf naming cleanup 2015-01-31 22:29:17 +01:00
Dominic Clifton 01b2ce0b36 IMU naming cleanup. 2015-01-31 22:23:38 +01:00
Dominic Clifton 8b0a982931 Telemetry naming cleanup. 2015-01-31 22:12:11 +01:00
Dominic Clifton 7c2c5eb152 Removing TODOs.
If it needs to be done it will be done.
2015-01-31 22:08:03 +01:00
Dominic Clifton 27f0216a19 Ensure that current meter feature is not disabled since it requires no
hardware io.
2015-01-31 21:56:01 +01:00
Joel Fuster ec946ea7d5 Split filter into separate file for future reuse 2015-01-31 11:46:44 -05:00
Joel Fuster 4f0af41e79 Merge remote-tracking branch 'upstream/master' into lowpass 2015-01-31 10:47:39 -05:00
tracernz cda2f3169e Add NMEA $GPGSV Decoding for Sat Data 2015-01-31 18:08:36 +13:00
tracernz c226f6a412 Tidy up NMEA Code A Little
Still a LOT of tidying up needed in future, of the whole GPS module
really.
2015-01-31 18:07:05 +13:00
Dominic Clifton c85919325c Exclude a bit more code when USE_ADC is not defined for a target. 2015-01-30 22:43:04 +01:00
Dominic Clifton d21a009d40 Change scale for I and D for inflight adjustments to PIDs of FP based
PID.
2015-01-30 22:09:36 +01:00
Dominic Clifton 1f3c9ab0db Fix failing targets. 2015-01-30 22:02:25 +01:00
Dominic Clifton de9a89ca85 Fix missing ) from ea386e6da2 2015-01-30 21:47:29 +01:00
Dominic Clifton 2ac7282314 Use different scale for inflight adjustments to PIDs of FP based PID
controllers.
2015-01-30 21:46:23 +01:00
Dominic Clifton ea386e6da2 Remove magic number usage. Fix limits for FP based pid controller PID
adjustments to match those in serial_cli.c.
2015-01-30 21:27:09 +01:00
Dominic Clifton fa18940087 Minor cleanups to allow CJMCU to build again. 2015-01-30 21:25:18 +01:00