Convert userprefs to a json file instead of header file which has to be included everywhere #5471
+79
−141
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.
For your consideration is a change to the userPrefs scheme which has a more strategic direction for ad-hoc agent builds. One of the main goals of userPrefs was to enable ad-hoc builds with custom default values. However, boxing this into a header file was always limiting from a web app consumer perspective.
In the past I attempted to bridge this gap by using clang to generate a manifest of the userprefs into a json file which we would then later attempt to tokenize and replace values from user input. That approach was problematic and still had the issue of macros not being defined unless the userPrefs header was included in every single file that required use of them.
This new json based approach ensures availability globally by injecting them as build flags in our custom PIO script, still allows proper macro expansion, and will make consuming in an automated build application much simpler.