1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-15 20:35:33 +03:00
Commit graph

12667 commits

Author SHA1 Message Date
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
3b1801cacd CHEBUZZF3 - Update makefile and sensor initialisation code to support
ChebuzzF3 target.
2014-05-07 22:11:38 +01:00
Dominic Clifton
4bf0e9cfa2 Updating FIXME comments. 2014-05-07 18:56:55 +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
ddd322fb9f Adding test for the downwards thrust direction logic added in
495c6b8f73.
2014-05-05 17:06:20 +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
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
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
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
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
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
DTF UHF
02bb2089c1 Set SBAS mode in GPS for worldwide use instead of exclusively European use 2014-05-03 17:56:03 +01:00
Dominic Clifton
9b672791f4 Cleanup Fake GYRO and Fake ACC support. 2014-05-02 21:31:06 +01:00
Dominic Clifton
8be5e63faa Fix FY90Q build. 2014-05-02 21:30:29 +01:00
Dominic Clifton
019bb450c8 Adding a FIXME regarding failureMode() method signature. 2014-05-02 21:20:01 +01:00
Dominic Clifton
9a3c922efc STM32F30x - de-duplicate common uart code. 2014-05-02 21:19:19 +01:00
Dominic Clifton
89b9a0492f Cleanup OLIMEXINO softserial loopback support. 2014-05-02 21:17:18 +01:00
Dominic Clifton
ef06d438e4 STM32F30x - Use USART2 non-DMA RX. This enables the use of serial-rx. 2014-05-02 19:56:40 +01:00
Dominic Clifton
9b84d47d33 STM32F30x - Enable USART2 (not for serialRx)
Since it uses DMA to receive it means that serialRx is broken because
the RX callback function is only used when DMA is NOT used.

Currently only serialRx uses USART callbacks.

Attempting to disable RX DMA didn't work, the USART2 IRQ handler is
never called.
2014-05-02 18:39:03 +01:00
Dominic Clifton
92bed4a33d STM32F30x - Working parallel PWM. Timer IRQ handle was not defined for
TIM8 correctly. Software serial conficted with parallel PWM input. Fixed
crash due to incorrect timerConfig index calculation code.

The crash occurred when capture compare interrupt handlers attempted to
call an invalid callback.

Note: the crash does not affect existing baseflight code since the
formula is OK when using a 2 dimensional array with equal dimensions.

Formula details here:
https://docs.google.com/spreadsheets/d/1UuxnC0VKiprvt1wt3KXffefEWJUb_-ILFLQuP377Anw
2014-05-02 17:09:41 +01:00
dongie
c1fcdabdc1 rearranged startup / sensor detection for production testing. moved dead gyro endless loop out of the way. 2014-05-02 18:27:23 +09:00
dongie
2d248676f5 slight refactoring of PPM/PWM failsafe to make it actually work and honor failsafeThreshold value. 2014-05-02 16:12:31 +09:00
Dominic Clifton
fbe2f82c05 STM32F30x - Enable serial PWM (PPM) input on PWM1.
This might also fix parallel PWM input too, but untested.
2014-05-01 20:20:24 +01:00
Dominic Clifton
133f75a17b Update PWM driver so that all 10 PWM outputs work. Softserial also now
works as expected.  PWM/PPM input untested.  UART2 probably broken.
2014-05-01 15:09:32 +01:00
dongie
cce4d4975d moved some of init logic around to get sensors + other important hardware checked first; added dummy implementation of production test for future use, outputting debug info over PB6 (USART1_TX remap) 2014-05-01 19:05:13 +09:00
dongie
be5896f5b3 updated ADC driver to use more of available inputs, as well as made input selection more sane 2014-05-01 19:03:58 +09:00
dongie
fd4bb1eb1c adding rxmsp to uvision project 2014-05-01 12:37:20 +09:00
dongie
ef0c28ae0a Merge pull request #99 from treymarc/serialrx_msp
Serialrx msp
2014-05-01 12:33:44 +09:00
dongie
98bd9c5cda support 1S battery for voltage monitoring 2014-05-01 12:24:48 +09:00
treymarc
9d15009ad3 check frameComplete 2014-05-01 05:22:06 +02:00
dongie
25ec04763b add support for GPIO remapping (copied from stm32f_gpio.c) 2014-05-01 12:10:33 +09:00
treymarc
ed46b4e4ac add serial_rx msp 2014-05-01 05:06:36 +02:00
DTF UHF
5393d83e4d Set SBAS mode in GPS for worldwide use instead of exclusively European use 2014-04-29 11:23:49 -04:00
Dominic Clifton
7e79a245c2 Cobbled together some bits of code to read and format the gyro data from
the L3GD29 gyro.  Some code borrowed again from AQ32PlusF3 and the
existing MPU6050 driver.
2014-04-28 22:29:51 +01:00
Dominic Clifton
5c9b16ccde Convert the acc readings so that the 1G value is correct. 2014-04-28 21:40:17 +01:00
Dominic Clifton
4febeb3969 Ported some I2C code from AQ32PlusF3 which itself looked ported from the
STM32 examples.
2014-04-28 19:18:57 +01:00
kh4
cf780bbad6 Enable input filtering on input capture timers. 2014-04-27 22:37:45 +03:00
Dominic Clifton
8d9ce86a5a get GPIO and USART ports working.
The STM32F3DISCOVERY board would crash when setting GPIOA Pin_13 or
Pin_14 to analog mode so they are excluded in the gpio initialisation.

The USART GPIO configuration did not work when using the F10x code.  The
USART status and DMA registers are different too.
2014-04-25 15:19:28 +01:00