diff options
Diffstat (limited to 'Demos/Device/Keyboard')
-rw-r--r-- | Demos/Device/Keyboard/Descriptors.c | 12 | ||||
-rw-r--r-- | Demos/Device/Keyboard/Descriptors.h | 4 | ||||
-rw-r--r-- | Demos/Device/Keyboard/Keyboard.c | 8 | ||||
-rw-r--r-- | Demos/Device/Keyboard/Keyboard.h | 4 |
4 files changed, 6 insertions, 22 deletions
diff --git a/Demos/Device/Keyboard/Descriptors.c b/Demos/Device/Keyboard/Descriptors.c index ddd19fc8c..8914909d7 100644 --- a/Demos/Device/Keyboard/Descriptors.c +++ b/Demos/Device/Keyboard/Descriptors.c @@ -136,7 +136,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .InterfaceNumber = 0x00,
.AlternateSetting = 0x00,
- .TotalEndpoints = 2,
+ .TotalEndpoints = 1,
.Class = 0x03,
.SubClass = 0x01,
@@ -165,16 +165,6 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointSize = KEYBOARD_EPSIZE,
.PollingIntervalMS = 0x04
},
-
- .KeyboardLEDsEndpoint =
- {
- .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
-
- .EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | KEYBOARD_LEDS_EPNUM),
- .Attributes = EP_TYPE_INTERRUPT,
- .EndpointSize = KEYBOARD_EPSIZE,
- .PollingIntervalMS = 0x04
- }
};
/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
diff --git a/Demos/Device/Keyboard/Descriptors.h b/Demos/Device/Keyboard/Descriptors.h index 0a95ca06e..40b358caa 100644 --- a/Demos/Device/Keyboard/Descriptors.h +++ b/Demos/Device/Keyboard/Descriptors.h @@ -54,15 +54,11 @@ USB_Descriptor_Interface_t Interface;
USB_Descriptor_HID_t KeyboardHID;
USB_Descriptor_Endpoint_t KeyboardEndpoint;
- USB_Descriptor_Endpoint_t KeyboardLEDsEndpoint;
} USB_Descriptor_Configuration_t;
/* Macros: */
/** Endpoint number of the Keyboard HID reporting IN endpoint. */
#define KEYBOARD_EPNUM 1
-
- /** Endpoint number of the Keyboard HID reporting OUT endpoint. */
- #define KEYBOARD_LEDS_EPNUM 2
/** Size in bytes of the Keyboard HID reporting IN and OUT endpoints. */
#define KEYBOARD_EPSIZE 8
diff --git a/Demos/Device/Keyboard/Keyboard.c b/Demos/Device/Keyboard/Keyboard.c index 923dd7176..bebad12e0 100644 --- a/Demos/Device/Keyboard/Keyboard.c +++ b/Demos/Device/Keyboard/Keyboard.c @@ -48,9 +48,6 @@ USB_ClassInfo_HID_t Keyboard_HID_Interface = .ReportINEndpointNumber = KEYBOARD_EPNUM,
.ReportINEndpointSize = KEYBOARD_EPSIZE,
- .ReportOUTEndpointNumber = KEYBOARD_LEDS_EPNUM,
- .ReportOUTEndpointSize = KEYBOARD_EPSIZE,
-
.ReportINBufferSize = sizeof(USB_KeyboardReport_Data_t),
.IdleCount = 500,
@@ -136,7 +133,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK) *
* \return Number of bytes written in the report (or zero if no report is to be sent
*/
-uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, void* ReportData)
+uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData)
{
USB_KeyboardReport_Data_t* KeyboardReport = (USB_KeyboardReport_Data_t*)ReportData;
@@ -168,7 +165,8 @@ uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceI * \param ReportData Pointer to a buffer where the created report has been stored
* \param ReportSize Size in bytes of the received HID report
*/
-void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, void* ReportData, uint16_t ReportSize)
+void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
+ void* ReportData, uint16_t ReportSize)
{
uint8_t LEDMask = LEDS_NO_LEDS;
uint8_t* LEDReport = (uint8_t*)ReportData;
diff --git a/Demos/Device/Keyboard/Keyboard.h b/Demos/Device/Keyboard/Keyboard.h index e04ae9e34..1b4bb7092 100644 --- a/Demos/Device/Keyboard/Keyboard.h +++ b/Demos/Device/Keyboard/Keyboard.h @@ -86,8 +86,8 @@ void EVENT_USB_ConfigurationChanged(void);
void EVENT_USB_UnhandledControlPacket(void);
- uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, void* ReportData);
- void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo,
+ uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData);
+ void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize);
#endif
|