* current encoding options, including baud rate, character format, parity mode and total number of \r
* bits in each data chunk.\r
*/\r
-CDC_Line_Coding_t LineCoding = { BaudRateBPS: 9600,\r
- CharFormat: OneStopBit,\r
- ParityType: Parity_None,\r
- DataBits: 8 };\r
+CDC_Line_Coding_t LineCoding = { .BaudRateBPS = 9600,\r
+ .CharFormat = OneStopBit,\r
+ .ParityType = Parity_None,\r
+ .DataBits = 8 };\r
\r
/** Current address counter. This stores the current address of the FLASH or EEPROM as set by the host,\r
* and is used when reading or writing to the AVRs memory (either FLASH or EEPROM depending on the issued\r
{\r
uint8_t* LineCodingData = (uint8_t*)&LineCoding;\r
\r
- Endpoint_Discard_Word();\r
-\r
/* Process CDC specific control requests */\r
- switch (bRequest)\r
+ switch (USB_ControlRequest.bRequest)\r
{\r
case REQ_GetLineEncoding:\r
- if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))\r
+ if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))\r
{\r
- Endpoint_ClearControlSETUP();\r
+ Endpoint_ClearSETUP();\r
\r
for (uint8_t i = 0; i < sizeof(LineCoding); i++)\r
Endpoint_Write_Byte(*(LineCodingData++)); \r
\r
- Endpoint_ClearControlIN();\r
+ Endpoint_ClearIN();\r
\r
/* Acknowledge status stage */\r
while (!(Endpoint_IsOUTReceived()));\r
- Endpoint_ClearControlOUT();\r
+ Endpoint_ClearOUT();\r
}\r
\r
break;\r
case REQ_SetLineEncoding:\r
- if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
+ if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
{\r
- Endpoint_ClearControlSETUP();\r
+ Endpoint_ClearSETUP();\r
\r
while (!(Endpoint_IsOUTReceived()));\r
\r
for (uint8_t i = 0; i < sizeof(LineCoding); i++)\r
*(LineCodingData++) = Endpoint_Read_Byte();\r
\r
- Endpoint_ClearControlOUT();\r
+ Endpoint_ClearOUT();\r
\r
/* Acknowledge status stage */\r
while (!(Endpoint_IsINReady()));\r
- Endpoint_ClearControlIN();\r
+ Endpoint_ClearIN();\r
}\r
\r
break;\r
case REQ_SetControlLineState:\r
- if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
+ if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
{\r
- Endpoint_ClearControlSETUP();\r
+ Endpoint_ClearSETUP();\r
\r
/* Acknowledge status stage */\r
while (!(Endpoint_IsINReady()));\r
- Endpoint_ClearControlIN();\r
+ Endpoint_ClearIN();\r
}\r
\r
break;\r