Merge branch 'qmk-pre-merge-2021-09-12' into qmk-merge-2021-09-12
This commit is contained in:
@ -272,7 +272,8 @@ static void send_extra(uint8_t report_id, uint16_t data) {
|
||||
last_id = report_id;
|
||||
last_data = data;
|
||||
|
||||
report_extra_t report = {.report_id = report_id, .usage = data};
|
||||
static report_extra_t report;
|
||||
report = (report_extra_t){.report_id = report_id, .usage = data};
|
||||
if (usbInterruptIsReadyShared()) {
|
||||
usbSetInterruptShared((void *)&report, sizeof(report_extra_t));
|
||||
}
|
||||
@ -291,6 +292,14 @@ static void send_consumer(uint16_t data) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void send_digitizer(report_digitizer_t *report) {
|
||||
#ifdef DIGITIZER_ENABLE
|
||||
if (usbInterruptIsReadyShared()) {
|
||||
usbSetInterruptShared((void *)report, sizeof(report_digitizer_t));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------*
|
||||
* Request from host *
|
||||
*------------------------------------------------------------------*/
|
||||
@ -513,8 +522,46 @@ const PROGMEM uchar shared_hid_report[] = {
|
||||
0x95, 0x01, // Report Count (1)
|
||||
0x75, 0x10, // Report Size (16)
|
||||
0x81, 0x00, // Input (Data, Array, Absolute)
|
||||
0xC0 // End Collection
|
||||
0xC0, // End Collection
|
||||
#endif
|
||||
|
||||
#ifdef DIGITIZER_ENABLE
|
||||
// Digitizer report descriptor
|
||||
0x05, 0x0D, // Usage Page (Digitizers)
|
||||
0x09, 0x01, // Usage (Digitizer)
|
||||
0xA1, 0x01, // Collection (Application)
|
||||
0x85, REPORT_ID_DIGITIZER, // Report ID
|
||||
0x09, 0x22, // Usage (Finger)
|
||||
0xA1, 0x00, // Collection (Physical)
|
||||
// Tip Switch (1 bit)
|
||||
0x09, 0x42, // Usage (Tip Switch)
|
||||
0x15, 0x00, // Logical Minimum
|
||||
0x25, 0x01, // Logical Maximum
|
||||
0x95, 0x01, // Report Count (1)
|
||||
0x75, 0x01, // Report Size (16)
|
||||
0x81, 0x02, // Input (Data, Variable, Absolute)
|
||||
// In Range (1 bit)
|
||||
0x09, 0x32, // Usage (In Range)
|
||||
0x81, 0x02, // Input (Data, Variable, Absolute)
|
||||
// Padding (6 bits)
|
||||
0x95, 0x06, // Report Count (6)
|
||||
0x81, 0x03, // Input (Constant)
|
||||
|
||||
// X/Y Position (4 bytes)
|
||||
0x05, 0x01, // Usage Page (Generic Desktop)
|
||||
0x26, 0xFF, 0x7F, // Logical Maximum (32767)
|
||||
0x95, 0x01, // Report Count (1)
|
||||
0x75, 0x10, // Report Size (16)
|
||||
0x65, 0x33, // Unit (Inch, English Linear)
|
||||
0x55, 0x0E, // Unit Exponent (-2)
|
||||
0x09, 0x30, // Usage (X)
|
||||
0x81, 0x02, // Input (Data, Variable, Absolute)
|
||||
0x09, 0x31, // Usage (Y)
|
||||
0x81, 0x02, // Input (Data, Variable, Absolute)
|
||||
0xC0, // End Collection
|
||||
0xC0 // End Collection
|
||||
#endif
|
||||
|
||||
#ifdef SHARED_EP_ENABLE
|
||||
};
|
||||
#endif
|
||||
@ -565,14 +612,6 @@ const PROGMEM uchar console_hid_report[] = {
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifndef SERIAL_NUMBER
|
||||
#ifdef VIAL_ENABLE
|
||||
# define SERIAL_NUMBER vial:f64c2b3c
|
||||
#else
|
||||
# define SERIAL_NUMBER 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef USB_MAX_POWER_CONSUMPTION
|
||||
# define USB_MAX_POWER_CONSUMPTION 500
|
||||
#endif
|
||||
@ -610,10 +649,10 @@ const PROGMEM usbStringDescriptor_t usbStringDescriptorProduct = {
|
||||
#if defined(SERIAL_NUMBER)
|
||||
const PROGMEM usbStringDescriptor_t usbStringDescriptorSerial = {
|
||||
.header = {
|
||||
.bLength = USB_STRING_LEN(sizeof(STR(SERIAL_NUMBER)) - 1),
|
||||
.bLength = USB_STRING_LEN(sizeof(SERIAL_NUMBER) - 1),
|
||||
.bDescriptorType = USBDESCR_STRING
|
||||
},
|
||||
.bString = LSTR(SERIAL_NUMBER)
|
||||
.bString = USBSTR(SERIAL_NUMBER)
|
||||
};
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user