Renamed NO_CLEARSET_FEATURE_REQUEST compile time token to NO_FEATURELESS_CONTROL_ONLY_DEVICE and expanded its function to also remove parts of the Get Status chapter 9 request, to further reduce code usage.

pull/1469/head
Dean Camera 16 years ago
parent 3803976534
commit 0214e096a0

@ -165,7 +165,7 @@ BOOT_START = 0x1E000
# Place -D or -U options here for C sources # Place -D or -U options here for C sources
CDEFS = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) CDEFS = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)
CDEFS += -DUSB_DEVICE_ONLY -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_CLEARSET_FEATURE_REQUEST CDEFS += -DUSB_DEVICE_ONLY -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DFEATURELESS_CONTROL_ONLY_DEVICE
CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=32 CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=32
CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
CDEFS += -DUSE_RAM_DESCRIPTORS -DBOOT_START_ADDR=$(BOOT_START)UL -DUSE_SINGLE_DEVICE_CONFIGURATION CDEFS += -DUSE_RAM_DESCRIPTORS -DBOOT_START_ADDR=$(BOOT_START)UL -DUSE_SINGLE_DEVICE_CONFIGURATION

@ -165,7 +165,7 @@ BOOT_START = 0xC000
# Place -D or -U options here for C sources # Place -D or -U options here for C sources
CDEFS = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) CDEFS = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)
CDEFS += -DUSB_DEVICE_ONLY -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_CLEARSET_FEATURE_REQUES CDEFS += -DUSB_DEVICE_ONLY -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DFEATURELESS_CONTROL_ONLY_DEVICE
CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8 CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8
CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
CDEFS += -DUSE_RAM_DESCRIPTORS -DBOOT_START_ADDR=$(BOOT_START)UL -DUSE_SINGLE_DEVICE_CONFIGURATION CDEFS += -DUSE_RAM_DESCRIPTORS -DBOOT_START_ADDR=$(BOOT_START)UL -DUSE_SINGLE_DEVICE_CONFIGURATION

@ -30,6 +30,8 @@
* - Added ATTR_ALWAYS_INLINE attribute to several key inlined library components, to ensure they are inlined in all circumstances * - Added ATTR_ALWAYS_INLINE attribute to several key inlined library components, to ensure they are inlined in all circumstances
* - Removed SetSystemClockPrescaler() macro, the clock_prescale_set() avr-libc macro has been corrected in recent avr-libc versions * - Removed SetSystemClockPrescaler() macro, the clock_prescale_set() avr-libc macro has been corrected in recent avr-libc versions
* - Fixed incorrect/missing control status stage transfers on demos, bootloaders and applications (thanks to Nate Lawson) * - Fixed incorrect/missing control status stage transfers on demos, bootloaders and applications (thanks to Nate Lawson)
* - The NO_CLEARSET_FEATURE_REQUEST compile time token has been renamed to NO_FEATURELESS_CONTROL_ONLY_DEVICE, and its function expanded
* to also remove parts of the Get Status chapter 9 request to further reduce code usage
* *
* \section Sec_ChangeLog090209 Version 090209 * \section Sec_ChangeLog090209 Version 090209
* *

@ -111,11 +111,10 @@
* EEPROM or RAM rather than flash memory) and reduces code maintenance. However, many USB device projects use only a single configuration. * EEPROM or RAM rather than flash memory) and reduces code maintenance. However, many USB device projects use only a single configuration.
* Defining this token enables single-configuration mode, reducing the compiled size of the binary at the expense of flexibility. * Defining this token enables single-configuration mode, reducing the compiled size of the binary at the expense of flexibility.
* *
* <b>NO_CLEARSET_FEATURE_REQUEST</b> - DevChapter9.h \n * <b>FEATURELESS_CONTROL_ONLY_DEVICE</b> - DevChapter9.h \n
* In some limited USB device applications, the Get Feature and Set Feature requests are not used - this is when the device does not have * In some limited USB device applications, device features (other than self-power) and endpoints other than the control endpoint aren't
* device level features (such as remote wakeup) nor any data endpoints beyond the mandatory control endpoint. In such limited situations, * used. In such limited situations, this token may be defined to remove the handling of the Set Feature Chapter 9 request entirely and
* this token may be defined to remove the handling of the Get Feature and Set Feature Chapter 9 requests to save space. Generally, this * parts of the Get Feature chapter 9 request to save space. Generally, this is usually only useful in (some) bootloaders.
* is usually only useful in (some) bootloaders.
* *
* <b>NO_STREAM_CALLBACKS</b> - Endpoint.h, Pipe.h \n * <b>NO_STREAM_CALLBACKS</b> - Endpoint.h, Pipe.h \n
* Both the endpoint and the pipe driver code contains stream functions, allowing for arrays of data to be sent to or from the * Both the endpoint and the pipe driver code contains stream functions, allowing for arrays of data to be sent to or from the

