Commit Graph

259 Commits

Author SHA1 Message Date
Dominic Clifton 6dca303130 Cleanup servo configuration storage (align some values more
efficiently).  Update MSP_SERVO_CONFIGURATIONS,
MSP_SET_SERVO_CONFIGURATION value order.  Add some error checking to
size of MSP_SET_SERVO_CONFIGURATION.
2015-07-12 23:32:07 +01:00
Dominic Clifton bc5f666069 Minor MSP cleanup and adding a FIXME. 2015-07-09 19:02:52 +01:00
Dominic Clifton 763c75873e Use 0 based index for motor and servo mix in CLI. Update
MSP_SERVO_MIX_RULES, MSP_SET_SERVO_MIX_RULE, MSP_SERVO_CONFIGURATIONS,
MSP_SET_SERVO_CONFIGURATION.  Delete MSP_CHANNEL_FORWARDING,
MSP_SET_CHANNEL_FORWARDING.
2015-07-08 12:54:09 +01:00
Dominic Clifton b5e18a90a2 Cleanup CLI
* optimize for code size.
* consolidate error message handling.
* replace similar error messages with identical ones.
* shorten all strings where possible.
* made less verbose.

This was required for the CC3D OPBL build.
2015-06-29 03:30:17 +01:00
Dominic Clifton ea6a6ccb3d First cut of custom servo mixers.
Main rule logic and MSP commands ported from baseflight.

Gimbal mixer updated to use rules.  This allows us to remove more
conditional logic.  Operation of gimbal servos is now different.
2015-06-28 23:06:56 +01:00
Dominic Clifton c142e3dfe9 Rename minLimit/maxLimit to angleAtMin and angleAtMax. Remove unneeded
MSP_SET_SERVO_LIMIT.  Bump MSP API version.  Add basic sanity checks to
MSP_SET_SERVO_CONF, reset all servos and adhere to the msp packet's data
size.
2015-06-28 12:22:14 +01:00
Mauro Mombelli da6ee6ffb7 first extract from Tilting for Servo pull request 2015-06-28 12:06:33 +01:00
Dominic Clifton a9b5ad71b2 Fixing MSP_RAW_IMU. See 26e950b433. Closes #1061.
Must have been a late one.
2015-06-27 21:15:51 +01:00
Dominic Clifton 26e950b433 Remove duplicate code from MSP_RAW_IMU. Saves a ~24 bytes of flash
space and results in easier to read code due to less nesting.
2015-06-24 23:17:59 +01:00
Dominic Clifton 7db626747d Allow all models to use servo tilt.
See #1006
2015-06-10 15:31:47 +01:00
Dominic Clifton 9a8a31676b Reduce maximum servos from 10 to 8.
1) the 2 extra servos were not used for anything, yet.
2) the MSP packet to set ALL the servo configurations in one go is
larger than the MSP input buffer size.

Likely the MSP_SET_SERVO_CONF should be updated with command that takes
an index of a servo to configure, as per mode ranges/colors/leds/etc.

Fixes #1002
2015-06-10 13:31:04 +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
Dominic Clifton 0c1a6c5c2f Merge branch 'lock_active_features' of https://github.com/ProDrone/cleanflight into ProDrone-lock_active_features
Conflicts:
	src/test/unit/rc_controls_unittest.cc
2015-05-29 20:05:25 +01:00
Dominic Clifton 41d737e29a Merge pull request #869 from SteveAmor/remove_tricopter_yaw_gyro_smoothing
Remove tricopter yaw gyro smoothing from imuUpdate
2015-05-29 15:39:02 +01:00
Dominic Clifton 55180070d6 Merge pull request #964 from nzmichaelh/more-const
various: optimise RAM and flash usage
2015-05-29 11:13:41 +01:00
Michael Hope c9349ce83b msp: rework the different size encoders.
Tidy the encoders up.  Reduce the code size stacking the encoders for
different sizes.

