Endpoint configuration is now refined to give better output when all configurations...
authorDean Camera <dean@fourwalledcubicle.com>
Fri, 24 Apr 2009 07:28:51 +0000 (07:28 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Fri, 24 Apr 2009 07:28:51 +0000 (07:28 +0000)
27 files changed:
Bootloaders/CDC/makefile
Bootloaders/DFU/makefile
Bootloaders/TeensyHID/makefile
Demos/Device/AudioInput/makefile
Demos/Device/AudioOutput/makefile
Demos/Device/CDC/Descriptors.c
Demos/Device/CDC/makefile
Demos/Device/DualCDC/makefile
Demos/Device/GenericHID/makefile
Demos/Device/Joystick/makefile
Demos/Device/Keyboard/makefile
Demos/Device/KeyboardMouse/makefile
Demos/Device/MIDI/makefile
Demos/Device/MassStorage/SCSI.c
Demos/Device/MassStorage/SCSI.h
Demos/Device/MassStorage/makefile
Demos/Device/Mouse/makefile
Demos/Device/RNDISEthernet/makefile
Demos/Device/USBtoSerial/makefile
LUFA/ChangeLog.txt
LUFA/CompileTimeTokens.txt
LUFA/Drivers/USB/Class/ConfigDescriptor.c
LUFA/Drivers/USB/Class/ConfigDescriptor.h
LUFA/Drivers/USB/LowLevel/Endpoint.c
LUFA/Drivers/USB/LowLevel/Endpoint.h
LUFA/MigrationInformation.txt
Projects/Magstripe/makefile

index 0227427..39a7a7d 100644 (file)
@@ -176,9 +176,9 @@ BOOT_START = 0x1E000
 # Place -D or -U options here for C sources\r
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)\r
 CDEFS += -DUSB_DEVICE_ONLY -DUSE_NONSTANDARD_DESCRIPTOR_NAMES\r
-CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8\r
+CDEFS += -DFIXED_CONTROL_ENDPOINT_SIZE=8 -DUSE_SINGLE_DEVICE_CONFIGURATION\r
 CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"\r
-CDEFS += -DUSE_RAM_DESCRIPTORS -DBOOT_START_ADDR=$(BOOT_START)UL -DUSE_SINGLE_DEVICE_CONFIGURATION\r
+CDEFS += -DUSE_RAM_DESCRIPTORS -DBOOT_START_ADDR=$(BOOT_START)UL\r
 \r
 \r
 # Place -D or -U options here for ASM sources\r
index d55235b..5b225b4 100644 (file)
@@ -176,9 +176,9 @@ BOOT_START = 0x1E000
 # Place -D or -U options here for C sources\r
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)\r
 CDEFS += -DUSB_DEVICE_ONLY -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DCONTROL_ONLY_DEVICE\r
-CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=32\r
+CDEFS += -DFIXED_CONTROL_ENDPOINT_SIZE=32 -DUSE_SINGLE_DEVICE_CONFIGURATION\r
 CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"\r
-CDEFS += -DUSE_RAM_DESCRIPTORS -DBOOT_START_ADDR=$(BOOT_START)UL -DUSE_SINGLE_DEVICE_CONFIGURATION\r
+CDEFS += -DUSE_RAM_DESCRIPTORS -DBOOT_START_ADDR=$(BOOT_START)UL\r
 \r
 \r
 # Place -D or -U options here for ASM sources\r
index 12b1b45..48c4d1e 100644 (file)
@@ -176,9 +176,9 @@ BOOT_START = 0xC000
 # Place -D or -U options here for C sources\r
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)\r
 CDEFS += -DUSB_DEVICE_ONLY -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DCONTROL_ONLY_DEVICE\r
-CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8\r
+CDEFS += -DFIXED_CONTROL_ENDPOINT_SIZE=8 -DUSE_SINGLE_DEVICE_CONFIGURATION\r
 CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"\r
