Skip to content

Commit

Permalink
Corrections to uart driver for Chibios platform (#19075)
Browse files Browse the repository at this point in the history
  • Loading branch information
infinityis authored Jan 23, 2023
1 parent dfb2833 commit aea1194
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions platforms/chibios/drivers/uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
11 changes: 4 additions & 7 deletions platforms/chibios/drivers/uart.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit aea1194

Please sign in to comment.