1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-12 19:10:32 +03:00
Commit graph

19050 commits

Author SHA1 Message Date
Git bot (blckmn)
e66010165e Auto updated submodule references [12-07-2025] 2025-07-12 06:25:03 +00:00
ke deng
acbab53d13
Fix incorrect TIMUP DMA configuration dump on H743 (#14502)
## Commit Summary: Fix incorrect TIMUP DMA configuration dump on H743

**Problem**: H743 platform had incorrect TIMUP DMA configuration dumping and parsing, causing errors when restoring dumped configurations.

**Solution**: This PR implements a comprehensive fix for TIMUP DMA handling across multiple areas:

### CLI DMA Option Handling (`src/main/cli/cli.c`)
- Added `getDmaOptDisplayNumber()` and `displayNumberToDmaOptIndex()` helper functions
- Properly translates between internal DMA option indices and user-facing display numbers
- Integrates presence mask validation for `DMA_PERIPH_TIMUP` peripheral
- Ensures only valid/present timer options are displayed and accepted

### Timer Definition Refactoring (Multiple Platforms)
- Replaced hardcoded `HARDWARE_TIMER_DEFINITION_COUNT` with dynamic `BITCOUNT(USED_TIMERS)` 
- Updated STM32H7/G4 `TIMUP_TIMERS` macros to use `TIM_N(x)` instead of `BIT(x)`
- Expanded AT32 `USED_TIMERS` to include timers 6 and 7
- Added static assertion to verify `TIMUP_TIMERS` bits are included in `USED_TIMERS`

### Timer Index Management (`src/main/drivers/timer.h` + platform implementations)
- Added `TIM_N(n)` macro for timer bitmask generation
- Added `TIMER_INDEX(i)` macro for proper index calculation
- Implemented `timerGetIndexByNumber()` function across all platforms (STM32, AT32, APM32)
- Provides bidirectional timer number ↔ index conversion

### DMA Request Mapping Updates
- Modified `REQMAP_TIMUP` macros to use `TIMER_INDEX(timno)` instead of `timno - 1`
- Ensures correct DMA request mapping for non-contiguous timer numbering

### Timer Configuration (`src/main/pg/timerup.c`)
- Replaced hardware timer count checks with `TIMUP_TIMERS` bitmask validation
- Added support for timers 6 and 7 that were previously omitted
- Uses computed `TIMER_INDEX()` for proper array indexing
2025-07-10 13:36:39 +02:00
Jay Blackman
90d2503274
PICO: Removing the flash CS pin as it will be defined in config.h (#14529) 2025-07-10 11:12:22 +10:00
Jay Blackman
f80672467f
Update README.md 2025-07-10 11:11:52 +10:00
Jay Blackman
67276e2f9a
Update README.md 2025-07-10 11:10:28 +10:00
mjs1441
2ad78c5571
accgyro_mpu initialise gyro->segments. (#14528) 2025-07-09 19:18:58 +02:00
ke deng
9458ac043a
refactor dshot_decode_telemetry_value to prevent EDT data in RPM (#14490)
* refactor dshot_decode_telemetry_value to prevent EDT data in RPM

* Optimize telemetry type detection for extended DShot protocol

* Fix extended telemetry array size and eRPM fallback logic

* Update src/main/drivers/dshot.c

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

* Format alignment

---------

Co-authored-by: Petr Ledvina <ledvinap@gmail.com>
2025-07-09 09:23:07 +02:00
Git bot (blckmn)
13b09a277e Auto updated submodule references [09-07-2025] 2025-07-09 06:25:03 +00:00
mjs1441
6c9e77d5b7
Fix a CLI status crash when no gyro present (#14524)
* CLI status fix crash when no gyro.

* Update n/a text per code review.
2025-07-08 12:25:21 +02:00
Steve Evans
1743a43d19
USE_DMA_SPEC not needed on RP2350 as DMA channel use is unrestricted (#14513)
* USE_DMA_SPEC not needed on RP2350 as DMA channel use is unrestricted

* Removed src/config stuff
2025-07-08 09:40:44 +10:00
Jay Blackman
babfff336d
PICO: Adding PICO tooling to CI (#14503)
* PICO: Adding PICO tooling to CI

* Removing description

* Removing requirement for configs when installing pico_sdk

* Remove requirement for ARM when populating sdks

* Removing exclusion for RP2350 targets

* Adding recursive sub-modules checkout

* Allow for different outputs to only .hex

* Attempt to get SITL bin build to upload as an artifact
2025-07-08 09:15:02 +10:00
Jay Blackman
4985d315d5
REFACTOR: Moving code sections to platform (#14509)
* REFACTOR: Moving code sections to platform

* Correct build error (FAST_CODE_PREF redefined)

* Re-ordered

* Updated comment (as per @ledvinap)
2025-07-08 09:14:34 +10:00
Mark Haslinghuis
cbf070af8f
Fix length for manufacturer and board name (#14518)
Fix length
2025-07-07 21:38:54 +02:00
mjs1441
b6d37008f5
Fix missing #if for PINIO_COUNT (#14515)
Allow user to supply CFLAGS_DISABLED to Makefile.
Fix missing #if..endif for PINIO_COUNT in pinio.c.
Fix other strncpy build warning/errors for build with CFLAGS_DISABLED="-flto=auto".
2025-07-06 18:13:06 +02:00
Steve Evans
01329e3350
Move DMA IRQ acknowledge to before the callback as it's edge triggered (#14514)
* Remove superfluous comments

* Move DMA IRQ acknowledge to before the callback as it's edge triggered
2025-07-06 16:59:37 +02:00
Git bot (blckmn)
35aac9f924 Auto updated submodule references [06-07-2025] 2025-07-06 06:25:03 +00:00
Git bot (blckmn)
d054b68ffe Auto updated submodule references [04-07-2025] 2025-07-04 06:25:03 +00:00
Jay Blackman
d1ff01d738
SITL: Minor changes to simplify platform (#14501)
* SITL: Minor changes to simplify platform

* Update main.c

* Update platform.h

* As per @ledvinap review
2025-07-04 15:40:17 +10:00
blckmn
9b4d123db3 Merge branch 'RP2350' 2025-07-03 08:18:25 +10:00
mjs1441
2a48e4d401
PICO: Beeper implementation (pwm) (#14493) 2025-07-03 02:32:06 +10:00
ke deng
46c73e70ba
Update STM32F4 DMA-Timer mapping comments for datasheet compliance (#14492) 2025-07-03 02:30:19 +10:00
Steve Evans
3dc130c4aa
Register allocated DMA channels for dma show (#14496) 2025-07-03 02:29:25 +10:00
mjs1441
c390aba083
PICO: Revert uartPinConfigure code (pending updates for PIO UART) (#14499) 2025-07-03 02:27:49 +10:00
Jay Blackman
dd45f9a7fe
PICO: Renamed MCU FAMILY to RP2350 (#14497) 2025-07-01 13:41:49 +10:00
Steve Evans
bc6f95928e
Pico GYRO_EXTI pin definition (#14494)
Define GYRO_1_EXTI_PIN
2025-06-30 18:51:28 +01:00
Kevin Plaizier
0d94108068
Update the google olc code to not have compiler warnings (#14484)
* Update the google olc code to not have compiler warnings

* With newer BF updates (double) is no longer needed in olc.c
2025-06-30 19:18:29 +02:00
Jay Blackman
dd9a51a108
Move beeper pwm functions to platform. (#14478) (#14491) 2025-06-30 21:00:14 +10:00
mjs1441
a1b8ad17d0
Move beeper pwm functions to platform. (#14478) 2025-06-30 20:57:16 +10:00
Steve Evans
c74787ea98
Fix ICM426XX_RA_DEVICE_CONFIG (#14487) 2025-06-30 08:46:55 +02:00
Git bot (blckmn)
67de7fd41a Auto updated submodule references [30-06-2025] 2025-06-30 06:25:03 +00:00
Steve Evans
f21854cda1
PICO USE_LATE_TASK_STATISTICS (#14489) 2025-06-30 11:22:59 +10:00
Steve Evans
ac918d37fe
Add PICO EXTI support (#14488) 2025-06-30 11:22:26 +10:00
Steve Evans
9fed1f9ebb
Add support for SPI DMA (#14483) 2025-06-30 11:21:56 +10:00
Git bot (blckmn)
fd0fd25ef1 Auto updated submodule references [27-06-2025] 2025-06-27 06:25:02 +00:00
Git bot (blckmn)
e2dba8f080 Auto updated submodule references [26-06-2025] 2025-06-26 06:25:03 +00:00
mjs1441
7abb14335d
Fix uninitialised loop variable in msp.c (#14479) 2025-06-26 00:49:34 +02:00
blckmn
aeda0905c5 PICO: Minor dma channel claim update 2025-06-26 07:59:44 +10:00
blckmn
f11eea69ce Merge branch 'master' into RP2350 2025-06-26 07:47:24 +10:00
Jay Blackman
0d0c00f341
REFACTOR: Adding DMA_FIRST_HANDLER (#14474)
* REFACTOR: Adding DMA_FIRST_HANDLER

 dmaIdentifier_e could be zero based in the future and align to descriptor array index directly

Also removed unused DMA_INPUT_STRING

* Removed magic number following code rabbit review
2025-06-26 07:34:29 +10:00
blckmn
c284edb89c PICO: DMA Removing magic numbers 2025-06-25 04:56:29 +10:00
blckmn
4bb1edfba0 PICO: Adding DMA_FIRST_HANDLER for master compatibility 2025-06-25 04:54:33 +10:00
blckmn
62ad213878 PICO: Correct DMA index usage
//TODO: index / channel / identifier can be one and the same - need support for zero based
2025-06-25 04:00:22 +10:00
blckmn
6a95d4e13f PICO: Enabling DMA IRQ Channel 2025-06-25 03:11:59 +10:00
Git bot (blckmn)
35dd55f6d7 Auto updated submodule references [24-06-2025] 2025-06-24 06:25:03 +00:00
Kevin Plaizier
078ffafec1
Add 3+ IMU support (Gyro Fusion) (#14383)
* Allow for 3 gyros to be fused at once.

* Handle the case where no GYRO_COUNT is defined

* Fix accel init bug

* Fix bugs found by AI

* Fix compile time assert message

* Move to picking which IMU you want to enable, allow IMU that have the same scale and looprate to run together even if they aren't identical IMU.

* Fully support 8 IMU

* Fix suggestions, except for MSP all suggestions

* Fix bugs found by AI

* Update gyro_init

* Fix unit tests (feels wrong though)

* Allow MSP to update all gyro alignment

* resolve comments

* Only auto set up to 4 gyros in a config.

* Update MSP implementation

* Fix divide by 0 error

* Update src/main/target/common_post.h

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

* Handle case where gyro 1 does not exist

* Fix 426XX driver

* fix = logic in if statement

* Update src/main/msp/msp.c

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

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

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

* Apply ledvinap suggestions

* Fix detectedSensors initialization

* fix getGyroDetectedFlags

* Automatically handle GYRO_COUNT for up to 4 IMU

* better handle unit tests

* Backwards compatible with older config.h files

* Update src/main/sensors/gyro_init.c

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

* Update src/main/target/common_pre.h

Co-authored-by: nerdCopter <56646290+nerdCopter@users.noreply.github.com>

* Update src/main/sensors/gyro_init.c

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

* Update src/main/sensors/gyro.c

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

* This needs to be the case or unit tests fail, without this we cannot choose default gyro either.

* ledvinap suggestions

* whitespace

---------

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
Co-authored-by: Petr Ledvina <ledvinap@gmail.com>
Co-authored-by: nerdCopter <56646290+nerdCopter@users.noreply.github.com>
2025-06-23 21:35:11 +02:00
blckmn
635b3c2de4 Merge remote-tracking branch 'betaflight/master' into RP2350 2025-06-23 16:11:51 +10:00
Lukas Lendvorsky
3370752442
Disable entering CMS menu when armed (#14470) 2025-06-23 02:15:28 +02:00
Jay Blackman
f45c5c5355
REFACTOR: More platform specific defines moved to platform (#14471) 2025-06-23 10:07:49 +10:00
Jay Blackman
5969e4c3ad
PICO: Initial multicore (using it for IRQs) (#14458)
* PICO: Initial multicore (using it for IRQs)

* Updated so any function can be pushed.

* Corrected includes

* Move to queues

* Removed header

* Adding check on command

- correcting core reset return

* Updates based on feedback

* Whitespace

* making static

* Removing comment
2025-06-23 10:07:22 +10:00
Steve Evans
e63dfb9a9a
Pico uart pin configure (#14473)
* Add empty uartPinConfigure() implementation for RP2350

* Fix tabs
2025-06-22 22:36:31 +01:00