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

Timelapse: Port save, name, viewport, icon changes

Willy-JL 2 лет назад
Родитель
Сommit
aeafc0044a

+ 3 - 2
timelapse/application.fam

@@ -1,6 +1,6 @@
 App(
-    appid="zeitraffer",
-    name="Zeitraffer",
+    appid="timelapse",
+    name="[GPIO] Timelapse",
     apptype=FlipperAppType.EXTERNAL,
     entry_point="zeitraffer_app",
     cdefines=["APP_ZEITRAFFER"],
@@ -14,6 +14,7 @@ App(
     order=90,
 	fap_version="1.1",
 	fap_icon_assets="icons",
+    fap_icon_assets_symbol="zeitraffer",
 	fap_icon="zeitraffer.png",
     fap_category="GPIO",
 	fap_description="Simple intervalometer/timelapse app",

BIN
timelapse/icons/ButtonDown_7x4.png


BIN
timelapse/icons/ButtonLeft_4x7.png


BIN
timelapse/icons/ButtonRight_4x7.png


BIN
timelapse/icons/ButtonUp_7x4.png


BIN
timelapse/icons/Pin_star_7x7.png


BIN
timelapse/icons/loading_10px.png


+ 7 - 7
timelapse/zeitraffer.c

@@ -7,8 +7,9 @@
 #include "gpio_item.h"
 #include "zeitraffer_icons.h"
 
-#define CONFIG_FILE_DIRECTORY_PATH "/ext/apps_data/zeitraffer"
-#define CONFIG_FILE_PATH CONFIG_FILE_DIRECTORY_PATH "/zeitraffer.conf"
+#include <assets_icons.h>
+
+#define CONFIG_FILE_PATH APP_DATA_PATH("timelapse.conf")
 
 // Часть кода покрадена из https://github.com/zmactep/flipperzero-hello-world
 
@@ -153,10 +154,6 @@ int32_t zeitraffer_app(void* p) {
     FlipperFormat* load = flipper_format_file_alloc(storage);
 
     do {
-        if(!storage_simply_mkdir(storage, CONFIG_FILE_DIRECTORY_PATH)) {
-            notification_message(notifications, &sequence_error);
-            break;
-        }
         if(!flipper_format_file_open_existing(load, CONFIG_FILE_PATH)) {
             notification_message(notifications, &sequence_error);
             break;
@@ -325,6 +322,7 @@ int32_t zeitraffer_app(void* p) {
                     }
                 }
             }
+            view_port_update(view_port);
         }
 
         // Наше событие — это сработавший таймер
@@ -378,6 +376,8 @@ int32_t zeitraffer_app(void* p) {
             default:
                 notification_message(notifications, &sequence_display_backlight_enforce_auto);
             }
+
+            view_port_update(view_port);
         }
         if(Time < 1) Time = 1; // Не даём открутить таймер меньше единицы
         if(Count < -1)
@@ -398,7 +398,7 @@ int32_t zeitraffer_app(void* p) {
         }
         if(!flipper_format_write_comment_cstr(
                save,
-               "Zeitraffer app settings:  of frames, interval time, backlight type, Delay")) {
+               "Zeitraffer app settings: n of frames, interval time, backlight type, Delay")) {
             notification_message(notifications, &sequence_error);
             break;
         }