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

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

# Conflicts:
#	evil_portal/evil_portal_app_i.h
Willy-JL 1 éve
szülő
commit
e9d4a97a32
1 módosított fájl, 10 hozzáadás és 0 törlés
  1. 10 0
      evil_portal/evil_portal_app.c

+ 10 - 0
evil_portal/evil_portal_app.c

@@ -3,6 +3,7 @@
 
 #include <furi.h>
 #include <furi_hal.h>
+#include <expansion/expansion.h>
 
 static bool evil_portal_app_custom_event_callback(void* context, uint32_t event) {
     furi_assert(context);
@@ -127,6 +128,11 @@ void evil_portal_app_free(Evil_PortalApp* app) {
 
 int32_t evil_portal_app(void* p) {
     UNUSED(p);
+
+    // Disable expansion protocol to avoid interference with UART Handle
+    Expansion* expansion = furi_record_open(RECORD_EXPANSION);
+    expansion_disable(expansion);
+
     Evil_PortalApp* evil_portal_app = evil_portal_app_alloc();
 
     bool otg_was_enabled = furi_hal_power_is_otg_enabled();
@@ -151,5 +157,9 @@ int32_t evil_portal_app(void* p) {
         furi_hal_power_disable_otg();
     }
 
+    // Return previous state of expansion
+    expansion_enable(expansion);
+    furi_record_close(RECORD_EXPANSION);
+
     return 0;
 }