InfiniTime icon indicating copy to clipboard operation
InfiniTime copied to clipboard

Show shake calibration being disabled when in sleep mode

Open dariusarnold opened this issue 10 months ago • 1 comments

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: InfiniSim_2025-03-12_203033

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

dariusarnold avatar Mar 12 '25 20:03 dariusarnold

Build size and comparison to main:

Section Size Difference
text 373312B 192B
data 948B 0B
bss 22536B 0B

Run in InfiniEmu

github-actions[bot] avatar Mar 12 '25 20:03 github-actions[bot]

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

mark9064 avatar Oct 15 '25 16:10 mark9064