projects
/
pub
/
lufa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed GenericHIDHost demo report write routine incorrect for control type requests...
[pub/lufa.git]
/
Demos
/
Device
/
CDC
/
CDC.c
diff --git
a/Demos/Device/CDC/CDC.c
b/Demos/Device/CDC/CDC.c
index
5e153f6
..
3dc6240
100644
(file)
--- a/
Demos/Device/CDC/CDC.c
+++ b/
Demos/Device/CDC/CDC.c
@@
-36,12
+36,6
@@
\r
#include "CDC.h"
\r
\r
\r
#include "CDC.h"
\r
\r
-/* Project Tags, for reading out using the ButtLoad project */
\r
-BUTTLOADTAG(ProjName, "LUFA CDC App");
\r
-BUTTLOADTAG(BuildTime, __TIME__);
\r
-BUTTLOADTAG(BuildDate, __DATE__);
\r
-BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
\r
-
\r
/* Scheduler Task List */
\r
TASK_LIST
\r
{
\r
/* Scheduler Task List */
\r
TASK_LIST
\r
{
\r
@@
-172,13
+166,13
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
/* Acknowledge the SETUP packet, ready for data transfer */
\r
if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
/* Acknowledge the SETUP packet, ready for data transfer */
\r
- Endpoint_Clear
SetupReceived
();
\r
+ Endpoint_Clear
ControlSETUP
();
\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
Setup
OUT();
\r
+ Endpoint_Clear
Control
OUT();
\r
}
\r
\r
break;
\r
}
\r
\r
break;
\r
@@
-186,13
+180,13
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
/* Acknowledge the SETUP packet, ready for data transfer */
\r
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
/* Acknowledge the SETUP packet, ready for data transfer */
\r
- Endpoint_Clear
SetupReceived
();
\r
+ Endpoint_Clear
ControlSETUP
();
\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
Setup
IN();
\r
+ Endpoint_Clear
Control
IN();
\r
}
\r
\r
break;
\r
}
\r
\r
break;
\r
@@
-211,11
+205,11
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
#endif
\r
\r
/* Acknowledge the SETUP packet, ready for data transfer */
\r
#endif
\r
\r
/* Acknowledge the SETUP packet, ready for data transfer */
\r
- Endpoint_Clear
SetupReceived
();
\r
+ Endpoint_Clear
ControlSETUP
();
\r
\r
/* Acknowledge status stage */
\r
\r
/* Acknowledge status stage */
\r
- while (!(Endpoint_Is
Setup
INReady()));
\r
- Endpoint_Clear
Setup
IN();
\r
+ while (!(Endpoint_IsINReady()));
\r
+ Endpoint_Clear
Control
IN();
\r
}
\r
\r
break;
\r
}
\r
\r
break;
\r
@@
-276,7
+270,7
@@
TASK(CDC_Task)
Endpoint_SelectEndpoint(CDC_NOTIFICATION_EPNUM);
\r
Endpoint_Write_Stream_LE(&Notification, sizeof(Notification));
\r
Endpoint_Write_Stream_LE(&LineStateMask, sizeof(LineStateMask));
\r
Endpoint_SelectEndpoint(CDC_NOTIFICATION_EPNUM);
\r
Endpoint_Write_Stream_LE(&Notification, sizeof(Notification));
\r
Endpoint_Write_Stream_LE(&LineStateMask, sizeof(LineStateMask));
\r
- Endpoint_Clear
CurrentBank
();
\r
+ Endpoint_Clear
IN
();
\r
#endif
\r
\r
/* Determine if a joystick action has occurred */
\r
#endif
\r
\r
/* Determine if a joystick action has occurred */
\r
@@
-307,19
+301,19
@@
TASK(CDC_Task)
Endpoint_Write_Stream_LE(ReportString, strlen(ReportString));
\r
\r
/* Finalize the stream transfer to send the last packet */
\r
Endpoint_Write_Stream_LE(ReportString, strlen(ReportString));
\r
\r
/* Finalize the stream transfer to send the last packet */
\r
- Endpoint_Clear
CurrentBank
();
\r
+ Endpoint_Clear
IN
();
\r
\r
/* Wait until the endpoint is ready for another packet */
\r
\r
/* Wait until the endpoint is ready for another packet */
\r
- while (!(Endpoint_
ReadWriteAllowed
()));
\r
+ while (!(Endpoint_
IsINReady
()));
\r
\r
/* Send an empty packet to ensure that the host does not buffer data sent to it */
\r
\r
/* Send an empty packet to ensure that the host does not buffer data sent to it */
\r
- Endpoint_Clear
CurrentBank
();
\r
+ Endpoint_Clear
IN
();
\r
}
\r
\r
/* Select the Serial Rx Endpoint */
\r
Endpoint_SelectEndpoint(CDC_RX_EPNUM);
\r
\r
/* Throw away any received data from the host */
\r
}
\r
\r
/* Select the Serial Rx Endpoint */
\r
Endpoint_SelectEndpoint(CDC_RX_EPNUM);
\r
\r
/* Throw away any received data from the host */
\r
- if (Endpoint_
ReadWriteAllow
ed())
\r
- Endpoint_Clear
CurrentBank
();
\r
+ if (Endpoint_
IsOUTReceiv
ed())
\r
+ Endpoint_Clear
OUT
();
\r
}
\r
}
\r