From aea1194ea33fe85a8bdc380bd2cb27d3c3d6078a Mon Sep 17 00:00:00 2001 From: David Hoelscher Date: Mon, 23 Jan 2023 14:05:47 -0600 Subject: Corrections to uart driver for Chibios platform (#19075) --- platforms/chibios/drivers/uart.c | 4 ++-- platforms/chibios/drivers/uart.h | 11 ++++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/platforms/chibios/drivers/uart.c b/platforms/chibios/drivers/uart.c index b16130d80b..34f77232b6 100644 --- a/platforms/chibios/drivers/uart.c +++ b/platforms/chibios/drivers/uart.c @@ -42,8 +42,8 @@ void uart_init(uint32_t baud) { palSetLineMode(SD1_TX_PIN, SD1_TX_PAL_MODE); palSetLineMode(SD1_RX_PIN, SD1_RX_PAL_MODE); #else - palSetLineMode(SD1_TX_PIN, PAL_MODE_ALTERNATE(SD1_TX_PAL_MODE) | PAL_OUTPUT_TYPE_OPENDRAIN); - palSetLineMode(SD1_RX_PIN, PAL_MODE_ALTERNATE(SD1_RX_PAL_MODE) | PAL_OUTPUT_TYPE_OPENDRAIN); + palSetLineMode(SD1_TX_PIN, PAL_MODE_ALTERNATE(SD1_TX_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); + palSetLineMode(SD1_RX_PIN, PAL_MODE_ALTERNATE(SD1_RX_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); #endif sdStart(&SERIAL_DRIVER, &serialConfig); } diff --git a/platforms/chibios/drivers/uart.h b/platforms/chibios/drivers/uart.h index db97840270..e9e3b0855b 100644 --- a/platforms/chibios/drivers/uart.h +++ b/platforms/chibios/drivers/uart.h @@ -42,19 +42,16 @@ #ifdef USE_GPIOV1 # ifndef SD1_TX_PAL_MODE -# define SD1_TX_PAL_MODE PAL_MODE_ALTERNATE_OPENDRAIN +# define SD1_TX_PAL_MODE PAL_MODE_ALTERNATE_PUSHPULL # endif - # ifndef SD1_RX_PAL_MODE -# define SD1_RX_PAL_MODE PAL_MODE_ALTERNATE_OPENDRAIN +# define SD1_RX_PAL_MODE PAL_MODE_INPUT # endif - # ifndef SD1_CTS_PAL_MODE -# define SD1_CTS_PAL_MODE PAL_MODE_ALTERNATE_OPENDRAIN +# define SD1_CTS_PAL_MODE PAL_MODE_INPUT # endif - # ifndef SD1_RTS_PAL_MODE -# define SD1_RTS_PAL_MODE PAL_MODE_ALTERNATE_OPENDRAIN +# define SD1_RTS_PAL_MODE PAL_MODE_ALTERNATE_PUSHPULL # endif #else # ifndef SD1_TX_PAL_MODE -- cgit v1.2.3