Commit graph

2704 commits

Author SHA1 Message Date
treymarc
5758a42e77 { 2014-04-19 00:09:01 +00:00
Dominic Clifton
b1f7a36ae5 update binaries. 2014-04-19 01:07:39 +01:00
Dominic Clifton
8bda006d97 fix FY90Q build. 2014-04-19 01:07:23 +01:00
treymarc
7c74e0e9ca do no msp_write_eeprom from msp if armed , tel the gui about the error 2014-04-19 00:04:37 +00:00
Dominic Clifton
a7e4c859bd decouple cli/msp from each other. relocated non-msp code into
serial_common.c/h. decouple runtime_config from serial ports.  decouple
buzzer from serial ports.  decouple opening of the main serial port from
the msp code.  decouple serial rx providers from runtime_config.  rename
core_t to serialPorts_t since it only contained serial ports.  It's now
clear which files use serial ports based on the header files they
include.
2014-04-19 01:01:31 +01:00
Dominic Clifton
2baf385b99 Remove mpu6050_scale from core_t by providing a sensor independent way
of determining a revision code.  Previously there was mpu6050 specific
code in cli.c (the status command).

Finally this commit has removed all non-serial port configuration
settings from core_t so that a future commit can refactor core_t to
reduce dependencies on serial port code.

In doing this I also noted from other source code that the MPU6050
accelerometer trim for some revisions appeared to be incorrectly set to
255 * 8 instead of 256 * 8.
2014-04-18 23:32:48 +01:00
Dominic Clifton
94c0f87c45 Remove useServos from core_t since it's only needed for initial startup
and by the mixer.  main.c now asks the mixer if it needs to use servos
and the mixer decides this in mixerInit().  Main already has a
dependency on the mixer.  This allows future commits to further clean up
core_t which is still a source of dependency problems.
2014-04-18 23:13:43 +01:00
Dominic Clifton
7b079ca297 Remove code duplication for gimbal servo updates. 2014-04-18 21:05:03 +01:00
Dominic Clifton
799844d933 Provide temporary support for old clients that try and send a channel
index instead of a servo middle when using MSP_SET_SERVO_CONF.

Old GUI clients can still be used to SET channel forwarding, but cannot
be used to READ the status of channel forwarding until they are updated
to use MSP_CHANNEL_FORWARDING/MSP_SET_CHANNEL_FORWARDING.

To the user it will mean their GUI may not match the stored
configuration.  However there is no way to DISABLE channel forwarding
other than a reset if they have enabled it using an old client.

This situation is not ideal, but without this commit it would mean that
bad data could be stored and used incorrectly by baseflight if a user
enables channel forwarding using an old client.
2014-04-18 20:51:16 +01:00
Dominic Clifton
3c1b0b1998 Use constants for PWM ranges instead of the magic numbers 0, 1000 and
2000.
2014-04-18 20:41:49 +01:00
Dominic Clifton
be6ce96e5d Merge remote-tracking branch 'multiwii/master' into project-structure-alternative
Conflicts:
	src/mw.h
2014-04-18 19:45:30 +01:00
Dominic Clifton
b8e7c2d14f Fix servo middle/channel forwarding variable re-use. Adds a new
capability flag which is returned by MSP IDENT (CAP_CHANNEL_FORWARDING).
Adds two new MSP commands that are specifically for configuring channel
forwarding (MSP_CHANNEL_FORWARDING/MSP_SET_CHANNEL_FORWARDING).  Servo
'middle' and 'forward from channel' are now stored independently, as
they probably should always have been.
2014-04-18 19:19:37 +01:00
Dominic Clifton
43258c045d build of latest binaries with spektrum 2048 8channel support. 2014-04-18 17:31:28 +01:00
Dominic Clifton
f68fc17627 Cleaned up RX initialisation. Updated Spektrum RX code to support 12
channels when using Spektrum 2048 - untested.  Renamed and extracted
core_t.numRCChannels to rxConfig.channelCount so that future commits can
clean up core_t further since core_t contains completely unrelated
properties.
2014-04-18 17:25:53 +01:00
dongie
33614a5b22 Merge pull request #86 from treymarc/patch_speed
Remove unnecessary var, inline accsum_reset, lrintf , rename smallAngle
2014-04-18 22:27:23 +09:00
Dominic Clifton
d777bac39d move printf and typeconversion to common to reduce visual clutter of
main source directory.
2014-04-18 14:03:42 +01:00
Dominic Clifton
a85bfa51e3 Remove config.c's dependencies on the mw.h/board.h files. Moved some RX
code into rx_common.c. Moved some GPS code into gps_common.c.  Isolated
some GPS functions into gps_common.c that were called from mw.c/loop().
moved gimbal defines into gimbal.h.  Moved sound & light code into
statusindicator.c
2014-04-18 12:13:37 +01:00
Dominic Clifton
8477b45061 Cleanup declarations of failsafeCnt so that it is only in failsafe.h and
failsafe.c.  Now it is clear from the list of includes that each
serialrx provider supports failsafe.
2014-04-18 00:37:03 +01:00
Dominic Clifton
6a9d38783c Fixing and unifying Serial RX initialisation. Destination arguments now
go last and each init method is passed the rxConfig.
2014-04-18 00:08:48 +01:00
Dominic Clifton
f06c8bb99b Relocate common code which can be used by drivers and by main into
'common'.  Cleanup includes.  Fix FY90Q target compilation.
2014-04-17 23:50:13 +01:00
Dominic Clifton
d4ebd8a748 Rename 'altimeter' related files to 'barometer' since GPS and other
sensors handle altitude too - requested by @treymarc
2014-04-17 23:23:06 +01:00
Dominic Clifton
c658e31b62 Remove spektrum and sumd's dependencies on the mw.h/board.h files. 2014-04-17 23:11:13 +01:00
Dominic Clifton
0f02e12f40 de-duplicate failsafe code. extract failsafe code to seperate files.
remove dependency on board.h and mw.h on a few files.

Moved rx configuration paramaters into rxConfig in order to remove the
dependency on config_t from the sbus rx code  - sumd/spektrum to follow.

Avoided use of YAW/PITCH/ROLL in some files since those constants are
from an unrelated enum type.

Replaced some magic numbers with constants to remove comments and
improve code readability.

Note, due to the tight coupling and global variable usage it was
difficult to create a smaller commit.
2014-04-17 23:02:22 +01:00
Dominic Clifton
d7eb416aa9 de-duplicate degrees to radians code.
Note, this also makes the operator precedence clearer.
2014-04-17 22:53:18 +01:00
treymarc
e39636cc00 format 2014-04-17 20:45:09 +00:00
treymarc
5468a9cfa0 correct lpf for d term
renormalize vect (is that required or the real cause of the gyro
headfree?)
2014-04-17 20:25:08 +00:00
Dominic Clifton
41b5a01958 Decouple board alignment code. 2014-04-17 19:31:01 +01:00
Dominic Clifton
59a5846146 Removing unused define for MAX_SERIAL_PORTS. 2014-04-17 17:51:14 +01:00
Dominic Clifton
fcc898c3f8 Removing unused define for a uart buffer size. 2014-04-17 17:50:19 +01:00
Dominic Clifton
7e45a0c7e6 Fixing FY90Q build. Cleanup of printf support and initialisation.
Remove duplicate inclusion of math.h in board.h.
2014-04-17 17:37:43 +01:00
Dominic Clifton
89612bd881 De-couple battery code.
This fixes a bug where buzzerFreq could be uninitialised before it's
use.
This improves performance by only checking whether to sound the battery
alarm after the battery voltage has been recalculated.
There were unused battery beep codes which have been deleted to save
code size.
Configuration structure extracted from mw.h into config.h.
Moved mixer configuration structures into flight_mixer.h.
Added a build_config.c in order to decouple pwm_common.h from config.h.
Finally, battery configuration values now live in a batteryConfig
structure which means that battery.c does not depend on config.h and all
of it's dependencies.

Fixed the use of plurals on defines that were not collection objects.
PIDITEMS and CHECKBOXITEMS are now PID_ITEM_COUNT and
CHECKBOX_ITEM_COUNT.
2014-04-17 16:36:01 +01:00
Dominic Clifton
64d16e1987 Relocated used code from board.h into appropriate headers, deleted
unused code.
2014-04-17 15:02:41 +01:00
Dominic Clifton
3ef05c0eb9 Update timer drivers so they do not include "board.h". It is now
clear what all timer drivers need to compile and what was
unnecessarily included before.
2014-04-17 14:45:05 +01:00
Dominic Clifton
45ce1862cd Update sonar drivers so they do not include "board.h". It is now
clear what all sonar drivers need to compile and what was
unnecessarily included before.
2014-04-17 14:43:57 +01:00
Dominic Clifton
2f07f52cf7 Update system/beeper drivers so they do not include "board.h". It is now
clear what all system/beeper drivers need to compile and what was
unnecessarily included before.

Extracted system beeper code to a separate file.
2014-04-17 14:41:17 +01:00
Dominic Clifton
1e9186d3a1 Update serial drivers so they do not include "board.h". It is now clear
what all serial drivers need to compile and what was unnecessarily
included before.
2014-04-17 14:27:30 +01:00
Dominic Clifton
86e4e1c98f Update pwm drivers so they do not include "board.h". It is now clear
what all pwm drivers need to compile and what was unnecessarily included
before.
2014-04-17 14:21:56 +01:00
Dominic Clifton
38ec0b6080 Update gpio/ledring drivers so they do not include "board.h". It is now
clear what all gpio/ledring drivers need to compile and what was
unnecessarily included before.
 
In attempting this it was clear that ledring had a dependency on the
multiwii code, this was removed by passing the led status update method
the values it needs.

It also turned out that the ROLL/PITCH defines were coming from
rc_alias_e and much unrelated code is coupled to these defines.  This
commit also includes some cleanups relating to that problem.
2014-04-17 13:56:23 +01:00
Dominic Clifton
b6232573c0 Update compass drivers so they do not include "board.h". It is now clear
what all compass drivers need to compile and what was unnecessarily
included before.

LED macros now moved into light_led.h
2014-04-17 12:33:59 +01:00
Dominic Clifton
1205765b4c Update i2c/spi drivers so they do not include "board.h". It is now clear
what all i2c/spi drivers need to compile and what was unnecessarily
included
before.

Renamed printf_config.h into build_config.h, move SOFT_I2C toggle switch
to build_config.h.
2014-04-17 12:12:08 +01:00
Dominic Clifton
ff0f4e66a9 Update altimeter drivers so they do not include "board.h". It is now
clear what all altimeter drivers need to compile and what was
unnecessarily included before.

Moved some platform specific configuration from board.h into platform.h
2014-04-17 11:56:03 +01:00
treymarc
f6024c5406 update header 2014-04-16 22:51:03 +00:00
treymarc
6330456296 remove unnecessary var, inline accsum_reset, lrintf , rename smallAngle 2014-04-16 22:48:37 +00:00
Dominic Clifton
001de4cdf3 Move FY90q acc/gyro code to accgyro_fy90q.c. Update ADC drivers so they
do not include "board.h". It is now clear what all ADC drivers need to
compile and what was unnecessarily included before.

Note: FY90Q make target now compiles successfully, it was broken for
various reasons before.
2014-04-16 18:58:20 +01:00
Dominic Clifton
5442f8ea41 Fix typo in filename. 2014-04-16 17:49:51 +01:00
Dominic Clifton
3c1ba729b9 Merge remote-tracking branch 'multiwii/master' into
project-structure-alternative

Conflicts:
	src/sensors.c
2014-04-16 17:49:10 +01:00
Dominic Clifton
f75f7a7e17 Updating accgyro files so they do not include "board.h". It is now
clear what all accgyro drivers need to compile and what was
unnecessarily included before.
2014-04-16 17:33:47 +01:00
dongie
cd08d6d782 Merge pull request #84 from treymarc/patch-1
Update imu.c
2014-04-17 01:23:23 +09:00
dongie
d687afd109 Merge pull request #83 from treymarc/format2
format
2014-04-17 01:21:13 +09:00
dongie
c3235e3fed Merge pull request #81 from treymarc/type_bool
type bool and inflight acc calib
2014-04-17 01:19:36 +09:00