summaryrefslogtreecommitdiff
path: root/stmhal/usbd_hid_interface.c
diff options
context:
space:
mode:
authorPavol Rusnak <stick@gk2.sk>2016-12-28 18:56:03 +0100
committerDamien George <damien.p.george@gmail.com>2017-01-19 12:34:58 +1100
commit6ace84b08962baff5baae09443e9d4f968d11e84 (patch)
tree534ed310557d0859c2784425adb276256c446201 /stmhal/usbd_hid_interface.c
parent89f2b620164c72f522613997a15d7427f693409b (diff)
stmhal: Implement ioctl for USB HID read.
Diffstat (limited to 'stmhal/usbd_hid_interface.c')
-rw-r--r--stmhal/usbd_hid_interface.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/stmhal/usbd_hid_interface.c b/stmhal/usbd_hid_interface.c
index 837feece9..4987314bd 100644
--- a/stmhal/usbd_hid_interface.c
+++ b/stmhal/usbd_hid_interface.c
@@ -93,6 +93,11 @@ static int8_t HID_Itf_Receive(uint8_t* Buf, uint32_t Len) {
return USBD_OK;
}
+// Returns number of ready rx buffers.
+int USBD_HID_RxNum(void) {
+ return (current_read_buffer != current_write_buffer);
+}
+
// timout in milliseconds.
// Returns number of bytes read from the device.
int USBD_HID_Rx(uint8_t *buf, uint32_t len, uint32_t timeout) {