1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 21:05:35 +03:00
Commit graph

109 commits

Author SHA1 Message Date
Dominic Clifton
9fa99cf9f5 Re-organize files by topic
Keil project not updated, I have no way to verify it.

Note, mw.c, drv_pwm.c and drv_system.c contain code for too many topics.
Later commits will relocate the code as appropriate.

Not even looked at utils yet.  'Utils' is a bad naming practice and is a
synonym for 'too lazy to find the right file/name'.
2014-04-08 16:11:17 +01:00
Dominic Clifton
c012e7480f Merge remote-tracking branch 'multiwii/master' into hott-telemetry 2014-04-07 23:08:03 +01:00
Johannes Kasberger
74a54d81dd Added options to allow further TPA configuration
Replaced define BREAKPOINT with cfg option
Added tpa and tpa_breakpoint to cli
2014-04-07 22:52:32 +02:00
Dominic Clifton
3007d3cbdc Improving code readability by aligning comments with code and removing
comments that duplicated code.  Comments are harder to refactor than
code and become stale.  Updating default and limit values for some
settings to use enum values.
2014-04-07 01:05:33 +01:00
Dominic Clifton
3ca868a59f Enable HoTT as a telemetry provider.
Import cGiensen's HoTT telemetry implementation - untested.
2014-04-06 23:51:48 +01:00
Dominic Clifton
d73094396d Allow user to use telemetry on softserial port 2. Should have been in
previous commit.
2014-04-06 22:33:18 +01:00
Dominic Clifton
6f0a419bf6 Cleanup telemetry code. Remove duplicate logic. Improve readability.
Add support for another provider.  Change default softserial baud rate
to match the speed used by FrSky telemetry.
2014-04-06 22:25:22 +01:00
dongie
f336fc8d20 allow configurable bootloader reboot character to workaround retarded BT adapters that spam 'R' 2014-04-06 13:42:10 +09:00
Kemal Hadimli
2ca082f09c GPS: clean up NMEA autodetect baud. -1 no longer used, it will cycle through available baud rates if no data is received anyway 2014-04-06 00:38:37 +03:00
Dominic Clifton
c7de7d2ebc Add support for 2 softserial ports on PWM4+5/TIM3_CH1+2/PA6+PA7 and
PWM6+7/TIM3_CH3+4/PB0+PB1

Update software serial to monitor serial pins for signal changes instead
of periodically sampling pin signals.

When reading the data the timer used is syncronized to the falling edge
of the start bit which allows for better syncronisation at higher
speeds.  The code has been tested OK from 1200 baud to 19200.  38400
baud was tested and partially usable but has been disabled because there
are too many transmit and receive errors, especially when transmitting
and receiving at the same time.

Due to the way a single timer is used for transmitting and receiving, if
data comes in while transmitting the system may incorrectly transmit a
short or long bit.  However at 19200 and below this didn't cause a
problem in the limited testing I performed.
2014-04-03 22:42:15 +01:00
Dominic Clifton
c36d884899 Change softserial timer calculation code to support baud rates in the
range 600 to 19200 (tested)
2014-04-03 13:00:12 +01:00
dongie
30afff2578 got rid of feature_gyro_smoothing. nobody used that, and its retarded to do anyway. 2014-02-18 15:27:53 +09:00
dongie
202fc17608 added max_angle_inclination to CLI to configure (default) 50 degree max inclination. configurable between 10 and 90 (100..900 in cli) 2014-02-18 15:23:02 +09:00
kh4
ceb1f78526 Fix line endings to CRLF 2014-02-07 13:40:27 +02:00
dongie
0c46bdbfc8 added cli settings for pidvel
added (unsupported) GPS nav MSP numbers.
2014-02-04 08:21:40 +09:00
dongie
e8b3d00003 implement (not flight tested) brushed motors support.
set motor_pwm_rate to some value > 500 (1000, 8000, 16000 etc works on my scope).
then the motor output can be used to directly drive brushed motor fets.
PWM is rescaled to 0-base in brushed mode, so all same values of min/maxthrottle apply.
2014-01-31 11:56:55 +09:00
dongie
a695ddd66a added sumd serial receiver support by cesco/Plüschi 2014-01-31 10:02:50 +09:00
KipK
7bd2db04be Added a mcfg.telemetry_switch for CLI
If telemetry_switch=1 it change baudrate and protocol using aux channel, either it switch  when armed/disarmed.

