Corrections to uart driver for Chibios platform (#19075)

This commit is contained in:
David Hoelscher 2023-01-23 14:05:47 -06:00 committed by GitHub
parent dfb28334e4
commit aea1194ea3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 9 deletions

View file

@ -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);
}

View file

@ -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