Commit graph

2704 commits

Author SHA1 Message Date
Dominic Clifton
5c4bfd4e58 Configuration validation.
This enables a new feature setting for PARALLEL_PWM which is enabled by
default.

This starts to move much of the feature checking/excluding code that is
littered through into a single place - validateAndFixConfig().  Since
the config is known to be valid after the method is called other code
can just get on with it's job instead of checking for confliciting
features/settings.
2014-05-10 14:12:24 +01:00
Dominic Clifton
0fd127bf60 Allow the user to specify their serial port scenarios. 2014-05-10 14:11:01 +01:00
Dominic Clifton
5043370b2f Disable some acc/gyros on Olimexino. 2014-05-10 14:09:38 +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
dongie
17742315fa Merge pull request #95 from kh4/master
Enable input filtering on input capture timers.
2014-05-10 07:58:50 +09:00
dongie
a848ccc129 Merge pull request #102 from fnurgel/fnurgel/sbus_rx_failsafe_enable
Use rx failsafe when baseflight failsafe is not enabled for s.bus
2014-05-10 07:58:03 +09:00
Dominic Clifton
1777d8feda First cut of configurable serial port functionality.
Currently port usage is hard-coded to the default port layout, cli
commands are coming in a future commit.

This decouples all code from the global 'serialPorts' structure which
has been removed.  Any code that needs to use a serial port can use
findOpenSerialPort() and openSerialPort() and maintain it's own
reference to the port.

Ports can switch between functions.  e.g. by default
cli/msp/telemetry/gps
passthrough all use USART1.  Each port maintains it's current function.
see begin/endSerialPortFunction.

There are only certain combinations of serial port functions that are
supported, these are listed in serialPortFunctionScenario_e.

This commit also adds a few 'static' keywords to variables that should
have been.

There a a few other minor fixes and tweaks to various bits of code that
this uncovered too.
2014-05-09 23:39:10 +01:00
Dominic Clifton
533a1f9e48 CHEBUZZF3 - Fix software serial pwm mapping. 2014-05-08 22:11:11 +01:00
Dominic Clifton
185fd0f4c9 Fix the problem where RC channels would show up as 1498 with no receiver
connected instead of the 'midrc' value.

Achieved by deleting unnecessary legacy ardino code.

Discussion here:
http://www.multiwii.com/forum/viewtopic.php?f=8&t=5063&p=50635#p50634

Basically it was there because the Ardiuno PPMSUM timer resolution is
lower than the STM32 code we use.

With a Grapner GR-24 receiver using parallel PWM or PPM (12channel) the
values hardly fluctuate at all, slightly more noticable with parallel
PWM input.
2014-05-08 15:31:35 +01:00
dongie
399cc784be building current hex 2014-05-08 22:11:12 +09:00
dongie
509f6ae75e moved BMP085/BMP180 init before MS5611 - reports of calibration data inside BMP180 passing MS5611 PROM CRC could trigger false detection 2014-05-08 22:03:22 +09:00
dongie
842380bc31 check data returned from rcReadRawFunc() for being valid 2014-05-08 21:58:26 +09:00
Dominic Clifton
3c91ce6c8b Avoid uninitialised variable warning in rx_common.c. 2014-05-08 13:29:10 +01:00
Dominic Clifton
6704ba40b5 Decouple failsafe from RX drivers.
This removes a number of FIXMEs regarding driver dependencies on the
main code.

The code to verify pulse lengths is now in computeRC which means that
all RX drivers do not have to duplicate the pulse length checking code.

This means that failsafe can be used to validate serial RX providers as
well as PWM/PPM RX providers.
2014-05-08 13:28:14 +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
dongie
a667eda98e Merge pull request #106 from treymarc/format2
format code properly
2014-05-08 09:40:29 +09:00
treymarc
1f293795e7 format code properly
match the comment from pullrequest about spacing
remains : some hand alignment for comment and wrong /** */ usage.
2014-05-08 00:36:19 +00:00
Dominic Clifton
35f7ce06f3 Rename pwm_rx failsafeCheck variables. 2014-05-08 01:29:21 +01:00
Dominic Clifton
10f3835491 CHEBUZZF3 - Use timer configuration that matches the hardware. 2014-05-08 01:28:31 +01:00
Dominic Clifton
90d36b6869 Cleanup sensor auto detection code.
Decoupled mpu6050 acc and gyro detection code.

This commit cleans up the #ifdef/#ifndef code which, due to the amount
of targets and variants, was starting to get a bit out of hand.

Now each acc & gyro is assumed to be used unless the respective
USE_ACC_* and USE_GYRO_* is #undef'd at the top of the file by a
particular target.

This commit also cleans up the mess of re-running all the mpu6050
detection code twice.  Now the acc specific communication code is only
run once and only code that is actually needed to be run twice is run
twice, and the rest of the code is now only used once.  This will
improve board startup time, albeit negligibly.

Sensor alignment is only known for the NAZE target so now the alignment
will be ALIGN_DEFAULT for all targets other than NAZE unless they are
known.

