From 6320ba96e099bb73ac419062ee56fe0a0a87cd69 Mon Sep 17 00:00:00 2001 From: Fritz Heiden Date: Tue, 27 May 2025 12:31:08 +0200 Subject: [PATCH] feat: add file manager and file browser view --- data/audio/some_song.mp3 | 0 data/test_file.txt | 0 include/lv_conf.h | 2 +- platformio.ini | 1 + src/input/user_input_manager.cpp | 2 - src/main.cpp | 2 + src/tools/file_manager.cpp | 47 ++++++++++++ src/tools/file_manager.hpp | 21 +++++ src/ui/display.cpp | 4 - src/ui/views/file_browser_view.cpp | 119 +++++++++++++++++++++++++++++ src/ui/views/file_browser_view.hpp | 12 +++ src/ui/views/main_view.cpp | 31 +------- 12 files changed, 206 insertions(+), 35 deletions(-) create mode 100644 data/audio/some_song.mp3 create mode 100644 data/test_file.txt create mode 100644 src/tools/file_manager.cpp create mode 100644 src/tools/file_manager.hpp create mode 100644 src/ui/views/file_browser_view.cpp create mode 100644 src/ui/views/file_browser_view.hpp diff --git a/data/audio/some_song.mp3 b/data/audio/some_song.mp3 new file mode 100644 index 0000000..e69de29 diff --git a/data/test_file.txt b/data/test_file.txt new file mode 100644 index 0000000..e69de29 diff --git a/include/lv_conf.h b/include/lv_conf.h index aab9a5d..283862f 100644 --- a/include/lv_conf.h +++ b/include/lv_conf.h @@ -285,7 +285,7 @@ *LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail *LV_LOG_LEVEL_USER Only logs added by the user *LV_LOG_LEVEL_NONE Do not log anything*/ - #define LV_LOG_LEVEL LV_LOG_LEVEL_INFO + #define LV_LOG_LEVEL LV_LOG_LEVEL_WARN /*1: Print the log with 'printf'; *0: User need to register a callback with `lv_log_register_print_cb()`*/ diff --git a/platformio.ini b/platformio.ini index b47e359..4c5b70a 100644 --- a/platformio.ini +++ b/platformio.ini @@ -13,6 +13,7 @@ platform = espressif32 board = esp32doit-devkit-v1 framework = arduino monitor_speed = 115200 +board_build.filesystem = littlefs lib_deps = ruiseixasm/Versatile_RotaryEncoder@^1.3.1 bodmer/TFT_eSPI@^2.5.43 diff --git a/src/input/user_input_manager.cpp b/src/input/user_input_manager.cpp index 15393ef..455d99f 100644 --- a/src/input/user_input_manager.cpp +++ b/src/input/user_input_manager.cpp @@ -51,10 +51,8 @@ namespace UserInputManager void pushEvent(InputEvent event) { - Serial.println("pushing new event " + String(event)); for (auto &queue : input_event_queues) { - Serial.println("pushing event to queue " + queue.first + " (" + String(queue.second.size()) + ")"); queue.second.push(event); } } diff --git a/src/main.cpp b/src/main.cpp index 0e0d7fb..795a8ff 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -15,6 +15,7 @@ #include #include #include