-
-
Notifications
You must be signed in to change notification settings - Fork 959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Infineat external resources #1324
Conversation
# Conflicts: # src/displayapp/screens/Symbols.h # src/displayapp/screens/settings/SettingWatchFace.cpp # src/displayapp/screens/settings/SettingWatchFace.h
…d fonts from the ilesystem
@JF002 looks good! Maybe a stupid question, but should the Actions build run as is on the PineTime? I've tried it but it crashes. There's probably something obvious I'm missing :) Also, just as a note, the case when the fonts are not loaded and falls back to the system fonts will cause misalignments. But this is probably fine, since at that point there is already something not working properly. |
@dmlls Thanks for the review!
I don't think you're missing anything obvious... I've just tried the DFU from the CI build (https://github.com/InfiniTimeOrg/InfiniTime/actions/runs/3032845417) and it works fine on my setup, even if the resources are not loaded yet. What happens when "it crashes" ? It boots and resets a few seconds later? EDIT : note that both files from the CI build are intended to be run with the bootloader. Most of the companion apps support the DFU ZIP file, and Amazfish needs the MCUBoot image (Amazfish implemented the support for the zip file recently, so it should be available soon!). If you want to flash it via SWD, you need to flash the MCUBoot image at offset 0x8000 (and the bootloader at 0x00).
I implemented this fallback mode to ensure that the watch wouldn't crash if the resources are not installed when running this code. And I confirm, the alignment is not perfect with the system font. That's something we can improve if we want the fallback mode to look good, indeed! |
@JF002 not sure what I was doing wrong, but installing the DFU via Gadgetbdrige worked neatly ;) Thanks!
Makes total sense!
In the original PR I fixed the alignment (see However this fix cannot be applied directly here as there were some small naming and layout changes. Nothing too complicated to implement, but this and next week will be super busy, so I don't want to block the PR. What if we leave it like this for now and I'll come back to it later? :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a complete review, I ran out of time
@@ -2,6 +2,7 @@ | |||
#include <FreeRTOS.h> | |||
#include <task.h> | |||
#include <libraries/log/nrf_log.h> | |||
#include <components/fs/FS.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
including our headers should be done with ""
, excluding other libs (like lvgl, nrf, std-lib) should be done with <>
#include <components/fs/FS.h> | |
#include "components/fs/FS.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
#include "displayapp/Apps.h" | ||
#include "components/settings/Settings.h" | ||
|
||
#define MAXLISTITEMS 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could make this define into a constexpr size_t and move it from the global namespace into the private CheckboxList one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! However, since this constant is also used in the ctor(), I added it as a public field of the class.
uint8_t (Controllers::Settings::*GetOptionIndex)() const; | ||
std::array<const char*, MAXLISTITEMS> options; | ||
|
||
lv_obj_t* cbOption[MAXLISTITEMS]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could use a std::array
here as well
lv_obj_t* cbOption[MAXLISTITEMS]; | |
std::array<lv_obj_t*, MAXLISTITEMS> cbOption; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
lv_point_t pageIndicatorBasePoints[2]; | ||
lv_point_t pageIndicatorPoints[2]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
although more to type I like std::array
😁
lv_point_t pageIndicatorBasePoints[2]; | |
lv_point_t pageIndicatorPoints[2]; | |
std::array<lv_point_t, 2> pageIndicatorBasePoints; | |
std::array<lv_point_t, 2> pageIndicatorPoints; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/displayapp/screens/Clock.h
Outdated
@@ -42,12 +43,14 @@ namespace Pinetime { | |||
Controllers::Settings& settingsController; | |||
Controllers::HeartRateController& heartRateController; | |||
Controllers::MotionController& motionController; | |||
Controllers::FS& fs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optional suggestion: we could rename it to filesystem
to be more explicit
see comment (far) above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -24,7 +25,8 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd, | |||
Pinetime::Controllers::TimerController& timerController, | |||
Pinetime::Controllers::AlarmController& alarmController, | |||
Pinetime::Controllers::BrightnessController& brightnessController, | |||
Pinetime::Controllers::TouchHandler& touchHandler) | |||
Pinetime::Controllers::TouchHandler& touchHandler, | |||
Pinetime::Controllers::FS& filesystem) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we're using fs
for the filesystem controller everywhere else (I think). I like the explicitness of filesystem
would you suggest to use filesystem
instead of fs
in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree with you, filesystem
is more explicit!
@@ -0,0 +1,144 @@ | |||
#pragma once | |||
|
|||
#include <lvgl/src/lv_core/lv_obj.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're using lvgl.h directly, instead of including from the internals of the lvgl library
#include <lvgl/src/lv_core/lv_obj.h> | |
#include <lvgl/lvgl.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
…tem, use std::array instead of raw array,...
@dmlls Thanks for your feedback! I'll (try to) merge those changes in your PR so that you get credits for this new watchface, and then merge it in develop, as I need those changes to merge the G7710 watchface! |
…finiTime#1024) DisplayApp needs the FileSystem as parameter to the constructor.
Merged in #1024 |
This branch contains #1024 merged with develop. I've also added support for external resources.
@dmlls Would you like to have a look at those changes? If it's OK for you, I can add those commit to your PR and eventually merge it :)