Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UART driver refactor #11637

Merged
merged 8 commits into from
Jan 27, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make CR1/2/3 configurable
  • Loading branch information
fauxpark committed Jan 21, 2021
commit 5d1954742e821bf9b8694fbaab4ff7c03c01e5c1
6 changes: 3 additions & 3 deletions drivers/chibios/uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@

static SerialConfig serialConfig = {
SERIAL_DEFAULT_BITRATE,
0,
USART_CR2_STOP_1,
0
SD1_CR1,
SD1_CR2,
SD1_CR3
};

void uart_init(uint32_t baud) {
Expand Down
12 changes: 12 additions & 0 deletions drivers/chibios/uart.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@
# define SERIAL_DRIVER SD1
#endif

#ifndef SD1_CR1
# define SD1_CR1 0
#endif

#ifndef SD1_CR2
# define SD1_CR2 0
#endif

#ifndef SD1_CR3
# define SD1_CR3 0
#endif

#ifdef USE_GPIOV1
# ifndef SD1_TX_PAL_MODE
# define SD1_TX_PAL_MODE PAL_MODE_STM32_ALTERNATE_OPENDRAIN
Expand Down