\r
Endpoint_ClearSetupIN();\r
\r
+ /* Acknowledge status stage */\r
while (!(Endpoint_IsSetupOUTReceived()));\r
Endpoint_ClearSetupOUT();\r
}\r
\r
Endpoint_ClearSetupOUT();\r
\r
+ /* Acknowledge status stage */\r
while (!(Endpoint_IsSetupINReady()));\r
Endpoint_ClearSetupIN();\r
}\r
{\r
Endpoint_ClearSetupReceived();\r
\r
+ /* Acknowledge status stage */\r
while (!(Endpoint_IsSetupINReady()));\r
Endpoint_ClearSetupIN();\r
}\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
+ * acknowledged. 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
\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
\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
\r
Endpoint_ClearSetupIN();\r
\r
+ /* Acknowledge status stage */\r
while (!(Endpoint_IsSetupOUTReceived()));\r
Endpoint_ClearSetupOUT();\r
\r
\r
/* Reset the status value variable to the default OK status */\r
DFU_Status = OK;\r
- \r
- Endpoint_ClearSetupIN();\r
\r
+ /* Acknowledge status stage */\r
+ while (!(Endpoint_IsSetupINReady()));\r
+ Endpoint_ClearSetupIN();\r
+ \r
break;\r
case DFU_GETSTATE:\r
Endpoint_ClearSetupReceived();\r
\r
Endpoint_ClearSetupIN();\r
\r
+ /* Acknowledge status stage */\r
while (!(Endpoint_IsSetupOUTReceived()));\r
Endpoint_ClearSetupOUT();\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
\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
- \r
- /* Handshake the request by sending an empty IN packet */\r
Endpoint_ClearSetupIN();\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
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
/* 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
+ /* Acknowledge the packet, clear the bank ready for the next packet */\r
Endpoint_ClearCurrentBank();\r
}\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
+ /* Acknowledge the SETUP packet, ready for data transfer */\r
Endpoint_ClearSetupReceived();\r
\r
/* Write the line coding data to the control endpoint */\r
case REQ_SetLineEncoding:\r
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
{\r
- /* Acknowedge the SETUP packet, ready for data transfer */\r
+ /* Acknowledge 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
// Do something with the given line states in wIndex\r
#endif\r
\r
- /* Acknowedge the SETUP packet, ready for data transfer */\r
+ /* Acknowledge the SETUP packet, ready for data transfer */\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
case REQ_GetLineEncoding:\r
if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))\r
{ \r
- /* Acknowedge the SETUP packet, ready for data transfer */\r
+ /* Acknowledge the SETUP packet, ready for data transfer */\r
Endpoint_ClearSetupReceived();\r
\r
/* Write the line coding data to the control endpoint */\r
case REQ_SetLineEncoding:\r
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
{\r
- /* Acknowedge the SETUP packet, ready for data transfer */\r
+ /* Acknowledge 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
case REQ_SetControlLineState:\r
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
{\r
- /* Acknowedge the SETUP packet, ready for data transfer */\r
+ /* Acknowledge the SETUP packet, ready for data transfer */\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
/* 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
- \r
- /* Handshake the request by sending an empty IN packet */\r
Endpoint_ClearSetupIN();\r
}\r
\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
/* 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
/* 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
\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
/* 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
- \r
- /* Handshake the request by sending an empty IN packet */\r
Endpoint_ClearSetupIN();\r
}\r
\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
/* 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
/* 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
\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
/* 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
- \r
- /* Handshake the request by sending an empty IN packet */\r
Endpoint_ClearSetupIN();\r
}\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
- \r
- /* Handshake the request by sending an empty IN packet */\r
Endpoint_ClearSetupIN();\r
}\r
\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
/* 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
/* 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
\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
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
+\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
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
+ \r
Endpoint_ClearSetupIN();\r
+ \r
+ /* Acknowledge status stage */\r
+ while (!(Endpoint_IsSetupOUTReceived()));\r
+ Endpoint_ClearSetupOUT();\r
}\r
\r
break;\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
/* 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
/* 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
\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
/* 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
/* 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
/* 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
\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
/* 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
/* 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
/* 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
\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
case REQ_GetLineEncoding:\r
if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))\r
{ \r
- /* Acknowedge the SETUP packet, ready for data transfer */\r
+ /* Acknowledge the SETUP packet, ready for data transfer */\r
Endpoint_ClearSetupReceived();\r
\r
/* Write the line coding data to the control endpoint */\r
case REQ_SetLineEncoding:\r
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
{\r
- /* Acknowedge the SETUP packet, ready for data transfer */\r
+ /* Acknowledge 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
// Do something with the given line states in wIndex\r
#endif\r
\r
- /* Acknowedge the SETUP packet, ready for data transfer */\r
+ /* Acknowledge the SETUP packet, ready for data transfer */\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
* - 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
- * - 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
* - 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
/** 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
+ /** Acknowledges 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
) 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 acknowledgement 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
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 acknowledgement 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
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 acknowledgement 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
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 acknowledgement 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
#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 acknowledged 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
#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
+ /** Acknowledges 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
/** 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 Acknowledge) 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
*\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
case REQ_GetLineEncoding:\r
if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))\r
{ \r
- /* Acknowedge the SETUP packet, ready for data transfer */\r
+ /* Acknowledge the SETUP packet, ready for data transfer */\r
Endpoint_ClearSetupReceived();\r
\r
/* Write the line coding data to the control endpoint */\r
case REQ_SetLineEncoding:\r
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
{\r
- /* Acknowedge the SETUP packet, ready for data transfer */\r
+ /* Acknowledge 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
case REQ_SetControlLineState:\r
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
{\r
- /* Acknowedge the SETUP packet, ready for data transfer */\r
+ /* Acknowledge the SETUP packet, ready for data transfer */\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
\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
/* 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
/* 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
\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