From 958a1b4e2bffdc548b34edd322d30cec5d5feacd Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Tue, 12 May 2009 08:28:02 +0000 Subject: Fixed Mouse and Keyboard device demos not acting in accordance with the HID specification for idle periods (thanks to Brian Dickman). Removed support for endpoint/pipe non-control interrupts; these did not act in the way users expected, and had many subtle issues. --- LUFA/ChangeLog.txt | 2 ++ LUFA/Drivers/USB/LowLevel/Endpoint.h | 37 -------------------------------- LUFA/Drivers/USB/LowLevel/HostChapter9.c | 2 +- LUFA/Drivers/USB/LowLevel/Pipe.h | 36 ------------------------------- LUFA/MigrationInformation.txt | 10 +++++++++ 5 files changed, 13 insertions(+), 74 deletions(-) (limited to 'LUFA') diff --git a/LUFA/ChangeLog.txt b/LUFA/ChangeLog.txt index cc198089c..1833596f3 100644 --- a/LUFA/ChangeLog.txt +++ b/LUFA/ChangeLog.txt @@ -11,6 +11,8 @@ * - Fixed bug in RNDISEthernet and DualCDC demos not using the correct USB_ControlRequest structure for control request data * - Fixed documentation showing incorrect USB mode support on the supported AVRs list * - Fixed RNDISEthernet not working under Linux due to Linux requiring an "optional" request which was unhandled + * - Fixed Mouse and Keyboard device demos not acting in accordance with the HID specification for idle periods (thanks to Brian Dickman) + * - Removed support for endpoint/pipe non-control interrupts; these did not act in the way users expected, and had many subtle issues * * * \section Sec_ChangeLog090510 Version 090510 diff --git a/LUFA/Drivers/USB/LowLevel/Endpoint.h b/LUFA/Drivers/USB/LowLevel/Endpoint.h index aa5005a82..4882acc3b 100644 --- a/LUFA/Drivers/USB/LowLevel/Endpoint.h +++ b/LUFA/Drivers/USB/LowLevel/Endpoint.h @@ -153,34 +153,6 @@ * \see \ref ENDPOINT_PIPE_vect for more information on the common pipe and endpoint interrupt vector. */ #define ENDPOINT_INT_SETUP UEIENX, (1 << RXSTPE), UEINTX, (1 << RXSTPI) - - /** Interrupt definition for the endpoint IN interrupt (for INTERRUPT type endpoints). Should be - * used with the USB_INT_* macros located in USBInterrupt.h. - * - * This interrupt will fire if enabled on an INTERRUPT type endpoint if a the endpoint interrupt - * period has elapsed and the endpoint is ready for a new packet to be written to its FIFO buffer - * (if required). - * - * \note This interrupt must be enabled and cleared on *each* endpoint which requires it (after the - * endpoint is selected), and will fire the common endpoint interrupt vector. - * - * \see \ref ENDPOINT_PIPE_vect for more information on the common pipe and endpoint interrupt vector. - */ - #define ENDPOINT_INT_IN UEIENX, (1 << TXINE) , UEINTX, (1 << TXINI) - - /** Interrupt definition for the endpoint OUT interrupt (for INTERRUPT type endpoints). Should be - * used with the USB_INT_* macros located in USBInterrupt.h. - * - * This interrupt will fire if enabled on an INTERRUPT type endpoint if a the endpoint interrupt - * period has elapsed and the endpoint is ready for a packet from the host to be read from its - * FIFO buffer (if received). - * - * \note This interrupt must be enabled and cleared on *each* endpoint which requires it (after the - * endpoint is selected), and will fire the common endpoint interrupt vector. - * - * \see \ref ENDPOINT_PIPE_vect for more information on the common pipe and endpoint interrupt vector. - */ - #define ENDPOINT_INT_OUT UEIENX, (1 << RXOUTE), UEINTX, (1 << RXOUTI) /* Pseudo-Function Macros: */ #if defined(__DOXYGEN__) @@ -265,13 +237,6 @@ */ static inline uint8_t Endpoint_GetEndpointInterrupts(void); - /** Clears the endpoint interrupt flag. This clears the specified endpoint number's interrupt - * mask in the endpoint interrupt flag register. - * - * \param EndpointNumber Index of the endpoint whose interrupt flag should be cleared - */ - static inline void Endpoint_ClearEndpointInterrupt(uint8_t EndpointNumber); - /** Determines if the specified endpoint number has interrupted (valid only for INTERRUPT type * endpoints). * @@ -398,8 +363,6 @@ #define Endpoint_GetEndpointInterrupts() UEINT - #define Endpoint_ClearEndpointInterrupt(n) MACROS{ UEINT &= ~(1 << n); }MACROE - #define Endpoint_HasEndpointInterrupted(n) ((UEINT & (1 << n)) ? true : false) #define Endpoint_IsINReady() ((UEINTX & (1 << TXINI)) ? true : false) diff --git a/LUFA/Drivers/USB/LowLevel/HostChapter9.c b/LUFA/Drivers/USB/LowLevel/HostChapter9.c index ee51cf3ae..4b96c691d 100644 --- a/LUFA/Drivers/USB/LowLevel/HostChapter9.c +++ b/LUFA/Drivers/USB/LowLevel/HostChapter9.c @@ -155,7 +155,7 @@ static uint8_t USB_Host_Wait_For_Setup_IOS(const uint8_t WaitType) { uint16_t TimeoutCounter = USB_HOST_TIMEOUT_MS; - while (!(((WaitType == USB_HOST_WAITFOR_SetupSent) && Pipe_IsSETUPSent()) || + while (!(((WaitType == USB_HOST_WAITFOR_SetupSent) && Pipe_IsSETUPSent()) || ((WaitType == USB_HOST_WAITFOR_InReceived) && Pipe_IsINReceived()) || ((WaitType == USB_HOST_WAITFOR_OutReady) && Pipe_IsOUTReady()))) { diff --git a/LUFA/Drivers/USB/LowLevel/Pipe.h b/LUFA/Drivers/USB/LowLevel/Pipe.h index 7e81cf686..d5c209492 100644 --- a/LUFA/Drivers/USB/LowLevel/Pipe.h +++ b/LUFA/Drivers/USB/LowLevel/Pipe.h @@ -158,34 +158,6 @@ */ #define PIPE_EPSIZE_MASK 0x7FF - /** Interrupt definition for the pipe IN interrupt (for INTERRUPT type pipes). Should be used with - * the USB_INT_* macros located in USBInterrupt.h. - * - * This interrupt will fire if enabled on an INTERRUPT type pipe if the pipe interrupt period has - * elapsed and the pipe is ready for the next packet from the attached device to be read out from its - * FIFO buffer (if received). - * - * \note This interrupt must be enabled and cleared on *each* pipe which requires it (after the pipe - * is selected), and will fire the common pipe interrupt vector. - * - * \see \ref ENDPOINT_PIPE_vect for more information on the common pipe and endpoint interrupt vector. - */ - #define PIPE_INT_IN UPIENX, (1 << RXINE) , UPINTX, (1 << RXINI) - - /** Interrupt definition for the pipe OUT interrupt (for INTERRUPT type pipes). Should be used with - * the USB_INT_* macros located in USBInterrupt.h. - * - * This interrupt will fire if enabled on an INTERRUPT type endpoint if a the pipe interrupt period - * has elapsed and the pipe is ready for a packet to be written to the pipe's FIFO buffer and sent - * to the attached device (if required). - * - * \note This interrupt must be enabled and cleared on *each* pipe which requires it (after the pipe - * is selected), and will fire the common pipe interrupt vector. - * - * \see \ref ENDPOINT_PIPE_vect for more information on the common pipe and endpoint interrupt vector. - */ - #define PIPE_INT_OUT UPIENX, (1 << TXOUTE), UPINTX, (1 << TXOUTI) - /** Interrupt definition for the pipe SETUP bank ready interrupt (for CONTROL type pipes). Should be * used with the USB_INT_* macros located in USBInterrupt.h. * @@ -337,12 +309,6 @@ */ static inline uint8_t Pipe_GetPipeInterrupts(void); - /** Clears the interrupt flag for the specified pipe number. - * - * \param PipeNumber Index of the pipe whose interrupt flag is to be cleared - */ - static inline void Pipe_ClearPipeInterrupt(uint8_t PipeNumber); - /** Determines if the specified pipe number has interrupted (valid only for INTERRUPT type * pipes). * @@ -504,8 +470,6 @@ #define Pipe_GetPipeInterrupts() UPINT - #define Pipe_ClearPipeInterrupt(n) MACROS{ UPINT &= ~(1 << n); }MACROE - #define Pipe_HasPipeInterrupted(n) ((UPINT & (1 << n)) ? true : false) #define Pipe_Unfreeze() MACROS{ UPCONX &= ~(1 << PFREEZE); }MACROE diff --git a/LUFA/MigrationInformation.txt b/LUFA/MigrationInformation.txt index 891c5b273..d7eb2dfcc 100644 --- a/LUFA/MigrationInformation.txt +++ b/LUFA/MigrationInformation.txt @@ -12,6 +12,16 @@ * * \section Sec_MigrationXXXXXX Migrating from 090510 to XXXXXX * + * Device Mode + * - Support for non-control data endpoint interrupts has been dropped due to many issues in the implementation. All existing + * projects using interrupts on non-control endpoints should switch to polling. + * - The Endpoint_ClearEndpointInterrupt() macro has been deleted and references to it should be removed. + * + * Device Mode + * - Support for non-control data pipe interrupts has been dropped due to many issues in the implementation. All existing + * projects using interrupts on non-control pipes should switch to polling. + * - The Pipe_ClearPipeInterrupt() macro has been deleted and references to it should be removed. + * * * \section Sec_Migration090510 Migrating from 090401 to 090510 * -- cgit v1.2.3