فهرست منبع

Merge dap_link from https://github.com/xMasterX/all-the-plugins

Willy-JL 1 سال پیش
والد
کامیت
af1ed5ea59
2فایلهای تغییر یافته به همراه13 افزوده شده و 1 حذف شده
  1. 1 1
      dap_link/application.fam
  2. 12 0
      dap_link/dap_link.c

+ 1 - 1
dap_link/application.fam

@@ -9,7 +9,7 @@ App(
     ],
     stack_size=4 * 1024,
     fap_description="Enables use of Flipper as a debug probe for ARM devices, implements the CMSIS-DAP protocol",
-    fap_version="1.1",
+    fap_version="1.2",
     fap_icon="dap_link.png",
     fap_category="GPIO",
     fap_private_libs=[

+ 12 - 0
dap_link/dap_link.c

@@ -9,6 +9,8 @@
 #include <stm32wbxx_ll_usart.h>
 #include <stm32wbxx_ll_lpuart.h>
 
+#include <expansion/expansion.h>
+
 #include "dap_link.h"
 #include "dap_config.h"
 #include "gui/dap_gui.h"
@@ -512,6 +514,9 @@ DapConfig* dap_app_get_config(DapApp* app) {
 
 int32_t dap_link_app(void* p) {
     UNUSED(p);
+    // Disable expansion protocol to avoid interference with UART Handle
+    Expansion* expansion = furi_record_open(RECORD_EXPANSION);
+    expansion_disable(expansion);
 
     if(furi_hal_usb_is_locked()) {
         DialogsApp* dialogs = furi_record_open(RECORD_DIALOGS);
@@ -528,6 +533,9 @@ int32_t dap_link_app(void* p) {
         dialog_message_show(dialogs, message);
         dialog_message_free(message);
         furi_record_close(RECORD_DIALOGS);
+        // Return previous state of expansion
+        expansion_enable(expansion);
+        furi_record_close(RECORD_EXPANSION);
         return -1;
     }
 
@@ -553,5 +561,9 @@ int32_t dap_link_app(void* p) {
     // free app
     dap_app_free(app);
 
+    // Return previous state of expansion
+    expansion_enable(expansion);
+    furi_record_close(RECORD_EXPANSION);
+
     return 0;
 }