Browse Source

Fix merge

Willy-JL 1 year ago
parent
commit
41db75d2f6

+ 1 - 0
meal_pager/.gitsubtree

@@ -1 +1,2 @@
+https://github.com/xMasterX/all-the-plugins dev non_catalog_apps/meal_pager
 https://github.com/leedave/flipper-zero-meal-pager main /

+ 2 - 2
meal_pager/application.fam

@@ -1,12 +1,12 @@
 App(
     appid="meal_pager",
-    name="Restaurant Pager Trigger",
+    name="Restaurant Pager",
     apptype=FlipperAppType.EXTERNAL,
     entry_point="meal_pager_app",
     stack_size=2 * 1024,
     fap_icon="icons/meal_pager_10px.png",
     fap_icon_assets="icons",
-    fap_category="Sub-Ghz",
+    fap_category="Sub-GHz",
     fap_version="1.6",
     fap_author="leedave",
     fap_weburl="https://github.com/leedave/flipper-zero-meal-pager",

+ 9 - 6
meal_pager/helpers/meal_pager_storage.c

@@ -163,6 +163,7 @@ void meal_pager_read_settings(void* context) {
         FURI_LOG_E(TAG, "Cannot open file %s", MEAL_PAGER_SETTINGS_SAVE_PATH);
         meal_pager_close_config_file(fff_file);
         meal_pager_close_storage();
+        furi_string_free(temp_str);
         return;
     }
 
@@ -170,6 +171,7 @@ void meal_pager_read_settings(void* context) {
         FURI_LOG_E(TAG, "Missing Header Data");
         meal_pager_close_config_file(fff_file);
         meal_pager_close_storage();
+        furi_string_free(temp_str);
         return;
     }
 
@@ -177,6 +179,7 @@ void meal_pager_read_settings(void* context) {
         FURI_LOG_I(TAG, "old config version, will be removed.");
         meal_pager_close_config_file(fff_file);
         meal_pager_close_storage();
+        furi_string_free(temp_str);
         return;
     }
 
@@ -223,26 +226,26 @@ void meal_pager_set_max_values(void* context) {
     }
     if(app->first_station > app->max_station) {
         app->first_station = app->max_station;
-        snprintf(app->text_store[0], 20, "%lu", app->first_station);
+        snprintf(app->text_store[0], sizeof(app->text_store[0]), "%lu", app->first_station);
     }
     if(app->last_station > app->max_station) {
         app->last_station = app->max_station;
-        snprintf(app->text_store[1], 20, "%lu", app->last_station);
+        snprintf(app->text_store[1], sizeof(app->text_store[1]), "%lu", app->last_station);
     }
     if(app->last_station < app->first_station) {
         app->last_station = app->first_station;
-        snprintf(app->text_store[1], 20, "%lu", app->last_station);
+        snprintf(app->text_store[1], sizeof(app->text_store[1]), "%lu", app->last_station);
     }
     if(app->first_pager > app->max_pager) {
         app->first_pager = app->max_pager;
-        snprintf(app->text_store[2], 20, "%lu", app->first_pager);
+        snprintf(app->text_store[2], sizeof(app->text_store[2]), "%lu", app->first_pager);
     }
     if(app->last_pager > app->max_pager) {
         app->last_pager = app->max_pager;
-        snprintf(app->text_store[3], 20, "%lu", app->last_pager);
+        snprintf(app->text_store[3], sizeof(app->text_store[3]), "%lu", app->last_pager);
     }
     if(app->last_pager < app->first_pager) {
         app->last_pager = app->first_pager;
-        snprintf(app->text_store[3], 20, "%lu", app->last_pager);
+        snprintf(app->text_store[3], sizeof(app->text_store[3]), "%lu", app->last_pager);
     }
 }

+ 1 - 1
meal_pager/scenes/meal_pager_scene_set_first_pager.c

