Introduce StateManager to persist state between power cycles (#6)

- add reset state menu option to return all settings back to default values.
- add reverse encoder menu option and save state
- make saving to EEPROM safer by wrapping put calls with noInterrupts()
- improve save state behavior by using a mutex flag and update check with debounce in main loop
- refactor gravity.h global const definitions to be static and more readable.
- improve usage of EncoderDir in ISR with pointer to instance and static isr() method.
- reduce u8g2 memory usage by using single page buffer

Reviewed-on: https://git.pinkduck.xyz/adam/libGravity/pulls/6
Co-authored-by: Adam Wonak <adam.wonak@gmail.com>
Co-committed-by: Adam Wonak <adam.wonak@gmail.com>
This commit is contained in:
2025-06-16 02:47:25 +00:00
committed by adam
parent 07ed4b3d9a
commit d12764313b
10 changed files with 378 additions and 105 deletions

View File

@ -39,6 +39,4 @@
#define OUT_CH5 9
#define OUT_CH6 11
const uint8_t OUTPUT_COUNT = 6;
#endif