-CDEFS += -DUSE_RAM_DESCRIPTORS -DBOOT_START_ADDR=$(BOOT_START)UL -DUSE_SINGLE_DEVICE_CONFIGURATION\r
+CDEFS += -DUSE_RAM_DESCRIPTORS -DBOOT_START_ADDR=$(BOOT_START)UL\r
 \r
 \r
 # Place -D or -U options here for ASM sources\r
index 19dc5e2..4b3938a 100644 (file)
@@ -185,7 +185,7 @@ CSTANDARD = -std=gnu99
 # Place -D or -U options here for C sources\r
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)\r
 CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS -DUSB_DEVICE_ONLY\r
-CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8\r
+CDEFS += -DFIXED_CONTROL_ENDPOINT_SIZE=8 -DUSE_SINGLE_DEVICE_CONFIGURATION\r
 CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"\r
 \r
 \r
index b1a0511..bb609af 100644 (file)
@@ -185,7 +185,7 @@ CSTANDARD = -std=gnu99
 # Place -D or -U options here for C sources\r
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)\r
 CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS -DUSB_DEVICE_ONLY\r
-CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8\r
+CDEFS += -DFIXED_CONTROL_ENDPOINT_SIZE=8 -DUSE_SINGLE_DEVICE_CONFIGURATION\r
 CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"\r
 CDEFS += -DAUDIO_OUT_STEREO\r
 \r
index 6b65a76..3618b8d 100644 (file)
@@ -51,7 +51,7 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
        .SubClass               = 0x00,\r
        .Protocol               = 0x00,\r
                                \r
-       .Endpoint0Size          = FIXED_CONTROL_ENDPOINT_SIZE,\r
+       .Endpoint0Size          = 8,//FIXED_CONTROL_ENDPOINT_SIZE,\r
                \r
        .VendorID               = 0x03EB,\r
        .ProductID              = 0x2044,\r
index fe839d6..3a0ebb1 100644 (file)
@@ -185,7 +185,7 @@ CSTANDARD = -std=gnu99
 # Place -D or -U options here for C sources\r
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)\r
 CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS -DUSB_DEVICE_ONLY\r
-CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8\r
+CDEFS += -DFIXED_CONTROL_ENDPOINT_SIZE=8 -DUSE_SINGLE_DEVICE_CONFIGURATION\r
 CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"\r
 \r
 \r
index 9134f23..115a8f2 100644 (file)
@@ -185,7 +185,7 @@ CSTANDARD = -std=gnu99
 # Place -D or -U options here for C sources\r
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)\r
 CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS -DUSB_DEVICE_ONLY\r
-CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8\r
+CDEFS += -DFIXED_CONTROL_ENDPOINT_SIZE=8 -DUSE_SINGLE_DEVICE_CONFIGURATION\r
 CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"\r
 \r
 \r
index 3cf8070..74beb28 100644 (file)
@@ -185,7 +185,7 @@ CSTANDARD = -std=gnu99
 # Place -D or -U options here for C sources\r
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)\r
 CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS -DUSB_DEVICE_ONLY\r
-CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8\r
+CDEFS += -DFIXED_CONTROL_ENDPOINT_SIZE=8 -DUSE_SINGLE_DEVICE_CONFIGURATION\r
 CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"\r
 \r
 # Place -D or -U options here for ASM sources\r
index 5230af2..ce67e58 100644 (file)
@@ -185,7 +185,7 @@ CSTANDARD = -std=gnu99
 # Place -D or -U options here for C sources\r
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)\r
 CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS -DUSB_DEVICE_ONLY\r
-CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8\r
+CDEFS += -DFIXED_CONTROL_ENDPOINT_SIZE=8 -DUSE_SINGLE_DEVICE_CONFIGURATION\r
 CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"\r
 \r
 \r
index 68271f7..627e661 100644 (file)
@@ -185,7 +185,7 @@ CSTANDARD = -std=gnu99
 # Place -D or -U options here for C sources\r
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)\r
 CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS -DUSB_DEVICE_ONLY\r
-CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8\r
+CDEFS += -DFIXED_CONTROL_ENDPOINT_SIZE=8 -DUSE_SINGLE_DEVICE_CONFIGURATION\r
 CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"\r
 \r
 # Place -D or -U options here for ASM sources\r
