projects
/
pub
/
USBasp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4a09da2
)
Fixed incorrect/missing control status stage transfers on demos, bootloaders and...
author
Dean Camera
<dean@fourwalledcubicle.com>
Tue, 10 Mar 2009 05:56:17 +0000
(
05:56
+0000)
committer
Dean Camera
<dean@fourwalledcubicle.com>
Tue, 10 Mar 2009 05:56:17 +0000
(
05:56
+0000)
23 files changed:
Bootloaders/CDC/BootloaderCDC.c
patch
|
blob
|
blame
|
history
Bootloaders/DFU/BootloaderDFU.c
patch
|
blob
|
blame
|
history
Bootloaders/TeensyHID/TeensyHID.c
patch
|
blob
|
blame
|
history
Demos/AudioInput/AudioInput.c
patch
|
blob
|
blame
|
history
Demos/AudioOutput/AudioOutput.c
patch
|
blob
|
blame
|
history
Demos/CDC/CDC.c
patch
|
blob
|
blame
|
history
Demos/DualCDC/DualCDC.c
patch
|
blob
|
blame
|
history
Demos/Keyboard/Keyboard.c
patch
|
blob
|
blame
|
history
Demos/KeyboardFullInt/KeyboardFullInt.c
patch
|
blob
|
blame
|
history
Demos/KeyboardMouse/KeyboardMouse.c
patch
|
blob
|
blame
|
history
Demos/KeyboardViaInt/KeyboardViaInt.c
patch
|
blob
|
blame
|
history
Demos/MassStorage/MassStorage.c
patch
|
blob
|
blame
|
history
Demos/Mouse/Mouse.c
patch
|
blob
|
blame
|
history
Demos/MouseFullInt/MouseFullInt.c
patch
|
blob
|
blame
|
history
Demos/MouseViaInt/MouseViaInt.c
patch
|
blob
|
blame
|
history
Demos/USBtoSerial/USBtoSerial.c
patch
|
blob
|
blame
|
history
LUFA/ChangeLog.txt
patch
|
blob
|
blame
|
history
LUFA/Drivers/USB/LowLevel/Endpoint.h
patch
|
blob
|
blame
|
history
LUFA/Drivers/USB/LowLevel/LowLevel.h
patch
|
blob
|
blame
|
history
LUFA/Drivers/USB/LowLevel/Pipe.h
patch
|
blob
|
blame
|
history
LUFA/MigrationInformation.txt
patch
|
blob
|
blame
|
history
Projects/AVRISP_Programmer/AVRISP_Programmer.c
patch
|
blob
|
blame
|
history
Projects/Magstripe/Magstripe.c
patch
|
blob
|
blame
|
history
diff --git
a/Bootloaders/CDC/BootloaderCDC.c
b/Bootloaders/CDC/BootloaderCDC.c
index
60fe4a4
..
0add977
100644
(file)
--- a/
Bootloaders/CDC/BootloaderCDC.c
+++ b/
Bootloaders/CDC/BootloaderCDC.c
@@
-167,6
+167,7
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
\r
Endpoint_ClearSetupIN();
\r
\r
\r
Endpoint_ClearSetupIN();
\r
\r
+ /* Acknowledge status stage */
\r
while (!(Endpoint_IsSetupOUTReceived()));
\r
Endpoint_ClearSetupOUT();
\r
}
\r
while (!(Endpoint_IsSetupOUTReceived()));
\r
Endpoint_ClearSetupOUT();
\r
}
\r
@@
-184,6
+185,7
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
\r
Endpoint_ClearSetupOUT();
\r
\r
\r
Endpoint_ClearSetupOUT();
\r
\r
+ /* Acknowledge status stage */
\r
while (!(Endpoint_IsSetupINReady()));
\r
Endpoint_ClearSetupIN();
\r
}
\r
while (!(Endpoint_IsSetupINReady()));
\r
Endpoint_ClearSetupIN();
\r
}
\r
@@
-194,6
+196,7
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
{
\r
Endpoint_ClearSetupReceived();
\r
\r
{
\r
Endpoint_ClearSetupReceived();
\r
\r
+ /* Acknowledge status stage */
\r
while (!(Endpoint_IsSetupINReady()));
\r
Endpoint_ClearSetupIN();
\r
}
\r
while (!(Endpoint_IsSetupINReady()));
\r
Endpoint_ClearSetupIN();
\r
}
\r
diff --git
a/Bootloaders/DFU/BootloaderDFU.c
b/Bootloaders/DFU/BootloaderDFU.c
index
8cc5fd4
..
9fff20c
100644
(file)
--- a/
Bootloaders/DFU/BootloaderDFU.c
+++ b/
Bootloaders/DFU/BootloaderDFU.c
@@
-57,7
+57,7
@@
bool RunBootloader = true;
\r
/** Flag to indicate if the bootloader is waiting to exit. When the host requests the bootloader to exit and
\r
* jump to the application address it specifies, it sends two sequential commands which must be properly
\r
\r
/** Flag to indicate if the bootloader is waiting to exit. When the host requests the bootloader to exit and
\r
* jump to the application address it specifies, it sends two sequential commands which must be properly
\r
- * acknowedged. Upon reception of the first the RunBootloader flag is cleared and the WaitForExit flag is set,
\r
+ * acknow
l
edged. Upon reception of the first the RunBootloader flag is cleared and the WaitForExit flag is set,
\r
* causing the bootloader to wait for the final exit command before shutting down.
\r
*/
\r
bool WaitForExit = false;
\r
* causing the bootloader to wait for the final exit command before shutting down.
\r
*/
\r
bool WaitForExit = false;
\r
@@
-305,7
+305,8
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
\r
Endpoint_ClearSetupOUT();
\r
\r
\r
Endpoint_ClearSetupOUT();
\r
\r
- /* Send ZLP to the host to acknowedge the request */
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupINReady()));
\r
Endpoint_ClearSetupIN();
\r
\r
break;
\r
Endpoint_ClearSetupIN();
\r
\r
break;
\r
@@
-392,7
+393,7
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
\r
Endpoint_ClearSetupIN();
\r
\r
\r
Endpoint_ClearSetupIN();
\r
\r
- /*
Send ZLP to the host to acknowedge the request
*/
\r
+ /*
Acknowledge status stage
*/
\r
while (!(Endpoint_IsSetupOUTReceived()));
\r
Endpoint_ClearSetupOUT();
\r
\r
while (!(Endpoint_IsSetupOUTReceived()));
\r
Endpoint_ClearSetupOUT();
\r
\r
@@
-415,6
+416,7
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
\r
Endpoint_ClearSetupIN();
\r
\r
\r
Endpoint_ClearSetupIN();
\r
\r
+ /* Acknowledge status stage */
\r
while (!(Endpoint_IsSetupOUTReceived()));
\r
Endpoint_ClearSetupOUT();
\r
\r
while (!(Endpoint_IsSetupOUTReceived()));
\r
Endpoint_ClearSetupOUT();
\r
\r
@@
-424,9
+426,11
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
\r
/* Reset the status value variable to the default OK status */
\r
DFU_Status = OK;
\r
\r
/* Reset the status value variable to the default OK status */
\r
DFU_Status = OK;
\r
-
\r
- Endpoint_ClearSetupIN();
\r
\r
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupINReady()));
\r
+ Endpoint_ClearSetupIN();
\r
+
\r
break;
\r
case DFU_GETSTATE:
\r
Endpoint_ClearSetupReceived();
\r
break;
\r
case DFU_GETSTATE:
\r
Endpoint_ClearSetupReceived();
\r
@@
-436,6
+440,7
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
\r
Endpoint_ClearSetupIN();
\r
\r
\r
Endpoint_ClearSetupIN();
\r
\r
+ /* Acknowledge status stage */
\r
while (!(Endpoint_IsSetupOUTReceived()));
\r
Endpoint_ClearSetupOUT();
\r
\r
while (!(Endpoint_IsSetupOUTReceived()));
\r
Endpoint_ClearSetupOUT();
\r
\r
@@
-446,6
+451,8
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
/* Reset the current state variable to the default idle state */
\r
DFU_State = dfuIDLE;
\r
\r
/* Reset the current state variable to the default idle state */
\r
DFU_State = dfuIDLE;
\r
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupINReady()));
\r
Endpoint_ClearSetupIN();
\r
\r
break;
\r
Endpoint_ClearSetupIN();
\r
\r
break;
\r
diff --git
a/Bootloaders/TeensyHID/TeensyHID.c
b/Bootloaders/TeensyHID/TeensyHID.c
index
fe20702
..
93f0621
100644
(file)
--- a/
Bootloaders/TeensyHID/TeensyHID.c
+++ b/
Bootloaders/TeensyHID/TeensyHID.c
@@
-144,10
+144,8
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
\r
Endpoint_ClearSetupOUT();
\r
\r
\r
Endpoint_ClearSetupOUT();
\r
\r
- /*
Wait until the host is ready to receive the request confirmation
*/
\r
+ /*
Acknowledge status stage
*/
\r
while (!(Endpoint_IsSetupINReady()));
\r
while (!(Endpoint_IsSetupINReady()));
\r
-
\r
- /* Handshake the request by sending an empty IN packet */
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
diff --git
a/Demos/AudioInput/AudioInput.c
b/Demos/AudioInput/AudioInput.c
index
0db41c3
..
6ead7a0
100644
(file)
--- a/
Demos/AudioInput/AudioInput.c
+++ b/
Demos/AudioInput/AudioInput.c
@@
-163,7
+163,8
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
Scheduler_SetTaskMode(USB_Audio_Task, TASK_STOP);
\r
}
\r
\r
Scheduler_SetTaskMode(USB_Audio_Task, TASK_STOP);
\r
}
\r
\r
- /* Handshake the request */
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupINReady()));
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
diff --git
a/Demos/AudioOutput/AudioOutput.c
b/Demos/AudioOutput/AudioOutput.c
index
3d2e324
..
87afd36
100644
(file)
--- a/
Demos/AudioOutput/AudioOutput.c
+++ b/
Demos/AudioOutput/AudioOutput.c
@@
-193,7
+193,8
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
Scheduler_SetTaskMode(USB_Audio_Task, TASK_STOP);
\r
}
\r
\r
Scheduler_SetTaskMode(USB_Audio_Task, TASK_STOP);
\r
}
\r
\r
- /* Handshake the request */
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupINReady()));
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
@@
-249,7
+250,7
@@
TASK(USB_Audio_Task)
/* Check to see if the bank is now empty */
\r
if (!(Endpoint_ReadWriteAllowed()))
\r
{
\r
/* Check to see if the bank is now empty */
\r
if (!(Endpoint_ReadWriteAllowed()))
\r
{
\r
- /* Acknowedge the packet, clear the bank ready for the next packet */
\r
+ /* Acknow
l
edge the packet, clear the bank ready for the next packet */
\r
Endpoint_ClearCurrentBank();
\r
}
\r
\r
Endpoint_ClearCurrentBank();
\r
}
\r
\r
diff --git
a/Demos/CDC/CDC.c
b/Demos/CDC/CDC.c
index
eeae625
..
6e933d5
100644
(file)
--- a/
Demos/CDC/CDC.c
+++ b/
Demos/CDC/CDC.c
@@
-171,7
+171,7
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
case REQ_GetLineEncoding:
\r
if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
case REQ_GetLineEncoding:
\r
if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
- /* Acknowedge the SETUP packet, ready for data transfer */
\r
+ /* Acknow
l
edge the SETUP packet, ready for data transfer */
\r
Endpoint_ClearSetupReceived();
\r
\r
/* Write the line coding data to the control endpoint */
\r
Endpoint_ClearSetupReceived();
\r
\r
/* Write the line coding data to the control endpoint */
\r
@@
-185,7
+185,7
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
case REQ_SetLineEncoding:
\r
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
case REQ_SetLineEncoding:
\r
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
- /* Acknowedge the SETUP packet, ready for data transfer */
\r
+ /* Acknow
l
edge the SETUP packet, ready for data transfer */
\r
Endpoint_ClearSetupReceived();
\r
\r
/* Read the line coding data in from the host into the global struct */
\r
Endpoint_ClearSetupReceived();
\r
\r
/* Read the line coding data in from the host into the global struct */
\r
@@
-210,10
+210,11
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
// Do something with the given line states in wIndex
\r
#endif
\r
\r
// Do something with the given line states in wIndex
\r
#endif
\r
\r
- /* Acknowedge the SETUP packet, ready for data transfer */
\r
+ /* Acknow
l
edge the SETUP packet, ready for data transfer */
\r
Endpoint_ClearSetupReceived();
\r
\r
Endpoint_ClearSetupReceived();
\r
\r
- /* Send an empty packet to acknowedge the command */
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupINReady()));
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
diff --git
a/Demos/DualCDC/DualCDC.c
b/Demos/DualCDC/DualCDC.c
index
8e6e389
..
3c598da
100644
(file)
--- a/
Demos/DualCDC/DualCDC.c
+++ b/
Demos/DualCDC/DualCDC.c
@@
-209,7
+209,7
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
case REQ_GetLineEncoding:
\r
if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
case REQ_GetLineEncoding:
\r
if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
- /* Acknowedge the SETUP packet, ready for data transfer */
\r
+ /* Acknow
l
edge the SETUP packet, ready for data transfer */
\r
Endpoint_ClearSetupReceived();
\r
\r
/* Write the line coding data to the control endpoint */
\r
Endpoint_ClearSetupReceived();
\r
\r
/* Write the line coding data to the control endpoint */
\r
@@
-223,7
+223,7
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
case REQ_SetLineEncoding:
\r
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
case REQ_SetLineEncoding:
\r
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
- /* Acknowedge the SETUP packet, ready for data transfer */
\r
+ /* Acknow
l
edge the SETUP packet, ready for data transfer */
\r
Endpoint_ClearSetupReceived();
\r
\r
/* Read the line coding data in from the host into the global struct */
\r
Endpoint_ClearSetupReceived();
\r
\r
/* Read the line coding data in from the host into the global struct */
\r
@@
-237,10
+237,11
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
case REQ_SetControlLineState:
\r
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
case REQ_SetControlLineState:
\r
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
- /* Acknowedge the SETUP packet, ready for data transfer */
\r
+ /* Acknow
l
edge the SETUP packet, ready for data transfer */
\r
Endpoint_ClearSetupReceived();
\r
\r
Endpoint_ClearSetupReceived();
\r
\r
- /* Send an empty packet to acknowedge the command (currently unused) */
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupINReady()));
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
diff --git
a/Demos/Keyboard/Keyboard.c
b/Demos/Keyboard/Keyboard.c
index
22d406d
..
931f080
100644
(file)
--- a/
Demos/Keyboard/Keyboard.c
+++ b/
Demos/Keyboard/Keyboard.c
@@
-210,10
+210,8
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
/* Clear the endpoint data */
\r
Endpoint_ClearSetupOUT();
\r
\r
/* Clear the endpoint data */
\r
Endpoint_ClearSetupOUT();
\r
\r
- /*
Wait until the host is ready to receive the request confirmation
*/
\r
+ /*
Acknowledge status stage
*/
\r
while (!(Endpoint_IsSetupINReady()));
\r
while (!(Endpoint_IsSetupINReady()));
\r
-
\r
- /* Handshake the request by sending an empty IN packet */
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
@@
-228,6
+226,10
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
\r
/* Send the flag to the host */
\r
Endpoint_ClearSetupIN();
\r
\r
/* Send the flag to the host */
\r
Endpoint_ClearSetupIN();
\r
+
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupOUTReceived()));
\r
+ Endpoint_ClearSetupOUT();
\r
}
\r
\r
break;
\r
}
\r
\r
break;
\r
@@
-242,7
+244,8
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
/* Set or clear the flag depending on what the host indicates that the current Protocol should be */
\r
UsingReportProtocol = (wValue != 0x0000);
\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
- /* Send an empty packet to acknowedge the command */
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupINReady()));
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
@@
-258,7
+261,8
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
/* Get idle period in MSB */
\r
IdleCount = (wValue >> 8);
\r
\r
/* Get idle period in MSB */
\r
IdleCount = (wValue >> 8);
\r
\r
- /* Send an empty packet to acknowedge the command */
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupINReady()));
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
@@
-273,6
+277,10
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
\r
/* Send the flag to the host */
\r
Endpoint_ClearSetupIN();
\r
\r
/* Send the flag to the host */
\r
Endpoint_ClearSetupIN();
\r
+
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupOUTReceived()));
\r
+ Endpoint_ClearSetupOUT();
\r
}
\r
\r
break;
\r
}
\r
\r
break;
\r
diff --git
a/Demos/KeyboardFullInt/KeyboardFullInt.c
b/Demos/KeyboardFullInt/KeyboardFullInt.c
index
ed08137
..
6a15a92
100644
(file)
--- a/
Demos/KeyboardFullInt/KeyboardFullInt.c
+++ b/
Demos/KeyboardFullInt/KeyboardFullInt.c
@@
-212,10
+212,8
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
/* Clear the endpoint data */
\r
Endpoint_ClearSetupOUT();
\r
\r
/* Clear the endpoint data */
\r
Endpoint_ClearSetupOUT();
\r
\r
- /*
Wait until the host is ready to receive the request confirmation
*/
\r
+ /*
Acknowledge status stage
*/
\r
while (!(Endpoint_IsSetupINReady()));
\r
while (!(Endpoint_IsSetupINReady()));
\r
-
\r
- /* Handshake the request by sending an empty IN packet */
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
@@
-230,6
+228,10
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
\r
/* Send the flag to the host */
\r
Endpoint_ClearSetupIN();
\r
\r
/* Send the flag to the host */
\r
Endpoint_ClearSetupIN();
\r
+
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupOUTReceived()));
\r
+ Endpoint_ClearSetupOUT();
\r
}
\r
\r
break;
\r
}
\r
\r
break;
\r
@@
-244,7
+246,8
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
/* Set or clear the flag depending on what the host indicates that the current Protocol should be */
\r
UsingReportProtocol = (wValue != 0x0000);
\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
- /* Send an empty packet to acknowedge the command */
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupINReady()));
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
@@
-260,7
+263,8
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
/* Get idle period in MSB */
\r
IdleCount = (wValue >> 8);
\r
\r
/* Get idle period in MSB */
\r
IdleCount = (wValue >> 8);
\r
\r
- /* Send an empty packet to acknowedge the command */
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupINReady()));
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
@@
-275,6
+279,10
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
\r
/* Send the flag to the host */
\r
Endpoint_ClearSetupIN();
\r
\r
/* Send the flag to the host */
\r
Endpoint_ClearSetupIN();
\r
+
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupOUTReceived()));
\r
+ Endpoint_ClearSetupOUT();
\r
}
\r
\r
break;
\r
}
\r
\r
break;
\r
diff --git
a/Demos/KeyboardMouse/KeyboardMouse.c
b/Demos/KeyboardMouse/KeyboardMouse.c
index
8108a30
..
3ee101b
100644
(file)
--- a/
Demos/KeyboardMouse/KeyboardMouse.c
+++ b/
Demos/KeyboardMouse/KeyboardMouse.c
@@
-213,10
+213,8
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
/* Clear the endpoint data */
\r
Endpoint_ClearSetupOUT();
\r
\r
/* Clear the endpoint data */
\r
Endpoint_ClearSetupOUT();
\r
\r
- /*
Wait until the host is ready to receive the request confirmation
*/
\r
+ /*
Acknowledge status stage
*/
\r
while (!(Endpoint_IsSetupINReady()));
\r
while (!(Endpoint_IsSetupINReady()));
\r
-
\r
- /* Handshake the request by sending an empty IN packet */
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
diff --git
a/Demos/KeyboardViaInt/KeyboardViaInt.c
b/Demos/KeyboardViaInt/KeyboardViaInt.c
index
b66506d
..
1e724e6
100644
(file)
--- a/
Demos/KeyboardViaInt/KeyboardViaInt.c
+++ b/
Demos/KeyboardViaInt/KeyboardViaInt.c
@@
-211,10
+211,8
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
/* Clear the endpoint data */
\r
Endpoint_ClearSetupOUT();
\r
\r
/* Clear the endpoint data */
\r
Endpoint_ClearSetupOUT();
\r
\r
- /*
Wait until the host is ready to receive the request confirmation
*/
\r
+ /*
Acknowledge status stage
*/
\r
while (!(Endpoint_IsSetupINReady()));
\r
while (!(Endpoint_IsSetupINReady()));
\r
-
\r
- /* Handshake the request by sending an empty IN packet */
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
@@
-229,6
+227,10
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
\r
/* Send the flag to the host */
\r
Endpoint_ClearSetupIN();
\r
\r
/* Send the flag to the host */
\r
Endpoint_ClearSetupIN();
\r
+
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupOUTReceived()));
\r
+ Endpoint_ClearSetupOUT();
\r
}
\r
\r
break;
\r
}
\r
\r
break;
\r
@@
-243,7
+245,8
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
/* Set or clear the flag depending on what the host indicates that the current Protocol should be */
\r
UsingReportProtocol = (wValue != 0x0000);
\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
- /* Send an empty packet to acknowedge the command */
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupINReady()));
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
@@
-259,7
+262,8
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
/* Get idle period in MSB */
\r
IdleCount = (wValue >> 8);
\r
\r
/* Get idle period in MSB */
\r
IdleCount = (wValue >> 8);
\r
\r
- /* Send an empty packet to acknowedge the command */
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupINReady()));
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
@@
-274,6
+278,10
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
\r
/* Send the flag to the host */
\r
Endpoint_ClearSetupIN();
\r
\r
/* Send the flag to the host */
\r
Endpoint_ClearSetupIN();
\r
+
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupOUTReceived()));
\r
+ Endpoint_ClearSetupOUT();
\r
}
\r
\r
break;
\r
}
\r
\r
break;
\r
diff --git
a/Demos/MassStorage/MassStorage.c
b/Demos/MassStorage/MassStorage.c
index
34fcee4
..
92e3307
100644
(file)
--- a/
Demos/MassStorage/MassStorage.c
+++ b/
Demos/MassStorage/MassStorage.c
@@
-159,10
+159,13
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
case REQ_MassStorageReset:
\r
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
case REQ_MassStorageReset:
\r
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
- /* Indicate that the current transfer should be aborted */
\r
- IsMassStoreReset = true;
\r
-
\r
Endpoint_ClearSetupReceived();
\r
Endpoint_ClearSetupReceived();
\r
+
\r
+ /* Indicate that the current transfer should be aborted */
\r
+ IsMassStoreReset = true;
\r
+
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupINReady()));
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
@@
-171,9
+174,15
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
/* Indicate to the host the number of supported LUNs (virtual disks) on the device */
\r
if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
/* Indicate to the host the number of supported LUNs (virtual disks) on the device */
\r
- Endpoint_ClearSetupReceived();
\r
+ Endpoint_ClearSetupReceived();
\r
+
\r
Endpoint_Write_Byte(TOTAL_LUNS - 1);
\r
Endpoint_Write_Byte(TOTAL_LUNS - 1);
\r
+
\r
Endpoint_ClearSetupIN();
\r
Endpoint_ClearSetupIN();
\r
+
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupOUTReceived()));
\r
+ Endpoint_ClearSetupOUT();
\r
}
\r
\r
break;
\r
}
\r
\r
break;
\r
diff --git
a/Demos/Mouse/Mouse.c
b/Demos/Mouse/Mouse.c
index
3e59706
..
da8a4a8
100644
(file)
--- a/
Demos/Mouse/Mouse.c
+++ b/
Demos/Mouse/Mouse.c
@@
-201,6
+201,10
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
\r
/* Send the flag to the host */
\r
Endpoint_ClearSetupIN();
\r
\r
/* Send the flag to the host */
\r
Endpoint_ClearSetupIN();
\r
+
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupOUTReceived()));
\r
+ Endpoint_ClearSetupOUT();
\r
}
\r
\r
break;
\r
}
\r
\r
break;
\r
@@
-215,7
+219,8
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
/* Set or clear the flag depending on what the host indicates that the current Protocol should be */
\r
UsingReportProtocol = (wValue != 0x0000);
\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
- /* Send an empty packet to acknowedge the command */
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupINReady()));
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
@@
-231,7
+236,8
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
/* Get idle period in MSB */
\r
IdleCount = (wValue >> 8);
\r
\r
/* Get idle period in MSB */
\r
IdleCount = (wValue >> 8);
\r
\r
- /* Send an empty packet to acknowedge the command */
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupINReady()));
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
@@
-246,6
+252,10
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
\r
/* Send the flag to the host */
\r
Endpoint_ClearSetupIN();
\r
\r
/* Send the flag to the host */
\r
Endpoint_ClearSetupIN();
\r
+
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupOUTReceived()));
\r
+ Endpoint_ClearSetupOUT();
\r
}
\r
\r
break;
\r
}
\r
\r
break;
\r
diff --git
a/Demos/MouseFullInt/MouseFullInt.c
b/Demos/MouseFullInt/MouseFullInt.c
index
98782b6
..
7e69d81
100644
(file)
--- a/
Demos/MouseFullInt/MouseFullInt.c
+++ b/
Demos/MouseFullInt/MouseFullInt.c
@@
-200,6
+200,10
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
\r
/* Send the flag to the host */
\r
Endpoint_ClearSetupIN();
\r
\r
/* Send the flag to the host */
\r
Endpoint_ClearSetupIN();
\r
+
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupOUTReceived()));
\r
+ Endpoint_ClearSetupOUT();
\r
}
\r
\r
break;
\r
}
\r
\r
break;
\r
@@
-214,7
+218,8
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
/* Set or clear the flag depending on what the host indicates that the current Protocol should be */
\r
UsingReportProtocol = (wValue != 0x0000);
\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
- /* Send an empty packet to acknowedge the command */
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupINReady()));
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
@@
-230,7
+235,8
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
/* Get idle period in MSB */
\r
IdleCount = (wValue >> 8);
\r
\r
/* Get idle period in MSB */
\r
IdleCount = (wValue >> 8);
\r
\r
- /* Send an empty packet to acknowedge the command */
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupINReady()));
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
@@
-245,6
+251,10
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
\r
/* Send the flag to the host */
\r
Endpoint_ClearSetupIN();
\r
\r
/* Send the flag to the host */
\r
Endpoint_ClearSetupIN();
\r
+
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupOUTReceived()));
\r
+ Endpoint_ClearSetupOUT();
\r
}
\r
\r
break;
\r
}
\r
\r
break;
\r
diff --git
a/Demos/MouseViaInt/MouseViaInt.c
b/Demos/MouseViaInt/MouseViaInt.c
index
445fb49
..
465459a
100644
(file)
--- a/
Demos/MouseViaInt/MouseViaInt.c
+++ b/
Demos/MouseViaInt/MouseViaInt.c
@@
-198,6
+198,10
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
\r
/* Send the flag to the host */
\r
Endpoint_ClearSetupIN();
\r
\r
/* Send the flag to the host */
\r
Endpoint_ClearSetupIN();
\r
+
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupOUTReceived()));
\r
+ Endpoint_ClearSetupOUT();
\r
}
\r
\r
break;
\r
}
\r
\r
break;
\r
@@
-212,7
+216,8
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
/* Set or clear the flag depending on what the host indicates that the current Protocol should be */
\r
UsingReportProtocol = (wValue != 0x0000);
\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
- /* Send an empty packet to acknowedge the command */
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupINReady()));
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
@@
-228,7
+233,8
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
/* Get idle period in MSB */
\r
IdleCount = (wValue >> 8);
\r
\r
/* Get idle period in MSB */
\r
IdleCount = (wValue >> 8);
\r
\r
- /* Send an empty packet to acknowedge the command */
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupINReady()));
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
@@
-243,6
+249,10
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
\r
/* Send the flag to the host */
\r
Endpoint_ClearSetupIN();
\r
\r
/* Send the flag to the host */
\r
Endpoint_ClearSetupIN();
\r
+
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupOUTReceived()));
\r
+ Endpoint_ClearSetupOUT();
\r
}
\r
\r
break;
\r
}
\r
\r
break;
\r
diff --git
a/Demos/USBtoSerial/USBtoSerial.c
b/Demos/USBtoSerial/USBtoSerial.c
index
0495826
..
c7c9e4b
100644
(file)
--- a/
Demos/USBtoSerial/USBtoSerial.c
+++ b/
Demos/USBtoSerial/USBtoSerial.c
@@
-164,7
+164,7
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
case REQ_GetLineEncoding:
\r
if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
case REQ_GetLineEncoding:
\r
if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
- /* Acknowedge the SETUP packet, ready for data transfer */
\r
+ /* Acknow
l
edge the SETUP packet, ready for data transfer */
\r
Endpoint_ClearSetupReceived();
\r
\r
/* Write the line coding data to the control endpoint */
\r
Endpoint_ClearSetupReceived();
\r
\r
/* Write the line coding data to the control endpoint */
\r
@@
-178,7
+178,7
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
case REQ_SetLineEncoding:
\r
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
case REQ_SetLineEncoding:
\r
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
- /* Acknowedge the SETUP packet, ready for data transfer */
\r
+ /* Acknow
l
edge the SETUP packet, ready for data transfer */
\r
Endpoint_ClearSetupReceived();
\r
\r
/* Read the line coding data in from the host into the global struct */
\r
Endpoint_ClearSetupReceived();
\r
\r
/* Read the line coding data in from the host into the global struct */
\r
@@
-206,10
+206,11
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
// Do something with the given line states in wIndex
\r
#endif
\r
\r
// Do something with the given line states in wIndex
\r
#endif
\r
\r
- /* Acknowedge the SETUP packet, ready for data transfer */
\r
+ /* Acknow
l
edge the SETUP packet, ready for data transfer */
\r
Endpoint_ClearSetupReceived();
\r
\r
Endpoint_ClearSetupReceived();
\r
\r
- /* Send an empty packet to acknowedge the command */
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupINReady()));
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
diff --git
a/LUFA/ChangeLog.txt
b/LUFA/ChangeLog.txt
index
1a2b9f8
..
d283d7f
100644
(file)
--- a/
LUFA/ChangeLog.txt
+++ b/
LUFA/ChangeLog.txt
@@
-29,13
+29,15
@@
* - Function attribute ATTR_ALWAYSINLINE renamed to ATTR_ALWAYS_INLINE to match other function attribute macro naming conventions
\r
* - Added ATTR_ALWAYS_INLINE attribute to several key inlined library components, to ensure they are inlined in all circumstances
\r
* - Removed SetSystemClockPrescaler() macro, the clock_prescale_set() avr-libc macro has been corrected in recent avr-libc versions
\r
* - Function attribute ATTR_ALWAYSINLINE renamed to ATTR_ALWAYS_INLINE to match other function attribute macro naming conventions
\r
* - Added ATTR_ALWAYS_INLINE attribute to several key inlined library components, to ensure they are inlined in all circumstances
\r
* - Removed SetSystemClockPrescaler() macro, the clock_prescale_set() avr-libc macro has been corrected in recent avr-libc versions
\r
+ * - Fixed incorrect/missing control status stage transfers on demos, bootloaders and applications (thanks to Nate Lawson)
\r
*
\r
* \section Sec_ChangeLog090209 Version 090209
\r
*
\r
* - PWM timer mode in AudioOut demo changed to Fast PWM for speed
\r
* - Updated Magstripe project to work with the latest hardware revision
\r
* - Fixed library not responding to the BCERRI flag correctly in host mode, leading to device lockups
\r
*
\r
* \section Sec_ChangeLog090209 Version 090209
\r
*
\r
* - PWM timer mode in AudioOut demo changed to Fast PWM for speed
\r
* - Updated Magstripe project to work with the latest hardware revision
\r
* - Fixed library not responding to the BCERRI flag correctly in host mode, leading to device lockups
\r
- * - Fixed library handling Get Descriptor requests when not addressed as standard requests to the device or interface
\r
+ * - Fixed library handling Get Descriptor requests when not addressed as standard requests to the device or interface (thanks to
\r
+ * Nate Lawson)
\r
* - Fixed serious data corruption issue in MassStorage demo dataflash write routine
\r
* - Added new NO_CLEARSET_FEATURE_REQUEST compile time token
\r
* - USB task now restores previous global interrupt state after execution, rather than forcing global interrupts to be enabled
\r
* - Fixed serious data corruption issue in MassStorage demo dataflash write routine
\r
* - Added new NO_CLEARSET_FEATURE_REQUEST compile time token
\r
* - USB task now restores previous global interrupt state after execution, rather than forcing global interrupts to be enabled
\r
@@
-326,7
+328,7
@@
* - Added Endpoint_Read_Stream, Endpoint_Write_Stream, Pipe_Read_Stream and Pipe_Write_Stream functions
\r
* (including Big and Little Endian variants)
\r
* - Made Dataflash functions inline for speed, removed now empty Dataflash.c driver file
\r
* - Added Endpoint_Read_Stream, Endpoint_Write_Stream, Pipe_Read_Stream and Pipe_Write_Stream functions
\r
* (including Big and Little Endian variants)
\r
* - Made Dataflash functions inline for speed, removed now empty Dataflash.c driver file
\r
- * - Added new SetSystemClockPrescaler() macro
- thanks to Joerg Wunsch
\r
+ * - Added new SetSystemClockPrescaler() macro
(thanks to Joerg Wunsch)
\r
* - Fixed Endpoint_ClearStall() to function correctly on full USB controller AVRs (AT90USBXXX6/7)
\r
* - Endpoint_Setup_In_Clear() and Endpoint_Setup_Out_Clear() no longer set FIFOCON, in line with the
\r
* directives in the datasheet
\r
* - Fixed Endpoint_ClearStall() to function correctly on full USB controller AVRs (AT90USBXXX6/7)
\r
* - Endpoint_Setup_In_Clear() and Endpoint_Setup_Out_Clear() no longer set FIFOCON, in line with the
\r
* directives in the datasheet
\r
diff --git
a/LUFA/Drivers/USB/LowLevel/Endpoint.h
b/LUFA/Drivers/USB/LowLevel/Endpoint.h
index
d1ad131
..
1626686
100644
(file)
--- a/
LUFA/Drivers/USB/LowLevel/Endpoint.h
+++ b/
LUFA/Drivers/USB/LowLevel/Endpoint.h
@@
-256,7
+256,7
@@
/** Sends an IN packet to the host on the currently selected CONTROL type endpoint. */
\r
#define Endpoint_ClearSetupIN() MACROS{ UEINTX &= ~(1 << TXINI); }MACROE
\r
\r
/** Sends an IN packet to the host on the currently selected CONTROL type endpoint. */
\r
#define Endpoint_ClearSetupIN() MACROS{ UEINTX &= ~(1 << TXINI); }MACROE
\r
\r
- /** Acknowedges an OUT packet to the host on the currently selected CONTROL type endpoint, freeing
\r
+ /** Acknow
l
edges an OUT packet to the host on the currently selected CONTROL type endpoint, freeing
\r
* up the endpoint for the next packet.
\r
*/
\r
#define Endpoint_ClearSetupOUT() MACROS{ UEINTX &= ~(1 << RXOUTI); }MACROE
\r
* up the endpoint for the next packet.
\r
*/
\r
#define Endpoint_ClearSetupOUT() MACROS{ UEINTX &= ~(1 << RXOUTI); }MACROE
\r
@@
-667,7
+667,7
@@
) ATTR_NON_NULL_PTR_ARG(1);
\r
\r
/** Writes the given number of bytes to the CONTROL type endpoint from the given buffer in little endian,
\r
) ATTR_NON_NULL_PTR_ARG(1);
\r
\r
/** Writes the given number of bytes to the CONTROL type endpoint from the given buffer in little endian,
\r
- * sending full packets to the host as needed. The host OUT acknowedgement is not automatically cleared
\r
+ * sending full packets to the host as needed. The host OUT acknow
l
edgement is not automatically cleared
\r
* in both failure and success states; the user is responsible for manually clearing the setup OUT to
\r
* finalize the transfer via the Endpoint_ClearSetupOUT() macro.
\r
*
\r
* in both failure and success states; the user is responsible for manually clearing the setup OUT to
\r
* finalize the transfer via the Endpoint_ClearSetupOUT() macro.
\r
*
\r
@@
-684,7
+684,7
@@
uint8_t Endpoint_Write_Control_Stream_LE(const void* Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
\r
\r
/** Writes the given number of bytes to the CONTROL type endpoint from the given buffer in big endian,
\r
uint8_t Endpoint_Write_Control_Stream_LE(const void* Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
\r
\r
/** Writes the given number of bytes to the CONTROL type endpoint from the given buffer in big endian,
\r
- * sending full packets to the host as needed. The host OUT acknowedgement is not automatically cleared
\r
+ * sending full packets to the host as needed. The host OUT acknow
l
edgement is not automatically cleared
\r
* in both failure and success states; the user is responsible for manually clearing the setup OUT to
\r
* finalize the transfer via the Endpoint_ClearSetupOUT() macro.
\r
*
\r
* in both failure and success states; the user is responsible for manually clearing the setup OUT to
\r
* finalize the transfer via the Endpoint_ClearSetupOUT() macro.
\r
*
\r
@@
-701,7
+701,7
@@
uint8_t Endpoint_Write_Control_Stream_BE(const void* Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
\r
\r
/** Reads the given number of bytes from the CONTROL endpoint from the given buffer in little endian,
\r
uint8_t Endpoint_Write_Control_Stream_BE(const void* Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
\r
\r
/** Reads the given number of bytes from the CONTROL endpoint from the given buffer in little endian,
\r
- * discarding fully read packets from the host as needed. The device IN acknowedgement is not
\r
+ * discarding fully read packets from the host as needed. The device IN acknow
l
edgement is not
\r
* automatically sent after success or failure states; the user is responsible for manually sending the
\r
* setup IN to finalize the transfer via the Endpoint_ClearSetupIN() macro.
\r
*
\r
* automatically sent after success or failure states; the user is responsible for manually sending the
\r
* setup IN to finalize the transfer via the Endpoint_ClearSetupIN() macro.
\r
*
\r
@@
-718,7
+718,7
@@
uint8_t Endpoint_Read_Control_Stream_LE(void* Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
\r
\r
/** Reads the given number of bytes from the CONTROL endpoint from the given buffer in big endian,
\r
uint8_t Endpoint_Read_Control_Stream_LE(void* Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
\r
\r
/** Reads the given number of bytes from the CONTROL endpoint from the given buffer in big endian,
\r
- * discarding fully read packets from the host as needed. The device IN acknowedgement is not
\r
+ * discarding fully read packets from the host as needed. The device IN acknow
l
edgement is not
\r
* automatically sent after success or failure states; the user is responsible for manually sending the
\r
* setup IN to finalize the transfer via the Endpoint_ClearSetupIN() macro.
\r
*
\r
* automatically sent after success or failure states; the user is responsible for manually sending the
\r
* setup IN to finalize the transfer via the Endpoint_ClearSetupIN() macro.
\r
*
\r
diff --git
a/LUFA/Drivers/USB/LowLevel/LowLevel.h
b/LUFA/Drivers/USB/LowLevel/LowLevel.h
index
9721bac
..
98deaac
100644
(file)
--- a/
LUFA/Drivers/USB/LowLevel/LowLevel.h
+++ b/
LUFA/Drivers/USB/LowLevel/LowLevel.h
@@
-205,7
+205,7
@@
#if !defined(USB_STREAM_TIMEOUT_MS) || defined(__DOXYGEN__)
\r
/** Constant for the maximum software timeout period of the USB data stream transfer functions
\r
* (both control and standard) when in either device or host mode. If the next packet of a stream
\r
#if !defined(USB_STREAM_TIMEOUT_MS) || defined(__DOXYGEN__)
\r
/** Constant for the maximum software timeout period of the USB data stream transfer functions
\r
* (both control and standard) when in either device or host mode. If the next packet of a stream
\r
- * is not received or acknowedged within this time period, the stream function will fail.
\r
+ * is not received or acknow
l
edged within this time period, the stream function will fail.
\r
*
\r
* This value may be overridden in the user project makefile as the value of the
\r
* USB_STREAM_TIMEOUT_MS token, and passed to the compiler using the -D switch.
\r
*
\r
* This value may be overridden in the user project makefile as the value of the
\r
* USB_STREAM_TIMEOUT_MS token, and passed to the compiler using the -D switch.
\r
diff --git
a/LUFA/Drivers/USB/LowLevel/Pipe.h
b/LUFA/Drivers/USB/LowLevel/Pipe.h
index
f7d10bc
..
5d4793e
100644
(file)
--- a/
LUFA/Drivers/USB/LowLevel/Pipe.h
+++ b/
LUFA/Drivers/USB/LowLevel/Pipe.h
@@
-347,7
+347,7
@@
*/
\r
#define Pipe_IsSetupOUTReady() ((UPINTX & (1 << TXOUTI)) ? true : false)
\r
\r
*/
\r
#define Pipe_IsSetupOUTReady() ((UPINTX & (1 << TXOUTI)) ? true : false)
\r
\r
- /** Acknowedges the reception of a setup IN request from the attached device on the currently selected
\r
+ /** Acknow
l
edges the reception of a setup IN request from the attached device on the currently selected
\r
* CONTROL type endpoint, allowing for the transmission of a setup OUT packet, or the reception of
\r
* another setup IN packet.
\r
*/
\r
* CONTROL type endpoint, allowing for the transmission of a setup OUT packet, or the reception of
\r
* another setup IN packet.
\r
*/
\r
@@
-356,7
+356,7
@@
/** Sends the currently selected CONTROL type pipe's contents to the device as a setup OUT packet. */
\r
#define Pipe_ClearSetupOUT() MACROS{ UPINTX &= ~(1 << TXOUTI); UPINTX &= ~(1 << FIFOCON); }MACROE
\r
\r
/** Sends the currently selected CONTROL type pipe's contents to the device as a setup OUT packet. */
\r
#define Pipe_ClearSetupOUT() MACROS{ UPINTX &= ~(1 << TXOUTI); UPINTX &= ~(1 << FIFOCON); }MACROE
\r
\r
- /** Returns true if the device sent a NAK (Negative Acknowedge) in response to the last sent packet on
\r
+ /** Returns true if the device sent a NAK (Negative Acknow
l
edge) in response to the last sent packet on
\r
* the currently selected pipe. This ocurrs when the host sends a packet to the device, but the device
\r
* is not currently ready to handle the packet (i.e. its endpoint banks are full). Once a NAK has been
\r
* received, it must be cleard using Pipe_ClearNAKReceived() before the previous (or any other) packet
\r
* the currently selected pipe. This ocurrs when the host sends a packet to the device, but the device
\r
* is not currently ready to handle the packet (i.e. its endpoint banks are full). Once a NAK has been
\r
* received, it must be cleard using Pipe_ClearNAKReceived() before the previous (or any other) packet
\r
diff --git
a/LUFA/MigrationInformation.txt
b/LUFA/MigrationInformation.txt
index
364f09c
..
75b5d19
100644
(file)
--- a/
LUFA/MigrationInformation.txt
+++ b/
LUFA/MigrationInformation.txt
@@
-22,6
+22,9
@@
*
\r
* <b>Library Demos</b>
\r
* - The USBtoSerial demo now discards all data when not connected to a host, rather than buffering it for later transmission.
\r
*
\r
* <b>Library Demos</b>
\r
* - The USBtoSerial demo now discards all data when not connected to a host, rather than buffering it for later transmission.
\r
+ * - Most demos, bootloaders and applications have had their control request handling code corrected, to properly send the status
\r
+ * stage in all handled requests. If you are using code based off one of the library demos, bootloaders or applications, you should
\r
+ * update to the latest revisions.
\r
*
\r
* <b>Non-USB Library Components</b>
\r
* - The ATTR_ALWAYSINLINE function attribute macro has been renamed to ATTR_ALWAYS_INLINE.
\r
*
\r
* <b>Non-USB Library Components</b>
\r
* - The ATTR_ALWAYSINLINE function attribute macro has been renamed to ATTR_ALWAYS_INLINE.
\r
diff --git
a/Projects/AVRISP_Programmer/AVRISP_Programmer.c
b/Projects/AVRISP_Programmer/AVRISP_Programmer.c
index
4bc4f9c
..
5859367
100644
(file)
--- a/
Projects/AVRISP_Programmer/AVRISP_Programmer.c
+++ b/
Projects/AVRISP_Programmer/AVRISP_Programmer.c
@@
-267,7
+267,7
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
case REQ_GetLineEncoding:
\r
if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
case REQ_GetLineEncoding:
\r
if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
- /* Acknowedge the SETUP packet, ready for data transfer */
\r
+ /* Acknow
l
edge the SETUP packet, ready for data transfer */
\r
Endpoint_ClearSetupReceived();
\r
\r
/* Write the line coding data to the control endpoint */
\r
Endpoint_ClearSetupReceived();
\r
\r
/* Write the line coding data to the control endpoint */
\r
@@
-281,7
+281,7
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
case REQ_SetLineEncoding:
\r
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
case REQ_SetLineEncoding:
\r
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
- /* Acknowedge the SETUP packet, ready for data transfer */
\r
+ /* Acknow
l
edge the SETUP packet, ready for data transfer */
\r
Endpoint_ClearSetupReceived();
\r
\r
/* Read the line coding data in from the host into the global struct */
\r
Endpoint_ClearSetupReceived();
\r
\r
/* Read the line coding data in from the host into the global struct */
\r
@@
-298,10
+298,11
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
case REQ_SetControlLineState:
\r
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
case REQ_SetControlLineState:
\r
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
- /* Acknowedge the SETUP packet, ready for data transfer */
\r
+ /* Acknow
l
edge the SETUP packet, ready for data transfer */
\r
Endpoint_ClearSetupReceived();
\r
\r
Endpoint_ClearSetupReceived();
\r
\r
- /* Send an empty packet to acknowedge the command */
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupINReady()));
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
diff --git
a/Projects/Magstripe/Magstripe.c
b/Projects/Magstripe/Magstripe.c
index
2826c14
..
0e10053
100644
(file)
--- a/
Projects/Magstripe/Magstripe.c
+++ b/
Projects/Magstripe/Magstripe.c
@@
-204,6
+204,10
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
\r
/* Send the flag to the host */
\r
Endpoint_ClearSetupIN();
\r
\r
/* Send the flag to the host */
\r
Endpoint_ClearSetupIN();
\r
+
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupOUTReceived()));
\r
+ Endpoint_ClearSetupOUT();
\r
}
\r
\r
break;
\r
}
\r
\r
break;
\r
@@
-218,7
+222,8
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
/* Set or clear the flag depending on what the host indicates that the current Protocol should be */
\r
UsingReportProtocol = (wValue != 0x0000);
\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
- /* Send an empty packet to acknowedge the command */
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupINReady()));
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
@@
-234,7
+239,8
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
/* Get idle period in MSB */
\r
IdleCount = (wValue >> 8);
\r
\r
/* Get idle period in MSB */
\r
IdleCount = (wValue >> 8);
\r
\r
- /* Send an empty packet to acknowedge the command */
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupINReady()));
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
Endpoint_ClearSetupIN();
\r
}
\r
\r
@@
-249,6
+255,10
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
\r
/* Send the flag to the host */
\r
Endpoint_ClearSetupIN();
\r
\r
/* Send the flag to the host */
\r
Endpoint_ClearSetupIN();
\r
+
\r
+ /* Acknowledge status stage */
\r
+ while (!(Endpoint_IsSetupOUTReceived()));
\r
+ Endpoint_ClearSetupOUT();
\r
}
\r
\r
break;
\r
}
\r
\r
break;
\r