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

18887 commits

Author SHA1 Message Date
ke deng
d5f899156d
Fixes #13930: fix timer based bidirectional dshot command not working issue (#13978)
* fix timer based bidirectional dshot command not working issue

* smaller scope of isBitbangActive
2024-10-22 16:13:06 +02:00
Mark Haslinghuis
69f75b55f6
Add CRSF baro altitude sensor (#13840)
* Add CRSF baro altitude sensor

* Thanks Ledvinap

* Fix parenthesis

* Review bkleiner

* Review karate

* Rename getVerticalSpeedPacked
2024-10-20 03:06:16 +02:00
Mark Haslinghuis
2c4d76c920
Update build options (#13974) 2024-10-20 11:04:25 +11:00
ctzsnooze
fc52b6b4ff
Use wasThrottleRaised in place of isAirmodeActivated where appropriate (#13968)
* use wasThrottleRaised in place of isAirmodeActivated where airmode isn't really needed

* fix unit test

* fix typo

* remove unnecessary check

* final changes and clarificartions

* Update src/main/flight/mixer.c

Co-authored-by: Ivan Efimov <gendalf44@yandex.ru>

---------

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
Co-authored-by: Ivan Efimov <gendalf44@yandex.ru>
2024-10-17 10:46:54 +02:00
ctzsnooze
58fc8bbbb8
Shared altitude control function in position_control.c (#13954)
* Altitude control code shared

fewer debugs
subtract D

* remove #include comments, simplify coding, restructuring

thanks JP and MH

* fix cms limits for throttle control

* Use altitude_control debug, fix throttle calculation

minor refactoring

* use AUTO_CONTROL_ALTITUDE debug in place of GPS Rescue throttle pid

* use autopilot for position control names

* fixes from reviews - thanks

* Re-organise included files and functions thanks Karate

* missed init and other typos

* remove old unused unit test file, tidy up thanks Mark

* fix indentation on one line
2024-10-16 23:17:44 +02:00
Ivan Efimov
1d9823b4cd
TPA air speed speed estimation instead of TPA delay (for wings) (#13895)
* tpa speed speed estimation (for wings)

* Some renaming based on Karatebrot review

* Fix with currentPidProfile

* Ledvinap's review

* minor fixes

* Karatebrot and ledvinap review

* Review by haslinghuis
2024-10-15 23:11:00 +02:00
J Blackman
b21cfe3282
Code re-organisation: src/platform/xxx for the MCU type (#13955) 2024-10-13 03:07:17 +11:00
Kevin Plaizier
7158ff7081
Fix pt2 and pt3 filter initialization in gyro_init.c (#13960)
fix pt1 and pt3 filter initialization
2024-10-08 23:34:25 +02:00
Mark Haslinghuis
7fb6ed39be
Move USE_SOFTSERIAL to build options (#13305) 2024-10-09 06:49:03 +11:00
Kevin Plaizier
ea30a11d1a
Make the imuGyroFilter actually filter (#13961) 2024-10-09 06:44:39 +11:00
Mark Haslinghuis
07bf547d42
Add STM32F4DISCOVERY to CI (#13963) 2024-10-09 06:42:47 +11:00
ctzsnooze
5ffeea6ab1
refactor motor idle, rename dshot_idle_value to motor_idle (#13936)
* use idleOffset, simplify idle : check PWM idle

* remove get for dshot idle and calculate it once only

* fixes from reviews, thanks

* use motor_idle for CLI name

* use motorConfig->motorIdle not idleOffset

* rename dshotmotorIdle variable to motorIdlePercent

* small comment improvement
2024-10-08 18:31:08 +02:00
ke deng
10d5963d24
Fixes #13934: Fix motor(PWM protocol) spin while fc reset. (#13937)
* Fix motor(PWM protocol) spin while fc reset.

* move delay out to motorShutdown
2024-10-07 17:51:37 +02:00
Henry Warhurst
909ab19a1b
Log servos in blackbox (#13944)
* Log servos in blackbox

* Add hasServos helper
2024-10-06 22:48:17 +02:00
ctzsnooze
16c157e840
Shared altitude control parameters (#13884) 2024-10-05 16:32:50 +10:00
ctzsnooze
7156dc84a3
Update turtle / crashflip mode (#13905)
* stop motors after 90 degrees of rotation and with max rate

* handle no accelerometer data

* improve check for acc, although seems to be OK without it

* disable all attenuation if rate is set to zero

* refactoring thanks Karate

* use sensors.h

* remove unnecessary arming check

* exit crashFlip immediately switch is reverted if throttle is zero

* add Crashflip Rate to OSD

* Revert unnecessary changes in crashflip core.c code

and clarify comments about crashflip switch

* update / minimise comments, thanks Karate

* ensure all names say `crashflip` consistently

* Undo quick re-arm because motrors were not reversed

* fix issue with reversed motors, we must disarm

* ignore yaw rotation and set gyro limit to 1900 deg/s

* default attenuation to off (crashflip_rate = 0)

* refactoring, increase rate limit to allow stronger inhibition

* enable in race_pro mode

* don't attenuate on attitude until a significant change occurs

* no attenuation for small changes

* Updates from review by PL

* remove whitespace

* refactor motorOutput, update comments, renaming variables

thanks PL

* changes from review PL

* only permit fast re-arm if crashflip rate set and crashflip was successful

* properly exit turtle mode

* add crashFlipSuccessful to unit test extern c

* small updates from review

* improved crashflip switch handling

* remove unnecessary motors normal check
2024-10-05 07:58:33 +10:00
Mark Haslinghuis
95d55525ad
Make telemetry default for jeti (#13951) 2024-10-04 00:25:53 +02:00
J Blackman
c2900de5c1
Adding CLI command pass through for MSP (#13940) 2024-10-03 23:59:47 +10:00
Mark Haslinghuis
23e682c310
Fix build when using SRXL telemetry (#13947) 2024-10-03 16:27:34 +10:00
ctzsnooze
776e8c7b3c
Refactor Rx code and better support 25Hz links (#13435)
* RX task update rate to 22Hz, to improve 25Hz link stability

* modified Rx code

* add LQ to debug

* use max of frameAge or FrameDelta

* Require a dropouit of 200ms, not 100ms, before RXLOSS

* remove FrameAge, use 150ms timeout 50ms checks

* fix tests and tidy up the comments

* Handle NULL input as before, log frame time

* possible solutions to review comment about names

* Remove rxFrameTimeUs

- prepare for direct use of lastRcFrameTimeUs
- refactor rx_spi callback

* remove global currentRxRateHz

* simplify updateRcRefreshRate

* re-name to recheck interval, return frame time debug

* Calculate RxRate only once

* use rxReceivingSignal for consistency

* use signalReceived not rxDataReceived for consistency

* suggestions from review PL

* move defines, thanks K

* fixes from review, thanks MH

* review changes, undo task interval change

rename bool rxIsReceivingSignal to isRxReceivingSignal
thanks Steve for resolving that tasks changes are not needed
thanks PL for your feedback also

---------

Co-authored-by: Petr Ledvina <ledvinap@hp124.ekotip.cz>
2024-10-01 09:23:24 +10:00
Ivan Efimov
a37bd7c974
Always USE_TPA_MODE (#13942)
Always use TPA_MODES
2024-09-30 16:30:52 +02:00
Ivan Efimov
dfea2c8cbf
Some defines removed from USE_WING build that is not useful for planes (#13941) 2024-09-30 16:15:24 +02:00
Mark Haslinghuis
713ba21407
Fix custom box names (#13935)
* Fix custom box names

* Review ledvinap
2024-09-30 16:11:06 +02:00
Vladimir Demidov
a7672a0a1e
GPS Home altitude is added to blackbox logging (#13939)
added logging of gps homes altitude
2024-09-29 00:11:40 +02:00
ctzsnooze
4ed21bdd06
Fix DMax calculations (#13933)
Refactor DMax calculations
2024-09-29 00:00:11 +02:00
Ivan Efimov
983b510184
Fix: Hyperbolic TPA curve initialization (for wings) (#13932) 2024-09-27 20:24:34 +02:00
J Blackman
331801c7a2
Minor CLI update to give a noreboot option so save and exit (#13904)
* Give a -n option to exit CLI

- means you can set any serial port to MSP, and then activate CLI on it using #, with an "exit -n" to return to MSP mode without a reboot required.
- https://webserial.io is a great utility for using CLI outside the configurator.
- future changes will include possible multiple CLIs being active at the same time, along with debug printf from anywhere in the code to an active debug cli.

* Altered to strcasecmp, and changed param required to noreboot

* Adding additional details to the commands
2024-09-26 14:30:57 +02:00
ctzsnooze
6b5b5cfbdb
Use static idle value to set the initial dynamic idle limit before takeoff (#13906)
use static idle value in dynamic idle
2024-09-24 16:41:46 +02:00
MikeNomatter
908f9cc32d
Remove d min confusion (#13908)
* rename dMin, remove D_MIN_GAIN_MAX

* rename vars

* fix logic

* fix logic

* Revert "fix tests"

This reverts commit c518c9c444.

* Revert "add yaw and other adjustment cases"

This reverts commit 2cacd4b360.

* Revert "fix unit test"

This reverts commit 3d88f4158a.

* Revert "fix D adjustments change dmax instead of D"

This reverts commit 7ee4e7f8af.

* Revert "Fix telemetry for Spektrum/SRXL (#13814)"

This reverts commit 04fe4b4461.

* review adjustments and test fixes

* Reapply "Fix telemetry for Spektrum/SRXL (#13814)"

This reverts commit eb7f8ee0fd.

* fix logic

* Apply suggestions from code review

Co-authored-by: Jan Post <Rm2k-Freak@web.de>
Co-authored-by: Mark Haslinghuis <mark@numloq.nl>

* fix d_max slider

---------

Co-authored-by: Jan Post <Rm2k-Freak@web.de>
Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
2024-09-24 11:28:25 +02:00
Steve Evans
c0c24d7f52
Don't consider a prior I2C NACK to indicate the bus to be busy (#13917) 2024-09-22 14:35:53 +02:00
Kiss Ultra
a6d70be96a
Fixes #13220: Fix kiss esc passthrough, Fix castle (escprog cc) command. (#13911)
* Fix kiss esc passthrough, Fix castle (escprog cc) command.

* Update src/main/drivers/serial_escserial.c

Thank you.

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>

---------

Co-authored-by: Alex Fedorov <fedor@anuta.org>
Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
2024-09-21 02:32:46 +02:00
ot0tot
e8f091a6f5
Update timer_at32f43x.c (#13909)
* Update timer_at32f43x.c

Adds missing timer defines from https://www.arterychip.com/download/RM/RM_AT32F435_437_EN_V2.06.pdf

* Update timer_def.h

* Update timer_def.h

* Fix alignment
2024-09-19 23:23:45 +02:00
Mark Haslinghuis
698b8616f9
CRSF Flight Mode Sensor Value update (#13854)
* CRSF Flight Mode Sensor Value update

* Fix FS FM

* Add ? for GPS not available

* Need to check define

* better name

* Update mode and test unit

* Fixes review CT

* Fixes review JimB40

* Apply ctz comment

* Update isAllowArmingWithoutFix

* Fix fs/resc sw

* Add required sats

* Update comments
2024-09-16 17:38:31 +02:00
Vladimir Demidov
654d18ced4
Fix: the wrong ability to turn on HORIZON_MODE without ACC sensors (#13892)
added check of acc sensor enabled condition by turn on horizon mode
2024-09-16 11:36:57 +02:00
Jan Post
f71170db1b
Vector library expansion (#12968) 2024-09-16 07:03:32 +10:00
Vladimir Demidov
fc4b7a0008
Added 'Storage mode' action in Blackbox part of OSD menu (#13899)
* added turn on 'storage device mode' action in OSD Blackbox menu

* Code style improvement

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>

* Code style improvement

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>

* text messages are edited in the usb mass storage osd menu

* The NO menu action is default by selecting ERASE or USB MASS STORAGE items in OSD menu

* improved cmsx_StorageDevice function code

* added check of define USE_USB_MSC for storage mass mode code

* USB mass storage OSD menu text messages placement improvement

* added return NULL after systemResetToMsc

* Code improvement

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>

* Code style improvement src/main/cms/cms_menu_blackbox.c

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>

---------

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
2024-09-14 23:04:36 +02:00
Steve Evans
73b26168cd
OSD background rendering (#13897)
* Ensure display severity attribute is set to defaults for background items

* MAX7456 doesn't have a background layer
2024-09-13 22:20:18 +02:00
Mark Haslinghuis
c88f7c9016
Fix MSP output buffer overflow (#13879)
* Fix MSP output buffer overflow

* Add comment
2024-09-10 19:53:42 +02:00
Petr Ledvina
aa92203215
rc-modes bugfix - prevent buffer overflow when serializing box names (#13880) 2024-09-10 18:15:52 +02:00
Mark Haslinghuis
1382c30601
Fix FEATURE_RX_PPM (#13891) 2024-09-10 10:01:53 +02:00
Petr Ledvina
dab60e3093
MSP - fix buffers in MSP_MULTIPLE_MSP (#13881)
Fix case when MSP command fills all available space
2024-09-07 18:49:09 +02:00
cvetaevvitaliy
bb353e76bb
pinio: add set custom string for PINIO box name (#13883)
* pinio: add set custom string

* Update src/main/msp/msp_box.c

Co-authored-by: Petr Ledvina <ledvinap@gmail.com>

* Update src/main/msp/msp_box.c

* Update src/main/target/common_defaults_post.h

---------

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
Co-authored-by: Petr Ledvina <ledvinap@gmail.com>
2024-09-06 20:55:24 +02:00
Petr Ledvina
952ccb68c4
cli - fix gpspassthrouh when GPS port is not open (#13878)
- return status from gpsPassthrough
- test gpsPort
2024-09-06 09:46:51 +02:00
Mark Haslinghuis
f0e1deb932
Refactor debugType (#13866) 2024-09-04 15:17:45 +02:00
ctzsnooze
254da8f460
Altitude hold for 4.6 (#13816) 2024-09-04 20:29:03 +10:00
Mark Haslinghuis
350510603c
Fix sbufReadData (#13869) 2024-09-04 11:29:11 +10:00
ctzsnooze
3fe4281a63
Apply iterm_windup per-axis by limiting iTerm based on pidSum (#13543) 2024-09-04 11:26:40 +10:00
Petr Ledvina
3e130de49c
Makefile - remove -j0 (#13838)
Makefile - don't override user-supplied --jobs argument

Some targets will default to parallel build, but only when no
-j / --jobs argument is specified on make command line
2024-08-30 16:12:17 +02:00
Ivan Efimov
dc741d4d83
if USE_WING is defined then define also ADVANCED_TPA and SERVOS (#13860) 2024-08-30 15:14:42 +02:00
ctzsnooze
cfe41ac022
Fix angle mode rate profile change bug (#13862)
fix angle mode rate profile change bug
2024-08-30 15:10:01 +02:00