feat: Implement core frontend application with task management, user selection, and a collapsible sidebar.
This commit is contained in:
@@ -12,7 +12,6 @@
|
||||
#include "nvs_flash.h"
|
||||
#include "soc/gpio_num.h"
|
||||
|
||||
|
||||
// Project headers
|
||||
#include "appstate.hpp"
|
||||
#include "types.hpp"
|
||||
@@ -45,25 +44,23 @@ extern "C" void app_main()
|
||||
nvs_handle_t my_handle;
|
||||
if (nvs_open("storage", NVS_READWRITE, &my_handle) == ESP_OK)
|
||||
{
|
||||
// If we are running from the factory partition, force the www partition to
|
||||
// 0 This ensures that after a USB flash (which only writes to www_0), we
|
||||
// aren't stuck looking at an old www_1.
|
||||
const esp_partition_t *running = esp_ota_get_running_partition();
|
||||
if (running && running->subtype == ESP_PARTITION_SUBTYPE_APP_FACTORY)
|
||||
// Read active www partition from NVS
|
||||
err = nvs_get_u8(my_handle, "www_part", &g_Active_WWW_Partition);
|
||||
|
||||
if (err == ESP_ERR_NVS_NOT_FOUND)
|
||||
{
|
||||
printf(
|
||||
"Running from factory: resetting www_part to 0 for consistency.\n");
|
||||
// First boot (no NVS key yet): default to www_0
|
||||
// This ensures that after a fresh USB flash (which only writes www_0),
|
||||
// we start from the correct partition.
|
||||
printf("No www_part in NVS, defaulting to 0.\n");
|
||||
g_Active_WWW_Partition = 0;
|
||||
nvs_set_u8(my_handle, "www_part", 0);
|
||||
nvs_commit(my_handle);
|
||||
}
|
||||
else
|
||||
else if (err != ESP_OK)
|
||||
{
|
||||
err = nvs_get_u8(my_handle, "www_part", &g_Active_WWW_Partition);
|
||||
if (err != ESP_OK && err != ESP_ERR_NVS_NOT_FOUND)
|
||||
{
|
||||
printf("Error reading www_part from NVS: %s\n", esp_err_to_name(err));
|
||||
}
|
||||
printf("Error reading www_part from NVS: %s\n", esp_err_to_name(err));
|
||||
g_Active_WWW_Partition = 0;
|
||||
}
|
||||
|
||||
if (g_Active_WWW_Partition > 1)
|
||||
|
||||
Reference in New Issue
Block a user