apps: POC for bitfield-based compile-time apps#1672
Closed
FintasticMan wants to merge 2 commits intoInfiniTimeOrg:mainfrom
Closed
apps: POC for bitfield-based compile-time apps#1672FintasticMan wants to merge 2 commits intoInfiniTimeOrg:mainfrom
FintasticMan wants to merge 2 commits intoInfiniTimeOrg:mainfrom
Conversation
Uses the value of the Apps enumerations for a 64-bit bitfield. Increases memory usage considerably for some reason. ApplicationList is pretty ugly.
|
Build size and comparison to main:
|
Member
Author
|
Now the ApplicationList is a little bit cleaner, but it still leave holes in the app list UI where the apps used to be. |
Contributor
|
Nice to see someone else play around with this concept, too! 😊 I will take a closer look at your idea with the bit array. In #1408 I aimed to fix the holes in the application list by creating the array iteratively in a function and hoping for the compiler to optimize it 😄 |
Member
Author
|
This isn't the way we want to solve this issue. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Proof-of-concept for using the value of the Apps enumerations for a 64-bit bitfield for choosing what apps to include at compile-time. The reason for making this is because we want to minimise the number of places people need to add their new app to. By using the values of the Apps enumerations and a bitfield developers don't need to add their app to another place just for it to be togglable at compile-time. (Inspired by #1408 (comment)).
This also attempts to use the preprocessor as little as possible, and I've got it down to one ifdef for the declaration of
disabledApps.For some reason, this increases flash usage considerably, but it does fluctuate as expected by changing the
disabledAppsvariable.The implementation for the ApplicationList is really ugly (and clang-format can't format it properly), so if anyone has any suggestions on how to make that nicer, it would be much appreciated. It also doesn't move apps in the UI, so there are just gaps wherever apps have been disabled.
Another issue is that, to disable apps via the CMake command-line, users need to calculate bitwise operations for the apps they want to disable. This isn't very friendly, so if someone has any ideas, I'd love to hear them.
Fixes #1114