mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-29 16:25:47 +03:00
DAP-Link: show error if usb is locked (#1982)
This commit is contained in:
parent
2d6c2886ae
commit
4d11213494
@ -13,6 +13,8 @@
|
||||
#include "dap_config.h"
|
||||
#include "gui/dap_gui.h"
|
||||
#include "usb/dap_v2_usb.h"
|
||||
#include <dialogs/dialogs.h>
|
||||
#include "dap_link_icons.h"
|
||||
|
||||
/***************************************************************************/
|
||||
/****************************** DAP COMMON *********************************/
|
||||
@ -495,6 +497,24 @@ DapConfig* dap_app_get_config(DapApp* app) {
|
||||
int32_t dap_link_app(void* p) {
|
||||
UNUSED(p);
|
||||
|
||||
if(furi_hal_usb_is_locked()) {
|
||||
DialogsApp* dialogs = furi_record_open(RECORD_DIALOGS);
|
||||
DialogMessage* message = dialog_message_alloc();
|
||||
dialog_message_set_header(message, "Connection\nis active!", 3, 2, AlignLeft, AlignTop);
|
||||
dialog_message_set_text(
|
||||
message,
|
||||
"Disconnect from\nPC or phone to\nuse this function.",
|
||||
3,
|
||||
30,
|
||||
AlignLeft,
|
||||
AlignTop);
|
||||
dialog_message_set_icon(message, &I_ActiveConnection_50x64, 78, 0);
|
||||
dialog_message_show(dialogs, message);
|
||||
dialog_message_free(message);
|
||||
furi_record_close(RECORD_DIALOGS);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// alloc app
|
||||
DapApp* app = dap_app_alloc();
|
||||
app_handle = app;
|
||||
|
BIN
applications/plugins/dap_link/icons/ActiveConnection_50x64.png
Normal file
BIN
applications/plugins/dap_link/icons/ActiveConnection_50x64.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.8 KiB |
Loading…
Reference in New Issue
Block a user