index 000dba2..1c239ba 100644 (file)
@@ -185,7 +185,7 @@ CSTANDARD = -std=gnu99
 # Place -D or -U options here for C sources\r
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)\r
 CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS -DUSB_DEVICE_ONLY\r
-CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8\r
+CDEFS += -DFIXED_CONTROL_ENDPOINT_SIZE=8 -DUSE_SINGLE_DEVICE_CONFIGURATION\r
 CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"\r
 \r
 \r
index d7d28e8..11a9f36 100644 (file)
@@ -185,7 +185,7 @@ CSTANDARD = -std=gnu99
 # Place -D or -U options here for C sources\r
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)\r
 CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS -DUSB_DEVICE_ONLY\r
-CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8\r
+CDEFS += -DFIXED_CONTROL_ENDPOINT_SIZE=8 -DUSE_SINGLE_DEVICE_CONFIGURATION\r
 CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"\r
 \r
 \r
index 6ddd144..a88be51 100644 (file)
@@ -43,7 +43,7 @@
  */\r
 SCSI_Inquiry_Response_t InquiryData = \r
        {\r
-               .DeviceType          = 0,\r
+               .DeviceType          = DEVICE_TYPE_BLOCK,\r
                .PeripheralQualifier = 0,\r
                        \r
                .Removable           = true,\r
index 58eea1b..158b7ed 100644 (file)
 \r
                /** Macro for the SCSI_Command_ReadWrite_10() function, to indicate that data is to be written to the storage medium. */\r
                #define DATA_WRITE     false\r
+\r
+               /** Value for the DeviceType entry in the SCSI_Inquiry_Response_t enum, indicating a Block Media device. */\r
+               #define DEVICE_TYPE_BLOCK 0x00\r
                \r
+               /** Value for the DeviceType entry in the SCSI_Inquiry_Response_t enum, indicating a CD-ROM device. */\r
+               #define DEVICE_TYPE_CDROM 0x05\r
+\r
        /* Type Defines: */\r
                /** Type define for a SCSI response structure to a SCSI INQUIRY command. For details of the\r
                 *  structure contents, refer to the SCSI specifications.\r
index 9ef390d..faee640 100644 (file)
@@ -187,7 +187,7 @@ CSTANDARD = -std=gnu99
 # Place -D or -U options here for C sources\r
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)\r
 CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DUSB_DEVICE_ONLY\r
-CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8\r
+CDEFS += -DFIXED_CONTROL_ENDPOINT_SIZE=8 -DUSE_SINGLE_DEVICE_CONFIGURATION\r
 CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"\r
 \r
 \r
index 79e16e3..f7e4d89 100644 (file)
@@ -184,7 +184,7 @@ CSTANDARD = -std=gnu99
 # Place -D or -U options here for C sources\r
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)\r
 CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS -DUSB_DEVICE_ONLY\r
-CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8\r
+CDEFS += -DFIXED_CONTROL_ENDPOINT_SIZE=8 -DUSE_SINGLE_DEVICE_CONFIGURATION\r
 CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"\r
 \r
 # Place -D or -U options here for ASM sources\r
index 33b37cf..0954c28 100644 (file)
@@ -197,9 +197,8 @@ CSTANDARD = -std=gnu99
 # Place -D or -U options here for C sources\r
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)\r
 CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS -DUSB_DEVICE_ONLY\r
-CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8\r
+CDEFS += -DFIXED_CONTROL_ENDPOINT_SIZE=8 -DUSE_SINGLE_DEVICE_CONFIGURATION\r
 CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"\r
-\r
 CDEFS += -DNO_DECODE_ETHERNET -DNO_DECODE_ARP -DNO_DECODE_ICMP -DNO_DECODE_IP -DNO_DECODE_TCP -DNO_DECODE_UDP -DNO_DECODE_DHCP\r
 \r
 \r
index 94f2314..189741a 100644 (file)
@@ -186,7 +186,7 @@ CSTANDARD = -std=gnu99
 # Place -D or -U options here for C sources\r
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)\r
 CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS -DUSB_DEVICE_ONLY\r
-CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8\r
+CDEFS += -DFIXED_CONTROL_ENDPOINT_SIZE=8 -DUSE_SINGLE_DEVICE_CONFIGURATION\r
 CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"\r
 \r
 \r
index 1557db5..4b1c5dc 100644 (file)
@@ -60,7 +60,9 @@
   *  - The USB_UnhandledControlPacket event has had its parameters removed, in favour of accessing the new USB_ControlRequest structure\r
   *  - The Endpoint control stream functions now correctly send a ZLP to the host when less data than requested is sent\r
   *  - Fixed USB_RemoteWakeupEnabled flag never being set (the REMOTE WAKEUP Set Feature request was not being handled)\r
-  *  - Renamed the FEATURELESS_CONTROL_ONLY_DEVICE compile-time token to CONTROL_ONLY_DEVICE \r
+  *  - Renamed the FEATURELESS_CONTROL_ONLY_DEVICE compile-time token to CONTROL_ONLY_DEVICE\r
+  *  - Endpoint configuration is now refined to give better output when all configurations have static inputs - removed the now useless\r
+  *    STATIC_ENDPOINT_CONFIGURATION compile time token\r
   *    \r
   *\r
   *  \section Sec_ChangeLog090401 Version 090401\r
index 090ace8..e3afc59 100644 (file)
  *  Normally this reduces the amount of configuration required for the library, allows the value to change dynamically (if\r
  *  descriptors are stored in EEPROM or RAM rather than flash memory) and reduces code maintenance. However, this token can be\r
  *  defined to a non-zero value instead to give the size in bytes of the control endpoint, to reduce the size of the compiled\r
- *  binary at the expense of flexibility.\r
- *\r
- *  <b>STATIC_ENDPOINT_CONFIGURATION</b> - ( \ref Group_EndpointManagement ) \n\r
- *  By default, the endpoint configuration routine is designed to accept dynamic inputs, so that the endpoints can be configured\r
- *  using variable values known only at runtime. This allows for a great deal of flexibility, however uses a small amount of binary\r
- *  space which may be wasted if all endpoint configurations are static and known at compile time. Define this token via the -D switch\r
- *  to optimize the endpoint configuration routine for constant inputs, to reduce the size of the compiled binary at the expense of\r
- *  flexibility. Note that with this option dynamic values may still be used, but will result in many times more code to be generated than\r
- *  if the option was disabled. This is designed to be used only if the FIXED_CONTROL_ENDPOINT_SIZE option is also used.\r
+ *  binary.\r
  *\r
  *  <b>USE_SINGLE_DEVICE_CONFIGURATION</b> - ( \ref Group_Device ) \n\r
  *  By default, the library determines the number of configurations a USB device supports by reading the device descriptor. This reduces\r
index 367b28a..7883830 100644 (file)
@@ -114,7 +114,7 @@ void USB_GetNextDescriptorOfTypeAfter(uint16_t* const BytesRem,
          USB_GetNextDescriptorOfType(BytesRem, CurrConfigLoc, Type);\r
 }\r
                        \r
-uint8_t USB_GetNextDescriptorComp_P(uint16_t* BytesRem, uint8_t** CurrConfigLoc, ComparatorPtr_t ComparatorRoutine)\r
+uint8_t USB_GetNextDescriptorComp_Prv(uint16_t* BytesRem, uint8_t** CurrConfigLoc, ComparatorPtr_t ComparatorRoutine)\r
 {\r
        uint8_t ErrorCode;\r
                \r
index da38492..dce7de7 100644 (file)
                                 */\r
                                uint8_t USB_GetNextDescriptorComp(uint16_t* BytesRem, uint8_t** CurrConfigLoc, ComparatorPtr_t ComparatorRoutine);\r
                        #else\r
-                               #define USB_GetNextDescriptorComp(DSize, DPos, DSearch) USB_GetNextDescriptorComp_P(DSize, DPos, DCOMP_##DSearch)\r
+                               #define USB_GetNextDescriptorComp(DSize, DPos, DSearch) USB_GetNextDescriptorComp_Prv(DSize, DPos, DCOMP_##DSearch)\r
                        #endif\r
                        \r
                /* Enums: */\r
                        typedef uint8_t (* const ComparatorPtr_t)(void* const);\r
 \r
                /* Function Prototypes: */\r
-                       uint8_t USB_GetNextDescriptorComp_P(uint16_t* BytesRem, uint8_t** CurrConfigLoc, ComparatorPtr_t ComparatorRoutine);\r
+                       uint8_t USB_GetNextDescriptorComp_Prv(uint16_t* BytesRem, uint8_t** CurrConfigLoc, ComparatorPtr_t ComparatorRoutine);\r
        #endif\r
                        \r
        /* Disable C linkage for C++ Compilers: */\r
index da2925e..4615baa 100644 (file)
 uint8_t USB_ControlEndpointSize = ENDPOINT_CONTROLEP_DEFAULT_SIZE;\r
 #endif\r
 \r
-#if !defined(STATIC_ENDPOINT_CONFIGURATION)\r
-bool Endpoint_ConfigureEndpoint(const uint8_t  Number, const uint8_t Type, const uint8_t Direction,\r
-                                           const uint16_t Size, const uint8_t Banks)\r
+uint8_t Endpoint_BytesToEPSizeMaskDynamic(const uint16_t Size)\r
 {\r
-       Endpoint_SelectEndpoint(Number);\r
-       Endpoint_EnableEndpoint();\r
-\r
-       UECFG1X = 0;    \r
-\r
-       UECFG0X = ((Type << EPTYPE0) | Direction);\r
-       UECFG1X = ((1 << ALLOC) | Banks | Endpoint_BytesToEPSizeMask(Size));\r
-\r
-       return Endpoint_IsConfigured();\r
+       return Endpoint_BytesToEPSizeMask(Size);\r
 }\r
-#else\r
-bool Endpoint_ConfigureEndpointStatic(const uint8_t Number, const uint8_t UECFG0XData, const uint8_t UECFG1XData)\r
+\r
+bool Endpoint_ConfigureEndpoint_Prv(const uint8_t Number, const uint8_t UECFG0XData, const uint8_t UECFG1XData)\r
 {\r
        Endpoint_SelectEndpoint(Number);\r
        Endpoint_EnableEndpoint();\r
@@ -66,7 +56,6 @@ bool Endpoint_ConfigureEndpointStatic(const uint8_t Number, const uint8_t UECFG0
 \r
        return Endpoint_IsConfigured();\r
 }\r
-#endif\r
 \r
 void Endpoint_ClearEndpoints(void)\r
 {\r
index 1e88e06..4d5aa53 100644 (file)
                         *\r
                         *  The success of this routine can be determined via the \ref Endpoint_IsConfigured() macro.\r
                         *\r
-                        *  By default, the routine is entirely dynamic, and will accept both constant and variable inputs.\r
-                        *  If dynamic configuration is unused, a small space savings can be made by defining the\r
-                        *  STATIC_ENDPOINT_CONFIGURATION macro via the -D switch to the compiler, to optimize for constant\r
-                        *  input values.\r
-                        *\r
                         *  \note This routine will select the specified endpoint, and the endpoint will remain selected\r
                         *        once the routine completes regardless of if the endpoint configuration succeeds.\r
                         *\r
                                #define ENDPOINT_DETAILS_EP4               64,  true                    \r
                        #endif\r
 \r
-                       #if defined(STATIC_ENDPOINT_CONFIGURATION)\r
-                               #define Endpoint_ConfigureEndpoint(Number, Type, Direction, Size, Banks)        \\r
-                                                                    Endpoint_ConfigureEndpointStatic(Number,   \\r
-                                                                             ((Type << EPTYPE0) | Direction),  \\r
-                                                                             ((1 << ALLOC) | Banks | Endpoint_BytesToEPSizeMask(Size)));\r
-                       #endif\r
-\r
+                       #define Endpoint_ConfigureEndpoint(Number, Type, Direction, Size, Banks)            \\r
+                                                           Endpoint_ConfigureEndpoint_Prv(Number,          \\r
+                                                                     ((Type << EPTYPE0) | Direction),      \\r
+                                                                     ((1 << ALLOC) | Banks |               \\r
+                                                                       (__builtin_constant_p(Size) ?       \\r
+                                                                        Endpoint_BytesToEPSizeMask(Size) :  \\r
+                                                                        Endpoint_BytesToEPSizeMaskDynamic(Size))))\r
+                                                                                                       \r
                /* Function Prototypes: */\r
-                       void Endpoint_ClearEndpoints(void);\r
-                       bool Endpoint_ConfigureEndpointStatic(const uint8_t Number, const uint8_t UECFG0XData, const uint8_t UECFG1XData);\r
+                       void    Endpoint_ClearEndpoints(void);\r
+                       uint8_t Endpoint_BytesToEPSizeMaskDynamic(const uint16_t Size);\r
+                       bool    Endpoint_ConfigureEndpoint_Prv(const uint8_t Number, const uint8_t UECFG0XData, const uint8_t UECFG1XData);\r
                        \r
                /* Inline Functions: */\r
                        static inline uint8_t Endpoint_BytesToEPSizeMask(const uint16_t Bytes) ATTR_WARN_UNUSED_RESULT ATTR_CONST ATTR_ALWAYS_INLINE;\r
                        static inline uint8_t Endpoint_BytesToEPSizeMask(const uint16_t Bytes)\r
                        {\r
-                               if (Bytes <= 8)\r
-                                 return (0 << EPSIZE0);\r
-                               else if (Bytes <= 16)\r
-                                 return (1 << EPSIZE0);\r
-                               else if (Bytes <= 32)\r
-                                 return (2 << EPSIZE0);\r
-                               #if defined(USB_LIMITED_CONTROLLER)\r
-                               else\r
-                                 return (3 << EPSIZE0);\r
-                               #else\r
-                               else if (Bytes <= 64)\r
-                                 return (3 << EPSIZE0);\r
-                               else if (Bytes <= 128)\r
-                                 return (4 << EPSIZE0);\r
-                               else\r
-                                 return (5 << EPSIZE0);\r
-                               #endif\r
+                               uint8_t  MaskVal    = 0;\r
+                               uint16_t CheckBytes = 8;\r
+                               \r
+                               while (CheckBytes < Bytes)\r
+                               {\r
+                                       MaskVal++;\r
+                                       CheckBytes <<= 1;\r
+                               }\r
+                               \r
+                               return (MaskVal << EPSIZE0);\r
                        };\r
 \r
        #endif\r
index 9dbabb7..f3c3a6f 100644 (file)
@@ -37,6 +37,7 @@
  *      the Control Request header as all Control Request header data is now preloaded by the library and made available in the\r
  *      USB_ControlRequest structure.\r
  *    - The FEATURELESS_CONTROL_ONLY_DEVICE token has been renamed to CONTROL_ONLY_DEVICE.\r
+ *    - The STATIC_ENDPOINT_CONFIGURATION is no longer applicable as the library will apply this optimization when appropriate automatically.\r
  *\r
  *  <b>Host Mode</b>\r
  *    - The USB_Host_SendControlRequest() function no longer automatically selects the Control pipe (pipe 0) to allow it to be used on\r
index 8006b0c..5d474cd 100644 (file)
@@ -186,9 +186,8 @@ CSTANDARD = -std=gnu99
 # Place -D or -U options here for C sources
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)
 CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS -DUSB_DEVICE_ONLY
-CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8
+CDEFS += -DFIXED_CONTROL_ENDPOINT_SIZE=8 -DUSE_SINGLE_DEVICE_CONFIGURATION
 CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
-
 CDEFS += -DMAG_T1_CLOCK="(1 << 0)"
 CDEFS += -DMAG_T1_DATA="(1 << 1)"
 CDEFS += -DMAG_T2_CLOCK="(1 << 2)"