This allows to keep MSP serial while armed for BT dongle if needed.
2014-01-16 19:36:54 +01:00
dongie
9a7ff04422 adding untested (and needing work) fixedwing althold implementation.
see comments in code for things to fix. added new variable to cli, fixedwing_althold_dir (though its value isn't really clear, I think it should always be positive since servo direction mix is done later).
2014-01-06 21:38:36 +09:00
dongie
7a4cdec0e5 limit thr_expo to 100 for previous commit 2013-11-09 08:29:29 +09:00
dongie
b2f163d2ac whitespace fixes in previous commit 2013-11-07 22:12:28 +09:00
dongie
b7db6a04d1 Merge pull request #14 from schugabe/typepunnedwarning
fixed gcc compiler warning in cliset
2013-11-07 05:07:19 -08:00
fiendie
6ab48fc438 Revert new PID stuff and move it to a separate branch for now. 2013-11-07 13:15:31 +01:00
Johannes Kasberger
733f1ef51b fixed compiler warning in cliset
Warning was warning: dereferencing type-punned pointer will break strict-aliasing rules
2013-11-07 11:38:12 +01:00
Lukas S
b996b26cbb new Baseflight PID
full gyro scale is used now
and a new pid with float calculations was added based on PIDrewrite
eeprom size was also increased from 1kB to 2kB
2013-11-03 03:48:45 +01:00
dongie
bff260c7c6 logic and whitespace fixes in gps passthrough 2013-11-02 22:51:56 +09:00
dongie
ab6df2e317 Merge pull request #8 from disq/gps_passthrough
GPS passthrough cli command
2013-11-02 06:45:16 -07:00
dongie
29a9507c15 adding untested (and probably non-working) airplane mixer from mwc 2.3
flaperons not implemented (too hacky)
flaps should work
2013-11-02 16:22:30 +09:00
dongie
bd8b1a1c8f cleaned up cliMotor(), added MSP_SET_MOTORS and enabled CAP_DYNBALANCE so the motors can be controlled from GUI 2013-11-02 15:09:46 +09:00
dongie
d7b99e7938 Merge branch 'upstream' of https://github.com/davibe/baseflight into davibe-upstream 2013-11-02 14:40:50 +09:00
dongie
1990c6a67e add new gps type 2013-11-02 11:14:25 +09:00
Kemal Hadimli
c4dd556f3d gps passthrough cli command 2013-11-02 02:16:40 +02:00
dongie
7eec3aec9e add untested mixers - HEX6H, dual/single copter, to match mixer IDs with MultiWiiConf 2013-11-02 08:17:31 +09:00
Davide Bertola
786d727705 Add cli 'motor' command
It allows to get and set single motor output
value.
2013-11-01 11:28:29 +01:00
timecop@gmail.com
779dfe8a92 separate all telemetry code and add option to use softserial for telemetry.
to use, set softserial_baudrate=9600, softserial_inverted=1 and  telemetry_softserial=1
then enable feature TELEMETRY.
by disq


git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@448 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-10-23 09:47:38 +00:00
timecop@gmail.com
47a4d30358 fixed cli status command (thx alexk)
moved mpuscale into core struct since it's not a changeable setting

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@447 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-10-21 00:22:33 +00:00
timecop@gmail.com
8d7f82dc75 added ability to specify arbitrary roll/pitch/yaw translation for board mounting by alu.
this allows to mount FC vertically/upside down/etc easily.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@445 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-10-19 09:56:29 +00:00
timecop@gmail.com
ca7d7e32f6 removed some double promotions that sneaked in, as well as replaced fabs() with float-only fabsf() version. trashed doubles from _atof(). Considering trashing that whole function for KEIL builds.
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@439 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-10-13 16:19:46 +00:00
timecop@gmail.com
30ded7ff04 Beginning of the great GPS unfucking.
* Proper initialization sequence framework for various supported GPS types. NMEA will now auto-detect its baud rate based on received frames.
* As a result of the above, gps_baudrate has been changed to enum, to only allow fixed rates. (GPS baudrate, -1: autodetect (NMEA only), 0: 115200, 1: 57600, 2: 38400, 3: 19200, 4: 9600)
* UBX binary initialization at any specified baudrate with auto-reconnect on signal loss.
* GPS thread to handle initialization, signal loss and configuration. No longer does GPS need to be powered before FC, and on GPS reconnect, it will be re-initialized if needed.
MTK NMEA/binary initialization is omitted for now, as I can't find my MTK GPS
GPS deltaTime can be calculated to display update rate.


git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@438 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-10-13 15:25:45 +00:00
timecop@gmail.com
c682f1f21e Softserial can now be enabled/disabled via the SOFTSERIAL feature switch in the command line. Softserial baud rate can be set via softserial_baudrate setting. Added input & output inversion support, use softserial_inverted setting by Dominic Clifton
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@435 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-10-12 07:46:55 +00:00
timecop@gmail.com
9ebd82c5ef merged in mwii2.3 generic servo handler. completely untested.
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@434 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-10-12 07:03:01 +00:00
timecop@gmail.com
28d5927836 Totally rework software serial to provide tx at the same time as rx using only one timer.
First cut at polymorphic serial port implementation.  Split serialPort_t into uartPort_t and serialPort_t.  Calls to uartWrite() can now be replaced with calls to serialWrite().

Replacing calls to serialWriteByte(softSerial_t*, char) with calls to serialWrite(serialPort_t*, char).  This completes the proof of concept for polymorphic serial port implementations (uartPort and softSerialPort).

Renaming isSerialAvailable to uartTotalBytesWaiting.  Renaming serialAvailable to softSerialTotalBytesWaiting.  Adding serialTotalBytesWaiting to serial API and updating calls to the former methods to use the serial API.

Renaming serialRead to softSerialRead.  Adding serialRead to serial API and updating calls to uartRead and softSerialRead to use the serial API.  Renamed uartPrint to serialPrint which now works on any serialPort implementation.

Replacing calls to isUartTransmitEmpty with isSoftSerialTransmitBufferEmpty.  Replacing remaing calls to uartWrite with serialWrite.  Adding isSoftSerialTransmitBufferEmpty to the serial API.  Adding serialSet/GetBaudRate to the serial API.  Since softSerial does not implement serialSetBaudRate some GPS serial initialisation code has been updated.

At this point it is probably possible to switch around all the ports and use a software serial implementation if desired.

By Dominic Clifton / https://github.com/hydra/baseflight/

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@423 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-10-01 00:07:44 +00:00
timecop@gmail.com
2272e1a5a6 reorganization of uart-based receiver drivers
FEATURE_SPEKTRUM has been removed and replaced with FEATURE_SERIALRX.
cli  option serialrx_type now configures what type of receiver it is
0 = spektrum1024, 1 = spektrum2048, 2 = sbus
sbus will need hardware inverter to use.
also cleaned up receiver drivers to assign readrawRC callback instead of assigning in code in main()
none of this has been tested.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@418 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-09-29 14:40:20 +00:00
timecop@gmail.com
01eaf85510 added ability to assign one of aux1..4 channels as RSSI by the-kenny
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@416 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-09-29 13:58:25 +00:00
timecop@gmail.com
6763d8810b added test BMA280 driver
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@414 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-09-29 12:53:02 +00:00
timecop@gmail.com
71772f137b part 3 of the great sensor axis unfucking. careful flight testing may commence.
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@400 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-09-15 01:56:23 +00:00
timecop@gmail.com
1cc306493b beginnings of the great sensor orientation unfucking. WORK IN PROGRESS DO NOT FLY.
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@397 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-09-14 12:27:26 +00:00
dominicc1974@gmail.com
4c191270bf Changing all line endings to WINDOWS line endings (CR+LF) and removing all End-Of-Line whitespace and using spaces instead of tabs. Please ensure you configure your editors and tools to follow suit. If using git please enable autocrlf in your .git/config file.
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@393 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-09-06 23:14:48 +00:00
timecop@gmail.com
929bbc8c3f added (untested) flag to disable tricopter servo updates when unarmed.
tri_unarmed_servo to 1 (default) always updates tri servo whether armed or not.
tri_unarmed_servo to 0 will only send servo signal to tail servo when armed.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@392 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-09-06 00:03:32 +00:00
timecop@gmail.com
509e349e69 Whitespace/compiler warnings cleanups by Dominic Clifton;
Slight tweak of new althold defaults
NOT-flight-tested .hex committing so people can commence with althold testing.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@391 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-08-31 01:40:13 +00:00