11#include "include/nvs_init.h"
22#include "include/platform.h"
3+ #include "include/system.h"
34#include "include/ota_update.h"
45#include "include/factory_reset.h"
56#include "driver_framebuffer.h"
1213#include "nvs.h"
1314#include "micropython_main.h"
1415
16+
1517extern void micropython_entry (void );
1618
1719extern esp_err_t unpack_first_boot_zip (void );
@@ -36,45 +38,47 @@ void app_main()
3638 size_t mp_task_heap_size = mp_preallocate_heap ();
3739 ESP_LOGI ("MP" , "Heap size: %d" , mp_task_heap_size );
3840
39- logo ();
40- bool is_first_boot = nvs_init ();
41+ // logo();
42+ // bool is_first_boot = nvs_init();
4143
44+ fflush (stdout );
4245 platform_init ();
4346
44- if (is_first_boot ) {
45- #ifdef CONFIG_DRIVER_FRAMEBUFFER_ENABLE
46- driver_framebuffer_fill (NULL , COLOR_BLACK );
47- driver_framebuffer_print (NULL , "Extracting ZIP...\n" , 0 , 0 , 1 , 1 , COLOR_WHITE , & roboto_12pt7b );
48- driver_framebuffer_flush (0 );
49- #endif
50- printf ("Attempting to unpack FAT initialization ZIP file...\b" );
51- if (unpack_first_boot_zip () != ESP_OK ) { //Error
52- #ifdef CONFIG_DRIVER_FRAMEBUFFER_ENABLE
53- driver_framebuffer_fill (NULL , COLOR_BLACK );
54- driver_framebuffer_print (NULL , "ZIP error!\n" , 0 , 0 , 1 , 1 , COLOR_WHITE , & roboto_12pt7b );
55- driver_framebuffer_flush (0 );
56- #endif
57- printf ("An error occured while unpacking the ZIP file!" );
58- nvs_write_zip_status (false);
59- } else {
60- nvs_write_zip_status (true);
61- }
62- esp_restart ();
63- }
47+ // if (is_first_boot) {
48+ // #ifdef CONFIG_DRIVER_FRAMEBUFFER_ENABLE
49+ // driver_framebuffer_fill(NULL, COLOR_BLACK);
50+ // driver_framebuffer_print(NULL, "Extracting ZIP...\n", 0, 0, 1, 1, COLOR_WHITE, &roboto_12pt7b);
51+ // driver_framebuffer_flush(0);
52+ // #endif
53+ // printf("Attempting to unpack FAT initialization ZIP file...\b");
54+ // if (unpack_first_boot_zip() != ESP_OK) { //Error
55+ // #ifdef CONFIG_DRIVER_FRAMEBUFFER_ENABLE
56+ // driver_framebuffer_fill(NULL, COLOR_BLACK);
57+ // driver_framebuffer_print(NULL, "ZIP error!\n", 0, 0, 1, 1, COLOR_WHITE, &roboto_12pt7b);
58+ // driver_framebuffer_flush(0);
59+ // #endif
60+ // printf("An error occured while unpacking the ZIP file!");
61+ // nvs_write_zip_status(false);
62+ // } else {
63+ // nvs_write_zip_status(true);
64+ // }
65+ // esp_restart();
66+ // }
6467
65- int magic = get_magic ();
68+ // int magic = get_magic();
6669
67- switch (magic ) {
68- case MAGIC_OTA :
69- // This triggers an Over-the-Air firmware update
70- badge_ota_update ();
71- break ;
72- case MAGIC_FACTORY_RESET :
73- // This clears any FAT data partitions
74- factory_reset ();
75- break ;
76- default :
77- // This starts the MicroPython FreeRTOS task
78- start_mp ();
79- }
70+ // switch(magic) {
71+ // case MAGIC_OTA:
72+ // // This triggers an Over-the-Air firmware update
73+ // badge_ota_update();
74+ // break;
75+ // case MAGIC_FACTORY_RESET:
76+ // // This clears any FAT data partitions
77+ // factory_reset();
78+ // break;
79+ // default:
80+ // // This starts the MicroPython FreeRTOS task
81+ start_mp ();
82+ // while(1){}
83+ // }
8084}
0 commit comments