Commit a3a04aa6 authored by Dean Camera's avatar Dean Camera
Browse files

Pipe_ConfigurePipe() now automatically defaults IN pipes to accepting infinite...

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.
parent 7f81803a
......@@ -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));
......
......@@ -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);
}
......
......@@ -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);
......
......@@ -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);
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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);
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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);
}
......
......@@ -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;
}
}
......
......@@ -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),
......
......@@ -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();
}
......
......@@ -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.
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment