feat: rework CrossPointSettings#510
feat: rework CrossPointSettings#510borisfaure wants to merge 1 commit intocrosspoint-reader:masterfrom
Conversation
|
This fixes #487 |
|
What does it mean? |
What descriptions changed exactly? |
d16fda2 to
3e516a9
Compare
No description changed. The settings labels are in the same file as their declarations. |
3e516a9 to
329c897
Compare
|
Maybe make settings (de)serialization autogenerated in a way protobuf does? For example: uint8_t sleepScreen = DARK; // = 1
uint8_t sleepScreenCoverMode = FIT; // = 2
// settings:reserved uint8_t = 3
uint8_t statusBar = FULL; // = 4And make a script that generate |
I agree the whole serialization/deserialization can be greatly improved but should be done in a further PR. |
329c897 to
89aa47e
Compare
d1769e6 to
4ee4b26
Compare
Multiple goals are achieved with this change: - make descriptions of settings close to their definitions - settings validation on loading with reset to default in case of bad value - do not boot-loop on bad string values - (de)serialization is based on a single list of descriptors: single point of truth - possibly to have default values for the String configuration type - more constexpr to reduce RAM usage - less hardcoded values - more maintainable RAM Usage: From RAM: [=== ] 32.5% (used 106516 bytes from 327680 bytes) Flash: [========= ] 94.9% (used 6217240 bytes from 6553600 bytes) To RAM: [=== ] 32.3% (used 105844 bytes from 327680 bytes) Flash: [========= ] 94.8% (used 6213378 bytes from 6553600 bytes) Boot config validation with a test where the status bar config is wrong: [1256] [SD] SD card detected [1256] [CPS] Loading settings from file [1265] [CPS] Invalid value (0x3) for Status Bar, resetting to default [1265] [CPS] Settings loaded from file
4ee4b26 to
5ae10a7
Compare
|
I've moved forward with #920, however there are some nice small improvements in this PR which we can still merge if you're happy to rebase on top of master |
Summary
Multiple goals are achieved with this change:
constexprto reduce RAM usageRAM Usage:
From
To
Boot config validation:
AI Usage
While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it
helps set the right context for reviewers.
Did you use AI tools to help write this code? PARTIALLY