USB HID report timeout (#2682)

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Nikolay Minaylov 2023-05-25 17:50:13 +03:00 committed by GitHub
parent ed1ebf9b93
commit 12dc5b186f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -436,7 +436,11 @@ static bool hid_send_report(uint8_t report_id) {
if((hid_semaphore == NULL) || (hid_connected == false)) return false; if((hid_semaphore == NULL) || (hid_connected == false)) return false;
if((boot_protocol == true) && (report_id != ReportIdKeyboard)) 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) { if(hid_connected == false) {
return false; return false;
} }