Signed-off-by: Michael Hope <mlhx@google.com>
2015-05-29 05:42:22 +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
Dominic Clifton a7d347689d Merge pull request #953 from enly1/Telemetry_Switch_Fix
Telemetry_Switch TELEMETRY_BOX conditional logic incorrect
2015-05-28 23:36:20 +01:00
enly1 [Simon Love] 7df9f7d0d5 Telemetry_Switch TELEMETRY_BOX conditional logic incorrect - corrected so TELEMETRY_BOX now available in GUI with telemetry_switch=1 2015-05-26 20:43:05 +01:00
Dominic Clifton a370d60595 Support UART3 and I2C on Paris Air Hero 32 Flex port (aka Naze32_SP).
This change also allows serial ports to be removed at runtime.  e.g.
UART3 on Naze32 and SoftSerial 1 & 2 when softserial is not enabled.
2015-05-22 20:49:33 +01:00
Dominic Clifton 20a6f829d5 SPRacingF3 - Add support for airplane pwm mappings. 2015-05-21 02:02:33 +01:00
ProDrone b75de91f35 Instead of trying to latch the desired features...
...and apply them after a soft reset (which also required an additional
write to flash), it is now such that features and settings are modified
and stored in flash as before.

After initialisation completes, the active features are latched and are
not to be modified until the next startup. This guarantees that all
saved modifications are persistent even when power is switched of
(without a reset in between).

When a soft reset is required, the active features and the currently
configured features are used to detect if the oneshot feature has
changed state, in which case motor PWM outputs are stopped and soft
reset is done after a 1.5 second delay.

During normal operation the active features will not change and all
changes to features ordered via MSP commands or the CLI are applied to
the configuration that gets saved to flash.

The required effect of modifying features without changing the actions
in the running mainloop is achieved. The user needs to be aware that
changes to features are not applied immidiatly.
2015-05-21 01:27:45 +02:00
Steveis 6448b4b3d7 Replaced gyroData with gyroADC as they both contain the same value 2015-05-17 07:14:42 +01:00
Dominic Clifton fe40472050 Remove magic number from MSP_SERVO_CONF. 2015-05-08 18:54:20 +01:00
borisbstyle 083a534273 Bump API version to 1.10 due to RC Yaw Expo 2015-05-07 10:59:34 +02:00
Dominic Clifton f5bfe1ce83 Fix MSP_RC_TUNING and MSP_SET_RC_TUNING to cater for rcYawExpo 2015-05-06 22:27:48 +01:00
borisbstyle da8bb6f6fc Yaw Expo Feature 2015-05-06 22:23:40 +01:00
Dominic Clifton 526281a519 Fix data length for MSP_FAILSAFE_CONFIG.
Thanks @tricopterY
2015-05-04 18:56:51 +02:00
tricopterY d7e668af9f Bug fix to cater for additional number of Bytes MSP_RX_CONFIG 2015-05-04 08:56:42 +01:00
Dominic Clifton 441b58c9c8 Allow failsafe config to be set via MSP. Add min/max channel values to
MSP_RX_CONFIG.
2015-04-26 18:27:12 +02: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 f28158a5a7 Cleanup debug code. 2015-04-14 13:59:11 +01: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
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
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
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
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 3b77626dd8 Only enable VBat ADC when VBat feature is enabled.
Fixes #612
2015-03-13 22:28:10 +01:00
Dominic Clifton fce1d5a680 Bump MSP API version for recent MSP_RC_TUNING changes. 2015-03-11 22:40:10 +01: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
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 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 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 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 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
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
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 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
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 80ea5e4419 Add flash ready state to MSP response, add flash async block write 2015-02-13 20:28:19 +13: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
Nicholas Sherlock 5651e65a0b Add support for discovering beginning of free space on flash chip 2015-02-10 13:44:18 +13: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 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 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 f77a762b48 Allow inflight adjustments for floating-point based PID controllers. 2015-01-30 20:54:34 +01:00
Nicholas Sherlock f7d227a208 Successfully blackbox logged 46kB of flawless log data on the bench
Data read back using MSP
2015-01-31 00:35:17 +13:00
Nicholas Sherlock ebff1bdcd7 Merge remote-tracking branch 'upstream/master' into blackbox-flash 2015-01-30 13:48:49 +13:00
Nicholas Sherlock 3c74ac2c91 Make more bulk writes asynchronous where possible, begin MSP impl. 2015-01-30 13:45:05 +13:00
Dominic Clifton 203c744763 Add MSP command to allow changing pid controller. 2015-01-29 18:17:53 +01:00
Dominic Clifton 50428f2dcc Change MSP_SONAR_ALTITUDE to be in the range used for cleanflight
original commands.

