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

Exclude SWD pins from being initialised as pull up if unused.

This commit is contained in:
mikeller 2020-01-28 00:00:04 +13:00 committed by Michael Keller
parent 0c6b965898
commit cd27b63b89
6 changed files with 24 additions and 8 deletions

View file

@ -285,13 +285,25 @@ static void configureSPIAndQuadSPI(void)
}
#ifdef USE_SDCARD
void sdCardAndFSInit()
static void sdCardAndFSInit()
{
sdcard_init(sdcardConfig());
afatfs_init();
}
#endif
static void swdPinsInit(void)
{
IO_t io = IOGetByTag(DEFIO_TAG_E(PA13)); // SWDIO
if (IOGetOwner(io) == OWNER_FREE) {
IOInit(io, OWNER_SWD, 0);
}
io = IOGetByTag(DEFIO_TAG_E(PA14)); // SWCLK
if (IOGetOwner(io) == OWNER_FREE) {
IOInit(io, OWNER_SWD, 0);
}
}
void init(void)
{
#ifdef SERIAL_PORT_COUNT
@ -1006,7 +1018,9 @@ void init(void)
motorEnable();
#endif
initializeUnusedPins();
swdPinsInit();
unusedPinsInit();
tasksInit();