Commit Graph

18 Commits

Author SHA1 Message Date
Dominic Clifton 032202ef8f BUGFIX - Cleanup failsafe system so it works correctly with Serial RX
systems and Parallel PWM/PPM systems.

Added setting for failsafe_max_usec.  Renamed failsafe_detect_threshold
to failsafe_min_usec.

Failsafe now detects when a PPM/PWM RX isn't sending ANY data out on
CH1-4.  See documentation notes regarding Graupner receivers in
Failsafe.md.

Documented failsafe system.
2014-05-15 14:28:57 +01:00
Dominic Clifton 21207ca940 Improvement: Add support for upto 18 channels. Allow RSSI to be read
from any channel, not just AUX1-4.

See documentation changes in this commit.
2014-05-14 19:23:27 +01:00
Dominic Clifton 5d460766e9 RXMSP is no longer a serial rx provider since it uses MSP and not it's
own dedicated serial port.
Added a feature to enable/disable RX_MSP.
Renamed feature SERIALRX to RX_SERIAL.
Renamed feature PARALLEL_PWM to RX_PARALLEL_PWM
Renamed PPM to RX_PPM.

Update serial configuration checking to better support Serial RX and
telemetry by verifiying serial port features and supported baud rates.

It's now possible to use a low-speed serial rx provider via softserial -
only problem is all the current serial rx providers are 100000/115200
baud.  The code changes however open the door for using serial rx and
any capable serial port such as uart3-5 on the STM32F30x

It's also now possible to use GPS at low speeds on software serial
ports.
2014-05-12 13:23:20 +01:00
treymarc cabc57774c format code properly
match the comment from pullrequest about spacing
remains : some hand alignment for comment and wrong /** */ usage.
Conflicts:

	src/board.h
	src/buzzer.c
	src/config.c
	src/drivers/serial_common.h
	src/drivers/system_common.c
	src/drv_gpio.h
	src/drv_pwm.c
	src/drv_timer.c
	src/drv_uart.c
	src/flight_imu.c
	src/mw.c
	src/serial_cli.c
2014-05-11 18:04:05 +01:00
Dominic Clifton f1d38c0fa2 Rename serialrx_type to serialrx_provider to match gps_provider and
telemetry_provider.
2014-05-10 00:32:42 +01:00
Dominic Clifton 3ed979e88c BUGFIX - pwmReadRawRC was broken in
2d248676f5. MSP RX ignored rc channel
mapping.

Symptoms: power up FC using parallel PWM or PPM with no receiver
attached.  Connect GUI tool to view receiver data.  Observe that each
channel has a reading of '2' instead of somewhere near 'midrc'.

Symptoms: rxMsp ignored rc channel map, cli 'map' command had no effect.

This commit re-instates the code that checked to see if an rc channel
value was in the correct range but moved it into computeRC where it
really belongs.

Additionally to the code to remap rc channels was moved from the rx
implementations into the computeRc method.  This results in smaller code
size, no duplication of logic avoids having to pass rxConfig to each rx
read method and finally fixes rxMsp so that channel mapping can be used.

Failsafe still works as intended, verified by using parallel PWM, arming
and then pulling out the throttle PWM inpout cable.

This also improves code cleanliness since now each rawRawRc method in
the RX implementations does not have to remap the channels.  The methods
now do only what their name says.
2014-05-08 12:07:15 +01:00
treymarc 9e8b05dc0e add serial_rx msp
Conflicts:

	Makefile
	src/board.h
	src/main.c
	src/mw.h
	src/serial_cli.c
2014-05-03 18:20:17 +01:00
Dominic Clifton 92f74ac0c2 Removing final dependency on board.h.
board.h is no-longer required.
2014-04-24 02:16:16 +01:00
Dominic Clifton 695db3523a Remove flight_mixer.c's dependency on mw.h/board.h.
This is a large commit, from the commit it is clear that the mixer has
many dependencies, this is expected since it is central to the
application.

To achieve the decoupling many master config and profile members had to
be moved into structures.

Relocated throttle/pitch curves into rc_curves.c/h since it has nothing
to with rx code, this fixed the dependencies inside the rx provider
files.
2014-04-24 00:18:24 +01:00
Dominic Clifton a5f0999c26 Remove serial_cli.c's dependency on mw.h/board.h.
Rename yawdeadband to yaw_deadband to match other variables/cli
commands.

Fix a couple of usages of MAX_MOTORS where MAX_SUPPORTED_MOTORS should
be used instead.
2014-04-23 20:42:38 +01:00
Dominic Clifton fe89d40fa0 Remove main.c's dependency on mw.h/board.h.
Moved pidControllers out of mw.c into flight_common.c/h.
Moved appropriate code into rc_controls.c/h.
2014-04-22 01:58:23 +01:00
Dominic Clifton e969d184e6 decouple failsafe from the rest of the system.
Note: the pwm_common driver has a dependency on the main failsafe code,
the solution is probably to move some of the code into rx_pwm.
2014-04-21 00:46: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 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 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
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 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