Skip to content

[RFC] Proposal around settings cli tool #2114

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

Open
Ralim opened this issue Mar 29, 2025 · 0 comments
Open

[RFC] Proposal around settings cli tool #2114

Ralim opened this issue Mar 29, 2025 · 0 comments
Assignees
Labels
Build System make/bash/python, github CI/CD & pals. Enhancement New feature or additional function. Usability UX, Usability and/or Design.
Milestone

Comments

@Ralim
Copy link
Owner

Ralim commented Mar 29, 2025

Writing this idea up for comments / planning.

This is a spin out from #1477 and #1776 in a way.

Generate settings code from yaml

Proposal is to store all the available settings options in a somewhat human friendly yaml file.

So this file would loosely have entries like

settings:
- default: 320
  increment: 10
  max: 420
  min: 50
  name: SolderingTemp
  enable_models: "ALL"
  description: "Soldering temperature in user units"
- default: 0
  increment: 1
  max: 10
  min: 0
  name: SleepTime

So we can take the contents from this file, parse it, then generate the main content of Settings.h and Settings.cpp.
Thinking along the same line as translations where we just generate normal c/cpp files and add them to the build. Rather than try and manipulate anything fancy.

This could then allow us to remove settings entries that do not apply to a model by having some filters defined on the entries.

This yaml file can then also be parsed any used by other projects that interact with the settings options over BLE for example.

We could also maybe export filtered "final" settings files in the per-device release zip files potentially

Generating and parsing setting files

Once we have all the settings into a nicer to work with format, we can make a basic script that can load and save "user settings" to/from a binary file.
Since settings are just encoded as a flat in-flash array of uint16_t values we can just generate this binary blob.

For the code to generate .bin/.hex/.dfu files from this blob, I've already made python code to do a lot of this we can re-use.

For loading these files its roughly going to be the reverse.
We can provide example commands for dfu-util and blisp to dump the area of flash the settings are in.

I view loading settings from a device as a "bonus" feature, and not required

@Ralim Ralim assigned Ralim and ia Mar 29, 2025
@ia ia added Enhancement New feature or additional function. Build System make/bash/python, github CI/CD & pals. Usability UX, Usability and/or Design. labels Mar 29, 2025
@ia ia modified the milestones: 2.25, 2.24 Mar 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build System make/bash/python, github CI/CD & pals. Enhancement New feature or additional function. Usability UX, Usability and/or Design.
Projects
None yet
Development

No branches or pull requests

2 participants