-
Notifications
You must be signed in to change notification settings - Fork 245
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
Forced 24h display build option #370
base: main
Are you sure you want to change the base?
Conversation
Unconditionally configures the movement settings for 24 hour mode.
Define a new static function that forces the movement to 24 hour mode if configured to do so at build time. By default, the watch will not be configured to do it which means the code will not be compiled into the function. The compiler's dead code elimination should delete all references to it.
Force the movement to 24h mode during framework initialization if configured to do so at build time.
Force the movement to 24h mode before calling any watch face functions if configured to do so at build time. This is necessary because watch faces can change movement settings.
Defines the appropriate configuration macro via compiler switch.
Lets me call it more than once.
Define a new static function that skips the clock mode page in the preferences watch face if configured to force 24h display. By default, the watch will not be configured in forced 24h mode which means the code will not be compiled into the function. The compiler's dead code elimination should delete all references to it.
There's no point in presenting that page in the forced 24h mode: the user may change the setting but it will be immediately reverted to 24h mode in the next tick of the movement framework.
Update the copyrights to include full name attribution to all who contributed to the updated files, including myself. Also add an SPDX license identifier header comment to the files. https://spdx.org/licenses/MIT.html
I've been using this on my watch for a bit now (with a small merge fix) and its working well. Like this PR as I never use the 12h option or even want it in the settings. |
@madhogs You've been using it? That's really cool!! It's a custom feature I developed for a customer. This was just my first attempt at it. In the end they preferred a smaller scale approach which is much closer to the 24 hour mode compile time default that was recently merged. I didn't think there would have been any interest in this PR and had all but abandoned it. Would you like me to rebase it? |
I have and it works well, thanks 😄 |
Adds a build time configuration option which causes the entire movement framework to force a 24 hour clock display mode configuration. Applies to all watch faces which use the setting and resists attempts by watch faces to set a different mode. Updates the preferences watch face to hide the clock mode configuration page since there's no point in changing the setting.
All of these changes are conditionally compiled into the movement framework. The compiler is expected to eliminate all the forced 24h logic as dead code when not in this configuration.
It can be used via the build system: