Makes each #define value a primary expression. Set the class length field in the HID descriptor to zero.

This commit is contained in:
mbanth
2021-05-27 17:56:26 +01:00
parent 0b9d970f75
commit 7b43785816
3 changed files with 22 additions and 22 deletions

View File

@@ -12,15 +12,15 @@
#include "xua_hid_descriptor.h"
#define HID_DESCRIPTOR_LENGTH_0 0x09 /* Size of descriptor in Bytes */
#define HID_DESCRIPTOR_TYPE_0 0x21 /* HID 0x21 */
#define HID_BCD_VERSION_LO 0x10 /* HID class specification release */
#define HID_BCD_VERSION_HI 0x01
#define HID_COUNTRY_CODE 0x00 /* Country code of localized hardware */
#define HID_NUM_DESCRIPTORS 0x01 /* Number of class descriptors */
#define HID_DESCRIPTOR_TYPE_1 0x22 /* Type of 1st class descriptor, Report 0x22 */
#define HID_DESCRIPTOR_LENGTH_1_LO sizeof(hidReportDescriptor) & 0xff
#define HID_DESCRIPTOR_LENGTH_1_HI sizeof(hidReportDescriptor) >> 8
#define HID_DESCRIPTOR_LENGTH_0 ( 0x09 ) /* Size of descriptor in Bytes */
#define HID_DESCRIPTOR_TYPE_0 ( 0x21 ) /* HID 0x21 */
#define HID_BCD_VERSION_LO ( 0x10 ) /* HID class specification release */
#define HID_BCD_VERSION_HI ( 0x01 )
#define HID_COUNTRY_CODE ( 0x00 ) /* Country code of localized hardware */
#define HID_NUM_DESCRIPTORS ( 0x01 ) /* Number of class descriptors */
#define HID_DESCRIPTOR_TYPE_1 ( 0x22 ) /* Type of 1st class descriptor, Report 0x22 */
#define HID_DESCRIPTOR_LENGTH_1_LO ( 0x00 ) /* Length of 1st class descriptor, set to zero */
#define HID_DESCRIPTOR_LENGTH_1_HI ( 0x00 ) /* since only pre-processor directives allowed here */
#endif // _HID_DESCRIPTOR_CONTENTS_

View File

@@ -12,11 +12,11 @@
#include "descriptor_defs.h"
#define HID_ENDPOINT_DESCRIPTOR_LENGTH 0x07 /* Size of descriptor in Bytes */
#define HID_ENDPOINT_DESCRIPTOR_TYPE 0x05 /* Endpoint 0x05 */
#define HID_ENDPOINT_ATTRIBUTES 0x03 /* Interrupt */
#define HID_ENDPOINT_DESCRIPTOR_PACKET_SIZE_LO 0x40
#define HID_ENDPOINT_DESCRIPTOR_PACKET_SIZE_HI 0x00
#define HID_ENDPOINT_DESCRIPTOR_LENGTH ( 0x07 ) /* Size of descriptor in Bytes */
#define HID_ENDPOINT_DESCRIPTOR_TYPE ( 0x05 ) /* Endpoint 0x05 */
#define HID_ENDPOINT_ATTRIBUTES ( 0x03 ) /* Interrupt */
#define HID_ENDPOINT_DESCRIPTOR_PACKET_SIZE_LO ( 0x40 )
#define HID_ENDPOINT_DESCRIPTOR_PACKET_SIZE_HI ( 0x00 )
#endif // _HID_ENDPOINT_DESCRIPTOR_CONTENTS_

View File

@@ -12,14 +12,14 @@
#include "descriptor_defs.h"
#define HID_INTERFACE_DESCRIPTOR_LENGTH 0x09 /* Size of descriptor in Bytes */
#define HID_INTERFACE_DESCRIPTOR_TYPE 0x04 /* Interface 0x04 */
#define HID_INTERFACE_ALTERNATE_SETTING 0x00 /* Value used alternate interfaces using SetInterface Request */
#define HID_INTERFACE_NUMBER_OF_ENDPOINTS 0x01 /* Number of endpoitns for this interface (excluding 0) */
#define HID_INTERFACE_CLASS 0x03
#define HID_INTERFACE_SUBCLASS 0x00 /* No boot device */
#define HID_INTERFACE_PROTOCOL 0x00
#define HID_INTERFACE_STRING_DESCRIPTOR_INDEX 0x00
#define HID_INTERFACE_DESCRIPTOR_LENGTH ( 0x09 ) /* Size of descriptor in Bytes */
#define HID_INTERFACE_DESCRIPTOR_TYPE ( 0x04 ) /* Interface 0x04 */
#define HID_INTERFACE_ALTERNATE_SETTING ( 0x00 ) /* Value used alternate interfaces using SetInterface Request */
#define HID_INTERFACE_NUMBER_OF_ENDPOINTS ( 0x01 ) /* Number of endpoitns for this interface (excluding 0) */
#define HID_INTERFACE_CLASS ( 0x03 )
#define HID_INTERFACE_SUBCLASS ( 0x00 ) /* No boot device */
#define HID_INTERFACE_PROTOCOL ( 0x00 )
#define HID_INTERFACE_STRING_DESCRIPTOR_INDEX ( 0x00 )
#endif // _HID_INTERFACE_DESCRIPTOR_CONTENTS_