| 5 | namespace tt::lvgl { |
| 6 | |
| 7 | bool label_set_text_file(lv_obj_t* label, const char* filepath) { |
| 8 | std::unique_ptr<uint8_t[]> text; |
| 9 | file::getLock(filepath)->withLock([&text, filepath] { |
| 10 | text = file::readString(filepath); |
| 11 | }); |
| 12 | |
| 13 | if (text != nullptr) { |
| 14 | lv_label_set_text(label, reinterpret_cast<const char*>(text.get())); |
| 15 | return true; |
| 16 | } else { |
| 17 | return false; |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | } // namespace |
nothing calls this directly
no test coverage detected