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

18729 commits

Author SHA1 Message Date
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
Ivan Efimov
ac384cf34c
Hyperbolic PID multiplier curve (for wings) (#13805)
* TPA_CURVE_HYPERBOLIC (for wings)

* typo fix: tpa_rate_stall_throttle

* ledvinap's review

* fix tpa_curve_expo divider (10 instead of 100)

* Define fixes

* whoops, 16 instead of 1600 for PWL points

* if case for when dividing by zero for hyperbolic expo

* More ledvinap's review

* pow instead of pow_approx + unit tests for hyperbolic TPA

* basic unit tests for classic TPA

* pow was for double. pow_approx for floats is enough

* remove #else from comments

* pow_approx -> powf for hyperbolic TPA

* PWL: brigning back static assert after #13818 PR

* removed extra line per haslinghuis's review
2024-08-29 15:57:03 +10:00
Petr Ledvina
deef912d47
GPS GPS_home refactor (#12870)
* GPS GPS_home refactor

- use `gpsLocation_t` for GPS_home, rename it to GPS_home_llh
- cleanup `GPS_distance_cm_bearing`
- add optiopnal 3D distance calculation in `GPS_distance_cm_bearing`
- rename some bogus defines

* GPS - finish upstream merge

- add const
- adapt src/main/fc/gps_lap_timer

* GPS - use gpsLocation_t in blackbox logging

Height member is ignored now

* GPS - remove unused declarations

---------

Co-authored-by: Petr Ledvina <ledvinap@hp124.ekotip.cz>
2024-08-28 09:20:01 +02:00
Ivan Efimov
9205c4594f
Disable SPA for angle mode - fix (for wings) (#13848)
* Disable SPA for angle mode - fix (for wings)

* moved the logic for axisInAngleMode[axis] inside applySpa

* ledvinap's review
2024-08-27 18:57:00 +02:00
ctzsnooze
f2bd6e69b2
Feedforward improvements for 4.6 (#13576)
* feedforward update for 4.6

improve jitter reduction method
don't interpolate CRSF protocol
replace 'boost' with highpass element for yaw FF
make yaw highpass element CLI adjustable
add yaw feedforward sustain params to CLI and BBE
refactoring and unit test fix

* implement review suggestions, start on the filter struct

* Attempt PT1 filter init method

* fix silly error, scale time constant correctly

improve gain linearisation at shorter time constants

* fix averaging init

* Review suggestions from PL

* Improve filter initialisation

much better :-)

* re-name prevPacketDuplicate to prevPacketWasADuplicate

* Add review comments - thanks Jan and Mark!

* cast gyro.gyroDebugAxis to int

* A better fix than int cast

* implement review comments from PL

also hopefully improved some comments.

* increase PG to 10, expecting the Disarm PR to use 9

* two always win against one ;-)

* remove inappropriate comment, remove space

* update comments and review suggestions from PL
2024-08-25 09:34:27 +02:00
ke deng
9e3fce54d3
Fix incorrect timer channel comments TIM2_CH1 (#13841)
Co-authored-by: kedeng <dengke@speedybee.cn>
2024-08-23 17:45:09 +02:00
J Blackman
5d5697177a
CLEANUP: Removing source wild cards from makefiles (#13834) 2024-08-23 05:59:17 +10:00
Steve Evans
16827f0270
Split OSD element rendering into draw and display states (#13813) 2024-08-23 05:57:33 +10:00
MikeNomatter
a232655b42
Fix d adjustment (#13822)
* fix D adjustments change dmax instead of D

* fix unit test

* add yaw and other adjustment cases

* fix tests
2024-08-21 15:08:01 +02:00