Incrementing date workaround for dead RTC battery (#1479)

* Enable f_utime function
* Added file_update_date() function
* Added rtc_battery_workaround() function
* Update ui_navigation.cpp
This commit is contained in:
Mark Thompson 2023-10-09 05:04:46 -05:00 committed by GitHub
parent e5546159c5
commit 65e71508ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 66 additions and 5 deletions

View file

@ -325,6 +325,14 @@ FATTimestamp file_created_date(const std::filesystem::path& file_path) {
return {filinfo.fdate, filinfo.ftime};
}
std::filesystem::filesystem_error file_update_date(const std::filesystem::path& file_path, FATTimestamp timestamp) {
FILINFO filinfo{};
filinfo.fdate = timestamp.FAT_date;
filinfo.ftime = timestamp.FAT_time;
return f_utime(reinterpret_cast<const TCHAR*>(file_path.c_str()), &filinfo);
}
std::filesystem::filesystem_error make_new_file(
const std::filesystem::path& file_path) {
File f;