From 85bfed0604dd013098574b9d6671b6820de49907 Mon Sep 17 00:00:00 2001 From: souldbminersmwc Date: Tue, 25 Aug 2026 14:54:06 -0400 Subject: [PATCH] lower fs reads during early warmboot --- Source/hoc-clk/sysmodule/src/file/file_utils.cpp | 14 ++------------ Source/hoc-clk/sysmodule/src/file/file_utils.hpp | 1 - 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/Source/hoc-clk/sysmodule/src/file/file_utils.cpp b/Source/hoc-clk/sysmodule/src/file/file_utils.cpp index f519a198..107a2b73 100644 --- a/Source/hoc-clk/sysmodule/src/file/file_utils.cpp +++ b/Source/hoc-clk/sysmodule/src/file/file_utils.cpp @@ -46,7 +46,6 @@ namespace fileUtils { std::atomic_bool g_has_initialized = false; bool g_log_enabled = false; bool g_uart_enabled = false; - std::uint64_t g_last_flag_check = 0; bool FlagExists(const char *path) { FILE *file = fopen(path, "r"); @@ -57,16 +56,9 @@ namespace fileUtils { return false; } - void RefreshFlags(bool force) { - std::uint64_t now = armTicksToNs(armGetSystemTick()); - if (!force && (now - g_last_flag_check) < FILE_FLAG_CHECK_INTERVAL_NS) { - return; - } - + void RefreshFlags() { g_log_enabled = FlagExists(FILE_LOG_FLAG_PATH); g_uart_enabled = FlagExists(FILE_UART_FLAG_PATH); - - g_last_flag_check = now; } void InitializeThreadFunc(void *args) { @@ -94,8 +86,6 @@ namespace fileUtils { return; } - RefreshFlags(false); - if (!g_log_enabled && !g_uart_enabled) { return; } @@ -223,7 +213,7 @@ namespace fileUtils { } if (R_SUCCEEDED(rc)) { - RefreshFlags(true); + RefreshFlags(); g_has_initialized = true; LogLine("=== hoc-clk " TARGET_VERSION " ==="); LogLine("by m4xw, natinusala, p-sam, Souldbminer, Lightos_ and Dominatorul"); diff --git a/Source/hoc-clk/sysmodule/src/file/file_utils.hpp b/Source/hoc-clk/sysmodule/src/file/file_utils.hpp index 69991f86..f2ab4b2a 100644 --- a/Source/hoc-clk/sysmodule/src/file/file_utils.hpp +++ b/Source/hoc-clk/sysmodule/src/file/file_utils.hpp @@ -35,7 +35,6 @@ #include #define FILE_CONFIG_DIR "/config/" CONFIG_DIR -#define FILE_FLAG_CHECK_INTERVAL_NS (10000ULL * 1000000000ULL) #define FILE_CONTEXT_CSV_PATH FILE_CONFIG_DIR "/context.csv" #define FILE_LOG_FLAG_PATH FILE_CONFIG_DIR "/log.flag" #define FILE_UART_FLAG_PATH FILE_CONFIG_DIR "/uart.flag"