@ -55,7 +55,7 @@ void USB_Device_ProcessControlPacket(void)
} }
break; break;
#if !defined(NO_CLEARSET_FEATURE_REQUEST) #if !defined(FEATURELESS_CONTROL_ONLY_DEVICE)
case REQ_ClearFeature: case REQ_ClearFeature:
case REQ_SetFeature: case REQ_SetFeature:
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_ENDPOINT)) if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_ENDPOINT))
@ -238,7 +238,9 @@ static void USB_Device_GetStatus(const uint8_t bmRequestType)
Endpoint_Discard_Word(); Endpoint_Discard_Word();
#if !defined(FEATURELESS_CONTROL_ONLY_DEVICE)
uint8_t wIndex_LSB = Endpoint_Read_Byte(); uint8_t wIndex_LSB = Endpoint_Read_Byte();
#endif
switch (bmRequestType) switch (bmRequestType)
{ {
@ -250,12 +252,14 @@ static void USB_Device_GetStatus(const uint8_t bmRequestType)
CurrentStatus |= FEATURE_REMOTE_WAKEUP_ENABLED; CurrentStatus |= FEATURE_REMOTE_WAKEUP_ENABLED;
break; break;
#if !defined(FEATURELESS_CONTROL_ONLY_DEVICE)
case (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_ENDPOINT): case (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_ENDPOINT):
Endpoint_SelectEndpoint(wIndex_LSB); Endpoint_SelectEndpoint(wIndex_LSB);
CurrentStatus = Endpoint_IsStalled(); CurrentStatus = Endpoint_IsStalled();
break; break;
#endif
} }
Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
@ -268,7 +272,7 @@ static void USB_Device_GetStatus(const uint8_t bmRequestType)
Endpoint_ClearSetupOUT(); Endpoint_ClearSetupOUT();
} }
#if !defined(NO_CLEARSET_FEATURE_REQUEST) #if !defined(FEATURELESS_CONTROL_ONLY_DEVICE)
static void USB_Device_ClearSetFeature(const uint8_t bRequest, const uint8_t bmRequestType) static void USB_Device_ClearSetFeature(const uint8_t bRequest, const uint8_t bmRequestType)
{ {
uint16_t wValue = Endpoint_Read_Word_LE(); uint16_t wValue = Endpoint_Read_Word_LE();

@ -121,7 +121,7 @@
static void USB_Device_GetConfiguration(void); static void USB_Device_GetConfiguration(void);
static void USB_Device_GetDescriptor(void); static void USB_Device_GetDescriptor(void);
static void USB_Device_GetStatus(const uint8_t bmRequestType); static void USB_Device_GetStatus(const uint8_t bmRequestType);
#if !defined(NO_CLEARSET_FEATURE_REQUEST) #if !defined(FEATURELESS_CONTROL_ONLY_DEVICE)
static void USB_Device_ClearSetFeature(const uint8_t bRequest, const uint8_t bmRequestType); static void USB_Device_ClearSetFeature(const uint8_t bRequest, const uint8_t bmRequestType);
#endif #endif
#endif #endif

@ -29,6 +29,12 @@
* <b>Non-USB Library Components</b> * <b>Non-USB Library Components</b>
* - The ATTR_ALWAYSINLINE function attribute macro has been renamed to ATTR_ALWAYS_INLINE. * - The ATTR_ALWAYSINLINE function attribute macro has been renamed to ATTR_ALWAYS_INLINE.
* *
* <b>Device Mode</b>
* - The NO_CLEARSET_FEATURE_REQUEST compile time token has been renamed to NO_FEATURELESS_CONTROL_ONLY_DEVICE, and its function expanded
* to also remove parts of the Get Status chapter 9 request to further reduce code usage. On all applications currently using the
* NO_CLEARSET_FEATURE_REQUEST compile time token, it can be replaced with the NO_FEATURELESS_CONTROL_ONLY_DEVICE token with no further
* modifications required.
*
* \section Sec_Migration090209 Migrating from 081217 to 090209 * \section Sec_Migration090209 Migrating from 081217 to 090209
* *
* <b>Device Mode</b> * <b>Device Mode</b>

Loading…
Cancel
Save