mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-18 22:05:17 +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_t *uartPort = (uartPort_t *)instance;
|
||||||
uartPort->port.baudRate = baudRate;
|
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);
|
uartReconfigure(uartPort);
|
||||||
#else
|
USART_Cmd(uartPort->USARTx, ENABLE);
|
||||||
uartOpen(uartPort->USARTx, uartPort->port.callback, uartPort->port.baudRate, uartPort->port.mode, uartPort->port.inversion);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void uartSetMode(serialPort_t *instance, portMode_t mode)
|
void uartSetMode(serialPort_t *instance, portMode_t mode)
|
||||||
{
|
{
|
||||||
uartPort_t *uartPort = (uartPort_t *)instance;
|
uartPort_t *uartPort = (uartPort_t *)instance;
|
||||||
uartPort->port.mode = mode;
|
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);
|
uartReconfigure(uartPort);
|
||||||
#else
|
USART_Cmd(uartPort->USARTx, ENABLE);
|
||||||
uartOpen(uartPort->USARTx, uartPort->port.callback, uartPort->port.baudRate, uartPort->port.mode, uartPort->port.inversion);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void uartStartTxDMA(uartPort_t *s)
|
void uartStartTxDMA(uartPort_t *s)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue