1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 13:25:30 +03:00

Fix GPIO AF settings being overridden by timerInit(). (#12886)

This commit is contained in:
Dominic Clifton 2023-06-13 11:08:56 +02:00 committed by GitHub
parent 7d1007ea03
commit 646de8c57d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 33 additions and 8 deletions

View file

@ -271,6 +271,15 @@ void init(void)
// initialize IO (needed for all IO operations)
IOInitGlobal();
#ifdef USE_TIMER
// timerIOInit blindly reconfigures GPIO AF for all pins in the fullTimerHardware array regardless
// of if the timer pin is used already by something else.
// If it is called AFTER the SPI initilisation, any AF settings for the SPI are overridden by timer
// AF, making the SPI hang when it's used.
// To work-around this issue init timer AF before other AF, such as SPI/QSPI/OSPI/etc.
timerIOInit();
#endif
#ifdef USE_HARDWARE_REVISION_DETECTION
detectHardwareRevision();
#endif