mirror of
https://github.com/InfiniTimeOrg/InfiniTime.git
synced 2024-12-24 10:13:56 +03:00
Infineat & G7710 : always close files when they are not needed anymore.
This commit is contained in:
parent
d3363baf69
commit
d6b4ef38f6
@ -36,14 +36,17 @@ WatchFaceCasioStyleG7710::WatchFaceCasioStyleG7710(DisplayApp* app,
|
||||
|
||||
lfs_file f = {};
|
||||
if (filesystem.FileOpen(&f, "/fonts/lv_font_dots_40.bin", LFS_O_RDONLY) >= 0) {
|
||||
filesystem.FileClose(&f);
|
||||
font_dot40 = lv_font_load("F:/fonts/lv_font_dots_40.bin");
|
||||
}
|
||||
|
||||
if (filesystem.FileOpen(&f, "/fonts/7segments_40.bin", LFS_O_RDONLY) >= 0) {
|
||||
filesystem.FileClose(&f);
|
||||
font_segment40 = lv_font_load("F:/fonts/7segments_40.bin");
|
||||
}
|
||||
|
||||
if (filesystem.FileOpen(&f, "/fonts/7segments_115.bin", LFS_O_RDONLY) >= 0) {
|
||||
filesystem.FileClose(&f);
|
||||
font_segment115 = lv_font_load("F:/fonts/7segments_115.bin");
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ WatchFaceInfineat::WatchFaceInfineat(DisplayApp* app,
|
||||
Controllers::NotificationManager& notificationManager,
|
||||
Controllers::Settings& settingsController,
|
||||
Controllers::MotionController& motionController,
|
||||
Controllers::FS& fs)
|
||||
Controllers::FS& filesystem)
|
||||
: Screen(app),
|
||||
currentDateTime {{}},
|
||||
dateTimeController {dateTimeController},
|
||||
@ -37,11 +37,13 @@ WatchFaceInfineat::WatchFaceInfineat(DisplayApp* app,
|
||||
settingsController {settingsController},
|
||||
motionController {motionController} {
|
||||
lfs_file f = {};
|
||||
if (fs.FileOpen(&f, "/fonts/teko.bin", LFS_O_RDONLY) >= 0) {
|
||||
if (filesystem.FileOpen(&f, "/fonts/teko.bin", LFS_O_RDONLY) >= 0) {
|
||||
filesystem.FileClose(&f);
|
||||
font_teko = lv_font_load("F:/fonts/teko.bin");
|
||||
}
|
||||
|
||||
if (fs.FileOpen(&f, "/fonts/bebas.bin", LFS_O_RDONLY) >= 0) {
|
||||
if (filesystem.FileOpen(&f, "/fonts/bebas.bin", LFS_O_RDONLY) >= 0) {
|
||||
filesystem.FileClose(&f);
|
||||
font_bebas = lv_font_load("F:/fonts/bebas.bin");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user