Skip to content
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

Watch face selection at build time #1926

Merged
merged 2 commits into from
Dec 21, 2023
Merged

Conversation

JF002
Copy link
Collaborator

@JF002 JF002 commented Dec 10, 2023

This PR allows to select which watch faces will be built into the firmware at build time. This is done in a similar way than in #1894 : a list of watch face descriptions is generated at build time (using constexpr / consteval and template meta programming). This list is then used at run time to build the setting menu and to load the watchface when requested by the user.

Using this PR together with #1894 (which is already merged), it is now possible to build a bare minimum firmware with no user app and a single watchface. This reduces the image size from 377KB (79%) down to 311KB (65%) in flash memory.

Copy link

Build size and comparison to main:

Section Size Difference
text 377408B -240B
data 940B 0B
bss 63460B -32B

Watch faces can now be selected at buid time. It's implemented in a similar way than the selection of user apps, using a list of watch face description that is generated at build time (consteval, constexpr)
@JF002 JF002 force-pushed the watchface-selection-at-build-time branch from f38b68f to 7add800 Compare December 10, 2023 17:47
Copy link
Member

@FintasticMan FintasticMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good! Just a couple of small details.

src/displayapp/Apps.h Outdated Show resolved Hide resolved
@FintasticMan FintasticMan added the new feature This thread is about a new feature label Dec 15, 2023
Do not assign specific values to the fields of the enum WatchFace.
@JF002 JF002 added this to the 1.14.0 milestone Dec 21, 2023
@JF002 JF002 merged commit 088082d into main Dec 21, 2023
7 checks passed
@FintasticMan FintasticMan deleted the watchface-selection-at-build-time branch December 21, 2023 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature This thread is about a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants