We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cdbc7d2 + 8b0e68f commit d15cc3dCopy full SHA for d15cc3d
source/hic_hal/stm32/stm32f103xb/uart.c
@@ -170,7 +170,11 @@ int32_t uart_set_configuration(UART_Configuration *config)
170
171
//Only 8 bit support
172
configuration.DataBits = UART_DATA_BITS_8;
173
- uart_handle.Init.WordLength = UART_WORDLENGTH_8B;
+ if (uart_handle.Init.Parity == HAL_UART_PARITY_ODD || uart_handle.Init.Parity == HAL_UART_PARITY_EVEN) {
174
+ uart_handle.Init.WordLength = UART_WORDLENGTH_9B;
175
+ } else {
176
+ uart_handle.Init.WordLength = UART_WORDLENGTH_8B;
177
+ }
178
179
// No flow control
180
configuration.FlowControl = UART_FLOW_CONTROL_NONE;
0 commit comments