Skip to content

Commit 7d2b430

Browse files
committed
bugfix - serial config parameter cannot be set
function usart_init must be called before usart_config_gpios_async
1 parent 17cbf25 commit 7d2b430

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

STM32F1/cores/maple/HardwareSerial.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,11 @@ void HardwareSerial::begin(uint32 baud, uint8_t config)
141141

142142
disable_timer_if_necessary(txi->timer_device, txi->timer_channel);
143143

144+
usart_init(this->usart_device);
144145
usart_config_gpios_async(this->usart_device,
145146
rxi->gpio_device, rxi->gpio_bit,
146147
txi->gpio_device, txi->gpio_bit,
147148
config);
148-
usart_init(this->usart_device);
149149
usart_set_baud_rate(this->usart_device, USART_USE_PCLK, baud);
150150
usart_enable(this->usart_device);
151151
}

0 commit comments

Comments
 (0)