summaryrefslogtreecommitdiff
path: root/src/displayapp/screens
diff options
context:
space:
mode:
authorJean-François Milants <jf@codingfield.com>2022-10-01 21:03:28 +0200
committerJean-François Milants <jf@codingfield.com>2022-10-01 21:03:28 +0200
commitd6b4ef38f6c070dc27577ae371d3b0b86d5aec3b (patch)
tree20cc5506f650b7c42512de493abd7cfd79556512 /src/displayapp/screens
parentd3363baf696968b0ed17478f620774c66bac55f9 (diff)
Infineat & G7710 : always close files when they are not needed anymore.
Diffstat (limited to 'src/displayapp/screens')
-rw-r--r--src/displayapp/screens/WatchFaceCasioStyleG7710.cpp3
-rw-r--r--src/displayapp/screens/WatchFaceInfineat.cpp8
2 files changed, 8 insertions, 3 deletions
diff --git a/src/displayapp/screens/WatchFaceCasioStyleG7710.cpp b/src/displayapp/screens/WatchFaceCasioStyleG7710.cpp
index 4ef2839c..f9a01abd 100644
--- a/src/displayapp/screens/WatchFaceCasioStyleG7710.cpp
+++ b/src/displayapp/screens/WatchFaceCasioStyleG7710.cpp
@@ -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");
}
diff --git a/src/displayapp/screens/WatchFaceInfineat.cpp b/src/displayapp/screens/WatchFaceInfineat.cpp
index e3ed1bf7..ae3f3dbb 100644
--- a/src/displayapp/screens/WatchFaceInfineat.cpp
+++ b/src/displayapp/screens/WatchFaceInfineat.cpp
@@ -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");
}