1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 06:15:16 +03:00

Support SPI MOSI/MISO DMA stream assignment

Add SPI_TX/SPI_RX aliases for SPI_MOSI/SPI_MISO for dma command
Only assign SPI DMA before motors on F4/F7
This commit is contained in:
Steve Evans 2021-10-07 19:34:30 +01:00
parent adcc36888b
commit 246a02dcc1
6 changed files with 107 additions and 51 deletions

View file

@ -964,14 +964,25 @@ void init(void)
setArmingDisabled(ARMING_DISABLED_BOOT_GRACE_TIME);
// On F4/F7 allocate SPI DMA streams before motor timers
#if defined(STM32F4) || defined(STM32F7)
#ifdef USE_SPI
// Attempt to enable DMA on all SPI busses
spiInitBusDMA();
#endif
#endif
#ifdef USE_MOTOR
motorPostInit();
motorEnable();
#endif
// On H7/G4 allocate SPI DMA streams after motor timers as SPI DMA allocate will always be possible
#if defined(STM32H7) || defined(STM32G4)
#ifdef USE_SPI
// Attempt to enable DMA on all SPI busses
spiInitBusDMA();
#endif
#endif
swdPinsInit();