| 82 | #pragma region Open_Events_Functions |
| 83 | |
| 84 | void openFile(const std::string& path) { |
| 85 | // We might be reading from the SD card, which could share a SPI bus with other devices (display) |
| 86 | file::getLock(path)->withLock([this, path] { |
| 87 | auto data = file::readString(path); |
| 88 | if (data != nullptr) { |
| 89 | auto lock = lvgl::getSyncLock()->asScopedLock(); |
| 90 | lock.lock(); |
| 91 | lv_textarea_set_text(uiNoteText, reinterpret_cast<const char*>(data.get())); |
| 92 | lv_label_set_text(uiCurrentFileName, path.c_str()); |
| 93 | filePath = path; |
| 94 | LOGGER.info("Loaded from {}", path); |
| 95 | } |
| 96 | }); |
| 97 | } |
| 98 | |
| 99 | bool saveFile(const std::string& path) { |
| 100 | // We might be writing to SD card, which could share a SPI bus with other devices (display) |
nothing calls this directly
no test coverage detected