mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-29 14:52:12 +01:00
usb cdc: return valid data in response to SetLineCoding
This commit is contained in:
parent
a68f5a4fc9
commit
16619584e4
@ -527,6 +527,13 @@ RESULT PIOS_CDC_SetControlLineState(void)
|
||||
return USB_SUCCESS;
|
||||
}
|
||||
|
||||
static uint8_t line_coding[] = {
|
||||
0x00, 0xE1, 0x00, 0x00, /* 57600bps */
|
||||
0x00, /* 1 stop bit */
|
||||
0x00, /* Even parity */
|
||||
0x08, /* 8 data bits */
|
||||
};
|
||||
|
||||
RESULT PIOS_CDC_SetLineCoding(void)
|
||||
{
|
||||
struct pios_usb_com_dev * usb_com_dev = (struct pios_usb_com_dev *)pios_usb_com_cdc_id;
|
||||
@ -544,7 +551,12 @@ uint8_t *PIOS_CDC_GetLineCoding(uint16_t Length)
|
||||
bool valid = PIOS_USB_COM_validate(usb_com_dev);
|
||||
PIOS_Assert(valid);
|
||||
|
||||
return NULL;
|
||||
if (Length == 0) {
|
||||
pInformation->Ctrl_Info.Usb_wLength = sizeof(line_coding);
|
||||
return NULL;
|
||||
} else {
|
||||
return (line_coding);
|
||||
}
|
||||
}
|
||||
|
||||
static uint8_t serial_state[] = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user