Use '/sd' instead of '/sdcard' for accessing the sd card

it's cleaner
custom
jacqueline 7 months ago
parent acdc9789c9
commit 50d6efada5
  1. 2
      lua/settings.lua
  2. 2
      src/drivers/storage.cpp
  3. 2
      src/tangara/ui/screenshot.cpp
  4. 2
      src/tangara/ui/ui_fsm.cpp

@ -319,7 +319,7 @@ local ThemeSettings = SettingsScreen:new {
local theme_dir_iter = filesystem.iterator("/.themes/") local theme_dir_iter = filesystem.iterator("/.themes/")
for dir in theme_dir_iter do for dir in theme_dir_iter do
local theme_name = tostring(dir):match("(.+).lua$") local theme_name = tostring(dir):match("(.+).lua$")
themeOptions[theme_name] = "/sdcard/.themes/" .. theme_name .. ".lua" themeOptions[theme_name] = "/sd/.themes/" .. theme_name .. ".lua"
end end
local saved_theme = theme.theme_filename(); local saved_theme = theme.theme_filename();

@ -31,7 +31,7 @@ static const uint8_t kMaxOpenFiles = 8;
namespace drivers { namespace drivers {
const char* kStoragePath = "/sdcard"; const char* kStoragePath = "/sd";
auto SdStorage::Create(IGpios& gpio) -> cpp::result<SdStorage*, Error> { auto SdStorage::Create(IGpios& gpio) -> cpp::result<SdStorage*, Error> {
gpio.WriteSync(IGpios::Pin::kSdPowerEnable, 1); gpio.WriteSync(IGpios::Pin::kSdPowerEnable, 1);

@ -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. // 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, auto res = lodepng_encode_file(fullpath.c_str(), buf->data, buf->header.w,
buf->header.h, LCT_RGB, 8); buf->header.h, LCT_RGB, 8);

@ -730,7 +730,7 @@ void Lua::entry() {
sPowerFastChargeEnabled.setDirect(sServices->nvs().FastCharge()); sPowerFastChargeEnabled.setDirect(sServices->nvs().FastCharge());
if (sServices->sd() == drivers::SdState::kMounted) { if (sServices->sd() == drivers::SdState::kMounted) {
sLua->RunScript("/sdcard/config.lua"); sLua->RunScript("/sd/config.lua");
} }
sLua->RunScript("/lua/main.lua"); sLua->RunScript("/lua/main.lua");
} }

Loading…
Cancel
Save