forked from mfulz_github/qmk_firmware
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.
This commit is contained in:
parent
3803976534
commit
0214e096a0
|
@ -165,7 +165,7 @@ BOOT_START = 0x1E000
|
|||
|
||||
# Place -D or -U options here for C sources
|
||||
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 += -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
|
||||
|
|
|
@ -165,7 +165,7 @@ BOOT_START = 0xC000
|
|||
|
||||
# Place -D or -U options here for C sources
|
||||
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 += -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
|
||||
|
|
|
@ -30,6 +30,8 @@
|
|||
* - 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
|
||||
* - 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
|
||||
*
|
||||
|
|
|
@ -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.
|
||||
* 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
|
||||
* In some limited USB device applications, the Get Feature and Set Feature requests are not used - this is when the device does not have
|
||||
* device level features (such as remote wakeup) nor any data endpoints beyond the mandatory control endpoint. In such limited situations,
|
||||
* this token may be defined to remove the handling of the Get Feature and Set Feature Chapter 9 requests to save space. Generally, this
|
||||
* is usually only useful in (some) bootloaders.
|
||||
* <b>FEATURELESS_CONTROL_ONLY_DEVICE</b> - DevChapter9.h \n
|
||||
* In some limited USB device applications, device features (other than self-power) and endpoints other than the control endpoint aren't
|
||||
* used. In such limited situations, this token may be defined to remove the handling of the Set Feature Chapter 9 request entirely and
|
||||
* parts of the Get Feature chapter 9 request to save space. Generally, this is usually only useful in (some) bootloaders.
|
||||
*
|
||||
* <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
|
||||
|
|
|
@ -55,7 +55,7 @@ void USB_Device_ProcessControlPacket(void)
|
|||
}
|
||||
|
||||
break;
|
||||
#if !defined(NO_CLEARSET_FEATURE_REQUEST)
|
||||
#if !defined(FEATURELESS_CONTROL_ONLY_DEVICE)
|
||||
case REQ_ClearFeature:
|
||||
case REQ_SetFeature:
|
||||
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_ENDPOINT))
|
||||
|
@ -238,7 +238,9 @@ static void USB_Device_GetStatus(const uint8_t bmRequestType)
|
|||
|
||||
Endpoint_Discard_Word();
|
||||
|
||||
#if !defined(FEATURELESS_CONTROL_ONLY_DEVICE)
|
||||
uint8_t wIndex_LSB = Endpoint_Read_Byte();
|
||||
#endif
|
||||
|
||||
switch (bmRequestType)
|
||||
{
|
||||
|
@ -250,12 +252,14 @@ static void USB_Device_GetStatus(const uint8_t bmRequestType)
|
|||
CurrentStatus |= FEATURE_REMOTE_WAKEUP_ENABLED;
|
||||
|
||||
break;
|
||||
#if !defined(FEATURELESS_CONTROL_ONLY_DEVICE)
|
||||
case (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_ENDPOINT):
|
||||
Endpoint_SelectEndpoint(wIndex_LSB);
|
||||
|
||||
CurrentStatus = Endpoint_IsStalled();
|
||||
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
|
||||
|
@ -268,7 +272,7 @@ static void USB_Device_GetStatus(const uint8_t bmRequestType)
|
|||
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)
|
||||
{
|
||||
uint16_t wValue = Endpoint_Read_Word_LE();
|
||||
|
|
|
@ -121,7 +121,7 @@
|
|||
static void USB_Device_GetConfiguration(void);
|
||||
static void USB_Device_GetDescriptor(void);
|
||||
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);
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -29,6 +29,12 @@
|
|||
* <b>Non-USB Library Components</b>
|
||||
* - 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
|
||||
*
|
||||
* <b>Device Mode</b>
|
||||
|
|
Loading…
Reference in New Issue