mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 00:05:33 +03:00
Add 230400 & 250000 baud rates, 2 stop-bits port mode
This commit is contained in:
parent
3e73b3de53
commit
cbaa67f1d0
4 changed files with 10 additions and 3 deletions
|
@ -28,6 +28,7 @@ typedef enum portMode_t {
|
|||
MODE_RXTX = MODE_RX | MODE_TX,
|
||||
MODE_SBUS = 1 << 2,
|
||||
MODE_BIDIR = 1 << 3,
|
||||
MODE_STOPBITS2 = 1 << 4,
|
||||
} portMode_t;
|
||||
|
||||
typedef void (*serialReceiveCallbackPtr)(uint16_t data); // used by serial drivers to return frames to app
|
||||
|
|
|
@ -79,7 +79,11 @@ static void uartReconfigure(uartPort_t *uartPort)
|
|||
USART_InitStructure.USART_StopBits = USART_StopBits_2;
|
||||
USART_InitStructure.USART_Parity = USART_Parity_Even;
|
||||
} else {
|
||||
if (uartPort->port.mode & MODE_STOPBITS2)
|
||||
USART_InitStructure.USART_StopBits = USART_StopBits_2;
|
||||
else
|
||||
USART_InitStructure.USART_StopBits = USART_StopBits_1;
|
||||
|
||||
USART_InitStructure.USART_Parity = USART_Parity_No;
|
||||
}
|
||||
USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
|
||||
|
|
|
@ -68,7 +68,7 @@ serialPortIdentifier_e serialPortIdentifiers[SERIAL_PORT_COUNT] = {
|
|||
#endif
|
||||
};
|
||||
|
||||
uint32_t baudRates[] = {0, 9600, 19200, 38400, 57600, 115200}; // see baudRate_e
|
||||
uint32_t baudRates[] = {0, 9600, 19200, 38400, 57600, 115200, 230400, 250000}; // see baudRate_e
|
||||
|
||||
#define BAUD_RATE_COUNT (sizeof(baudRates) / sizeof(baudRates[0]))
|
||||
|
||||
|
|
|
@ -41,7 +41,9 @@ typedef enum {
|
|||
BAUD_19200,
|
||||
BAUD_38400,
|
||||
BAUD_57600,
|
||||
BAUD_115200
|
||||
BAUD_115200,
|
||||
BAUD_230400,
|
||||
BAUD_250000,
|
||||
} baudRate_e;
|
||||
|
||||
extern uint32_t baudRates[];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue