Fix parity support on USB UART interface.
This commit is contained in:
parent
2b61bed291
commit
fad6eb3c14
|
@ -138,7 +138,12 @@ static void usbuart_run(void)
|
|||
void usbuart_set_line_coding(struct usb_cdc_line_coding *coding)
|
||||
{
|
||||
usart_set_baudrate(USBUSART, coding->dwDTERate);
|
||||
|
||||
if (coding->bParityType)
|
||||
usart_set_databits(USBUSART, coding->bDataBits + 1);
|
||||
else
|
||||
usart_set_databits(USBUSART, coding->bDataBits);
|
||||
|
||||
switch(coding->bCharFormat) {
|
||||
case 0:
|
||||
usart_set_stopbits(USBUSART, USART_STOPBITS_1);
|
||||
|
@ -150,6 +155,7 @@ void usbuart_set_line_coding(struct usb_cdc_line_coding *coding)
|
|||
usart_set_stopbits(USBUSART, USART_STOPBITS_2);
|
||||
break;
|
||||
}
|
||||
|
||||
switch(coding->bParityType) {
|
||||
case 0:
|
||||
usart_set_parity(USBUSART, USART_PARITY_NONE);
|
||||
|
|
Loading…
Reference in New Issue