projects
/
pub
/
USBasp.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/USBasp.git]
/
Demos
/
Device
/
KeyboardMouse
/
KeyboardMouse.c
diff --git
a/Demos/Device/KeyboardMouse/KeyboardMouse.c
b/Demos/Device/KeyboardMouse/KeyboardMouse.c
index
3ee101b
..
71e23ab
100644
(file)
--- a/
Demos/Device/KeyboardMouse/KeyboardMouse.c
+++ b/
Demos/Device/KeyboardMouse/KeyboardMouse.c
@@
-37,12
+37,6
@@
\r
#include "KeyboardMouse.h"
\r
\r
\r
#include "KeyboardMouse.h"
\r
\r
-/* Project Tags, for reading out using the ButtLoad project */
\r
-BUTTLOADTAG(ProjName, "LUFA MouseKBD 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
@@
-150,7
+144,7
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
case REQ_GetReport:
\r
if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
case REQ_GetReport:
\r
if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
- Endpoint_
Ignore
_Word();
\r
+ Endpoint_
Discard
_Word();
\r
\r
uint16_t wIndex = Endpoint_Read_Word_LE();
\r
\r
\r
uint16_t wIndex = Endpoint_Read_Word_LE();
\r
\r
@@
-173,7
+167,7
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
if (wLength > ReportSize)
\r
wLength = ReportSize;
\r
\r
if (wLength > ReportSize)
\r
wLength = ReportSize;
\r
\r
- Endpoint_Clear
SetupReceived
();
\r
+ Endpoint_Clear
ControlSETUP
();
\r
\r
/* Write the report data to the control endpoint */
\r
Endpoint_Write_Control_Stream_LE(ReportData, wLength);
\r
\r
/* Write the report data to the control endpoint */
\r
Endpoint_Write_Control_Stream_LE(ReportData, wLength);
\r
@@
-182,17
+176,17
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
memset(ReportData, 0, ReportSize);
\r
\r
/* Finalize the stream transfer to send the last packet or clear the host abort */
\r
memset(ReportData, 0, ReportSize);
\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
case REQ_SetReport:
\r
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
}
\r
\r
break;
\r
case REQ_SetReport:
\r
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
- Endpoint_Clear
SetupReceived
();
\r
+ Endpoint_Clear
ControlSETUP
();
\r
\r
/* Wait until the LED report has been sent by the host */
\r
\r
/* Wait until the LED report has been sent by the host */
\r
- while (!(Endpoint_Is
Setup
OUTReceived()));
\r
+ while (!(Endpoint_IsOUTReceived()));
\r
\r
/* Read in the LED report from the host */
\r
uint8_t LEDStatus = Endpoint_Read_Byte();
\r
\r
/* Read in the LED report from the host */
\r
uint8_t LEDStatus = Endpoint_Read_Byte();
\r
@@
-211,11
+205,11
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
LEDs_SetAllLEDs(LEDMask);
\r
\r
/* Clear the endpoint data */
\r
LEDs_SetAllLEDs(LEDMask);
\r
\r
/* Clear the endpoint data */
\r
- Endpoint_Clear
Setup
OUT();
\r
+ Endpoint_Clear
Control
OUT();
\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
@@
-281,13
+275,13
@@
TASK(USB_Keyboard)
Endpoint_SelectEndpoint(KEYBOARD_IN_EPNUM);
\r
\r
/* Check if Keyboard Endpoint Ready for Read/Write */
\r
Endpoint_SelectEndpoint(KEYBOARD_IN_EPNUM);
\r
\r
/* Check if Keyboard Endpoint Ready for Read/Write */
\r
- if (Endpoint_ReadWriteAllowed())
\r
+ if (Endpoint_
Is
ReadWriteAllowed())
\r
{
\r
/* Write Keyboard Report Data */
\r
Endpoint_Write_Stream_LE(&KeyboardReportData, sizeof(KeyboardReportData));
\r
\r
/* Finalize the stream transfer to send the last packet */
\r
{
\r
/* Write Keyboard Report Data */
\r
Endpoint_Write_Stream_LE(&KeyboardReportData, sizeof(KeyboardReportData));
\r
\r
/* Finalize the stream transfer to send the last packet */
\r
- Endpoint_Clear
CurrentBank
();
\r
+ Endpoint_Clear
IN
();
\r
\r
/* Clear the report data afterwards */
\r
memset(&KeyboardReportData, 0, sizeof(KeyboardReportData));
\r
\r
/* Clear the report data afterwards */
\r
memset(&KeyboardReportData, 0, sizeof(KeyboardReportData));
\r
@@
-297,7
+291,7
@@
TASK(USB_Keyboard)
Endpoint_SelectEndpoint(KEYBOARD_OUT_EPNUM);
\r
\r
/* Check if Keyboard LED Endpoint Ready for Read/Write */
\r
Endpoint_SelectEndpoint(KEYBOARD_OUT_EPNUM);
\r
\r
/* Check if Keyboard LED Endpoint Ready for Read/Write */
\r
- if (Endpoint_ReadWriteAllowed())
\r
+ if (Endpoint_
Is
ReadWriteAllowed())
\r
{
\r
/* Read in the LED report from the host */
\r
uint8_t LEDStatus = Endpoint_Read_Byte();
\r
{
\r
/* Read in the LED report from the host */
\r
uint8_t LEDStatus = Endpoint_Read_Byte();
\r
@@
-316,7
+310,7
@@
TASK(USB_Keyboard)
LEDs_SetAllLEDs(LEDMask);
\r
\r
/* Handshake the OUT Endpoint - clear endpoint and ready for next report */
\r
LEDs_SetAllLEDs(LEDMask);
\r
\r
/* Handshake the OUT Endpoint - clear endpoint and ready for next report */
\r
- Endpoint_Clear
CurrentBank
();
\r
+ Endpoint_Clear
OUT
();
\r
}
\r
}
\r
}
\r
}
\r
}
\r
}
\r
@@
-352,13
+346,13
@@
TASK(USB_Mouse)
Endpoint_SelectEndpoint(MOUSE_IN_EPNUM);
\r
\r
/* Check if Mouse Endpoint Ready for Read/Write */
\r
Endpoint_SelectEndpoint(MOUSE_IN_EPNUM);
\r
\r
/* Check if Mouse Endpoint Ready for Read/Write */
\r
- if (Endpoint_ReadWriteAllowed())
\r
+ if (Endpoint_
Is
ReadWriteAllowed())
\r
{
\r
/* Write Mouse Report Data */
\r
Endpoint_Write_Stream_LE(&MouseReportData, sizeof(MouseReportData));
\r
\r
/* Finalize the stream transfer to send the last packet */
\r
{
\r
/* Write Mouse Report Data */
\r
Endpoint_Write_Stream_LE(&MouseReportData, sizeof(MouseReportData));
\r
\r
/* Finalize the stream transfer to send the last packet */
\r
- Endpoint_Clear
CurrentBank
();
\r
+ Endpoint_Clear
IN
();
\r
\r
/* Clear the report data afterwards */
\r
memset(&MouseReportData, 0, sizeof(MouseReportData));
\r
\r
/* Clear the report data afterwards */
\r
memset(&MouseReportData, 0, sizeof(MouseReportData));
\r