File locking and DevelopmentService improvements (#358)

- Moved `file::getlock(path)` from `Tactility` to `TactilityCore`
- Changed all existing `file::*` functions to implement locking by default
- Removed all manual locking where `file::*` functions were used
- When `DevelopmentService` receives a file, it doesn't try to allocate it all in memory. This fixes going out-of-memory on devices without PSRAM.
- Fix for TactilityC include
This commit is contained in:
Ken Van Hoeylandt
2025-10-05 16:16:55 +02:00
committed by GitHub
parent a05a6afaaf
commit 3802679de4
18 changed files with 224 additions and 180 deletions
@@ -82,8 +82,6 @@ static void importWifiAp(const std::string& filePath) {
static void importWifiApSettings(std::shared_ptr<hal::sdcard::SdCardDevice> sdcard) {
auto path = file::getChildPath(sdcard->getMountPath(), "settings");
auto lock = sdcard->getLock()->asScopedLock();
lock.lock();
std::vector<dirent> dirent_list;
if (file::scandir(path, dirent_list, [](const dirent* entry) {
switch (entry->d_type) {
@@ -104,7 +102,6 @@ static void importWifiApSettings(std::shared_ptr<hal::sdcard::SdCardDevice> sdca
}, nullptr) == 0) {
return;
}
lock.unlock();
if (dirent_list.empty()) {
TT_LOG_W(TAG, "No AP files found at %s", sdcard->getMountPath().c_str());