1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 21:35:44 +03:00

Tidy up of AT (timer defs), and STM specific init defines (#12339)

* Tidy up of AT Timer Definitions
* Removed unnecessary F1 code.
* Remove some STM specific define logic from init.c
* As per renaming suggestion from @klutvott123
This commit is contained in:
J Blackman 2023-02-10 14:01:38 +11:00 committed by GitHub
parent 01df7f3057
commit 7b2d114c51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 93 additions and 116 deletions

View file

@ -256,6 +256,7 @@ static void sdCardAndFSInit(void)
}
#endif
#ifdef USE_SWDIO
static void swdPinsInit(void)
{
IO_t io = IOGetByTag(DEFIO_TAG_E(PA13)); // SWDIO
@ -267,6 +268,7 @@ static void swdPinsInit(void)
IOInit(io, OWNER_SWD, 0);
}
}
#endif
void init(void)
{
@ -1007,28 +1009,26 @@ 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
// allocate SPI DMA streams before motor timers
#if defined(USE_SPI) && defined(USE_SPI_DMA_ENABLE_EARLY)
// 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) || defined(AT32F435)
#ifdef USE_SPI
// allocate SPI DMA streams after motor timers as SPI DMA allocate will always be possible
#if defined(USE_SPI) && defined(USE_SPI_DMA_ENABLE_LATE) && !defined(USE_SPI_DMA_ENABLE_EARLY)
// Attempt to enable DMA on all SPI busses
spiInitBusDMA();
#endif
#endif
#ifdef USE_SWDIO
swdPinsInit();
#endif
unusedPinsInit();