mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 06:15:16 +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) {
|
if (softSerial->port.options & SERIAL_INVERTED) {
|
||||||
#ifdef STM32F1
|
#ifdef STM32F1
|
||||||
IOConfigGPIO(softSerial->rxIO, IOCFG_IPD);
|
IOConfigGPIO(softSerial->rxIO, IOCFG_IPD);
|
||||||
#elif defined(STM32F7)
|
|
||||||
IOConfigGPIOAF(softSerial->rxIO, IOCFG_AF_PP_PD, softSerial->timerHardware->alternateFunction);
|
|
||||||
#else
|
#else
|
||||||
IOConfigGPIO(softSerial->rxIO, IOCFG_AF_PP_PD);
|
IOConfigGPIOAF(softSerial->rxIO, IOCFG_AF_PP_PD, softSerial->timerHardware->alternateFunction);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
#ifdef STM32F1
|
#ifdef STM32F1
|
||||||
IOConfigGPIO(softSerial->rxIO, IOCFG_IPU);
|
IOConfigGPIO(softSerial->rxIO, IOCFG_IPU);
|
||||||
#elif defined(STM32F7)
|
|
||||||
IOConfigGPIOAF(softSerial->rxIO, IOCFG_AF_PP_UP, softSerial->timerHardware->alternateFunction);
|
|
||||||
#else
|
#else
|
||||||
IOConfigGPIO(softSerial->rxIO, IOCFG_AF_PP_UP);
|
IOConfigGPIOAF(softSerial->rxIO, IOCFG_AF_PP_UP, softSerial->timerHardware->alternateFunction);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,35 +161,35 @@ static void serialInputPortDeActivate(softSerial_t *softSerial)
|
||||||
TIM_CCxCmd(softSerial->timerHardware->tim, softSerial->timerHardware->channel, TIM_CCx_Disable);
|
TIM_CCxCmd(softSerial->timerHardware->tim, softSerial->timerHardware->channel, TIM_CCx_Disable);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef STM32F7
|
#ifdef STM32F1
|
||||||
IOConfigGPIOAF(softSerial->rxIO, IOCFG_IN_FLOATING, softSerial->timerHardware->alternateFunction);
|
|
||||||
#else
|
|
||||||
IOConfigGPIO(softSerial->rxIO, IOCFG_IN_FLOATING);
|
IOConfigGPIO(softSerial->rxIO, IOCFG_IN_FLOATING);
|
||||||
|
#else
|
||||||
|
IOConfigGPIOAF(softSerial->rxIO, IOCFG_IN_FLOATING, softSerial->timerHardware->alternateFunction);
|
||||||
#endif
|
#endif
|
||||||
softSerial->rxActive = false;
|
softSerial->rxActive = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void serialOutputPortActivate(softSerial_t *softSerial)
|
static void serialOutputPortActivate(softSerial_t *softSerial)
|
||||||
{
|
{
|
||||||
#ifdef STM32F7
|
#ifdef STM32F1
|
||||||
|
IOConfigGPIO(softSerial->txIO, IOCFG_OUT_PP);
|
||||||
|
#else
|
||||||
if (softSerial->exTimerHardware)
|
if (softSerial->exTimerHardware)
|
||||||
IOConfigGPIOAF(softSerial->txIO, IOCFG_OUT_PP, softSerial->exTimerHardware->alternateFunction);
|
IOConfigGPIOAF(softSerial->txIO, IOCFG_OUT_PP, softSerial->exTimerHardware->alternateFunction);
|
||||||
else
|
else
|
||||||
IOConfigGPIO(softSerial->txIO, IOCFG_OUT_PP);
|
IOConfigGPIO(softSerial->txIO, IOCFG_OUT_PP);
|
||||||
#else
|
|
||||||
IOConfigGPIO(softSerial->txIO, IOCFG_OUT_PP);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void serialOutputPortDeActivate(softSerial_t *softSerial)
|
static void serialOutputPortDeActivate(softSerial_t *softSerial)
|
||||||
{
|
{
|
||||||
#ifdef STM32F7
|
#ifdef STM32F1
|
||||||
|
IOConfigGPIO(softSerial->txIO, IOCFG_IN_FLOATING);
|
||||||
|
#else
|
||||||
if (softSerial->exTimerHardware)
|
if (softSerial->exTimerHardware)
|
||||||
IOConfigGPIOAF(softSerial->txIO, IOCFG_IN_FLOATING, softSerial->exTimerHardware->alternateFunction);
|
IOConfigGPIOAF(softSerial->txIO, IOCFG_IN_FLOATING, softSerial->exTimerHardware->alternateFunction);
|
||||||
else
|
else
|
||||||
IOConfigGPIO(softSerial->txIO, IOCFG_IN_FLOATING);
|
IOConfigGPIO(softSerial->txIO, IOCFG_IN_FLOATING);
|
||||||
#else
|
|
||||||
IOConfigGPIO(softSerial->txIO, IOCFG_IN_FLOATING);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,8 @@
|
||||||
|
|
||||||
#undef TELEMETRY_IBUS //no space left
|
#undef TELEMETRY_IBUS //no space left
|
||||||
#undef TELEMETRY_HOTT //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
|
#define TARGET_BOARD_IDENTIFIER "OMNI" // https://en.wikipedia.org/wiki/Omnibus
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue