Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In #1928 and #1934, we made it easier to select which apps and watch face will be built into the firmware.
However, those apps and watch faces must still be defined in the InfiniTime code base : the source code must be in
src/displayapp
and the enumsWatchFace
andApps
must list all the apps known to InfiniTime.With this PR, I would like to make another steps toward splitting the InfiniTime "core" from the applications and watch faces by removing the
WatchFace
enum.The end goal consist in allowing watch faces and apps to be defined in their own CMake project. Those projects would build a static lib (
.a
) for each watch face and application and the InfiniTime build system would simply link with them at build time. Those project could be added to InfinITime using gitsubmodule
s for example.The advantage of this approach is to allow applications and watch faces developer to manage their own project with their apps on their own, without any interventions of InfiniTime developers. Then, InfiniTime Core developers and fork maintainers would simply select the project they want to add in their own project.
For this to work, we need to remove as much dependencies as possible between apps/watch faces and InfiniTime : we need to be able to add them without making any changes in the InfiniTime code base.
The
WatchFace
andApps
enums do not play well with this goal : new apps and watch faces need to be added to this enum.This PR removes the need for the
WatchFace
enum : watch faces are now identified by their type at build time and by their name at runtime.The advantage of those changes is that they allow to make one step forward towards "external" application.
I'm less satisfied with the added code generated by CMake and with the string comparisons at runtime (previously, we just needed to check the value of the WatchFace enum - 1Byte, now, we need to compare a whole 16 chars string). But that might be the price to pay for more generic code.
This is WIP (work in progress), and the code generated by CMake needs to be improved (especially the generation of the include paths).
Any feedback/opinion about this?