mirror of
https://github.com/qmk/qmk_firmware.git
synced 2026-10-02 06:49:16 +02:00
Merge remote-tracking branch 'origin/develop' into xap
This commit is contained in:
@@ -115,9 +115,10 @@ uint8_t extra_report_blank[3] = {0};
|
||||
static const USBDescriptor *usb_get_descriptor_cb(USBDriver *usbp, uint8_t dtype, uint8_t dindex, uint16_t wIndex) {
|
||||
(void)usbp;
|
||||
static USBDescriptor desc;
|
||||
uint16_t wValue = ((uint16_t)dtype << 8) | dindex;
|
||||
desc.ud_string = NULL;
|
||||
desc.ud_size = get_usb_descriptor(wValue, wIndex, (const void **const) & desc.ud_string);
|
||||
uint16_t wValue = ((uint16_t)dtype << 8) | dindex;
|
||||
uint16_t wLength = ((uint16_t)usbp->setup[7] << 8) | usbp->setup[6];
|
||||
desc.ud_string = NULL;
|
||||
desc.ud_size = get_usb_descriptor(wValue, wIndex, wLength, (const void **const) & desc.ud_string);
|
||||
if (desc.ud_string == NULL)
|
||||
return NULL;
|
||||
else
|
||||
@@ -600,7 +601,8 @@ static uint16_t get_hword(uint8_t *p) {
|
||||
*/
|
||||
|
||||
static uint8_t set_report_buf[2] __attribute__((aligned(4)));
|
||||
static void set_led_transfer_cb(USBDriver *usbp) {
|
||||
|
||||
static void set_led_transfer_cb(USBDriver *usbp) {
|
||||
if (usbp->setup[6] == 2) { /* LSB(wLength) */
|
||||
uint8_t report_id = set_report_buf[0];
|
||||
if ((report_id == REPORT_ID_KEYBOARD) || (report_id == REPORT_ID_NKRO)) {
|
||||
|
||||
@@ -1014,5 +1014,5 @@ void protocol_post_task(void) {
|
||||
}
|
||||
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint16_t wIndex, const void **const DescriptorAddress) {
|
||||
return get_usb_descriptor(wValue, wIndex, DescriptorAddress);
|
||||
return get_usb_descriptor(wValue, wIndex, USB_ControlRequest.wLength, DescriptorAddress);
|
||||
}
|
||||
|
||||
@@ -45,6 +45,10 @@
|
||||
# include "joystick.h"
|
||||
#endif
|
||||
|
||||
#ifdef OS_DETECTION_ENABLE
|
||||
# include "os_detection.h"
|
||||
#endif
|
||||
|
||||
// clang-format off
|
||||
|
||||
/*
|
||||
@@ -1166,7 +1170,7 @@ const USB_Descriptor_String_t PROGMEM SerialNumberString = {
|
||||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
uint16_t get_usb_descriptor(const uint16_t wValue, const uint16_t wIndex, const void** const DescriptorAddress) {
|
||||
uint16_t get_usb_descriptor(const uint16_t wValue, const uint16_t wIndex, const uint16_t wLength, const void** const DescriptorAddress) {
|
||||
const uint8_t DescriptorType = (wValue >> 8);
|
||||
const uint8_t DescriptorIndex = (wValue & 0xFF);
|
||||
const void* Address = NULL;
|
||||
@@ -1208,6 +1212,9 @@ uint16_t get_usb_descriptor(const uint16_t wValue, const uint16_t wIndex, const
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
#ifdef OS_DETECTION_ENABLE
|
||||
process_wlength(wLength);
|
||||
#endif
|
||||
|
||||
break;
|
||||
case HID_DTYPE_HID:
|
||||
|
||||
@@ -330,4 +330,4 @@ enum usb_endpoints {
|
||||
#define DIGITIZER_EPSIZE 8
|
||||
#define XAP_EPSIZE 64
|
||||
|
||||
uint16_t get_usb_descriptor(const uint16_t wValue, const uint16_t wIndex, const void** const DescriptorAddress);
|
||||
uint16_t get_usb_descriptor(const uint16_t wValue, const uint16_t wIndex, const uint16_t wLength, const void** const DescriptorAddress);
|
||||
|
||||
@@ -49,6 +49,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# include "ring_buffer.h"
|
||||
#endif
|
||||
|
||||
#ifdef OS_DETECTION_ENABLE
|
||||
# include "os_detection.h"
|
||||
#endif
|
||||
|
||||
#define NEXT_INTERFACE __COUNTER__
|
||||
|
||||
/*
|
||||
@@ -1192,6 +1196,9 @@ USB_PUBLIC usbMsgLen_t usbFunctionDescriptor(struct usbRequest *rq) {
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
#ifdef OS_DETECTION_ENABLE
|
||||
process_wlength(rq->wLength.word);
|
||||
#endif
|
||||
break;
|
||||
case USBDESCR_HID:
|
||||
switch (rq->wValue.bytes[0]) {
|
||||
|
||||
Reference in New Issue
Block a user