Просмотр исходного кода

Revert "Hide error setting"

This reverts commit 5999573ee1b0c224c402c7889e55c4295d9a750b.
acegoal07 1 год назад
Родитель
Сommit
f036552718
6 измененных файлов с 3 добавлено и 36 удалено
  1. 0 1
      README.md
  2. 1 1
      application.fam
  3. 0 1
      nfc_playlist.c
  4. 1 3
      nfc_playlist.h
  5. 1 11
      scences/emulation.c
  6. 0 19
      scences/settings.c

+ 0 - 1
README.md

@@ -18,7 +18,6 @@ This app was design, built and tested using the <a href="https://github.com/Flip
 - Emulate time (How long the NFC card will be emulated for)
 - Emulate time (How long the NFC card will be emulated for)
 - Delay time (How long the gap between the cards will be)
 - Delay time (How long the gap between the cards will be)
 - LED indicator (Whether or not the LED's will be on)
 - LED indicator (Whether or not the LED's will be on)
-- Hide error messages (Hides any errors about NFC files and just skips to the next one)
 - Reset settings (Puts all the settings back to the defaults)
 - Reset settings (Puts all the settings back to the defaults)
 
 
 ## Playlist editor
 ## Playlist editor

+ 1 - 1
application.fam

@@ -8,7 +8,7 @@ App(
     fap_category="NFC",
     fap_category="NFC",
     fap_author="@acegoal07",
     fap_author="@acegoal07",
     fap_weburl="https://github.com/acegoal07/FlipperZero_NFC_Playlist/tree/main",
     fap_weburl="https://github.com/acegoal07/FlipperZero_NFC_Playlist/tree/main",
-    fap_version="1.4",
+    fap_version="1.3",
     fap_icon="assets/icon.png",
     fap_icon="assets/icon.png",
     fap_private_libs=[
     fap_private_libs=[
         Lib(
         Lib(

+ 0 - 1
nfc_playlist.c

@@ -63,7 +63,6 @@ static NfcPlaylist* nfc_playlist_alloc() {
    nfc_playlist->settings.emulate_timeout = default_emulate_timeout;
    nfc_playlist->settings.emulate_timeout = default_emulate_timeout;
    nfc_playlist->settings.emulate_delay = default_emulate_delay;
    nfc_playlist->settings.emulate_delay = default_emulate_delay;
    nfc_playlist->settings.emulate_led_indicator = default_emulate_led_indicator;
    nfc_playlist->settings.emulate_led_indicator = default_emulate_led_indicator;
-   nfc_playlist->settings.hide_error = default_hide_error;
 
 
    nfc_playlist->notification = furi_record_open(RECORD_NOTIFICATION);
    nfc_playlist->notification = furi_record_open(RECORD_NOTIFICATION);
    nfc_playlist->file_browser = file_browser_alloc(nfc_playlist->settings.file_path);
    nfc_playlist->file_browser = file_browser_alloc(nfc_playlist->settings.file_path);

+ 1 - 3
nfc_playlist.h

@@ -41,7 +41,6 @@ typedef struct {
    uint8_t emulate_timeout;
    uint8_t emulate_timeout;
    uint8_t emulate_delay;
    uint8_t emulate_delay;
    bool emulate_led_indicator;
    bool emulate_led_indicator;
-   bool hide_error;
 } NfcPlaylistSettings;
 } NfcPlaylistSettings;
 
 
 typedef struct {
 typedef struct {
@@ -63,5 +62,4 @@ static const int options_emulate_timeout[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
 static const int default_emulate_timeout = 4;
 static const int default_emulate_timeout = 4;
 static const int options_emulate_delay[] = { 0, 1, 2, 3, 4, 5, 6 };
 static const int options_emulate_delay[] = { 0, 1, 2, 3, 4, 5, 6 };
 static const int default_emulate_delay = 0;
 static const int default_emulate_delay = 0;
-static const bool default_emulate_led_indicator = true;
-static const bool default_hide_error = false;
+static const bool default_emulate_led_indicator = true;

+ 1 - 11
scences/emulation.c

@@ -1,7 +1,6 @@
 #include "nfc_playlist.h"
 #include "nfc_playlist.h"
 #include "scences/emulation.h"
 #include "scences/emulation.h"
 
 
-bool hiding_error = false;
 NfcPlaylistEmulationState EmulationState = NfcPlaylistEmulationState_Stopped;
 NfcPlaylistEmulationState EmulationState = NfcPlaylistEmulationState_Stopped;
 
 
 void nfc_playlist_emulation_scene_on_enter(void* context) {
 void nfc_playlist_emulation_scene_on_enter(void* context) {
@@ -71,7 +70,7 @@ int32_t nfc_playlist_emulation_task(void* context) {
 
 
          if (strlen(file_path) <= 1) {continue;}
          if (strlen(file_path) <= 1) {continue;}
 
 
-         if (nfc_playlist->settings.emulate_delay > 0 && file_position > 0 && !hiding_error) {
+         if (nfc_playlist->settings.emulate_delay > 0 && file_position > 0) {
             popup_set_header(nfc_playlist->popup, "Delaying", 64, 10, AlignCenter, AlignTop);
             popup_set_header(nfc_playlist->popup, "Delaying", 64, 10, AlignCenter, AlignTop);
             start_blink(nfc_playlist, NfcPlaylistLedState_Error);
             start_blink(nfc_playlist, NfcPlaylistLedState_Error);
             int time_counter_delay_ms = (options_emulate_delay[nfc_playlist->settings.emulate_delay]*1000);
             int time_counter_delay_ms = (options_emulate_delay[nfc_playlist->settings.emulate_delay]*1000);
@@ -86,7 +85,6 @@ int32_t nfc_playlist_emulation_task(void* context) {
             file_position++;
             file_position++;
          }
          }
 
 
-         if (hiding_error) {hiding_error = false;}
          if (EmulationState != NfcPlaylistEmulationState_Emulating) {break;}
          if (EmulationState != NfcPlaylistEmulationState_Emulating) {break;}
 
 
          char const* full_file_name = strchr(file_path, '/') != NULL ? &strrchr(file_path, '/')[1] : file_path;
          char const* full_file_name = strchr(file_path, '/') != NULL ? &strrchr(file_path, '/')[1] : file_path;
@@ -97,10 +95,6 @@ int32_t nfc_playlist_emulation_task(void* context) {
          int time_counter_ms = (options_emulate_timeout[nfc_playlist->settings.emulate_timeout]*1000);
          int time_counter_ms = (options_emulate_timeout[nfc_playlist->settings.emulate_timeout]*1000);
 
 
          if (storage_file_exists(storage, file_path) == false) {
          if (storage_file_exists(storage, file_path) == false) {
-            if (nfc_playlist->settings.hide_error) {
-               hiding_error = true;
-               continue;
-            }
             int popup_header_text_size = strlen(file_name) + 18;
             int popup_header_text_size = strlen(file_name) + 18;
             char popup_header_text[popup_header_text_size];
             char popup_header_text[popup_header_text_size];
             snprintf(popup_header_text, popup_header_text_size, "%s\n%s", "ERROR not found:", file_name);
             snprintf(popup_header_text, popup_header_text_size, "%s\n%s", "ERROR not found:", file_name);
@@ -114,10 +108,6 @@ int32_t nfc_playlist_emulation_task(void* context) {
                time_counter_ms -= 50;
                time_counter_ms -= 50;
             }
             }
          } else if (strcasestr(file_ext, "nfc") == NULL) {
          } else if (strcasestr(file_ext, "nfc") == NULL) {
-            if (nfc_playlist->settings.hide_error) {
-               hiding_error = true;
-               continue;
-            }
             int popup_header_text_size = strlen(file_name) + 21;
             int popup_header_text_size = strlen(file_name) + 21;
             char popup_header_text[popup_header_text_size];
             char popup_header_text[popup_header_text_size];
             snprintf(popup_header_text, popup_header_text_size, "%s\n%s", "ERROR invalid file:", file_name);
             snprintf(popup_header_text, popup_header_text_size, "%s\n%s", "ERROR invalid file:", file_name);

+ 0 - 19
scences/settings.c

@@ -5,7 +5,6 @@ typedef enum {
    NfcPlaylistSettings_Timeout,
    NfcPlaylistSettings_Timeout,
    NfcPlaylistSettings_Delay,
    NfcPlaylistSettings_Delay,
    NfcPlaylistSettings_LedIndicator,
    NfcPlaylistSettings_LedIndicator,
-   NfcPlaylistSettings_HideError,
    NfcPlaylistSettings_Reset
    NfcPlaylistSettings_Reset
 } NfcPlaylistMenuSelection;
 } NfcPlaylistMenuSelection;
 
 
@@ -30,11 +29,6 @@ void nfc_playlist_settings_menu_callback(void* context, uint32_t index) {
       VariableItem* emulation_led_indicator_settings = variable_item_list_get(nfc_playlist->variable_item_list, NfcPlaylistSettings_LedIndicator);
       VariableItem* emulation_led_indicator_settings = variable_item_list_get(nfc_playlist->variable_item_list, NfcPlaylistSettings_LedIndicator);
       variable_item_set_current_value_index(emulation_led_indicator_settings, nfc_playlist->settings.emulate_led_indicator);
       variable_item_set_current_value_index(emulation_led_indicator_settings, nfc_playlist->settings.emulate_led_indicator);
       variable_item_set_current_value_text(emulation_led_indicator_settings, nfc_playlist->settings.emulate_led_indicator ? "ON" : "OFF");
       variable_item_set_current_value_text(emulation_led_indicator_settings, nfc_playlist->settings.emulate_led_indicator ? "ON" : "OFF");
-
-      nfc_playlist->settings.hide_error = default_hide_error;
-      VariableItem* hide_error_indicator_settings = variable_item_list_get(nfc_playlist->variable_item_list, NfcPlaylistSettings_HideError);
-      variable_item_set_current_value_index(hide_error_indicator_settings, nfc_playlist->settings.hide_error);
-      variable_item_set_current_value_text(hide_error_indicator_settings, nfc_playlist->settings.hide_error ? "ON" : "OFF");
    }
    }
 }
 }
 
 
@@ -63,10 +57,6 @@ void nfc_playlist_settings_options_change_callback(VariableItem* item) {
          nfc_playlist->settings.emulate_led_indicator = option_value_index;
          nfc_playlist->settings.emulate_led_indicator = option_value_index;
          variable_item_set_current_value_text(item, nfc_playlist->settings.emulate_led_indicator ? "ON" : "OFF");
          variable_item_set_current_value_text(item, nfc_playlist->settings.emulate_led_indicator ? "ON" : "OFF");
          break;
          break;
-      case NfcPlaylistSettings_HideError:
-         nfc_playlist->settings.hide_error = option_value_index;
-         variable_item_set_current_value_text(item, nfc_playlist->settings.hide_error ? "ON" : "OFF");
-         break;
       default:
       default:
          break;
          break;
    }
    }
@@ -108,15 +98,6 @@ void nfc_playlist_settings_scene_on_enter(void* context) {
    variable_item_set_current_value_index(emulation_led_indicator_settings, nfc_playlist->settings.emulate_led_indicator);
    variable_item_set_current_value_index(emulation_led_indicator_settings, nfc_playlist->settings.emulate_led_indicator);
    variable_item_set_current_value_text(emulation_led_indicator_settings, nfc_playlist->settings.emulate_led_indicator ? "ON" : "OFF");
    variable_item_set_current_value_text(emulation_led_indicator_settings, nfc_playlist->settings.emulate_led_indicator ? "ON" : "OFF");
 
 
-   VariableItem* hide_error_indicator_settings = variable_item_list_add(
-      nfc_playlist->variable_item_list,
-      "Hide error messages",
-      2,
-      nfc_playlist_settings_options_change_callback,
-      nfc_playlist);
-   variable_item_set_current_value_index(hide_error_indicator_settings, nfc_playlist->settings.hide_error);
-   variable_item_set_current_value_text(hide_error_indicator_settings, nfc_playlist->settings.hide_error ? "ON" : "OFF");
-
    variable_item_list_add(nfc_playlist->variable_item_list, "Reset settings", 0, NULL, NULL);
    variable_item_list_add(nfc_playlist->variable_item_list, "Reset settings", 0, NULL, NULL);
 
 
    variable_item_list_set_enter_callback(nfc_playlist->variable_item_list, nfc_playlist_settings_menu_callback, nfc_playlist);
    variable_item_list_set_enter_callback(nfc_playlist->variable_item_list, nfc_playlist_settings_menu_callback, nfc_playlist);