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

18491 commits

Author SHA1 Message Date
J Blackman
ffdf918b07
Node 16 based github actions no longer supported (#13705) 2024-06-22 09:16:05 +10:00
Steve Evans
cff4c9cde3
Set next state expected time on per element basis (#13706)
* Set next state expected time on per element basis

* Rename osdNextElement to be clearer
2024-06-21 13:15:34 +02:00
J Blackman
a84042199d
CLEANUP: small adjustment to the legacy gyro directory (#13693)
* CLEANUP: small adjustment to the legacy gyro directory

* Legacy source explicit declaration.
2024-06-20 19:58:25 +02:00
J Blackman
5fd8c02908
Move launch control default to pitchonly (#13699)
Move launch control default to pitchonly.
2024-06-20 19:54:35 +02:00
Ivan Efimov
f140fec847
Allow TPA_LOW to be negative (for wings) (#13661)
* Allow TPA_LOW to be negative (for wings)

* Fix minimax type

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

* Range -128 to 127

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

* Proper limits for TPA

Co-authored-by: Jan Post <Rm2k-Freak@web.de>

* separate minmaxes for wing/without wing for TPA_LOW

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

* Separate define for TPA_LOW_RATE_MIN

---------

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
Co-authored-by: Jan Post <Rm2k-Freak@web.de>
2024-06-20 12:06:30 +02:00
Ivan Efimov
e2e1a68ba0
S-term (for wings) (#13679)
* S-term for wings

* tabs

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

* pidData[axis].S

---------

Co-authored-by: Petr Ledvina <ledvinap@gmail.com>
2024-06-20 12:01:13 +02:00
Ivan Efimov
00ca8232d5
TPA delay in ms (for wings) (#13662)
* TPA delay in ms (for wings)

* Added comments for time constant

* ledvinap's suggestions

* tpaFactor local variable (based on ledvinap's suggestions)

* pt1FilterGainFromDelay with inlined calculations for cutoff (based on ledvinap's suggestions)

* Karatebrot extra review

* Pump PG for pidConfig_t

* Fixes based on review

* Moved tpaLpf to the end of pidRuntime_t
2024-06-18 23:23:07 +02:00
J Blackman
660018b1de
FIX: make: Circular configs <- configs dependency dropped. (#13695) 2024-06-17 21:30:08 +02:00
J Blackman
7075ed67b8
Adding exclude file for H563 (so not included in CI) (#13690) 2024-06-16 13:04:19 +10:00
J Blackman
a49c5c3a35
Adding initial H563 target files in preparation (#13686)
* Adding initial H563 target files in preparation
* Start up files
* Explicit inclusion of source files for @ledvinap suggestion
- adding system_stm32h5xx.c
2024-06-16 12:57:35 +10:00
Petr Ledvina
e0483ada8f
flash_w25n - remove macro with hidden variable reference (#13680) 2024-06-16 12:06:37 +10:00
Míguel Ángel Mulero Martínez
dc40b8f655
Add RSSI dBm alarm to MSP (#13682)
* Upgrade MSP version to 1.47

* Add RSSI dBm alarm to MSP

* Fix unit test after changing MSP version
2024-06-13 15:05:07 +02:00
J Blackman
d82c8facb2
Cleanup HAL usb driver (#13669) 2024-06-11 12:53:33 +10:00
Eike Ahmels
49adddbdd5
only apply osd defines if not set (#13612)
Co-authored-by: Eike Ahmels <ea@weslink.de>
2024-06-09 03:31:54 +02:00
Steve Evans
ab022b0467
Add support for W25N02K 2Gbit/256Mbyte FLASH (#13677)
* Add support for W25N02K 2Gbit/256Mbyte FLASH

* Remove duplicate defintion check

* Rename W25N01G_BB_*_BLOCK macros

* Remove debug

* Create unified driver for W25N01G and W25N02K devices

* Put device parameters in a table

* Add W25N01GV to stacked die driver
2024-06-09 08:30:33 +10:00
J Blackman
6080bffccc
Preparations for release of H563 target (#13657)
Adding H5 middle ware
2024-06-04 09:03:14 +10:00
Mark Haslinghuis
6885deb89b
Fix Wstringop-overflow warning on latest ARM SDK (#13659)
Fix Wstringop-overflow warning
2024-05-31 01:24:04 +02:00
Mark Haslinghuis
1074950e42
Update ARM SDK (#12286)
* Update ARM SDK
* Add ARM_SDK_BASE_DIR
* Update ARM SDK to latest 13.2.Rel1
2024-05-30 13:06:42 +10:00
Petr Ledvina
6ba4944a9f
build - trigger rebuild on change of most flag change (#13596)
Sometimes, files with different build flags are mixed, producing
broken result. With this change, most flags are hashed and force
rebuild if changed.
2024-05-24 17:46:57 +10:00
Mark Haslinghuis
e60224395e
Add MSP support for gyro_cal_on_first_arm (#13626)
* Add MSP support for gyro_cal_on_first_arm

* Update comment

* Add parameter to MSP

* Fix unit test

* Adjust condition

* Fix unittest instead
2024-05-22 16:38:54 +02:00
Mark Haslinghuis
4ae4a06b16
Do not enable features by default (#13608)
* Do not enable features by default

* Enable OSD by default if included

* Enable OSD by default if included 2

* Fixes per review blckmn

* Add gate

* Only enable defined features

* No need for DEFAULT_FEATURES predefine

* No need for gating as we use featuresSupportedByBuild

* Fixes per review from ledvinap
2024-05-21 15:12:54 +02:00
Štěpán Dalecký
2a627829cc
Tune huffman table to save nearly 500B (#11171) 2024-05-21 10:46:38 +02:00
Petr Ledvina
286cfb5022
Improve features (+ cli) (#13494)
* Features - refactor featureNames[]

Use designated initializers for used features. NULL values are stored
in gaps.
Use ARRAYLEN() for featureNames iteration
Use `unsigned` for bitmasks

* Features - add featuresSupportedByBuild

bitmask of features that are supported in current build
configuration. Copied from init.c sanitization

* Features - simplify feature sanitization code

featuresSupportedByBuild makes things much easier

* Features - improve cli feature handling

- refuse all features that are not compiled in
- AlreadyDisabled/AlreadyEnabled info
- refuse operation if multiple features match

* fixup! Features - improve cli feature handling

* Features - print available and not supported features separately

* Update src/main/cli/cli.c

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

* features - print full state without command

---------

Co-authored-by: Petr Ledvina <ledvinap@hp124.ekotip.cz>
Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
2024-05-20 16:03:19 +02:00
Petr Ledvina
dac4939215
beeper - minor refactoring (#13610) 2024-05-17 20:19:01 +10:00
Petr Ledvina
3094dd6766
Refactor beeper (#13492)
* Beeper - improve/fix beeper sequencing

- beeperSequenceAdvance is used to advance beeperPos
- sequences starting with 0 (delay first) are handled correctly
- 'empty' beeper states are supressed
- leds do blink beeper sequence, even when beeper is silenced

* Beeper - refactor beep_multiBeeps

- simpler length definition
- helpper function to simplify beep generation

* Beeper - refactor beeperTable

Refuse modes where beeperTableEntry->sequence is NULL
Rest of code is refactored without functional changes

* Beeper - improve micros() overflow handling + minor refactoring

- beeperNextToggleTime==0 when not enabled
- lastDshotBeaconCommandTimeUs is updated during DSHOT_BEACON_GUARD_DELAY_US phase
- DSHOT_BEACON_ALLOWED_MODES instead of explicit tests

* Beeper - minor refactor

- improve comments
- add STATIC_ASSERT
- reformat some code
- move #ifdef to better follow semantic structure
- return unsigned from BEEPER_GET_FLAG

* fixup! Beeper - minor refactor

---------

Co-authored-by: Petr Ledvina <ledvinap@hp124.ekotip.cz>
2024-05-16 19:54:17 +02:00
John Raahauge
9d4ebda2eb
GPS Rescue using MSP is not getting Velocity to Home (#13639)
Update gps.c

Added calculateNavInterval() function call into MSP GPS logic. Needed to update gpsSol.navIntervalMs so velocity to home can get calculated.
2024-05-16 15:41:26 +02:00
Steve Evans
2d3c8eea33
Remove superfluous checks of useDshotTelemetry (#13633) 2024-05-13 07:58:54 +10:00
Steve Evans
e55918c0e0
Display one of four logos on arming (#13057) 2024-05-12 05:46:23 +10:00
Mark Haslinghuis
076049ed7e
Update CRSF spec (#13614) 2024-05-12 04:59:59 +10:00
ctzsnooze
7ae92a9319
minor define fixes found during documentation work (#13631) 2024-05-12 04:50:41 +10:00
Mark Haslinghuis
764d82d4fd
Remove canvas configuration in cli (#13595)
* Remove canvas configuration in cli

* Add gating for OSD_CANVAS_SIZE_DEBUG
2024-05-10 14:16:40 +02:00
Petr Ledvina
d778a4fdfe
timers - remove obsolete defines from SITL and unittests (#13597) 2024-05-10 14:05:55 +02:00
Mark Haslinghuis
33ead2d022
Fix ICM20469 (#13616)
* Fix ICM20469

* Reorder defines for acc & gyro
2024-05-10 13:29:40 +10:00
Mark Haslinghuis
5a28ce5129
Make Cppcheck happier revived (#13566)
Co-authored-by: Štěpán Dalecký <daleckystepan@gmail.com>
2024-05-10 13:23:32 +10:00
Mark Haslinghuis
d5af7d2254
Add CRSF vario sensor support (#13558) 2024-05-10 06:42:42 +10:00
Jonas Becker
d1ffa46aa6
New led functions gps bar battery bar altitude (#13404)
* Add LED functions: Battery Bar, GPS Bar

Battery Bar:
Indicates the battery percentage with a loading bar style

GPS Bar:
Indicates the amount of locked GPS satellites with a loading bar style

* LED altitude function

Adds a new function: LED altitude.
Sets the LED color based on the altitude, measured from the initialized position.

* set led color to background if value decreases

Even if the gps satellite count decreases at a later point in time, the LEDs update correctly now.
It is the same for the battery level function.
LEDs color changes more strongly now when based on altitude.

* Added proper ifdefs for GPS and Barometer

* fixed unittest and use estimate altitute

- fixed unittest

- cleaner indentation

- the altitude function now uses the estimate function instead of the raw value (gps+barometer)

* counters in struct, gps bar color gradient

- Counters for the led bar are now handled in a structure.

- Moved the led bar code to a seperate function that is only called when the led config changes.

- improved usefulness of the gps led bar with less than 4 leds installed by adding a color gradient.

* Update src/main/io/ledstrip.c

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

* Update src/main/io/ledstrip.c

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

* Update src/main/io/ledstrip.c

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

* Update src/main/io/ledstrip.h

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

* Update src/main/io/ledstrip.c

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

* one min led for very low battery, use failsafe sats to interpolate

- at least one led is lit up for the battery/gps bar at all time (to show color gradient, also making the function more useful when only applying it to 1 led).

- gps bar now takes the failsafe min sats (or default 8) to interpolate between red and green.

- rewrote the led codes to be less fragile

- some structural changes that also adress comments on the pull request

* fix code if no gps rescue is used

fixes code if no gps rescue is used.
sets the default min sats to 8.

* Update src/main/io/ledstrip.c

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

* Fixes per review ledvinap

* Fixes per review Ledvinap 2

* Update src/main/io/ledstrip.c

* Update src/main/io/ledstrip.c

---------

Co-authored-by: jonas-becker <jonas@Thinkpad>
Co-authored-by: Petr Ledvina <ledvinap@gmail.com>
Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
2024-05-05 16:32:18 +02:00
Petr Ledvina
5fd38528ba
battery - fix BATTERY_NOT_PRESENT detection, detection logic change (#13599)
* battery - fix BATTERY_NOT_PRESENT detection, detection logic change

Detection logic is refactored - battery voltage delta is tested each
50ms, voltage is considered stable when difference of last 10 samples
is smaller than 100mV
This makes stable threshold more forgiving than #13350 (time for
comparison is 50 instead of 500ms).

* battery - improve stable voltage detection

- voltageStablePrevFiltered every time delta is exceeded
- voltage within range is ANDed over 100ms periods
- voltage is stable if it was within range for 10 out of 11 periods
  - slowly changing voltage will update threshold, but voltage will be
    considered stable
  - 1 update/s (100mV/s) is tolerated

* battery - fuix typos, improve comments
2024-05-04 10:47:06 +02:00
TheIsotopes
62aebac3fc
Update README.md (#13615)
Firmware 4.5 Release date added
2024-05-04 10:32:21 +02:00
Petr Ledvina
4640a5da96
cppcheck - minor problems fixed (#13609) 2024-04-30 14:04:28 +02:00
Dominic Clifton
a000913ed4
Fix stm32h730 hardcoded target IO (#13604)
Fix hard-coded TARGET_IO_PORT* defines.

This should be able to be overridden by targets.  e.g. ones that  use
octospi IO lines 4-7 instead of 0-3.
2024-04-29 16:56:35 +02:00
Mark Haslinghuis
59c93bad6e
Update version to 4.6 (#13499) 2024-04-28 11:57:01 +10:00
Mark Haslinghuis
c155f5830d
Update EEPROM version for 4.5 (#13498) 2024-04-28 11:51:47 +10:00
Steve Evans
565de1b68b
Use the cached value of useDshotTelemetry to ensure consistent runtime use if dshot_bidir is changed (#13589) 2024-04-28 09:31:50 +10:00
Mark Haslinghuis
54377940e0
Fix W25N01G lockup when using QUAD/OCTO SPI (#13584)
* Fix W25N01G lockup when using QUAD/OCTO SPI

* Move clock speed setting to configure
2024-04-25 23:41:54 +02:00
BloodSakura3774
5dae5f85b3
Sync usbd_product_string behavior (#13529)
* Update target.h
2024-04-24 08:06:38 +10:00
Mark Haslinghuis
92287b870d
Fix smartport over softserial using override (#13540)
* Fix smartport over softserial

* Constrain baudrateIndex does not work

* Reapply 57600 for SmartPort

* Use custom define for baudrate override

* Return when baudrate requested is above set limit of softserial

* Thanks ledvinap

* Fix macro name

* Cloud Build API does not allow define size > 32
2024-04-23 21:04:52 +02:00
Dominic Clifton
8d1d8872d6
Remove functionality to enter flash bootloader by sending 'F' on a UART configued for MSP. (#13572)
Remove functionality to enter flash bootloader by sending 'F' on a UART
configured for MSP.

* The proper way to reboot to the boot loader is by sending an
MSP_REBOOT command.
2024-04-23 11:53:53 +02:00
Petr Ledvina
7bf3928f91
RX - minor optimizations/minor cleanup (#13493)
* RX - minor optimizations/minor cleanup

- reuse millis() in rxInit
- rcData[] is float
- cleanup some float math
- fix GET_FRAME_ERR_LPF_FREQUENCY macro argument

* Update src/main/pg/rx.h

Co-authored-by: Jan Post <Rm2k-Freak@web.de>

---------

Co-authored-by: Petr Ledvina <ledvinap@hp124.ekotip.cz>
Co-authored-by: Jan Post <Rm2k-Freak@web.de>
2024-04-23 11:17:34 +02:00
Dominic Clifton
790fabcfbc
Fix inability to use the CLI resource command to configure LPUART_RX. (#13568)
* See https://github.com/betaflight/betaflight/issues/13567#issuecomment-2068693404
* See https://github.com/betaflight/betaflight/pull/13306#discussion_r1502901863
2024-04-23 02:04:03 +02:00
Mark Haslinghuis
e756c92f87
Use clang 15 as default (#13561) 2024-04-23 08:28:04 +10:00