diff options
Diffstat (limited to 'firmware/usbstack')
| -rw-r--r-- | firmware/usbstack/usb_hid.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/firmware/usbstack/usb_hid.c b/firmware/usbstack/usb_hid.c index ed08163..2b05f5c 100644 --- a/firmware/usbstack/usb_hid.c +++ b/firmware/usbstack/usb_hid.c @@ -169,6 +169,7 @@ typedef struct } usb_hid_report_t; static usb_hid_report_t usb_hid_reports[REPORT_ID_COUNT]; +static uint8_t usb_hid_led_buf; static unsigned char report_descriptor[HID_BUF_SIZE_REPORT] USB_DEVBSS_ATTR __attribute__((aligned(32))); @@ -668,7 +669,7 @@ static int usb_hid_set_report(struct usb_ctrlrequest *req) } memset(buf, 0, length); - usb_drv_recv(EP_CONTROL, buf, length); + usb_drv_recv_blocking(EP_CONTROL, buf, length); #ifdef LOGF_ENABLE if (buf[1] & 0x01) @@ -688,6 +689,11 @@ static int usb_hid_set_report(struct usb_ctrlrequest *req) return 0; } +uint8_t usb_hid_leds(void) +{ + return usb_hid_led_buf; +} + /* called by usb_core_control_request() */ bool usb_hid_control_request(struct usb_ctrlrequest *req, unsigned char *dest) { |