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() {
151
151
}
152
152
153
153
void 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 ;
156
155
this ->state .ticksSinceLastStateSwitch = 0 ;
156
+ if (frame == this ->state .currentFrame ) return ;
157
157
this ->state .frameState = FIXED;
158
158
this ->state .currentFrame = frame;
159
159
this ->state .isIndicatorDrawen = true ;
160
160
}
161
161
162
162
void 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 ;
164
166
this ->nextFrameNumber = frame;
165
167
this ->lastTransitionDirection = this ->state .frameTransitionDirection ;
166
168
this ->state .manuelControll = true ;
167
169
this ->state .frameState = IN_TRANSITION;
168
- this ->state .ticksSinceLastStateSwitch = 0 ;
169
170
this ->state .frameTransitionDirection = frame < this ->state .currentFrame ? -1 : 1 ;
170
171
}
171
172
You can’t perform that action at this time.
0 commit comments