Explorar o código

Fix export all

Esteban Fuentealba hai 1 ano
pai
achega
b8cd722930
Modificáronse 3 ficheiros con 9 adicións e 7 borrados
  1. 3 0
      malveke_gb_photo.h
  2. 0 3
      views/boilerplate_scene_1.h
  3. 6 4
      views/boilerplate_scene_2.c

+ 3 - 0
malveke_gb_photo.h

@@ -30,6 +30,9 @@
 #define MALVEKE_APP_FOLDER_RAMS MALVEKE_APP_FOLDER "/rams"
 #define MALVEKE_APP_FOLDER_PHOTOS MALVEKE_APP_FOLDER "/photos"
 
+#define GB_FIRST_PHOTO_OFFSET 0x2000
+#define GB_PHOTO_SIZE 0x1000
+
 typedef struct {
     Gui* gui;
     NotificationApp* notification;

+ 0 - 3
views/boilerplate_scene_1.h

@@ -14,9 +14,6 @@
 #define FRAME_WIDTH 128
 #define FRAME_HEIGTH 64
 
-#define GB_FIRST_PHOTO_OFFSET 0x2000
-#define GB_PHOTO_SIZE 0x1000
-
 typedef struct BoilerplateScene1 BoilerplateScene1;
 
 typedef void (*BoilerplateScene1Callback)(BoilerplateCustomEvent event, void* context);

+ 6 - 4
views/boilerplate_scene_2.c

@@ -33,7 +33,9 @@ void draw_thumbnail(void* context, Canvas* canvas, int page) {
     UNUSED(app);
     //  Gallery
     // for (int s=0;s< 8 * (page+1);s++) {
-    int count = ((page + 2) * 0x1000) + 0x0e00;
+    // int count = ((page + 2) * 0x1000) + 0x0e00;
+    int count = ((page + 2) * GB_PHOTO_SIZE) + 0x0e00;
+
     storage_file_seek(app->camera_ram_sav, count, true);
     for(int y = 0; y < 4; y++) {
         for(int x = 0; x < 4; x++) {
@@ -109,7 +111,7 @@ void save_all_image(void* context) {
     }
 
     for(int page = 0; page < 30; page++) {
-        int count = (page + 1) * 0x1000;
+        int count = GB_FIRST_PHOTO_OFFSET + page * GB_PHOTO_SIZE;
         storage_file_seek(app->camera_ram_sav, count, true);
         // create file name
         FuriString* file_name = furi_string_alloc();
@@ -193,10 +195,10 @@ bool boilerplate_scene_2_input(InputEvent* event, void* context) {
         case InputKeyBack:
             instance->callback(BoilerplateCustomEventScene2Back, instance->context);
             break;
-        case InputKeyUp:
-        case InputKeyDown:
         case InputKeyLeft:
         case InputKeyRight:
+        case InputKeyUp:
+        case InputKeyDown:
         case InputKeyMAX:
             break;
         }