See
https://code.google.com/p/multiwii/source/browse/trunk/MultiWii_shared/Protocol.cpp#18
2015-01-29 15:23:38 +01:00
Krzysztof Rosinski 34cd8f466e MSP command for sonar altitude 2015-01-29 15:17:15 +01:00
Petr Ledvina bf1bc864ae Send current meter reading as signed value
Use signed value normally, truncate to 0-0xffff when multiwiiCurrentMeterOutput is active
2015-01-28 17:28:32 +01:00
Dominic Clifton 7bd98e557a Add current_meter_type into the new MSP command. 2015-01-26 15:34:34 +01:00
Marc Egli 99089b9e70 add new msp messages for voltage meter and enhance messages for current meter 2015-01-25 16:45:41 +01:00
Marc Egli 0db1807fec fix the length of some msp messages 2015-01-25 16:17:35 +01:00
Dominic Clifton 3fc7f32324 Merge branch 'imu-cleanup' of https://github.com/avoid3d/cleanflight into avoid3d-imu-cleanup 2015-01-25 01:00:14 +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 8bdca1b38e Improve magic number use. 2015-01-22 22:57:34 +01:00
Dominic Clifton e7302a9e10 Update MSP to allow setting of LED colors. 2015-01-22 22:24:58 +01:00
Dominic Clifton d2536e3792 Ensure LED configuration is re-evaluated after changes to led
configuration are made via MSP.
2015-01-22 21:38:09 +01:00
Chris Penny bfdb4d7564 removed commented out code 2015-01-20 20:27:37 +00:00
Chris Penny aede4037cf LED on/off add via LEDLOW mode 2015-01-20 19:51:07 +00:00
Dominic Clifton d72983e150 Bump version numbers for release. 2015-01-16 12:38:44 +00:00
Dominic Clifton b7462c0b3d Merge pull request #351 from nebbian/baseflight-pid-horizon-mode-tuneup_a
Baseflight pid (pid_controller=2) horizon mode tuneup
2015-01-16 00:50:12 +00:00
Dominic Clifton 8caff86006 Update MSP_SET_LED_STRIP_CONFIG. Each LED must be sent one at a time
since sending 32 leds needs a packet larger than the MSP receiver buffer
allows.
2015-01-16 00:09:02 +00:00
Dominic Clifton ce49dcee31 Bump MSP api version. Ensure the the number of LEDs in the
MSP_SET_LED_STRIP_CONFIG packet is validated.
2015-01-08 23:19:57 +00:00
Dominic Clifton 9729c59cb0 Fix MSP_LED_STRIP_CONFIG length. 2015-01-08 22:47:28 +00:00
Dominic Clifton fd86014308 Update RX_MSP to support 18 channels. Fix MSP_SET_RAW_RC / channel
mapping problem.
2015-01-08 09:03:57 +00:00
Ben Hitchcock 69d94c81e1 Second draft of the tuneup.
This uses ints for the sensitivity instead of mapping floats back and forth.
 Also the stick position is read directly, without the RC_Rate affecting this value.
2015-01-07 21:54:13 +08:00
Ben Hitchcock 6b7c9facd3 First draft of better horizon mode 2015-01-06 21:53:23 +08:00
Dominic Clifton 73e82b8446 Adding new (private) MSP commands for configurating serial port
scenarios and baud rates.
2015-01-03 00:54:24 +00:00
Dominic Clifton 98343af7a2 Break MSP_API_VERSION into smaller more specific commands. Bump MSP API
version to 1.1.  Set FC version to 1.4 to match next release.
2015-01-02 18:31:51 +00:00
Dominic Clifton c0dbde0318 Fix unable to arm using after setting mode range for arm and being able
to arm using sticks after removing all mode ranges for arm.
2014-12-26 20:04:17 +00:00
Dominic Clifton e7cac196a1 Prevent MSP from hogging the CPU. 2014-12-26 18:06:27 +00:00
Dominic Clifton ee19c1f071 Rename multiType to mixerMode. Rename MULTITYPE_* to MIXER_*.
'Type' is a noise word.

