Add branch for the conversion of demos to use standard C header files for configuration, rather than makefile defined macros.
This commit is contained in:
1 parent
e8570c4a37
commit
359fbfe14d
395 files changed
+9912
-2756
No files matched your search
@@ -155,10 +155,10 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
||||
{
|
||||
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||
|
||||
.EndpointAddress = (ENDPOINT_DIR_IN | JOYSTICK_EPNUM),
|
||||
.EndpointAddress = JOYSTICK_EPADDR,
|
||||
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
|
||||
.EndpointSize = JOYSTICK_EPSIZE,
|
||||
.PollingIntervalMS = 0x01
|
||||
.PollingIntervalMS = 0x05
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -57,8 +57,8 @@
|
||||
} USB_Descriptor_Configuration_t;
|
||||
|
||||
/* Macros: */
|
||||
/** Endpoint number of the Joystick HID reporting IN endpoint. */
|
||||
#define JOYSTICK_EPNUM 1
|
||||
/** Endpoint address of the Joystick HID reporting IN endpoint. */
|
||||
#define JOYSTICK_EPADDR (ENDPOINT_DIR_IN | 1)
|
||||
|
||||
/** Size in bytes of the Joystick HID reporting IN endpoint. */
|
||||
#define JOYSTICK_EPSIZE 8
|
||||
|
||||
@@ -96,8 +96,7 @@ void EVENT_USB_Device_ConfigurationChanged(void)
|
||||
bool ConfigSuccess = true;
|
||||
|
||||
/* Setup HID Report Endpoint */
|
||||
ConfigSuccess &= Endpoint_ConfigureEndpoint(JOYSTICK_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN,
|
||||
JOYSTICK_EPSIZE, ENDPOINT_BANK_SINGLE);
|
||||
ConfigSuccess &= Endpoint_ConfigureEndpoint(JOYSTICK_EPADDR, EP_TYPE_INTERRUPT, JOYSTICK_EPSIZE, 1);
|
||||
|
||||
/* Indicate endpoint configuration success or failure */
|
||||
LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
|
||||
@@ -183,7 +182,7 @@ void HID_Task(void)
|
||||
return;
|
||||
|
||||
/* Select the Joystick Report Endpoint */
|
||||
Endpoint_SelectEndpoint(JOYSTICK_EPNUM);
|
||||
Endpoint_SelectEndpoint(JOYSTICK_EPADDR);
|
||||
|
||||
/* Check to see if the host is ready for another packet */
|
||||
if (Endpoint_IsINReady())
|
||||
|
||||
Reference in new issue
Block a user