Rename TOTAL_NUM_CONFIGURATIONS to FIXED_NUM_CONFIGURATIONS, to match the existing FIXED_CONTROL_ENDPOINT_SIZE compile time option. Add FIXED_NUM_CONFIGURATIONS to the descriptors of each project using the option.

This commit is contained in:
Dean Camera 2009-08-02 23:14:30 +00:00
parent bbf89d81fa
commit 6f4cc344ab
71 changed files with 75 additions and 76 deletions

View file

@ -136,8 +136,8 @@ void HID_Device_ProcessControlPacket(USB_ClassInfo_HID_Device_t* const HIDInterf
bool HID_Device_ConfigureEndpoints(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)
{
memset(&HIDInterfaceInfo->State, 0x00, sizeof(HIDInterfaceInfo->State));
HIDInterfaceInfo->State.IdleCount = 500;
HIDInterfaceInfo->State.UsingReportProtocol = true;
HIDInterfaceInfo->State.IdleCount = 500;
if (!(Endpoint_ConfigureEndpoint(HIDInterfaceInfo->Config.ReportINEndpointNumber, EP_TYPE_INTERRUPT,
ENDPOINT_DIR_IN, HIDInterfaceInfo->Config.ReportINEndpointSize, ENDPOINT_BANK_SINGLE)))

View file

@ -141,8 +141,8 @@ static void USB_Device_SetConfiguration(void)
{
bool AlreadyConfigured = (USB_ConfigurationNumber != 0);
#if defined(TOTAL_NUM_CONFIGURATIONS)
if ((uint8_t)USB_ControlRequest.wValue > TOTAL_NUM_CONFIGURATIONS)
#if defined(FIXED_NUM_CONFIGURATIONS)
if ((uint8_t)USB_ControlRequest.wValue > FIXED_NUM_CONFIGURATIONS)
return;
#else
#if !defined(USE_FLASH_DESCRIPTORS) && !defined(USE_EEPROM_DESCRIPTORS) && !defined(USE_RAM_DESCRIPTORS)

View file

@ -51,7 +51,7 @@
/* Public Interface - May be used in end-application: */
/* Macros: */
#if defined(USE_SINGLE_DEVICE_CONFIGURATION)
#define TOTAL_NUM_CONFIGURATIONS 1
#define FIXED_NUM_CONFIGURATIONS 1
#endif
/* Enums: */

View file

@ -29,7 +29,7 @@
* - Added new FAST_STREAM_TRANSFERS compile time option for faster stream transfers via multiple bytes copied per stream loop
* - Added stdio stream demo code to the CDC device demos, to show how to create standard streams out of the virtual serial ports
* - Added new EEPROM and FLASH buffer versions of the Endpoint and Pipe stream functions
* - Added new USE_FLASH_DESCRIPTORS and TOTAL_NUM_CONFIGURATIONS compile time options
* - Added new USE_FLASH_DESCRIPTORS and FIXED_NUM_CONFIGURATIONS compile time options
* - Added support for the new ATMEGA32U2, ATMEGA16U2 and ATMEGA8U2 AVR models
* - Added new USB_DeviceState variable to keep track of the current Device mode USB state
* - Added new LEDs_ToggleLEDs() function to the LEDs driver
@ -57,6 +57,7 @@
* - Internal per-device preprocessing conditions changed to per-device series rather than per-controller group for finer-grain
* internal control
* - Interrupts are no longer disabled during the processing of Control Requests on the default endpoint while in device mode
* - AudioOutput demos now always output to board LEDs, regardless of output mode (removed AUDIO_OUT_LEDS project option)
*
* <b>Fixed:</b>
* - Changed bootloaders to use FLASHEND rather than the existence of RAMPZ to determine if far FLASH pointers are needed to fix

View file

@ -109,7 +109,7 @@
* reserved for application use. When defined, the corresponding GPIOR register should not be used within the user application except
* implicitly via the library APIs.
*
* <b>TOTAL_NUM_CONFIGURATIONS</b> - ( \ref Group_Device ) \n
* <b>FIXED_NUM_CONFIGURATIONS</b> - ( \ref Group_Device ) \n
* By default, the library determines the number of configurations a USB device supports by reading the device descriptor. This reduces
* the amount of configuration required to set up the library, and allows the value to change dynamically (if descriptors are stored in
* EEPROM or RAM rather than flash memory) and reduces code maintenance. However, this value may be fixed via this token in the project