Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions Apps/Diceware/main/Source/Diceware.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include <app/paths.h>
#include <lvgl/lvgl.h>
#include <lvgl/widgets/toolbar.h>
#include <tactility/filesystem/file_mutex.h>

#include <esp_random.h>
#include <esp_log.h>
Expand Down Expand Up @@ -39,17 +38,13 @@ static std::string readWordAtLine(const int lineIndex) {
return "";
}

struct FileMutex mutex;
file_mutex_get(&mutex, path);
std::string word;
file_mutex_lock(&mutex);
FILE* file = fopen(path, "r");
if (file != nullptr) {
skipNewlines(file, lineIndex);
word = readWord(file);
fclose(file);
} else { ESP_LOGE(TAG, "Failed to open %s", path); }
file_mutex_unlock(&mutex);
return word;
}

Expand Down
4 changes: 2 additions & 2 deletions Apps/Diceware/manifest.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ manifest.version=0.2
target.sdk=0.8.0-dev
target.platforms=esp32,esp32s3,esp32c6,esp32p4
app.id=tactility.diceware
app.version.name=0.12.0
app.version.code=12
app.version.name=0.13.0
app.version.code=13
app.name=Diceware
13 changes: 2 additions & 11 deletions Apps/EpubReader/main/Source/EpubReaderAsync.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include "EpubReader.h"
#include <lvgl/widgets/toolbar.h>
#include <tactility/filesystem/file_mutex.h>
#include <tactility/log.h>
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
Expand Down Expand Up @@ -112,15 +111,9 @@ void asyncSwitchToBrowser(void* data) {
void backgroundOpenTask(void* data) {
auto* a = static_cast<OpenArgs*>(data);

// Acquire the filesystem lock before any SD card I/O - prevents concurrent
// SDMMC access from the background and LVGL tasks (bus errors 0x107/0x108).
struct FileMutex mutex;
file_mutex_get(&mutex, a->filePath.c_str());
file_mutex_lock(&mutex);

if (isTextFile(a->filePath)) {
// Read the entire text file here (under the lock) so asyncOpenComplete
// only needs to update UI state - no SD I/O on the LVGL task.
// Read the entire text file here so asyncOpenComplete only needs to
// update UI state - no SD I/O on the LVGL task.
FILE* f = fopen(a->filePath.c_str(), "r");
if (f) {
char buf[512];
Expand All @@ -140,8 +133,6 @@ void backgroundOpenTask(void* data) {
a->epub = EpubService::open(a->filePath);
}

file_mutex_unlock(&mutex);

// Signal the LVGL task that the work is done
lv_async_call(asyncOpenComplete, a);
vTaskDelete(nullptr);
Expand Down
4 changes: 2 additions & 2 deletions Apps/EpubReader/manifest.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ manifest.version=0.2
target.sdk=0.8.0-dev
target.platforms=esp32s3,esp32p4
app.id=tactility.epubreader
app.version.name=0.9.0
app.version.code=9
app.version.name=0.10.0
app.version.code=10
app.name=Epub Reader
app.description=Epub and text file reader. Requires PSRAM!
10 changes: 0 additions & 10 deletions Apps/TodoList/main/Source/TodoList.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "TodoList.h"
#include <app/paths.h>
#include <lvgl_window_manager/window_manager.h>
#include <tactility/filesystem/file_mutex.h>
#include <Tactility/kernel/Kernel.h>
#include <lvgl/widgets/toolbar.h>
#include <lvgl/lvgl.h>
Expand Down Expand Up @@ -62,27 +61,19 @@ void saveTodos(Context* ctx) {
char savePath[256];
if (!getSaveFilePath(savePath, sizeof(savePath))) return;

struct FileMutex mutex;
file_mutex_get(&mutex, savePath);
file_mutex_lock(&mutex);
FILE* f = fopen(savePath, "w");
if (f) {
for (int i = 0; i < ctx->count; i++) {
fprintf(f, "%c %s\n", ctx->items[i].done ? '+' : '-', ctx->items[i].text);
}
fclose(f);
}
file_mutex_unlock(&mutex);
}

void loadTodos(Context* ctx) {
char savePath[256];
if (!getSaveFilePath(savePath, sizeof(savePath))) return;

struct FileMutex mutex;
file_mutex_get(&mutex, savePath);

file_mutex_lock(&mutex);
ctx->count = 0;
FILE* f = fopen(savePath, "r");
if (f) {
Expand All @@ -103,7 +94,6 @@ void loadTodos(Context* ctx) {
}
fclose(f);
}
file_mutex_unlock(&mutex);
}

/* ── UI Helpers ───────────────────────────────────────────────────── */
Expand Down
4 changes: 2 additions & 2 deletions Apps/TodoList/manifest.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ manifest.version=0.2
target.sdk=0.8.0-dev
target.platforms=esp32,esp32s3,esp32c6,esp32p4
app.id=tactility.todolist
app.version.name=0.11.0
app.version.code=11
app.version.name=0.12.0
app.version.code=12
app.name=Todo List
app.description=Simple task list manager
Loading