Browse Source

Merge branch 'merge_momentum_dev'

Zachary Weiss 1 year ago
parent
commit
d94b8bfd27

+ 4 - 2
application.fam

@@ -1,6 +1,6 @@
 App(
 App(
-    appid="mag",
-    name="MagSpoof",
+    appid="magspoof",
+    name="[MAG] MagSpoof",
     apptype=FlipperAppType.EXTERNAL,
     apptype=FlipperAppType.EXTERNAL,
     entry_point="mag_app",
     entry_point="mag_app",
     cdefines=["APP_MAG"],
     cdefines=["APP_MAG"],
@@ -10,12 +10,14 @@ App(
         "notification",
         "notification",
         "dialogs",
         "dialogs",
     ],
     ],
+    resources="resources",
     provides=[],
     provides=[],
     stack_size=6 * 1024,
     stack_size=6 * 1024,
     order=64,  # keep it at the bottom of the list while still WIP
     order=64,  # keep it at the bottom of the list while still WIP
     fap_icon="icons/mag_10px.png",
     fap_icon="icons/mag_10px.png",
     fap_category="GPIO",
     fap_category="GPIO",
     fap_icon_assets="icons",
     fap_icon_assets="icons",
+    fap_icon_assets_symbol="mag",
     fap_version=(0, 5),  # major, minor
     fap_version=(0, 5),  # major, minor
     fap_description="WIP MagSpoof port using the RFID subsystem",
     fap_description="WIP MagSpoof port using the RFID subsystem",
     fap_author="Zachary Weiss",
     fap_author="Zachary Weiss",

+ 10 - 11
helpers/mag_helpers.c

@@ -68,9 +68,9 @@ void play_halfbit(bool value, MagSetting* setting) {
         //(value) ? furi_hal_nfc_ll_txrx_on() : furi_hal_nfc_ll_txrx_off();
         //(value) ? furi_hal_nfc_ll_txrx_on() : furi_hal_nfc_ll_txrx_off();
 
 
         if(last_value == 2 || value != (bool)last_value) {
         if(last_value == 2 || value != (bool)last_value) {
-            furi_hal_nfc_ll_txrx_on();
+            //furi_hal_nfc_ll_txrx_on();
             //furi_delay_us(64);
             //furi_delay_us(64);
-            furi_hal_nfc_ll_txrx_off();
+            //furi_hal_nfc_ll_txrx_off();
         }
         }
         break;
         break;
     case MagTxCC1101_434:
     case MagTxCC1101_434:
@@ -126,8 +126,6 @@ void play_track(uint8_t* bits_manchester, uint16_t n_bits, MagSetting* setting,
 void tx_init_rfid() {
 void tx_init_rfid() {
     // initialize RFID system for TX
     // initialize RFID system for TX
 
 
-    // OTG needed for RFID? Or just legacy from GPIO?
-    // furi_hal_power_enable_otg();
     furi_hal_ibutton_pin_configure();
     furi_hal_ibutton_pin_configure();
 
 
     // furi_hal_ibutton_start_drive();
     // furi_hal_ibutton_start_drive();
@@ -155,7 +153,6 @@ void tx_deinit_rfid() {
     furi_hal_gpio_write(RFID_PIN_OUT, 0);
     furi_hal_gpio_write(RFID_PIN_OUT, 0);
 
 
     furi_hal_rfid_pins_reset();
     furi_hal_rfid_pins_reset();
-    furi_hal_power_disable_otg();
 }
 }
 
 
 void tx_init_rf(int hz) {
 void tx_init_rf(int hz) {
@@ -189,7 +186,6 @@ bool tx_init(MagSetting* setting) {
         tx_init_rfid();
         tx_init_rfid();
         break;
         break;
     case MagTxStateGPIO:
     case MagTxStateGPIO:
-        furi_hal_power_enable_otg();
         // gpio_item_configure_all_pins(GpioModeOutputPushPull);
         // gpio_item_configure_all_pins(GpioModeOutputPushPull);
         furi_hal_gpio_init(GPIO_PIN_A, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
         furi_hal_gpio_init(GPIO_PIN_A, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
         furi_hal_gpio_init(GPIO_PIN_B, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
         furi_hal_gpio_init(GPIO_PIN_B, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
@@ -208,7 +204,7 @@ bool tx_init(MagSetting* setting) {
         tx_init_rfid();
         tx_init_rfid();
         break;
         break;
     case MagTxStateNFC:
     case MagTxStateNFC:
-        furi_hal_nfc_exit_sleep();
+        //furi_hal_nfc_exit_sleep();
         break;
         break;
     case MagTxCC1101_434:
     case MagTxCC1101_434:
         tx_init_rf(434000000);
         tx_init_rf(434000000);
@@ -234,9 +230,12 @@ bool tx_deinit(MagSetting* setting) {
         furi_hal_gpio_write(GPIO_PIN_B, 0);
         furi_hal_gpio_write(GPIO_PIN_B, 0);
         furi_hal_gpio_write(GPIO_PIN_ENABLE, 0);
         furi_hal_gpio_write(GPIO_PIN_ENABLE, 0);
 
 
-        // set back to analog output mode?
+        // set back to analog output mode? - YES
+        furi_hal_gpio_init(GPIO_PIN_A, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
+        furi_hal_gpio_init(GPIO_PIN_B, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
+        furi_hal_gpio_init(GPIO_PIN_ENABLE, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
+
         //gpio_item_configure_all_pins(GpioModeAnalog);
         //gpio_item_configure_all_pins(GpioModeAnalog);
-        furi_hal_power_disable_otg();
         break;
         break;
     case MagTxStatePiezo:
     case MagTxStatePiezo:
         tx_deinit_piezo();
         tx_deinit_piezo();
@@ -246,8 +245,8 @@ bool tx_deinit(MagSetting* setting) {
         tx_deinit_rfid();
         tx_deinit_rfid();
         break;
         break;
     case MagTxStateNFC:
     case MagTxStateNFC:
-        furi_hal_nfc_ll_txrx_off();
-        furi_hal_nfc_start_sleep();
+        //furi_hal_nfc_ll_txrx_off();
+        //furi_hal_nfc_start_sleep();
         break;
         break;
     case MagTxCC1101_434:
     case MagTxCC1101_434:
     case MagTxCC1101_868:
     case MagTxCC1101_868:

+ 0 - 2
helpers/mag_types.h

@@ -12,7 +12,6 @@ typedef enum {
     MagViewWidget,
     MagViewWidget,
     MagViewVariableItemList,
     MagViewVariableItemList,
     MagViewTextInput,
     MagViewTextInput,
-    MagViewMagTextInput,
 } MagView;
 } MagView;
 
 
 typedef enum {
 typedef enum {
@@ -37,7 +36,6 @@ typedef enum {
     MagTxCC1101_868,
     MagTxCC1101_868,
 } MagTxState;
 } MagTxState;
 
 
-
 typedef enum {
 typedef enum {
     UART_TerminalEventRefreshConsoleOutput = 0,
     UART_TerminalEventRefreshConsoleOutput = 0,
     UART_TerminalEventStartConsole,
     UART_TerminalEventStartConsole,

+ 26 - 13
mag.c

@@ -1,4 +1,5 @@
 #include "mag_i.h"
 #include "mag_i.h"
+#include <expansion/expansion.h>
 
 
 #define TAG "Mag"
 #define TAG "Mag"
 
 
@@ -92,11 +93,6 @@ static Mag* mag_alloc() {
     view_dispatcher_add_view(
     view_dispatcher_add_view(
         mag->view_dispatcher, MagViewTextInput, text_input_get_view(mag->text_input));
         mag->view_dispatcher, MagViewTextInput, text_input_get_view(mag->text_input));
 
 
-    // Custom Mag Text Input
-    mag->mag_text_input = mag_text_input_alloc();
-    view_dispatcher_add_view(
-        mag->view_dispatcher, MagViewMagTextInput, mag_text_input_get_view(mag->mag_text_input));
-
     return mag;
     return mag;
 }
 }
 
 
@@ -148,10 +144,6 @@ static void mag_free(Mag* mag) {
     view_dispatcher_remove_view(mag->view_dispatcher, MagViewTextInput);
     view_dispatcher_remove_view(mag->view_dispatcher, MagViewTextInput);
     text_input_free(mag->text_input);
     text_input_free(mag->text_input);
 
 
-    // Custom Mag TextInput
-    view_dispatcher_remove_view(mag->view_dispatcher, MagViewMagTextInput);
-    mag_text_input_free(mag->mag_text_input);
-
     // View Dispatcher
     // View Dispatcher
     view_dispatcher_free(mag->view_dispatcher);
     view_dispatcher_free(mag->view_dispatcher);
 
 
@@ -174,18 +166,40 @@ static void mag_free(Mag* mag) {
 
 
 // entry point for app
 // entry point for app
 int32_t mag_app(void* p) {
 int32_t mag_app(void* p) {
-    Mag* mag = mag_alloc();
     UNUSED(p);
     UNUSED(p);
 
 
+    // Disable expansion protocol to avoid interference with UART Handle
+    Expansion* expansion = furi_record_open(RECORD_EXPANSION);
+    expansion_disable(expansion);
+
+    Mag* mag = mag_alloc();
+
     mag_make_app_folder(mag);
     mag_make_app_folder(mag);
 
 
+    // Enable 5v power, multiple attempts to avoid issues with power chip protection false triggering
+    uint8_t attempts = 0;
+    bool otg_was_enabled = furi_hal_power_is_otg_enabled();
+    while(!furi_hal_power_is_otg_enabled() && attempts++ < 5) {
+        furi_hal_power_enable_otg();
+        furi_delay_ms(10);
+    }
+
     view_dispatcher_attach_to_gui(mag->view_dispatcher, mag->gui, ViewDispatcherTypeFullscreen);
     view_dispatcher_attach_to_gui(mag->view_dispatcher, mag->gui, ViewDispatcherTypeFullscreen);
     scene_manager_next_scene(mag->scene_manager, MagSceneStart);
     scene_manager_next_scene(mag->scene_manager, MagSceneStart);
 
 
     view_dispatcher_run(mag->view_dispatcher);
     view_dispatcher_run(mag->view_dispatcher);
 
 
+    // Disable 5v power
+    if(furi_hal_power_is_otg_enabled() && !otg_was_enabled) {
+        furi_hal_power_disable_otg();
+    }
+
     mag_free(mag);
     mag_free(mag);
 
 
+    // Return previous state of expansion
+    expansion_enable(expansion);
+    furi_record_close(RECORD_EXPANSION);
+
     return 0;
     return 0;
 }
 }
 
 
@@ -231,14 +245,13 @@ void mag_text_input_callback(void* context) {
 
 
 void mag_show_loading_popup(void* context, bool show) {
 void mag_show_loading_popup(void* context, bool show) {
     Mag* mag = context;
     Mag* mag = context;
-    TaskHandle_t timer_task = xTaskGetHandle(configTIMER_SERVICE_TASK_NAME);
 
 
     if(show) {
     if(show) {
         // Raise timer priority so that animations can play
         // Raise timer priority so that animations can play
-        vTaskPrioritySet(timer_task, configMAX_PRIORITIES - 1);
+        furi_timer_set_thread_priority(FuriTimerThreadPriorityElevated);
         view_dispatcher_switch_to_view(mag->view_dispatcher, MagViewLoading);
         view_dispatcher_switch_to_view(mag->view_dispatcher, MagViewLoading);
     } else {
     } else {
         // Restore default timer priority
         // Restore default timer priority
-        vTaskPrioritySet(timer_task, configTIMER_TASK_PRIORITY);
+        furi_timer_set_thread_priority(FuriTimerThreadPriorityNormal);
     }
     }
 }
 }

+ 4 - 5
mag_device.c

@@ -251,7 +251,7 @@ bool mag_device_parse_card_string(MagDevice* mag_dev, FuriString* f_card_str) {
         return false;
         return false;
     }
     }
     size_t track1_len = track1_end - track1_start;
     size_t track1_len = track1_end - track1_start;
-    
+
     FURI_LOG_D(TAG, "Track 1: %.*s", track1_len, track1_start);
     FURI_LOG_D(TAG, "Track 1: %.*s", track1_len, track1_start);
 
 
     mag_dev->dev_data.track[0].len = track1_len;
     mag_dev->dev_data.track[0].len = track1_len;
@@ -259,7 +259,7 @@ bool mag_device_parse_card_string(MagDevice* mag_dev, FuriString* f_card_str) {
 
 
     // Track 2
     // Track 2
     const char* track2_start = strchr(track1_end, ';');
     const char* track2_start = strchr(track1_end, ';');
-    if (!track2_start) {
+    if(!track2_start) {
         FURI_LOG_D(TAG, "Could not find track 2 start");
         FURI_LOG_D(TAG, "Could not find track 2 start");
         return true;
         return true;
     }
     }
@@ -279,7 +279,7 @@ bool mag_device_parse_card_string(MagDevice* mag_dev, FuriString* f_card_str) {
 
 
     // Track 3
     // Track 3
     const char* track3_start = strchr(track2_end, ';');
     const char* track3_start = strchr(track2_end, ';');
-    if (!track3_start) {
+    if(!track3_start) {
         FURI_LOG_D(TAG, "Could not find track 3 start");
         FURI_LOG_D(TAG, "Could not find track 3 start");
         return true;
         return true;
     }
     }
@@ -296,11 +296,10 @@ bool mag_device_parse_card_string(MagDevice* mag_dev, FuriString* f_card_str) {
 
 
     mag_dev->dev_data.track[2].len = track3_len;
     mag_dev->dev_data.track[2].len = track3_len;
     furi_string_printf(mag_dev->dev_data.track[2].str, "%%%.*s?", track3_len, track3_start);
     furi_string_printf(mag_dev->dev_data.track[2].str, "%%%.*s?", track3_len, track3_start);
-    
+
     return true;
     return true;
 }
 }
 
 
-
 void mag_device_set_loading_callback(
 void mag_device_set_loading_callback(
     MagDevice* mag_dev,
     MagDevice* mag_dev,
     MagLoadingCallback callback,
     MagLoadingCallback callback,

+ 3 - 1
mag_device.h

@@ -7,10 +7,12 @@
 
 
 #include "mag_icons.h"
 #include "mag_icons.h"
 
 
+#include <assets_icons.h>
+
 #define MAG_DEV_NAME_MAX_LEN 22
 #define MAG_DEV_NAME_MAX_LEN 22
 #define MAG_DEV_TRACKS 3
 #define MAG_DEV_TRACKS 3
 
 
-#define MAG_APP_FOLDER ANY_PATH("mag")
+#define MAG_APP_FOLDER STORAGE_APP_DATA_PATH_PREFIX
 #define MAG_APP_EXTENSION ".mag"
 #define MAG_APP_EXTENSION ".mag"
 
 
 typedef void (*MagLoadingCallback)(void* context, bool state);
 typedef void (*MagLoadingCallback)(void* context, bool state);

+ 2 - 6
mag_i.h

@@ -2,7 +2,6 @@
 
 
 #include "mag_device.h"
 #include "mag_device.h"
 //#include "helpers/mag_helpers.h"
 //#include "helpers/mag_helpers.h"
-#include "helpers/mag_text_input.h"
 #include "helpers/mag_types.h"
 #include "helpers/mag_types.h"
 
 
 #include <furi.h>
 #include <furi.h>
@@ -51,7 +50,6 @@ typedef struct {
     uint32_t us_interpacket;
     uint32_t us_interpacket;
 } MagSetting;
 } MagSetting;
 
 
-
 typedef struct {
 typedef struct {
     ViewDispatcher* view_dispatcher;
     ViewDispatcher* view_dispatcher;
     Gui* gui;
     Gui* gui;
@@ -76,15 +74,13 @@ typedef struct {
     Widget* widget;
     Widget* widget;
     VariableItemList* variable_item_list;
     VariableItemList* variable_item_list;
 
 
-    // Custom views
-    Mag_TextInput* mag_text_input;
-
     // UART
     // UART
     FuriThread* uart_rx_thread;
     FuriThread* uart_rx_thread;
     FuriStreamBuffer* uart_rx_stream;
     FuriStreamBuffer* uart_rx_stream;
     uint8_t uart_rx_buf[UART_RX_BUF_SIZE + 1];
     uint8_t uart_rx_buf[UART_RX_BUF_SIZE + 1];
     void (*handle_rx_data_cb)(uint8_t* buf, size_t len, void* context);
     void (*handle_rx_data_cb)(uint8_t* buf, size_t len, void* context);
-    
+    FuriHalSerialHandle* serial_handle;
+
     char uart_text_input_store[UART_TERMINAL_TEXT_INPUT_STORE_SIZE + 1];
     char uart_text_input_store[UART_TERMINAL_TEXT_INPUT_STORE_SIZE + 1];
     FuriString* uart_text_box_store;
     FuriString* uart_text_box_store;
     size_t uart_text_box_store_strlen;
     size_t uart_text_box_store_strlen;

+ 7 - 0
resources/apps_data/magspoof/SamyExampleImage.mag

@@ -0,0 +1,7 @@
+Filetype: Flipper Mag device
+Version: 1
+# Mag device track data
+# Data matching image example in Samy's repo, for ease of comparison
+Track 1: %B426684131234567^LASTNAME/FIRST^YYMMSSSDDDDDDDDDDDDDDDDDDDDDDDDD?
+Track 2: ;426684131234567=230188855555555555555?
+Track 3: 

+ 7 - 0
resources/apps_data/magspoof/SamyExpiredCard.mag

@@ -0,0 +1,7 @@
+Filetype: Flipper Mag device
+Version: 1
+# Mag device track data
+# Found in samyk's MagSpoof branch f150bb783237051fba7e4e6ed96a722e542a9663; using as test data, card is long expired
+Track 1: %B493173000682759^URISTA HDZ-IVAN JAVIER    ^150220100234000000?
+Track 2: ;493173000682759=15022100000234?
+Track 3: 

+ 6 - 0
resources/apps_data/magspoof/TestMagstripe.mag

@@ -0,0 +1,6 @@
+Filetype: Flipper Mag device
+Version: 1
+# Mag device track data
+Track 1: %B123456781234567^LASTNAME/FIRST^YYMMSSSDDDDDDDDDDDDDDDDDDDDDDDDD?
+Track 2: ;123456781234567=YYMMSSSDDDDDDDDDDDDDD?
+Track 3: 

+ 1 - 1
scenes/mag_scene_delete_success.c

@@ -4,7 +4,7 @@ void mag_scene_delete_success_on_enter(void* context) {
     Mag* mag = context;
     Mag* mag = context;
     Popup* popup = mag->popup;
     Popup* popup = mag->popup;
 
 
-    popup_set_icon(popup, 0, 2, &I_DolphinMafia_115x62);
+    popup_set_icon(popup, 0, 2, &I_DolphinMafia_119x62);
     popup_set_header(popup, "Deleted", 83, 19, AlignLeft, AlignBottom);
     popup_set_header(popup, "Deleted", 83, 19, AlignLeft, AlignBottom);
 
 
     popup_set_callback(popup, mag_popup_timeout_callback);
     popup_set_callback(popup, mag_popup_timeout_callback);

+ 2 - 2
scenes/mag_scene_input_name.c

@@ -1,4 +1,4 @@
-#include <lib/toolbox/random_name.h>
+#include <toolbox/name_generator.h>
 #include "../mag_i.h"
 #include "../mag_i.h"
 
 
 void mag_scene_input_name_on_enter(void* context) {
 void mag_scene_input_name_on_enter(void* context) {
@@ -13,7 +13,7 @@ void mag_scene_input_name_on_enter(void* context) {
 
 
     if(name_is_empty) {
     if(name_is_empty) {
         furi_string_set(mag->file_path, MAG_APP_FOLDER);
         furi_string_set(mag->file_path, MAG_APP_FOLDER);
-        set_random_name(mag->text_store, MAG_TEXT_STORE_SIZE);
+        name_generator_make_auto(mag->text_store, MAG_TEXT_STORE_SIZE, "Mag");
         furi_string_set(folder_path, MAG_APP_FOLDER);
         furi_string_set(folder_path, MAG_APP_FOLDER);
     } else {
     } else {
         // TODO: compatible types etc
         // TODO: compatible types etc

+ 7 - 5
scenes/mag_scene_input_value.c

@@ -2,16 +2,18 @@
 
 
 void mag_scene_input_value_on_enter(void* context) {
 void mag_scene_input_value_on_enter(void* context) {
     Mag* mag = context;
     Mag* mag = context;
-    Mag_TextInput* mag_text_input = mag->mag_text_input;
+    TextInput* text_input = mag->text_input;
 
 
     // TODO: retrieve stored/existing data if editing rather than adding anew?
     // TODO: retrieve stored/existing data if editing rather than adding anew?
     mag_text_store_set(mag, furi_string_get_cstr(mag->mag_dev->dev_data.track[1].str));
     mag_text_store_set(mag, furi_string_get_cstr(mag->mag_dev->dev_data.track[1].str));
 
 
-    mag_text_input_set_header_text(mag_text_input, "Enter track data (WIP)");
-    mag_text_input_set_result_callback(
-        mag_text_input, mag_text_input_callback, mag, mag->text_store, MAG_TEXT_STORE_SIZE, true);
+    text_input_set_header_text(text_input, "Enter track data (WIP)");
+    text_input_set_result_callback(
+        text_input, mag_text_input_callback, mag, mag->text_store, MAG_TEXT_STORE_SIZE, true);
 
 
-    view_dispatcher_switch_to_view(mag->view_dispatcher, MagViewMagTextInput);
+    text_input_add_illegal_symbols(text_input);
+
+    view_dispatcher_switch_to_view(mag->view_dispatcher, MagViewTextInput);
 }
 }
 
 
 bool mag_scene_input_value_on_event(void* context, SceneManagerEvent event) {
 bool mag_scene_input_value_on_event(void* context, SceneManagerEvent event) {

+ 11 - 10
scenes/mag_scene_read.c

@@ -7,9 +7,10 @@
 
 
 #define TAG "MagSceneRead"
 #define TAG "MagSceneRead"
 
 
-void uart_callback(UartIrqEvent event, uint8_t data, void* context) {
+void uart_callback(FuriHalSerialHandle* handle, FuriHalSerialRxEvent event, void* context) {
     Mag* mag = context;
     Mag* mag = context;
-    if(event == UartIrqEventRXNE) {
+    if(event == FuriHalSerialRxEventData) {
+        uint8_t data = furi_hal_serial_async_rx(handle);
         furi_stream_buffer_send(mag->uart_rx_stream, &data, 1, 0);
         furi_stream_buffer_send(mag->uart_rx_stream, &data, 1, 0);
         furi_thread_flags_set(furi_thread_get_id(mag->uart_rx_thread), WorkerEvtRxDone);
         furi_thread_flags_set(furi_thread_get_id(mag->uart_rx_thread), WorkerEvtRxDone);
     }
     }
@@ -93,10 +94,10 @@ void mag_scene_read_on_enter(void* context) {
     update_widgets(mag);
     update_widgets(mag);
 
 
     // Initialize UART
     // Initialize UART
-    // furi_hal_console_disable();
-    furi_hal_uart_deinit(FuriHalUartIdUSART1);
-    furi_hal_uart_init(FuriHalUartIdUSART1, 9600);
-    furi_hal_uart_set_irq_cb(FuriHalUartIdUSART1, uart_callback, mag);
+    mag->serial_handle = furi_hal_serial_control_acquire(FuriHalSerialIdUsart);
+    furi_check(mag->serial_handle);
+    furi_hal_serial_init(mag->serial_handle, 9600);
+    furi_hal_serial_async_rx_start(mag->serial_handle, uart_callback, mag, false);
     FURI_LOG_D(TAG, "UART initialized");
     FURI_LOG_D(TAG, "UART initialized");
 
 
     mag->uart_rx_thread = furi_thread_alloc();
     mag->uart_rx_thread = furi_thread_alloc();
@@ -170,6 +171,10 @@ void mag_scene_read_on_exit(void* context) {
 
 
     // Stop UART worker
     // Stop UART worker
     FURI_LOG_D(TAG, "Stopping UART worker");
     FURI_LOG_D(TAG, "Stopping UART worker");
+    furi_hal_serial_async_rx_stop(mag->serial_handle);
+    furi_hal_serial_deinit(mag->serial_handle);
+    furi_hal_serial_control_release(mag->serial_handle);
+
     furi_thread_flags_set(furi_thread_get_id(mag->uart_rx_thread), WorkerEvtStop);
     furi_thread_flags_set(furi_thread_get_id(mag->uart_rx_thread), WorkerEvtStop);
     furi_thread_join(mag->uart_rx_thread);
     furi_thread_join(mag->uart_rx_thread);
     furi_thread_free(mag->uart_rx_thread);
     furi_thread_free(mag->uart_rx_thread);
@@ -177,9 +182,5 @@ void mag_scene_read_on_exit(void* context) {
 
 
     furi_string_free(mag->uart_text_box_store);
     furi_string_free(mag->uart_text_box_store);
 
 
-    furi_hal_uart_set_irq_cb(FuriHalUartIdUSART1, NULL, NULL);
-    furi_hal_uart_deinit(FuriHalUartIdUSART1);
-    // furi_hal_console_enable();
-
     notification_message(mag->notifications, &sequence_blink_stop);
     notification_message(mag->notifications, &sequence_blink_stop);
 }
 }

+ 1 - 2
scenes/mag_scene_read.h

@@ -5,7 +5,7 @@
 #define UART_RX_BUF_SIZE (320)
 #define UART_RX_BUF_SIZE (320)
 #define UART_TERMINAL_TEXT_BOX_STORE_SIZE (4096)
 #define UART_TERMINAL_TEXT_BOX_STORE_SIZE (4096)
 #define UART_TERMINAL_TEXT_INPUT_STORE_SIZE (512)
 #define UART_TERMINAL_TEXT_INPUT_STORE_SIZE (512)
-#define UART_CH (FuriHalUartIdUSART1)
+#define UART_CH (FuriHalSerialIdUsart)
 #define UART_BAUDRATE (9600)
 #define UART_BAUDRATE (9600)
 
 
 typedef enum {
 typedef enum {
@@ -17,5 +17,4 @@ typedef enum {
     UARTEventRxData = 100,
     UARTEventRxData = 100,
 } UARTEvents;
 } UARTEvents;
 
 
-
 #define WORKER_ALL_RX_EVENTS (WorkerEvtStop | WorkerEvtRxDone)
 #define WORKER_ALL_RX_EVENTS (WorkerEvtStop | WorkerEvtRxDone)

+ 1 - 1
scenes/mag_scene_save_success.c

@@ -8,7 +8,7 @@ void mag_scene_save_success_on_enter(void* context) {
     //scene_manager_set_scene_state(mag->scene_manager, LfRfidSceneSaveData, 0);
     //scene_manager_set_scene_state(mag->scene_manager, LfRfidSceneSaveData, 0);
     mag_text_store_clear(mag);
     mag_text_store_clear(mag);
 
 
-    popup_set_icon(popup, 32, 5, &I_DolphinNice_96x59);
+    popup_set_icon(popup, 36, 5, &I_DolphinDone_80x58);
     popup_set_header(popup, "Saved!", 5, 7, AlignLeft, AlignTop);
     popup_set_header(popup, "Saved!", 5, 7, AlignLeft, AlignTop);
     popup_set_context(popup, mag);
     popup_set_context(popup, mag);
     popup_set_callback(popup, mag_popup_timeout_callback);
     popup_set_callback(popup, mag_popup_timeout_callback);

+ 0 - 2
scenes/mag_scene_saved_menu.c

@@ -17,8 +17,6 @@ void mag_scene_saved_menu_on_enter(void* context) {
     Mag* mag = context;
     Mag* mag = context;
     Submenu* submenu = mag->submenu;
     Submenu* submenu = mag->submenu;
 
 
-    notification_message(mag->notifications, &sequence_blink_cyan_10);
-
     // messy code to quickly check which tracks are available for emulation/display
     // messy code to quickly check which tracks are available for emulation/display
     // there's likely a better spot to do this, but the MagDevice functions don't have access to the full mag struct...
     // there's likely a better spot to do this, but the MagDevice functions don't have access to the full mag struct...
     bool is_empty_t1 = furi_string_empty(mag->mag_dev->dev_data.track[0].str);
     bool is_empty_t1 = furi_string_empty(mag->mag_dev->dev_data.track[0].str);