\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
if (wLength > sizeof(JoystickReportData))\r
wLength = sizeof(JoystickReportData);\r
\r
- Endpoint_ClearSetupReceived();\r
+ Endpoint_ClearControlSETUP();\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_ClearSetupOUT();\r
+ Endpoint_ClearControlOUT();\r
}\r
\r
break;\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
Endpoint_Write_Stream_LE(&JoystickReportData, sizeof(JoystickReportData));\r
\r
/* Finalize the stream transfer to send the last packet */\r
- Endpoint_ClearCurrentBank();\r
+ Endpoint_ClearIN();\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