Merge pull request #108 from Horizon-OC/bpmpfw

hocclk: add BPMP-Lite firmware
This commit is contained in:
Souldbminer authored and GitHub committed 2026-08-25 19:21:30 -04:00
commit 8222fe6b0c
72 files changed
+2712 -58

No files matched your search

@@ -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;
}
@@ -103,7 +93,7 @@ namespace fileUtils {
va_list args;
va_start(args, format);
char buff[0xfff];
char buff[0x200];
int len = vsnprintf(buff, sizeof(buff), format, args);
va_end(args);
@@ -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");
@@ -35,7 +35,6 @@
#include <vector>
#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"