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

18543 commits

Author SHA1 Message Date
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
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
J Blackman
fec8542720
FIX: make: Circular configs <- configs dependency dropped. #13695 (#13815)
- reintroduced by #13660 (possible back re-base?)
2024-08-14 10:23:41 +02:00
Petr Ledvina
a2289bc6d8
build - remove -Wpedantic (#13818) 2024-08-14 06:37:59 +10: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
Steve Evans
6e0855c296
Allow change of debug flags without forcing complete rebuild (#13708) 2024-07-29 07:29:45 +09:00
Brian White
1fb73b36f4
Increase Number of Available Dynamic Notches to 7 (#13750) 2024-07-29 05:10:36 +09:00
Steve Evans
5e40ec857d
Fix unused variable compile time error (#13707) 2024-07-28 10:15:56 +09:00
Steve Evans
7ee2c99cd4
Add all_configs make target to build all FC configs (#13660)
* Add configs_all make target to build all FC configs

* Update Makefile

Change from `configs_all` to `all_configs`.

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

---------

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
2024-07-27 17:54:58 +02:00
Ivan Efimov
e43b33a02a
TPA gravity factor (for wings) (#13778)
* Wing TPA gravity factor

* Small corrections according to ledvinap's review (not all yet)

* Some review changes for tpa_gravity

* using throttle after LPF to scale between thr0 and thr100

* tpa gravity further review and fixes

* tpa gravity: removed logging of pitch angle, since it's just pitch

* moved tpa_gravity to the end in pid.h

* KarateBrot review
2024-07-27 09:50:32 +02:00
Steve Evans
bafcebcb8e
Read gyro data from correct lsm6dsv16x registers (#13784) 2024-07-26 22:13:15 +02:00
Mark Haslinghuis
0819a56d55
Add SPI ELRS Model Match ID (#13774) 2024-07-26 08:05:29 +02:00
Ivan Efimov
9730f9ee16
rename fix: smoothStepUpTransition (#13768)
smoothStepUpTransition rename fix
2024-07-15 16:55:47 +02:00
Benedikt Kleiner
ee9172f4da
fix at32 serial bidir pp od init and smart audio (#13764)
include fix for F4 and G4 as well

Co-authored-by: Eike Ahmels <ea@weslink.de>
2024-07-15 11:57:09 +02:00
Bryan Mayland
1bcde73c3c
Add FLRC F-modes to ELRS SPI implementation (#12936)
* Add FLRC F-modes to ELRS implementation

* Code quality changes per review

* Remove unused variable
2024-07-10 16:45:17 +02:00
Benedikt Kleiner
75f94d8c5c
at32: add PC6 and PC7 as i2c pins (#13760) 2024-07-10 10:48:54 +10:00
Brian White
cf6d1c1eb6
Put gyro debug axis in header (#13752)
* Put gyro debug axis in header

* Update blackbox.c 

added #include "sensors/gyro_init.h"
then changed line 1539 as per  @Haslinghuis suggestion
2024-07-07 12:01:12 +02:00
nerdCopter
ab80e94b12
[github workflow] auto-close PR's with branch named 'master' (#13745) 2024-07-07 11:01:47 +10:00
Morro
14bcc13150
Initiate APM32F40X MCU Support in Betaflight (#13709)
* Add APM32F4 driver libraries and USB middleware
* Remove all duplicated APM32 driver files and retaining only the APM32 LIB directory
2024-06-28 15:03:34 +10:00
Hochmueller
2ff71b0a1f
Fixes #13664 - Smartaudio don't work with Softserial (#13715)
Fixing issue #13664
Softserial port option has changed from 4.4.x to 4.5.0. By this the Smartaudio line is in an unknown voltage state while not TX is running - this violates the Smartaudio standard. vtx_softserial_alt should be set to OFF to use Smartaudio.
2024-06-27 17:53:13 +02:00
Steve Evans
a1e5292946
Update to LSM6DSV16X gyro driver (#13724)
* Enable LPF1_G_EN

* Gyro intialisation review input from STMicro

* Update src/main/drivers/accgyro/accgyro_spi_lsm6dsv16x.c

Error in code from STMicro

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

---------

Co-authored-by: Petr Ledvina <ledvinap@gmail.com>
2024-06-27 14:15:35 +02:00
Mark Haslinghuis
0686b74197
Add altitude variant for OSD (#13716) 2024-06-27 06:19:06 +10:00
Ivan Efimov
2ceb8e0417
Setpoint PID attenuation (for wings) (#13719)
* Setpoint PID attenuation

* Suggestions from ledvinap's review
2024-06-25 23:38:43 +02:00
J Blackman
8eec0fe8d5
FIX: Release build asset name change (#13722) 2024-06-26 07:32:30 +10:00
J Blackman
5762688f6d
CLEANUP: Move flash drivers to their own directory (#13691)
* CLEANUP: Move flash drivers to their own directory

* Missed flash_w25q128fv.h.

* Directories in #include, and specifying all source files explicitly.

* Revert RX driver src file implicit declaration
2024-06-25 16:24:40 +02:00
Mark Haslinghuis
352350f8d0
Fix redundant debug (#13711) 2024-06-25 07:30:34 +10:00