mxmxmx / temps_utile-

teensy 3.2 trigger generator
Other
147 stars 52 forks source link

Save settings in EEPROM #1

Closed patrickdowling closed 9 years ago

patrickdowling commented 9 years ago

Settings are saved when the UI times out and goes back to the idle screen, and only if the values have changed. The latest commits now save the internal clock BPM settings, and initialize the number of parameters as well as min/max values after loading. That seems to be enough, but I might have missed some internals.

The loaded values aren't explicitly re-checked for plausibility or min/max, but this could be added.

At the expense of some uncessary writes, the ::save function can drop the dirty check and rely on the low-level ::update function to check that data needs to be written. This might make it a bit faster if it throws the timing off. There are also better solutions to the brute-force comparison, e.g. setting a dirty flag in the UI, but this seemed a bit invasive.

I've used https://github.com/PaulStoffregen/EEPROM locally.

Let me know how it goes :smiley:

mxmxmx commented 9 years ago

...