Forráskód Böngészése

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

# Conflicts:
#	esp8266_deauth/esp8266_deauth.c
Willy-JL 1 éve
szülő
commit
85fc7254e4
1 módosított fájl, 12 hozzáadás és 0 törlés
  1. 12 0
      esp8266_deauth/esp8266_deauth.c

+ 12 - 0
esp8266_deauth/esp8266_deauth.c

@@ -6,6 +6,7 @@
 #include <gui/canvas_i.h>
 #include <gui/gui.h>
 #include <input/input.h>
+#include <expansion/expansion.h>
 //#include <math.h>
 //#include <notification/notification.h>
 //#include <notification/notification_messages.h>
@@ -317,6 +318,10 @@ static int32_t uart_worker(void* context) {
 int32_t esp8266_deauth_app(void* p) {
     UNUSED(p);
 
+    // Disable expansion protocol to avoid interference with UART Handle
+    Expansion* expansion = furi_record_open(RECORD_EXPANSION);
+    expansion_disable(expansion);
+
     DEAUTH_APP_LOG_I("Init");
 
     // FuriTimer* timer = furi_timer_alloc(blink_test_update, FuriTimerTypePeriodic, event_queue);
@@ -365,6 +370,9 @@ int32_t esp8266_deauth_app(void* p) {
     if(!app->mutex) {
         DEAUTH_APP_LOG_E("cannot create mutex\r\n");
         free(app);
+        // Return previous state of expansion
+        expansion_enable(expansion);
+        furi_record_close(RECORD_EXPANSION);
         return 255;
     }
 
@@ -543,5 +551,9 @@ int32_t esp8266_deauth_app(void* p) {
     }
 #endif
 
+    // Return previous state of expansion
+    expansion_enable(expansion);
+    furi_record_close(RECORD_EXPANSION);
+
     return 0;
 }