'Multi' is a mis-nomer - there is nothing 'multi' about a gimbal or
fixed wing.
2014-12-24 11:58:57 +00:00
Dominic Clifton b123b4ef03 Cleanup disabling of mixers for CJMCU, this might be usefulfor the
AlienWii32 target too.

Deleted old out of date comments.  Various other minor cleanups.
2014-12-24 11:33:14 +00:00
Dominic Clifton bd29298197 Fix being unable to configure mixer via GUI. 2014-12-23 19:37:39 +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 13305dd2e4 Disable mixer configuration on CJMCU to save flash size. 2014-12-21 23:40:48 +00:00
Dominic Clifton ec5929d278 Add MSP_BUILDINFO. 2014-12-20 02:57:02 +00:00
Dominic Clifton df61d9a7eb Support GPS Provider and SBAS mod in MSP_MISC. 2014-12-20 02:22:51 +00:00
Dominic Clifton a48a848890 Fix CRC errors in msp responses caused by double calling of
headSerialReply().  Ensure system is not reset while MSP response is
being transmitted.
2014-12-19 23:47:58 +00:00
Dominic Clifton 5b2659c92c Implement MSP_CONFIG and MSP_SET_CONFIG for backwards compatibility for
configurator.
2014-12-19 22:56:56 +00:00
Dominic Clifton 367eb79bd0 Add battery warning beeper. Update MSP_MISC/MSP_SET_MISC.
Note the old beeper was essentially 'battery critical'.
2014-12-19 22:16:47 +00:00
Dominic Clifton ca7991d532 Update MSP_RX_CONFIG to include the ability to confugure spektrum
satellite binding.
2014-12-17 23:15:33 +00:00
Michael Jakob c80090f39f Spektrum Satelitte bind code ported from Baseflight
includes support for a hardware bind plug (PB5 pin 41)
Activate via OPTIONS="HARDWARE_BIND_PLUG" during make
2014-12-17 23:15:27 +00:00
Kyle Manna c806046181 perms: Remove execute bit on source files
* Remove the execute bit on source files.
* No functional change.
2014-11-26 10:13:29 -06:00
Dominic Clifton 28da97f894 Fix MSP/Telemetry Arm/Disarm problems.
Tested with two MSP ports, one via softserial. Both with telemetry
enabled and without telemetry enabled.
2014-11-08 11:53:01 +00:00
Dominic Clifton 2461973dd6 There was a little more fixed to do when telemetry was not eanbled.
Tested arm/disarm/arm/disarm with telemetry on and off, all working now.

See #155.
2014-11-08 01:11:10 +00:00
Dominic Clifton 903392b883 Updating comment. 2014-11-06 19:52:10 +00:00
Dominic Clifton 59698c5a37 Merge branch 'naze-updates-pb' of github.com:Pierre-A/Cleanflight into Pierre-A-naze-updates-pb 2014-11-06 19:44:39 +00:00
Dominic Clifton db36cfe12e Fix arm/disarm/arm bug when using shared msp/telemetry ports.
All msp ports are now re-initialised when disarming.

Bug wa introduced by c06fd78b83 - see
#144.

Runtime serial port scenario should not have been erased.

