[FL-2315] USB Mode switch lock (#1036)

* usb mode switch lock
* lock_mutex removed
* Wait for session termination in rpc_cli, lock badusb and u2f if rpc session is opened

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Nikolay Minaylov
2022-03-24 18:45:03 +03:00
committed by GitHub
parent eafeefb843
commit 38e92cf789
20 changed files with 216 additions and 43 deletions

View File

@@ -191,7 +191,7 @@ static int32_t u2f_hid_worker(void* context) {
FURI_LOG_D(WORKER_TAG, "Init");
FuriHalUsbInterface* usb_mode_prev = furi_hal_usb_get_config();
furi_hal_usb_set_config(&usb_hid_u2f, NULL);
furi_check(furi_hal_usb_set_config(&usb_hid_u2f, NULL) == true);
u2f_hid->lock_timer = osTimerNew(u2f_hid_lock_timeout_callback, osTimerOnce, u2f_hid, NULL);