Re_Get function computes how many steps have passed since the last call and writes it to Diff var.
That way you won't lose steps if the processing is slow.
Diff can be positive or negative, depending on the direction.
I need to know the step number, regardless of the direction, that's why abs (absolute) is used.
Check rotate_encoder.h for RE_State_t structure description.
Yes, there aren't many other ways.. store the time and compare it, nasa science
You don't exactly know how often the screen update is called, the screen drawing will take more or less time depending on the widgets, causing a lot of jittering.
You needed 80mS because the whole screen is dma-erased and redrawed when the main screen is changed, it's faster than clearing and redrawing each widget, and needs to be done because some widgets slightly overlap, so updating only one would partially erase other nearby widgets.
But if I changed or removed a widget, that time would change, also if the CPU was faster or lower.
Working at the encoder level, you know it's called every 1mS, no matter what.