Fixes #144 and #155. Cleanup #125.
2014-11-05 20:23:59 +00:00
Pierre-A d545ab545f Remove profanity from comments (issue #43) 2014-11-02 14:53:57 +01:00
Dominic Clifton 0ba2933611 Add MSP_SET_ADJUSTMENT_RANGE and MSP_ADJUSTMENT_RANGES commands. 2014-11-01 10:24:32 +00:00
Dominic Clifton 28f9fa629c Add rate profiles and inflight switching between them. See Profiles and
Inflight Adjustment documentation for details.
2014-10-29 23:36:34 +00:00
Dominic Clifton 8aeee0b5fd Merge branch 'inflight-adjustments' 2014-10-24 23:12:45 +01:00
Dominic Clifton 18abad5dd7 Extract range definition so it can be reused. 2014-10-24 18:57:06 +01:00
Petr Ledvina e179218caf Trivial changes
- use inline functions for gpio (typesafe, no speed penalty)
- fix sortSerialPortFunctions (original was IMO broken)
- allow softserial port on sonar pin when FEATURE_SONAR is not enabled
- minor style changes and comments
2014-10-23 15:08:57 +02:00
Dominic Clifton 50971667d9 Fix a couple of typos in MSP guidelines. 2014-10-17 22:46:07 +01:00
Dominic Clifton 596d798732 Add MSP_API_VERSION command. Added MSP development guidelines. Define
board identifiers for all cleanflight targets.
2014-10-17 22:34:15 +01:00
Dominic Clifton 6f3aa6fb86 Add extra MSP commands to allow settings to be made via a GUI in
addition to setting via the CLI.

Note: MSP_CONFIG from baseflight
bc68d89983d762d35cc1cf5e3fa0c2cf03287b70 will not be supported because
more specific commands exist in cleanflight.

MSP_MISC and MSP_CONFIG are good examples of single responsibility
violations.
2014-10-17 01:33:47 +01:00
Dominic Clifton da51b5c479 Add MPU6500 SPI driver. Move sensor initialisation defines into target
specific headers.
2014-10-14 00:22:54 +01:00
Dominic Clifton 79c2e5648f Add MSP capability bit so clients can detect Cleanflight and use an
appropriate API.  Renumber some cleanflight specific MSP commands,
Cleanflight will use the range 32-63 for new MSP commands.
2014-10-13 22:36:00 +01:00
Dominic Clifton 59c55b4a19 Use permenant id for MSP_SET_MODE_RANGE. 2014-10-13 01:08:41 +01:00
Dominic Clifton c5280cd9d7 Ensure mode flags are correctly generated after the switch to a bitmask
for activated modes.
2014-10-13 00:53:41 +01:00
Dominic Clifton 50ba314116 Fix range check problem for first mode range index. 2014-10-12 23:43:12 +01:00
Dominic Clifton 77e83eef0c Use permenant mode ids in MSP_MODE_RANGES and MSP_SET_MODE_RANGE. 2014-10-12 21:47:39 +01:00
Dominic Clifton 2555858687 Add two new MSP commands to get ALL mode ranges and to set individual
mode ranges.
2014-10-12 21:22:05 +01:00
Dominic Clifton c0fd0c1f33 Replace profile.activate and rcOptions with
profile.modeActivationCondition and rcModeActivationMask.

Implementation of using and setting modeActivationConditions is missing.
2014-10-12 10:40:38 +01:00
Dominic Clifton 3eb8bcb3e5 Merge branch 'feature-sonar-flight-mode-no-baro' of dclifton-github.com:nebbian/cleanflight into nebbian-feature-sonar-flight-mode-no-baro
Fixed tabs, kept old references to VARIO.  Made SONAR mode a new option so that aux settings could be preserved.

Conflicts:
	src/main/config/runtime_config.h
	src/main/flight/altitudehold.h
	src/main/flight/imu.c
	src/main/io/rc_controls.h
	src/main/mw.c
	src/main/sensors/initialisation.c
2014-09-26 13:36:19 +01:00
Dominic Clifton 35280abfed Allow disabling of I2C for targets that do not use it. 2014-09-26 01:32:57 +01:00
Dominic Clifton 545980c14a Move colors from ram to master config. Initialise colors only when
config is reset to defaults.
2014-09-18 22:53:12 +01:00
Dominic Clifton 6ce5736990 Update LED strip code to allow configurable LED strips.
See documentation for details.
2014-09-15 03:15:11 +01:00
Ben Hitchcock 66fce423bb Code allowing the use of sonar without requiring a barometer.
This code has been flight tested on a Naze32 acro, with no barometer onboard.  It also works when the target doesn't have BARO defined.
2014-09-05 11:28:55 +08:00
Dominic Clifton 00a1858faa Cleanup and fix the use of permenant box ids. 2014-08-27 23:59:52 +01:00
Dominic Clifton d15b56f14e Fixing mis-reporting of armed state - missed in b6a8e20. 2014-08-26 21:24:07 +01:00
Dominic Clifton b6a8e20d8c Fix reporting of flight modes broken in 3f0754d
The conversion of the flags to bitmasks meant the mask was being bitshifted instead of 1 or 0.
2014-08-24 21:31:52 +01:00
Dominic Clifton 3f0754d295 Replace global flags with stateFlags, flightModeFlags and armingFlags.
Each flag was previously a whole byte, now all of the flags only take up
4 bytes as they are represented by bit masks.

This is cleaner because the different kind of flags are now separated.

Additionally this changes the behaviour of arming slightly.  When using
a switch to arm the aircraft will not arm unless the switch has been in
the off state once.  This prevents arming if you power the aircraft with
a low throttle and the switch in the on position.
2014-08-24 12:11:30 +01:00
Dominic Clifton 1ea014ae25 Support MSP telemetry on ports marked as TELEMETRY instead of MSP, this
follows the pattern that HoTT and FrSky use.

Previously MSP telemetry was actually output on the MSP port, NOT the
telemetry port.

Baudrate for MSP telemetry currently fixed at 19200.
2014-08-23 01:14:06 +01:00
Dominic Clifton 4604403098 Merge branch 'master' into msp-on-multiple-ports
Conflicts:
	src/main/config/config.c
	src/main/io/serial_msp.c
2014-08-22 22:30:33 +01:00
Dominic Clifton f51efaa7c0 Instead of copying a profile from the master config into memory again,
just use it in-place.  This saves ~308bytes of memory.

Prior to this there were 4 profiles in ram all the time, the 3 main
profiles and a copy of one of them.

This commit was aided by a side effect of the work done to clean up the
output of the cli dump command since it is now easy to conditionally
apply the changes to the memory addressed used to read/write cli
variables.  See 8c3a869251.
Conflicts:

	src/main/io/serial_msp.c
2014-08-22 22:05:35 +01:00
Dominic Clifton 71e7feebd9 Move 'boxes' out of ram and into flash - saves quite a bit of ram. 2014-08-22 22:01:04 +01:00
Dominic Clifton 8ebdb245c2 Instead of copying a profile from the master config into memory again,
just use it in-place.  This saves ~308bytes of memory.

Prior to this there were 4 profiles in ram all the time, the 3 main
profiles and a copy of one of them.

This commit was aided by a side effect of the work done to clean up the
output of the cli dump command since it is now easy to conditionally
apply the changes to the memory addressed used to read/write cli
variables.  See 8c3a869251.
2014-08-22 21:53:23 +01:00
Dominic Clifton 11a00e2697 Move 'boxes' out of ram and into flash - saves quite a bit of ram. 2014-08-22 21:05:55 +01:00
Dominic Clifton 349b20186d Comment cleanup 2014-08-18 19:09:12 +01:00
Dominic Clifton 0b353341f8 Limit MSP ports to 2 for normal usage scenarios. 2014-08-14 00:50:17 +01:00
Dominic Clifton 7453e98b3b Update serial and msp code to allow MSP on multiple ports.
Work in progress.  In testing using bluetooth on uart2 and uart1
connected to configurator it was observed that there is corrupted
responses being sent via uart2 - ez-gui shows some garbled data for the
box names.  updates appear sluggish in ez-gui but some correct data is
getting through.

Enabled with:

set serial_port_2_scenario = 8
save
2014-08-14 00:38:42 +01:00
Dominic Clifton 9906294cd8 Split navigation functionality from io/gps.c into flight/navigation.c.
gps.c now only has code that deals with gps hardware, state and
messaging.
navigation.c  now only has code dealing with flight
navigation/waypoints/home/hold/etc
2014-08-07 14:23:05 +01:00
Dominic Clifton 9a9ff9b1ad Cleanup various compiler warnings that were appearing since the
additional compiler flags were added.
2014-08-01 20:02:10 +01:00
Dominic Clifton 9f1a0fcb4c Cleanup line endings. 2014-07-31 23:53:34 +01:00
Dominic Clifton 3b629d58a0 GPS can now be conditionally compiled in. 2014-07-30 23:35:33 +01:00