diff options
| author | Franklin Wei <frankhwei536@gmail.com> | 2016-06-13 22:32:55 +0100 |
|---|---|---|
| committer | Franklin Wei <frankhwei536@gmail.com> | 2016-06-14 19:34:08 -0400 |
| commit | 475a26c6f6f723e080cbbb65f45eea5210f324de (patch) | |
| tree | 2c39038c98ec3daae396a07394bfeafdf0935170 /firmware/usbstack | |
| parent | c7a561e9f16b9c14631b448510297ffa912c298c (diff) | |
| download | rockbox-475a26c6f6f723e080cbbb65f45eea5210f324de.zip rockbox-475a26c6f6f723e080cbbb65f45eea5210f324de.tar.gz rockbox-475a26c6f6f723e080cbbb65f45eea5210f324de.tar.bz2 rockbox-475a26c6f6f723e080cbbb65f45eea5210f324de.tar.xz | |
usb: implement blocking receive
XXX explain why this is useful
Change-Id: I680fc8daf3b97e311dcb05baac8628cee2abf70e
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) { |