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

14917 commits

Author SHA1 Message Date
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
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
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
ctzsnooze
dd73ce4dd7
Re-name ezDisarm variables and tidying up (#13835)
* just re-naming variables and tidying up

* change name to landing_disarm_threshold
2024-08-21 09:01:49 +02:00
Ivan Efimov
8feb741e17
bbx 3d speed when gps_use_3d_speed==true (#13831) 2024-08-20 10:31:58 +02:00
Ivan Efimov
295d5425ad
Reschedule stats saving on disarm, if quad still moving (#13637)
* Rescedule stats saving on disarm, if quad still moving

* Review suggestions by KarateBrot and Ledvinap

* Moved statsSaveMoveLimit under statsConfig_t
2024-08-20 14:44:40 +10:00
luckk
6dcc268918
Add apm32f405/f407 support (#13796)
* Add APM32F4 driver libraries and USB middleware

* Add the APM32F405 and APM32F407 target files

* Add APM32 startup files

* Add APM32F4 linker files

* Add APM32F4.mk

* Add APM32 driver files

* Add APM32F40X MCU type

* Sync with the Betaflight master branch and modify the driver directory structure

* Implement CLI on the APM32

* Implement ADC on the APM32

* Implement  config streamer on the APM32

* Implement I2C on the APM32

* Implement SPI on the APM32

* Implement DSHOT on the APM32

* Implement transponder ir on the APM32

* Implement serial uart on the APM32

* Implement MCO on the APM32

* Implement DWT on the APM32

* Update the init.c file, adding APM32 MCO configuration

* Remove all duplicated APM32 driver files and retaining only the APM32 LIB directory

* Create APM32F4.mk

* Add linker files for APM32F405 and APM32F407

* Add startup and library config files for APM32F405 and APM32F407

* Add target files for APM32F405 and APM32F407

* Add apm32 MCU driver files

* Add build configuration for APM32 MCU

* Implement config streamer on APM32

* Implement CLI on the APM32

* Implement ADC on the APM32

* Implement RCC on the APM32

* Implement MCO on the APM32

* Implement I2C on the APM32

* Implement SPI on the APM32

* Implement serial uart on the APM32

* Implement IO on the APM32

* Implement DMA on the APM32

* Implement DSHOT on the APM32

* Implement transponder ir on the APM32

* Update init.c

* Add the inclusion of the 'platform.h' file to the APM USB driver source file

* Merge bus SPI duplicate code from APM32 to STM32

* Update timer_apm32.c

* Merge motor duplicate code from APM32 to STM32

* Merge serial uart duplicate code from APM32 to STM32

* Update APM32F4.mk

* Update cli.c

* Update APM32F4.mk

* Remove the apm32_flash_f4_split.ld

* Associate the apm32 linker file with stm32_flash_f4_split.ld
2024-08-19 08:34:31 +10:00
Mark Haslinghuis
27ec01ddda
Add MCU ID to blackbox (#13825)
* Add MCU ID to blackbox

* Update firmware type
2024-08-19 08:27:17 +10:00
Alexander
fcecabf01e
Fix searching a resource (#13826)
If you add a new resource whose name starts with an existing resource name it won't be found. For example if you add `PWM_EX` resource after `PWM` you won't be able to store a pin into it. So when you execute `resource PWM_EX 1 A01` it will be stored into `PWM`.
2024-08-17 20:25:39 +02:00
ainosukii
91439e0ac2
Modify STM32F405 UID Address for MSC Enumeration (#13769)
Update usbd_msc_desc.c
2024-08-16 07:15:26 +10:00
Mark Haslinghuis
04fe4b4461
Fix telemetry for Spektrum/SRXL (#13814)
* Fix telemetry for Spektrum/SRXL

* Update after ledvinap review

* Update comments
2024-08-14 17:31:25 +02:00
ctzsnooze
f890287598
Auto-disarm on landing impact (#13803)
* Disarm on landing

* Changes from review comments, thanks PL

* Sorry missed that one

* calculate Acc magnitude once only, not multiple times

* Include gyro factors as in crashRecovery

* Fix bug in CrashRecovery delta gains

Add temporary debugs to monitor error and delta inputs

* remove 1G subtraction for accMagnitude

thanks Karate

* Use AccDelta or Jerk - thanks Karate

* Revert using Gyro Setpoint and Delta

* Fix typo, thanks Mark

* increment PG version to 9
2024-08-10 08:34:51 +02:00
Ivan Efimov
8f10f17245
Piecewise linear interpolation routine (#13798)
* piecewise linear interpolation routines

* haslinghuis review

* triling spaces removed

* KarateBrot review

* ledvinap's review

* minor style fixes
2024-08-07 18:21:02 +02:00
Steve Evans
9520b5b40f
Add DEBUG_TASK mode (#13799)
* Add DEBUG_TASK mode

* Add difference between expected and actual execution time

* Increment config version

* Fix unit test
2024-08-05 15:54:13 +02:00
Steve Evans
665a42e295
Add OSD display of 2nd block of debug values (#13800)
Add OSD display of 2nd blocks of debug values
2024-08-05 15:48:41 +02:00
Steve Evans
2525be9a33
Fix flash_scan (#13789) 2024-07-31 12:03:20 +02:00