diff options
| author | Hierophect <hierophect@gmail.com> | 2019-12-05 14:25:39 -0500 |
|---|---|---|
| committer | Hierophect <hierophect@gmail.com> | 2019-12-05 14:25:39 -0500 |
| commit | 9b43d5ced4d41b58209cc37434543bd990cced8f (patch) | |
| tree | e20cf5c6d22da140c16a6810011dd3ea0d4af443 /shared-module/usb_hid/Device.c | |
| parent | 0d8eb3cfb4ef0e2a01a657752603a4c259423e46 (diff) | |
| parent | 12f64c7c16377c0600d7b09e7848474254e46d1e (diff) | |
Merge remote-tracking branch 'upstream/master' into stm32-blackpill
Diffstat (limited to 'shared-module/usb_hid/Device.c')
| -rw-r--r-- | shared-module/usb_hid/Device.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/shared-module/usb_hid/Device.c b/shared-module/usb_hid/Device.c index bed7d163f..8744f2ed3 100644 --- a/shared-module/usb_hid/Device.c +++ b/shared-module/usb_hid/Device.c @@ -30,6 +30,7 @@ #include "shared-bindings/usb_hid/Device.h" #include "shared-module/usb_hid/Device.h" #include "supervisor/shared/translate.h" +#include "supervisor/shared/tick.h" #include "tusb.h" uint8_t common_hal_usb_hid_device_get_usage_page(usb_hid_device_obj_t *self) { @@ -46,8 +47,8 @@ void common_hal_usb_hid_device_send_report(usb_hid_device_obj_t *self, uint8_t* } // Wait until interface is ready, timeout = 2 seconds - uint64_t end_ticks = ticks_ms + 2000; - while ( (ticks_ms < end_ticks) && !tud_hid_ready() ) { + uint64_t end_ticks = supervisor_ticks_ms64() + 2000; + while ( (supervisor_ticks_ms64() < end_ticks) && !tud_hid_ready() ) { RUN_BACKGROUND_TASKS; } |
