File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -151,21 +151,22 @@ void OLEDDisplayUi::previousFrame() {
151151}
152152
153153void OLEDDisplayUi::switchToFrame (uint8_t frame) {
154- if (frame >= this ->frameCount || frame != this ->state .currentFrame ) return ;
155- this ->state .lastUpdate = 0 ;
154+ if (frame >= this ->frameCount ) return
156155 this ->state .ticksSinceLastStateSwitch = 0 ;
156+ if (frame == this ->state .currentFrame ) return ;
157157 this ->state .frameState = FIXED;
158158 this ->state .currentFrame = frame;
159159 this ->state .isIndicatorDrawen = true ;
160160}
161161
162162void OLEDDisplayUi::transitionToFrame (uint8_t frame) {
163- if (frame >= this ->frameCount || frame != this ->state .currentFrame ) return ;
163+ if (frame >= this ->frameCount ) return
164+ this ->state .ticksSinceLastStateSwitch = 0 ;
165+ if (frame == this ->state .currentFrame ) return ;
164166 this ->nextFrameNumber = frame;
165167 this ->lastTransitionDirection = this ->state .frameTransitionDirection ;
166168 this ->state .manuelControll = true ;
167169 this ->state .frameState = IN_TRANSITION;
168- this ->state .ticksSinceLastStateSwitch = 0 ;
169170 this ->state .frameTransitionDirection = frame < this ->state .currentFrame ? -1 : 1 ;
170171}
171172
You can’t perform that action at this time.
0 commit comments