mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-18 22:05:17 +03:00
Merge pull request #4036 from jflyper/bfdev-fix-softserial-IOConfigGPIOAF
Explicitly call IOConfigGPIOAF for F3 and F4.
This commit is contained in:
commit
e90c0b01d1
2 changed files with 13 additions and 16 deletions
|
@ -131,18 +131,14 @@ static void serialInputPortActivate(softSerial_t *softSerial)
|
|||
if (softSerial->port.options & SERIAL_INVERTED) {
|
||||
#ifdef STM32F1
|
||||
IOConfigGPIO(softSerial->rxIO, IOCFG_IPD);
|
||||
#elif defined(STM32F7)
|
||||
IOConfigGPIOAF(softSerial->rxIO, IOCFG_AF_PP_PD, softSerial->timerHardware->alternateFunction);
|
||||
#else
|
||||
IOConfigGPIO(softSerial->rxIO, IOCFG_AF_PP_PD);
|
||||
IOConfigGPIOAF(softSerial->rxIO, IOCFG_AF_PP_PD, softSerial->timerHardware->alternateFunction);
|
||||
#endif
|
||||
} else {
|
||||
#ifdef STM32F1
|
||||
IOConfigGPIO(softSerial->rxIO, IOCFG_IPU);
|
||||
#elif defined(STM32F7)
|
||||
IOConfigGPIOAF(softSerial->rxIO, IOCFG_AF_PP_UP, softSerial->timerHardware->alternateFunction);
|
||||
#else
|
||||
IOConfigGPIO(softSerial->rxIO, IOCFG_AF_PP_UP);
|
||||
IOConfigGPIOAF(softSerial->rxIO, IOCFG_AF_PP_UP, softSerial->timerHardware->alternateFunction);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -165,35 +161,35 @@ static void serialInputPortDeActivate(softSerial_t *softSerial)
|
|||
TIM_CCxCmd(softSerial->timerHardware->tim, softSerial->timerHardware->channel, TIM_CCx_Disable);
|
||||
#endif
|
||||
|
||||
#ifdef STM32F7
|
||||
IOConfigGPIOAF(softSerial->rxIO, IOCFG_IN_FLOATING, softSerial->timerHardware->alternateFunction);
|
||||
#else
|
||||
#ifdef STM32F1
|
||||
IOConfigGPIO(softSerial->rxIO, IOCFG_IN_FLOATING);
|
||||
#else
|
||||
IOConfigGPIOAF(softSerial->rxIO, IOCFG_IN_FLOATING, softSerial->timerHardware->alternateFunction);
|
||||
#endif
|
||||
softSerial->rxActive = false;
|
||||
}
|
||||
|
||||
static void serialOutputPortActivate(softSerial_t *softSerial)
|
||||
{
|
||||
#ifdef STM32F7
|
||||
#ifdef STM32F1
|
||||
IOConfigGPIO(softSerial->txIO, IOCFG_OUT_PP);
|
||||
#else
|
||||
if (softSerial->exTimerHardware)
|
||||
IOConfigGPIOAF(softSerial->txIO, IOCFG_OUT_PP, softSerial->exTimerHardware->alternateFunction);
|
||||
else
|
||||
IOConfigGPIO(softSerial->txIO, IOCFG_OUT_PP);
|
||||
#else
|
||||
IOConfigGPIO(softSerial->txIO, IOCFG_OUT_PP);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void serialOutputPortDeActivate(softSerial_t *softSerial)
|
||||
{
|
||||
#ifdef STM32F7
|
||||
#ifdef STM32F1
|
||||
IOConfigGPIO(softSerial->txIO, IOCFG_IN_FLOATING);
|
||||
#else
|
||||
if (softSerial->exTimerHardware)
|
||||
IOConfigGPIOAF(softSerial->txIO, IOCFG_IN_FLOATING, softSerial->exTimerHardware->alternateFunction);
|
||||
else
|
||||
IOConfigGPIO(softSerial->txIO, IOCFG_IN_FLOATING);
|
||||
#else
|
||||
IOConfigGPIO(softSerial->txIO, IOCFG_IN_FLOATING);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,8 @@
|
|||
|
||||
#undef TELEMETRY_IBUS //no space left
|
||||
#undef TELEMETRY_HOTT //no space left
|
||||
#undef TELEMETRY_JETIEXBUS
|
||||
#undef TELEMETRY_JETIEXBUS // no space left
|
||||
#undef TELEMETRY_MAVLINK // no space left
|
||||
|
||||
#define TARGET_BOARD_IDENTIFIER "OMNI" // https://en.wikipedia.org/wiki/Omnibus
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue