Show shake calibration being disabled when in sleep mode
I was confused by the issue with the shake calibration on my PineTime for which a partial fix exists in https://github.com/InfiniTimeOrg/InfiniTime/pull/2161 (thank you lmamane). I adopted those changes and made the suggested enum refactor as well as fixed an issue with the text not disappearing when leaving the shake calibration screen.
Here is a screenshot of the new disabled message:
All changes are:
- Switch from bool EnableForCal to always saving and restoring shake wake mode to avoid to many conditionals in the constructor and destructor
- Refactor calibrating into currentCalibrationStep enum with descriptive names
- Initialize variables with default values in the class body
- Switch to forward declarations for references in the header and remove unused include
- Fix issue where text would stay on screen due to not calling lv_obj_clean() in the destructor
Build size and comparison to main:
| Section | Size | Difference |
|---|---|---|
| text | 373312B | 192B |
| data | 948B | 0B |
| bss | 22536B | 0B |
After #2328 it now works all the time :) thanks for writing up this feature nonetheless
The refactoring you've done still looks good though, if you would like to open a new PR for that I will try and take a look