projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed CDCHost not clearing configured endpoints and resetting configured endpoints...
[pub/USBasp.git]
/
Demos
/
Device
/
DualCDC
/
DualCDC.c
diff --git
a/Demos/Device/DualCDC/DualCDC.c
b/Demos/Device/DualCDC/DualCDC.c
index
69d26c4
..
9750ea2
100644
(file)
--- a/
Demos/Device/DualCDC/DualCDC.c
+++ b/
Demos/Device/DualCDC/DualCDC.c
@@
-186,57
+186,49
@@
EVENT_HANDLER(USB_ConfigurationChanged)
*/
\r
EVENT_HANDLER(USB_UnhandledControlPacket)
\r
{
\r
*/
\r
EVENT_HANDLER(USB_UnhandledControlPacket)
\r
{
\r
- uint8_t* LineCodingData;
\r
-
\r
- /* Discard the unused wValue parameter */
\r
- Endpoint_Discard_Word();
\r
-
\r
- /* wIndex indicates the interface being controlled */
\r
- uint16_t wIndex = Endpoint_Read_Word_LE();
\r
-
\r
/* Determine which interface's Line Coding data is being set from the wIndex parameter */
\r
/* Determine which interface's Line Coding data is being set from the wIndex parameter */
\r
-
LineCodingData = (
wIndex == 0) ? (uint8_t*)&LineCoding1 : (uint8_t*)&LineCoding2;
\r
+
uint8_t* LineCodingData = (USB_ControlRequest.
wIndex == 0) ? (uint8_t*)&LineCoding1 : (uint8_t*)&LineCoding2;
\r
\r
/* Process CDC specific control requests */
\r
\r
/* Process CDC specific control requests */
\r
- switch (bRequest)
\r
+ switch (
USB_ControlRequest.
bRequest)
\r
{
\r
case REQ_GetLineEncoding:
\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
/* Acknowledge the SETUP packet, ready for data transfer */
\r
{
\r
/* Acknowledge the SETUP packet, ready for data transfer */
\r
- Endpoint_Clear
Control
SETUP();
\r
+ Endpoint_ClearSETUP();
\r
\r
/* Write the line coding data to the control endpoint */
\r
Endpoint_Write_Control_Stream_LE(LineCodingData, sizeof(CDC_Line_Coding_t));
\r
\r
/* Finalize the stream transfer to send the last packet or clear the host abort */
\r
\r
/* Write the line coding data to the control endpoint */
\r
Endpoint_Write_Control_Stream_LE(LineCodingData, sizeof(CDC_Line_Coding_t));
\r
\r
/* Finalize the stream transfer to send the last packet or clear the host abort */
\r
- Endpoint_Clear
Control
OUT();
\r
+ Endpoint_ClearOUT();
\r
}
\r
\r
break;
\r
case REQ_SetLineEncoding:
\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
/* Acknowledge the SETUP packet, ready for data transfer */
\r
{
\r
/* Acknowledge the SETUP packet, ready for data transfer */
\r
- Endpoint_Clear
Control
SETUP();
\r
+ Endpoint_ClearSETUP();
\r
\r
/* Read the line coding data in from the host into the global struct */
\r
Endpoint_Read_Control_Stream_LE(LineCodingData, sizeof(CDC_Line_Coding_t));
\r
\r
/* Finalize the stream transfer to clear the last packet from the host */
\r
\r
/* Read the line coding data in from the host into the global struct */
\r
Endpoint_Read_Control_Stream_LE(LineCodingData, sizeof(CDC_Line_Coding_t));
\r
\r
/* Finalize the stream transfer to clear the last packet from the host */
\r
- Endpoint_Clear
Control
IN();
\r
+ Endpoint_ClearIN();
\r
}
\r
\r
break;
\r
case REQ_SetControlLineState:
\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
/* Acknowledge the SETUP packet, ready for data transfer */
\r
{
\r
/* Acknowledge the SETUP packet, ready for data transfer */
\r
- Endpoint_Clear
Control
SETUP();
\r
+ Endpoint_ClearSETUP();
\r
\r
/* Acknowledge status stage */
\r
while (!(Endpoint_IsINReady()));
\r
\r
/* Acknowledge status stage */
\r
while (!(Endpoint_IsINReady()));
\r
- Endpoint_Clear
Control
IN();
\r
+ Endpoint_ClearIN();
\r
}
\r
\r
break;
\r
}
\r
\r
break;
\r