1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 12:55:19 +03:00

SERIAL_BIDIR_PP option

Required for SmartAudio Support with single wire connection and without
external pull-up.

Tested with F3 only. F1 and F4 has untested mods, and Softserial
haven’t been touched.
This commit is contained in:
jflyper 2016-10-05 01:11:10 +09:00
parent f5dd171c8c
commit c724b7c4ee
3 changed files with 20 additions and 6 deletions

View file

@ -115,8 +115,10 @@ void serialUARTInit(IO_t tx, IO_t rx, portMode_t mode, portOptions_t options, ui
{
if (options & SERIAL_BIDIR) {
ioConfig_t ioCfg = IO_CONFIG(GPIO_Mode_AF, GPIO_Speed_50MHz,
(options & SERIAL_INVERTED) ? GPIO_OType_PP : GPIO_OType_OD,
(options & SERIAL_INVERTED) ? GPIO_PuPd_DOWN : GPIO_PuPd_UP
((options & SERIAL_INVERTED) || (options & SERIAL_BIDIR_PP))
? GPIO_OType_PP : GPIO_OType_OD,
((options & SERIAL_INVERTED) || (options & SERIAL_BIDIR_PP))
? GPIO_PuPd_DOWN : GPIO_PuPd_UP
);
IOInit(tx, OWNER_SERIAL, RESOURCE_UART_TXRX, index);