@@ -43,7 +43,7 @@ bool meal_pager_scene_set_first_pager_on_event(void* context, SceneManagerEvent
         app->first_pager = atoi(app->text_store[2]);
         if(app->first_pager > app->max_pager) {
             app->first_pager = app->max_pager;
-            snprintf(app->text_store[2], 20, "%lu", app->first_pager);
+            snprintf(app->text_store[2], sizeof(app->text_store[2]), "%lu", app->first_pager);
         }
         app->first_pager_char = app->text_store[2];
         scene_manager_previous_scene(app->scene_manager);

+ 1 - 1
meal_pager/scenes/meal_pager_scene_set_first_station.c

@@ -43,7 +43,7 @@ bool meal_pager_scene_set_first_station_on_event(void* context, SceneManagerEven
         app->first_station = atoi(app->text_store[0]);
         if(app->first_station > app->max_station) {
             app->first_station = app->max_station;
-            snprintf(app->text_store[0], 20, "%lu", app->first_station);
+            snprintf(app->text_store[0], sizeof(app->text_store[0]), "%lu", app->first_station);
         }
         app->first_station_char = app->text_store[0];
         scene_manager_previous_scene(app->scene_manager);

+ 2 - 2
meal_pager/scenes/meal_pager_scene_set_last_pager.c

@@ -43,11 +43,11 @@ bool meal_pager_scene_set_last_pager_on_event(void* context, SceneManagerEvent e
         app->last_pager = atoi(app->text_store[3]);
         if(app->last_pager > app->max_pager) {
             app->last_pager = app->max_pager;
-            snprintf(app->text_store[3], 20, "%lu", app->last_pager);
+            snprintf(app->text_store[3], sizeof(app->text_store[3]), "%lu", app->last_pager);
         }
         if(app->last_pager < app->first_pager) {
             app->last_pager = app->first_pager;
-            snprintf(app->text_store[3], 20, "%lu", app->last_pager);
+            snprintf(app->text_store[3], sizeof(app->text_store[3]), "%lu", app->last_pager);
         }
         app->last_pager_char = app->text_store[3];
         scene_manager_previous_scene(app->scene_manager);

+ 2 - 2
meal_pager/scenes/meal_pager_scene_set_last_station.c

@@ -43,11 +43,11 @@ bool meal_pager_scene_set_last_station_on_event(void* context, SceneManagerEvent
         app->last_station = atoi(app->text_store[1]);
         if(app->last_station > app->max_station) {
             app->last_station = app->max_station;
-            snprintf(app->text_store[1], 20, "%lu", app->last_station);
+            snprintf(app->text_store[1], sizeof(app->text_store[1]), "%lu", app->last_station);
         }
         if(app->last_station < app->first_station) {
             app->last_station = app->first_station;
-            snprintf(app->text_store[1], 20, "%lu", app->last_station);
+            snprintf(app->text_store[1], sizeof(app->text_store[1]), "%lu", app->last_station);
         }
         app->last_station_char = app->text_store[1];
         scene_manager_previous_scene(app->scene_manager);

+ 12 - 3
meal_pager/views/meal_pager_transmit.c

@@ -109,8 +109,9 @@ bool meal_pager_transmit_input(InputEvent* event, void* context) {
                 instance->view,
                 Meal_PagerTransmitModel * model,
                 {
-                    UNUSED(model);
-                    instance->callback(Meal_PagerCustomEventTransmitBack, instance->context);
+                    if(model->sending != 0) {
+                        //instance->callback(Meal_PagerCustomEventTransmitBack, instance->context);
+                    }
                 },
                 true);
             break;
@@ -171,7 +172,15 @@ void meal_pager_transmit_free(Meal_PagerTransmit* instance) {
     furi_assert(instance);
 
     with_view_model(
-        instance->view, Meal_PagerTransmitModel * model, { UNUSED(model); }, true);
+        instance->view,
+        Meal_PagerTransmitModel * model,
+        {
+            model->pager_type = 0;
+            model->station = 0;
+            model->pager = 0;
+            model->sending = 0;
+        },
+        true);
     view_free(instance->view);
     free(instance);
 }