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
/
Joystick
/
Joystick.c
diff --git
a/Demos/Device/Joystick/Joystick.c
b/Demos/Device/Joystick/Joystick.c
index
cd88227
..
c5d90e7
100644
(file)
--- a/
Demos/Device/Joystick/Joystick.c
+++ b/
Demos/Device/Joystick/Joystick.c
@@
-36,12
+36,6
@@
\r
#include "Joystick.h"
\r
\r
\r
#include "Joystick.h"
\r
\r
-/* Project Tags, for reading out using the ButtLoad project */
\r
-BUTTLOADTAG(ProjName, "LUFA Joystick 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
@@
-151,13
+145,13
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
if (wLength > sizeof(JoystickReportData))
\r
wLength = sizeof(JoystickReportData);
\r
\r
if (wLength > sizeof(JoystickReportData))
\r
wLength = sizeof(JoystickReportData);
\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(&JoystickReportData, wLength);
\r
\r
/* Finalize the stream transfer to send the last packet or clear the host abort */
\r
\r
/* Write the report data to the control endpoint */
\r
Endpoint_Write_Control_Stream_LE(&JoystickReportData, wLength);
\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
@@
-241,8
+235,8
@@
TASK(USB_Joystick_Report)
/* Select the Joystick Report Endpoint */
\r
Endpoint_SelectEndpoint(JOYSTICK_EPNUM);
\r
\r
/* Select the Joystick Report Endpoint */
\r
Endpoint_SelectEndpoint(JOYSTICK_EPNUM);
\r
\r
- /* Check
if Joystick Endpoint Ready for Read/Write
*/
\r
- if (Endpoint_
ReadWriteAllowed
())
\r
+ /* Check
to see if the host is ready for another packet
*/
\r
+ if (Endpoint_
IsINReady
())
\r
{
\r
USB_JoystickReport_Data_t JoystickReportData;
\r
\r
{
\r
USB_JoystickReport_Data_t JoystickReportData;
\r
\r
@@
-253,12
+247,10
@@
TASK(USB_Joystick_Report)
Endpoint_Write_Stream_LE(&JoystickReportData, sizeof(JoystickReportData));
\r
\r
/* Finalize the stream transfer to send the last packet */
\r
Endpoint_Write_Stream_LE(&JoystickReportData, sizeof(JoystickReportData));
\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
\r
/* Clear the report data afterwards */
\r
- JoystickReportData.X = 0;
\r
- JoystickReportData.Y = 0;
\r
- JoystickReportData.Button = 0;
\r
+ memset(&JoystickReportData, 0, sizeof(JoystickReportData));
\r
}
\r
}
\r
}
\r
}
\r
}
\r
}
\r