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]
/
Projects
/
Magstripe
/
Magstripe.c
diff --git
a/Projects/Magstripe/Magstripe.c
b/Projects/Magstripe/Magstripe.c
index
9368117
..
9132a80
100644
(file)
--- a/
Projects/Magstripe/Magstripe.c
+++ b/
Projects/Magstripe/Magstripe.c
@@
-37,12
+37,6
@@
\r
#include "Magstripe.h"
\r
\r
\r
#include "Magstripe.h"
\r
\r
-/* Project Tags, for reading out using the ButtLoad project */
\r
-BUTTLOADTAG(ProjName, "Magstripe Reader");
\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
@@
-184,30
+178,30
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
if (wLength > sizeof(KeyboardReportData))
\r
wLength = sizeof(KeyboardReportData);
\r
\r
if (wLength > sizeof(KeyboardReportData))
\r
wLength = sizeof(KeyboardReportData);
\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(&KeyboardReportData, 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(&KeyboardReportData, 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
case REQ_GetProtocol:
\r
if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
}
\r
\r
break;
\r
case REQ_GetProtocol:
\r
if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
- Endpoint_Clear
SetupReceived
();
\r
+ Endpoint_Clear
ControlSETUP
();
\r
\r
/* Write the current protocol flag to the host */
\r
Endpoint_Write_Byte(UsingReportProtocol);
\r
\r
/* Send the flag to the host */
\r
\r
/* Write the current protocol flag to the host */
\r
Endpoint_Write_Byte(UsingReportProtocol);
\r
\r
/* Send the flag to the host */
\r
- Endpoint_Clear
Setup
IN();
\r
+ Endpoint_Clear
Control
IN();
\r
\r
/* Acknowledge status stage */
\r
\r
/* Acknowledge status stage */
\r
- while (!(Endpoint_Is
Setup
OUTReceived()));
\r
- Endpoint_Clear
Setup
OUT();
\r
+ while (!(Endpoint_IsOUTReceived()));
\r
+ Endpoint_Clear
Control
OUT();
\r
}
\r
\r
break;
\r
}
\r
\r
break;
\r
@@
-217,14
+211,14
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
/* Read in the wValue parameter containing the new protocol mode */
\r
uint16_t wValue = Endpoint_Read_Word_LE();
\r
\r
/* Read in the wValue parameter containing the new protocol mode */
\r
uint16_t wValue = Endpoint_Read_Word_LE();
\r
\r
- Endpoint_Clear
SetupReceived
();
\r
+ Endpoint_Clear
ControlSETUP
();
\r
\r
/* Set or clear the flag depending on what the host indicates that the current Protocol should be */
\r
UsingReportProtocol = (wValue != 0x0000);
\r
\r
/* Acknowledge status stage */
\r
\r
/* Set or clear the flag depending on what the host indicates that the current Protocol should be */
\r
UsingReportProtocol = (wValue != 0x0000);
\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
@@
-234,31
+228,31
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
/* Read in the wValue parameter containing the idle period */
\r
uint16_t wValue = Endpoint_Read_Word_LE();
\r
\r
/* Read in the wValue parameter containing the idle period */
\r
uint16_t wValue = Endpoint_Read_Word_LE();
\r
\r
- Endpoint_Clear
SetupReceived
();
\r
+ Endpoint_Clear
ControlSETUP
();
\r
\r
/* Get idle period in MSB */
\r
IdleCount = (wValue >> 8);
\r
\r
/* Acknowledge status stage */
\r
\r
/* Get idle period in MSB */
\r
IdleCount = (wValue >> 8);
\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
case REQ_GetIdle:
\r
if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
}
\r
\r
break;
\r
case REQ_GetIdle:
\r
if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
- Endpoint_Clear
SetupReceived
();
\r
+ Endpoint_Clear
ControlSETUP
();
\r
\r
/* Write the current idle duration to the host */
\r
Endpoint_Write_Byte(IdleCount);
\r
\r
/* Send the flag to the host */
\r
\r
/* Write the current idle duration to the host */
\r
Endpoint_Write_Byte(IdleCount);
\r
\r
/* Send the flag to the host */
\r
- Endpoint_Clear
Setup
IN();
\r
+ Endpoint_Clear
Control
IN();
\r
\r
/* Acknowledge status stage */
\r
\r
/* Acknowledge status stage */
\r
- while (!(Endpoint_Is
Setup
OUTReceived()));
\r
- Endpoint_Clear
Setup
OUT();
\r
+ while (!(Endpoint_IsOUTReceived()));
\r
+ Endpoint_Clear
Control
OUT();
\r
}
\r
\r
break;
\r
}
\r
\r
break;
\r
@@
-410,7
+404,7
@@
TASK(USB_Keyboard_Report)
Endpoint_SelectEndpoint(KEYBOARD_EPNUM);
\r
\r
/* Check if Keyboard Endpoint Ready for Read/Write */
\r
Endpoint_SelectEndpoint(KEYBOARD_EPNUM);
\r
\r
/* Check if Keyboard Endpoint Ready for Read/Write */
\r
- if (Endpoint_ReadWriteAllowed())
\r
+ if (Endpoint_
Is
ReadWriteAllowed())
\r
{
\r
/* Only fetch the next key to send once the period between key presses has elapsed */
\r
if (!(KeyDelayRemaining))
\r
{
\r
/* Only fetch the next key to send once the period between key presses has elapsed */
\r
if (!(KeyDelayRemaining))
\r
@@
-436,7
+430,7
@@
TASK(USB_Keyboard_Report)
Endpoint_Write_Stream_LE(&KeyboardReportData, sizeof(USB_KeyboardReport_Data_t));
\r
\r
/* Finalize the stream transfer to send the last packet */
\r
Endpoint_Write_Stream_LE(&KeyboardReportData, sizeof(USB_KeyboardReport_Data_t));
\r
\r
/* Finalize the stream transfer to send the last packet */
\r
- Endpoint_Clear
CurrentBank
();
\r
+ Endpoint_Clear
IN
();
\r
\r
/* Reset the key delay period counter */
\r
KeyDelayRemaining = 2;
\r
\r
/* Reset the key delay period counter */
\r
KeyDelayRemaining = 2;
\r