mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-17 05:15:25 +03:00
STM32F3 - Fix uartReconfigure. Closes #125.
This commit is contained in:
parent
c06fd78b83
commit
a65a937313
1 changed files with 2 additions and 8 deletions
|
@ -169,22 +169,16 @@ void uartSetBaudRate(serialPort_t *instance, uint32_t baudRate)
|
|||
{
|
||||
uartPort_t *uartPort = (uartPort_t *)instance;
|
||||
uartPort->port.baudRate = baudRate;
|
||||
#ifndef STM32F303xC // FIXME this doesnt seem to work, for now re-open the port from scratch, perhaps clearing some uart flags may help?
|
||||
uartReconfigure(uartPort);
|
||||
#else
|
||||
uartOpen(uartPort->USARTx, uartPort->port.callback, uartPort->port.baudRate, uartPort->port.mode, uartPort->port.inversion);
|
||||
#endif
|
||||
USART_Cmd(uartPort->USARTx, ENABLE);
|
||||
}
|
||||
|
||||
void uartSetMode(serialPort_t *instance, portMode_t mode)
|
||||
{
|
||||
uartPort_t *uartPort = (uartPort_t *)instance;
|
||||
uartPort->port.mode = mode;
|
||||
#ifndef STM32F303xC // FIXME this doesnt seem to work, for now re-open the port from scratch, perhaps clearing some uart flags may help?
|
||||
uartReconfigure(uartPort);
|
||||
#else
|
||||
uartOpen(uartPort->USARTx, uartPort->port.callback, uartPort->port.baudRate, uartPort->port.mode, uartPort->port.inversion);
|
||||
#endif
|
||||
USART_Cmd(uartPort->USARTx, ENABLE);
|
||||
}
|
||||
|
||||
void uartStartTxDMA(uartPort_t *s)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue