diff --git a/Demos/Host/Incomplete/BluetoothHost/BluetoothHCICommands.c b/Demos/Host/Incomplete/BluetoothHost/BluetoothHCICommands.c index d865edefe0044473eca580078ed8df3f5e004f22..ddd159ef751d4cb2f1c4b6b72cb85f78208a629f 100644 --- a/Demos/Host/Incomplete/BluetoothHost/BluetoothHCICommands.c +++ b/Demos/Host/Incomplete/BluetoothHost/BluetoothHCICommands.c @@ -96,7 +96,6 @@ void Bluetooth_ProcessHCICommands(void) { case Bluetooth_Init: Pipe_SelectPipe(BLUETOOTH_EVENTS_PIPE); - Pipe_SetInfiniteINRequests(); memset(&Bluetooth_Connection, 0x00, sizeof(Bluetooth_Connection)); diff --git a/Demos/Host/Incomplete/BluetoothHost/ConfigDescriptor.c b/Demos/Host/Incomplete/BluetoothHost/ConfigDescriptor.c index 8d66ebc041d520a925235d6c938a021e6abcab6c..948c4fcc65df04fd826002bb0a9cc0e8b65cfcdd 100644 --- a/Demos/Host/Incomplete/BluetoothHost/ConfigDescriptor.c +++ b/Demos/Host/Incomplete/BluetoothHost/ConfigDescriptor.c @@ -86,7 +86,6 @@ uint8_t ProcessConfigurationDescriptor(void) EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE); - Pipe_SetInfiniteINRequests(); Pipe_SetInterruptPeriod(EndpointData->PollingIntervalMS); /* Set the flag indicating that the events notification pipe has been found */ @@ -102,8 +101,6 @@ uint8_t ProcessConfigurationDescriptor(void) EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE); - Pipe_SetInfiniteINRequests(); - /* Set the flag indicating that the data IN pipe has been found */ FoundEndpoints |= (1 << BLUETOOTH_DATA_IN_PIPE); } diff --git a/Demos/Host/LowLevel/CDCHost/ConfigDescriptor.c b/Demos/Host/LowLevel/CDCHost/ConfigDescriptor.c index 33234e4fd512b9685a8d2223f1368db2f1a4f895..f1a57cd74030d3c9655ff170094a3ce5e629133e 100644 --- a/Demos/Host/LowLevel/CDCHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/CDCHost/ConfigDescriptor.c @@ -138,7 +138,6 @@ uint8_t ProcessConfigurationDescriptor(void) Pipe_ConfigurePipe(CDC_NOTIFICATIONPIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN, EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE); - Pipe_SetInfiniteINRequests(); Pipe_SetInterruptPeriod(EndpointData->PollingIntervalMS); /* Set the flag indicating that the notification pipe has been found */ @@ -153,8 +152,6 @@ uint8_t ProcessConfigurationDescriptor(void) /* Configure the data IN pipe */ Pipe_ConfigurePipe(CDC_DATAPIPE_IN, EP_TYPE_BULK, PIPE_TOKEN_IN, EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE); - - Pipe_SetInfiniteINRequests(); /* Set the flag indicating that the data IN pipe has been found */ FoundEndpoints |= (1 << CDC_DATAPIPE_IN); diff --git a/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.c b/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.c index 26181c14612aa98ad00576fa33d6164812c3843f..dbec62b637ed1f436d299d47571b977ea6807e8f 100644 --- a/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.c @@ -102,8 +102,6 @@ uint8_t ProcessConfigurationDescriptor(void) /* Configure the HID data IN pipe */ Pipe_ConfigurePipe(HID_DATA_IN_PIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN, EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE); - - Pipe_SetInfiniteINRequests(); FoundEndpoints |= (1 << HID_DATA_IN_PIPE); } diff --git a/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.c b/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.c index a22420d00e451b787436a4bddd77e57186b4ed2c..4033060429f319862a80722e2d1c69ba3dce4aec 100644 --- a/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.c @@ -91,8 +91,6 @@ uint8_t ProcessConfigurationDescriptor(void) Pipe_ConfigurePipe(KEYBOARD_DATAPIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN, EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE); - Pipe_SetInfiniteINRequests(); - /* Valid data found, return success */ return SuccessfulConfigRead; } diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.c b/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.c index d48026d743d8579f45368b85a3cf65bd7608837f..d9fd50f692cdd0b80084e5e9c295fe461360e5c0 100644 --- a/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.c @@ -102,8 +102,6 @@ uint8_t ProcessConfigurationDescriptor(void) Pipe_ConfigurePipe(KEYBOARD_DATAPIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN, EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE); - Pipe_SetInfiniteINRequests(); - /* Valid data found, return success */ return SuccessfulConfigRead; } diff --git a/Demos/Host/LowLevel/MassStorageHost/ConfigDescriptor.c b/Demos/Host/LowLevel/MassStorageHost/ConfigDescriptor.c index d15a453cf37bcef0df769d77b2ffa6e89c94dc2c..9f80b42eeb5742333d9ab92a013d1c6b7e29611e 100644 --- a/Demos/Host/LowLevel/MassStorageHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/MassStorageHost/ConfigDescriptor.c @@ -98,8 +98,6 @@ uint8_t ProcessConfigurationDescriptor(void) EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_DOUBLE); - Pipe_SetInfiniteINRequests(); - /* Set the flag indicating that the data IN pipe has been found */ FoundEndpoints |= (1 << MASS_STORE_DATA_IN_PIPE); } diff --git a/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.c b/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.c index f594eb819259a64d05a0bb5b032d347065c1ec87..e0be70b1b5a2ef407f30eef702210e4f62b36e75 100644 --- a/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.c @@ -91,8 +91,6 @@ uint8_t ProcessConfigurationDescriptor(void) Pipe_ConfigurePipe(MOUSE_DATAPIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN, EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE); - Pipe_SetInfiniteINRequests(); - /* Valid data found, return success */ return SuccessfulConfigRead; } diff --git a/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.c b/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.c index 04247efab584dd2172100cd5f1e39b2788e0a35a..1d28351ee2b6ec6cd76cdc8e14041c050d979423 100644 --- a/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.c @@ -102,8 +102,6 @@ uint8_t ProcessConfigurationDescriptor(void) Pipe_ConfigurePipe(MOUSE_DATAPIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN, EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE); - Pipe_SetInfiniteINRequests(); - /* Valid data found, return success */ return SuccessfulConfigRead; } diff --git a/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.c b/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.c index 86a96b31afffe56929ba7a15753b53a686d6985f..351537430e793f4e3a7cb3e7c9307e4a251e85f0 100644 --- a/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.c @@ -101,7 +101,6 @@ uint8_t ProcessConfigurationDescriptor(void) EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_DOUBLE); - Pipe_SetInfiniteINRequests(); Pipe_SetInterruptPeriod(EndpointData->PollingIntervalMS); /* Set the flag indicating that the events pipe has been found */ @@ -118,8 +117,6 @@ uint8_t ProcessConfigurationDescriptor(void) EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_DOUBLE); - Pipe_SetInfiniteINRequests(); - /* Set the flag indicating that the data IN pipe has been found */ FoundEndpoints |= (1 << SIMAGE_DATA_IN_PIPE); } diff --git a/LUFA/Drivers/USB/Class/Host/CDC.c b/LUFA/Drivers/USB/Class/Host/CDC.c index 2d5ec0fb264d87170f4b8b9a142fe842ba019ce3..943cb73630d64daff19e07dd0ca0471ccb1668b9 100644 --- a/LUFA/Drivers/USB/Class/Host/CDC.c +++ b/LUFA/Drivers/USB/Class/Host/CDC.c @@ -109,7 +109,6 @@ static uint8_t CDC_Host_ProcessConfigDescriptor(USB_ClassInfo_CDC_Host_t* CDCInt EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE); CDCInterfaceInfo->State.NotificationPipeSize = EndpointData->EndpointSize; - Pipe_SetInfiniteINRequests(); Pipe_SetInterruptPeriod(EndpointData->PollingIntervalMS); FoundEndpoints |= CDC_FOUND_DATAPIPE_NOTIFICATION; @@ -123,9 +122,6 @@ static uint8_t CDC_Host_ProcessConfigDescriptor(USB_ClassInfo_CDC_Host_t* CDCInt EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE); CDCInterfaceInfo->State.DataINPipeSize = EndpointData->EndpointSize; - Pipe_SetInfiniteINRequests(); - Pipe_Unfreeze(); - FoundEndpoints |= CDC_FOUND_DATAPIPE_IN; } else @@ -134,8 +130,6 @@ static uint8_t CDC_Host_ProcessConfigDescriptor(USB_ClassInfo_CDC_Host_t* CDCInt EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE); CDCInterfaceInfo->State.DataOUTPipeSize = EndpointData->EndpointSize; - Pipe_Unfreeze(); - FoundEndpoints |= CDC_FOUND_DATAPIPE_OUT; } } diff --git a/LUFA/Drivers/USB/LowLevel/Host.c b/LUFA/Drivers/USB/LowLevel/Host.c index 1932b645c0f63dbcf8d2d2a7bd199176fb351b7f..037e6d80a8f63463dafb7c5add5fcf1c44c7aa0a 100644 --- a/LUFA/Drivers/USB/LowLevel/Host.c +++ b/LUFA/Drivers/USB/LowLevel/Host.c @@ -162,8 +162,6 @@ void USB_Host_ProcessNextHostState(void) break; } - Pipe_SetInfiniteINRequests(); - USB_ControlRequest = (USB_Request_Header_t) { .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE), diff --git a/LUFA/Drivers/USB/LowLevel/Pipe.c b/LUFA/Drivers/USB/LowLevel/Pipe.c index 35ba480cd6570d2bdc6396a03ad488040ac1facd..aead39dc5025f5e59375532d33fbbd28fc42b8cf 100644 --- a/LUFA/Drivers/USB/LowLevel/Pipe.c +++ b/LUFA/Drivers/USB/LowLevel/Pipe.c @@ -48,6 +48,9 @@ bool Pipe_ConfigurePipe(const uint8_t Number, const uint8_t Type, const uint8_t UPCFG0X = ((Type << EPTYPE0) | Token | ((EndpointNumber & PIPE_EPNUM_MASK) << PEPNUM0)); UPCFG1X = ((1 << ALLOC) | Banks | Pipe_BytesToEPSizeMask(Size)); + if (Token == PIPE_TOKEN_IN) + Pipe_SetInfiniteINRequests(); + return Pipe_IsConfigured(); } diff --git a/LUFA/Drivers/USB/LowLevel/Pipe.h b/LUFA/Drivers/USB/LowLevel/Pipe.h index 30f2d387c6e5d551fe7d01bd877308be160bfc72..30e0fde90da168d4d9cbd3c742c187d3a49a77da 100644 --- a/LUFA/Drivers/USB/LowLevel/Pipe.h +++ b/LUFA/Drivers/USB/LowLevel/Pipe.h @@ -732,7 +732,9 @@ * * A newly configured pipe is frozen by default, and must be unfrozen before use via the \ref Pipe_Unfreeze() * before being used. Pipes should be kept frozen unless waiting for data from a device while in IN mode, or - * sending data to the device in OUT mode. + * sending data to the device in OUT mode. IN type pipes are also automatically configured to accept infinite + * numbers of IN requests without automatic freezing - this can be overridden by a call to + * \ref Pipe_SetFiniteINRequests(). * * \note The default control pipe does not have to be manually configured, as it is automatically * configured by the library internally. diff --git a/LUFA/ManPages/ChangeLog.txt b/LUFA/ManPages/ChangeLog.txt index b80fa4d6f75e330f8fe05ae4fea0fb721c995be0..3843941e72a559ea10cdb4c096faddb12bfbb7ae 100644 --- a/LUFA/ManPages/ChangeLog.txt +++ b/LUFA/ManPages/ChangeLog.txt @@ -32,6 +32,8 @@ * added NO_INTERNAL_SERIAL compile time option to turn off new serial number reading code * - Fixed ADC driver for the ATMEGA32U4 and ATMEGA16U4 (thanks to Opendous Inc.) * - Pipe stream functions now automatically set the correct pipe token, so that bidirectional pipes can be used + * - Pipe_ConfigurePipe() now automatically defaults IN pipes to accepting infinite IN requests, this can still be changed by calling + * the existing \ref Pipe_SetFiniteINRequests() function * * * \section Sec_ChangeLog090605 Version 090605 diff --git a/Projects/MissileLauncher/ConfigDescriptor.c b/Projects/MissileLauncher/ConfigDescriptor.c index 2a6e1525694a5ec24e913450b9afa51bd204ca85..405daa4fe0760c8ef147b095673758620c691640 100644 --- a/Projects/MissileLauncher/ConfigDescriptor.c +++ b/Projects/MissileLauncher/ConfigDescriptor.c @@ -103,8 +103,6 @@ uint8_t ProcessConfigurationDescriptor(void) Pipe_ConfigurePipe(HID_DATA_IN_PIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN, EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE); - Pipe_SetInfiniteINRequests(); - FoundEndpoints |= (1 << HID_DATA_IN_PIPE); } else