From 50d6efada5bfa2b23a3e1830051475e95d33eb53 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Tue, 10 Sep 2024 14:42:40 +1000 Subject: [PATCH] Use '/sd' instead of '/sdcard' for accessing the sd card it's cleaner --- lua/settings.lua | 2 +- src/drivers/storage.cpp | 2 +- src/tangara/ui/screenshot.cpp | 2 +- src/tangara/ui/ui_fsm.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/settings.lua b/lua/settings.lua index 9b77274d..ae9a6e6d 100644 --- a/lua/settings.lua +++ b/lua/settings.lua @@ -319,7 +319,7 @@ local ThemeSettings = SettingsScreen:new { local theme_dir_iter = filesystem.iterator("/.themes/") for dir in theme_dir_iter do local theme_name = tostring(dir):match("(.+).lua$") - themeOptions[theme_name] = "/sdcard/.themes/" .. theme_name .. ".lua" + themeOptions[theme_name] = "/sd/.themes/" .. theme_name .. ".lua" end local saved_theme = theme.theme_filename(); diff --git a/src/drivers/storage.cpp b/src/drivers/storage.cpp index f4be5864..09702a8c 100644 --- a/src/drivers/storage.cpp +++ b/src/drivers/storage.cpp @@ -31,7 +31,7 @@ static const uint8_t kMaxOpenFiles = 8; namespace drivers { -const char* kStoragePath = "/sdcard"; +const char* kStoragePath = "/sd"; auto SdStorage::Create(IGpios& gpio) -> cpp::result { gpio.WriteSync(IGpios::Pin::kSdPowerEnable, 1); diff --git a/src/tangara/ui/screenshot.cpp b/src/tangara/ui/screenshot.cpp index e4f9cc3f..b6ee4e2f 100644 --- a/src/tangara/ui/screenshot.cpp +++ b/src/tangara/ui/screenshot.cpp @@ -34,7 +34,7 @@ auto SaveScreenshot(lv_obj_t* obj, const std::string& path) -> void { } // The LVGL lodepng fork uses LVGL's file API, so an extra '/' is needed. - std::string fullpath = "//sdcard/" + path; + std::string fullpath = "//sd/" + path; auto res = lodepng_encode_file(fullpath.c_str(), buf->data, buf->header.w, buf->header.h, LCT_RGB, 8); diff --git a/src/tangara/ui/ui_fsm.cpp b/src/tangara/ui/ui_fsm.cpp index 2009a888..3f59d4ad 100644 --- a/src/tangara/ui/ui_fsm.cpp +++ b/src/tangara/ui/ui_fsm.cpp @@ -730,7 +730,7 @@ void Lua::entry() { sPowerFastChargeEnabled.setDirect(sServices->nvs().FastCharge()); if (sServices->sd() == drivers::SdState::kMounted) { - sLua->RunScript("/sdcard/config.lua"); + sLua->RunScript("/sd/config.lua"); } sLua->RunScript("/lua/main.lua"); }