Skip to content

Commit

Permalink
USB HID report timeout (#2682)
Browse files Browse the repository at this point in the history
Co-authored-by: あく <[email protected]>
  • Loading branch information
nminaylov and skotopes authored May 25, 2023
1 parent ed1ebf9 commit 12dc5b1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion firmware/targets/f7/furi_hal/furi_hal_usb_hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,11 @@ static bool hid_send_report(uint8_t report_id) {
if((hid_semaphore == NULL) || (hid_connected == false)) return false;
if((boot_protocol == true) && (report_id != ReportIdKeyboard)) return false;

furi_check(furi_semaphore_acquire(hid_semaphore, FuriWaitForever) == FuriStatusOk);
FuriStatus status = furi_semaphore_acquire(hid_semaphore, HID_INTERVAL * 2);
if(status == FuriStatusErrorTimeout) {
return false;
}
furi_check(status == FuriStatusOk);
if(hid_connected == false) {
return false;
}
Expand Down

0 comments on commit 12dc5b1

Please sign in to comment.