[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

@@ -12,16 +12,26 @@ static void u2f_scene_error_event_callback(GuiButtonType result, InputType type,
void u2f_scene_error_on_enter(void* context) {
U2fApp* app = context;
widget_add_icon_element(app->widget, 0, 0, &I_SDQuestion_35x43);
widget_add_string_multiline_element(
app->widget,
81,
4,
AlignCenter,
AlignTop,
FontSecondary,
"No SD card or\napp data found.\nThis app will not\nwork without\nrequired files.");
if(app->error == U2fAppErrorNoFiles) {
widget_add_icon_element(app->widget, 0, 0, &I_SDQuestion_35x43);
widget_add_string_multiline_element(
app->widget,
81,
4,
AlignCenter,
AlignTop,
FontSecondary,
"No SD card or\napp data found.\nThis app will not\nwork without\nrequired files.");
} else if(app->error == U2fAppErrorCloseRpc) {
widget_add_string_multiline_element(
app->widget,
63,
10,
AlignCenter,
AlignTop,
FontSecondary,
"Disconnect from\ncompanion app\nto use this function");
}
widget_add_button_element(
app->widget, GuiButtonTypeLeft, "Back", u2f_scene_error_event_callback, app);