From 7240d45a4fcdb44f238abd8b0a5a4d4a06498052 Mon Sep 17 00:00:00 2001 From: GullCode Date: Fri, 31 Mar 2023 14:05:49 +0200 Subject: [PATCH] added on green sdcard load persistent settings --- firmware/application/ui_sd_card_status_view.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/firmware/application/ui_sd_card_status_view.cpp b/firmware/application/ui_sd_card_status_view.cpp index 252b3d27..73a0c9ff 100644 --- a/firmware/application/ui_sd_card_status_view.cpp +++ b/firmware/application/ui_sd_card_status_view.cpp @@ -21,11 +21,14 @@ */ #include "ui_sd_card_status_view.hpp" +#include "portapack_persistent_memory.hpp" #include #include #include "bitmap.hpp" +#include "file.hpp" + namespace ui { @@ -72,7 +75,16 @@ const Color color_sd_card(const sd_card::Status status) { return color_sd_card_unknown; case sd_card::Status::Mounted: + { + File pmem_flag_file_handle ; + std::string pmem_flag_file = "/SETTINGS/PMEM_FILEFLAG" ; + auto result = pmem_flag_file_handle.open(pmem_flag_file); + if(!result.is_valid()) + { + portapack::persistent_memory::load_persistent_settings_from_file("SETTINGS/pmem_settings"); + } return color_sd_card_ok; + } default: return color_sd_card_unknown;