Finally, in the Makefile a file was included twice in the source list
for the STM32F3DISCOVERY target and now additional sensors are supported
for users that may want to try them on that board.
2014-05-07 23:20:24 +01:00
Dominic Clifton
a3d23de2ca Update notes.txt
CHEBUZZF3 - Update board orientation notes.
2014-05-07 22:17:55 +01:00
Dominic Clifton
3b1801cacd CHEBUZZF3 - Update makefile and sensor initialisation code to support
ChebuzzF3 target.
2014-05-07 22:11:38 +01:00
Dominic Clifton
672627e7f4 ChebuzzF3 - add ChebuzzF3 target notes 2014-05-07 21:22:38 +01:00
Dominic Clifton
4bf0e9cfa2 Updating FIXME comments. 2014-05-07 18:56:55 +01:00
Dominic Clifton
3dbdedf1b2 latest binaries 2014-05-06 14:15:14 +01:00
Dominic Clifton
8322bba5f1 Fixing use of softserial for telemetry that was also broken in
92bed4a33d
2014-05-06 14:11:52 +01:00
Dominic Clifton
8919acb902 Fix PPM input that was broken in
92bed4a33d
2014-05-06 13:56:58 +01:00
Dominic Clifton
6e00615baf Fix PPM/PWM code. 2014-05-06 13:37:07 +01:00
Dominic Clifton
6721587566 Split PWM code into appropriate separate files - mapping, rx and output.
By decoupling everything the structures now only contain members they need.  The mapping code is simplified.  The calculation of timer periods is now where it belongs (with the output code, not with the mapping code).  Also, since each motor output has it's own callback method it is technically possible to mix brushed and brushless motors if the brushed motors and brushless motors use different timers.  Additional code would be required to fully support that.
2014-05-06 11:08:45 +01:00
Dominic Clifton
adfbb8ac43 Adding a comment so that readers know what IMU stands for. It appears
there is perhaps some non-IMU code in flight_imu.c and that IMU is too
broad a term to perhaps even name this file after.
2014-05-05 18:11:48 +01:00
Dominic Clifton
abde6bd276 Extract BaroPID calculation into separate method.
This reduces indentation level, separates method concerns, keeps logic
with method intent, removes the need for a comment and makes it
testable.
2014-05-05 18:07:20 +01:00
Dominic Clifton
d352c68c9b Renaming angleInclination_t to rollAndPitchInclination. renamed angle
to inclination.
2014-05-05 17:45:46 +01:00
Dominic Clifton
a4b16f461c Adding test-specific platform.h file. 2014-05-05 17:09:55 +01:00
Dominic Clifton
8999752cf0 Removing redundant test (scenario is covered by other tests). 2014-05-05 17:09:29 +01:00
Dominic Clifton
ddd322fb9f Adding test for the downwards thrust direction logic added in
495c6b8f73.
2014-05-05 17:06:20 +01:00
Dominic Clifton
f268c9c4f2 Adding the first unit test to verify battery voltage calculations based
on expected ADC readings.
2014-05-05 15:29:23 +01:00
Dominic Clifton
b0cc4df73f STM32F3DISCOVERY - Enable LEDs. Use RED LEDs instead of buzzer output.
LED and BUZZER outputs on the STM32F3DISCOVERY are inverted.
2014-05-05 13:17:12 +01:00
Dominic Clifton
c07f67735e fix comment regarding softserial/timer usage. 2014-05-05 02:05:41 +01:00
Dominic Clifton
c004e48a87 Merge remote-tracking branch 'multiwii/master'
Conflicts:
	src/flight_imu.c
	src/mw.c
2014-05-05 01:48:15 +01:00
Mikael Blomqvist
69f420ca3e When FEATURE_FAILSAFE is not enabled, always read the channels from the
s.bus rx (otherwise rx failsafe will not work)
2014-05-04 22:20:25 +02:00
dongie
ac4835ef67 Merge pull request #101 from luggi/althold-flipable
make flipping the quad safe with althold engaged
2014-05-04 22:50:50 +09:00
luggi
495c6b8f73 make flipping the quad safe with althold engaged
this should stop the copter from accelerating downwards, when upside
down with althold enabled.
2014-05-04 15:46:38 +02:00
Dominic Clifton
6c3a2e1cbb Latest binaries 2014-05-03 22:52:22 +01:00
Dominic Clifton
ee2140d324 Merge remote-tracking branch 'multiwii/master'
Conflicts:
	src/board.h
	src/drivers/adc_common.c
	src/drivers/pwm_common.c
	src/drivers/pwm_common.h
	src/main.c
	src/mw.c
	src/mw.h
	src/sensors.c
	src/utils.h
2014-05-03 22:50:57 +01:00
Dominic Clifton
0a441a9bb6 Merge commit 'fd4bb1eb1c40feb32a4b07223fd398529c6af514'
Conflicts:
	src/rxmsp.c
2014-05-03 21:58:44 +01:00
Dominic Clifton
1750bfbc2b Fixing missed commit #2 2014-05-03 21:50:58 +01:00
Dominic Clifton
a2862a5cfb Fixing missing commit 2014-05-03 21:50:39 +01:00
Dominic Clifton
a10528b103 Merge pull request #99 from treymarc/serialrx_msp
Serialrx msp
Conflicts:
	src/board.h
	src/drv_gpio.h
	src/mw.h
	src/sensors.c
2014-05-03 21:48:30 +01:00
dongie
65ba0fdf30 support 1S battery for voltage monitoring
Conflicts:

	src/sensors.c
2014-05-03 18:36:54 +01:00
dongie
78a335792d add support for GPIO remapping (copied from stm32f_gpio.c)
Conflicts:

	src/drv_gpio.h
2014-05-03 18:23:25 +01:00