Skip to content
Snippets Groups Projects
Commit 1a427e2f authored by Daniel Eichhorn's avatar Daniel Eichhorn Committed by GitHub
Browse files

Merge pull request #60 from squix78/fix-frame-function-bug

Fix broken switchToFrame/transitionToFrame condition
parents e28060f4 3ec1383a
No related branches found
No related tags found
No related merge requests found
......@@ -151,21 +151,22 @@ void OLEDDisplayUi::previousFrame() {
}
void OLEDDisplayUi::switchToFrame(uint8_t frame) {
if (frame >= this->frameCount || frame != this->state.currentFrame) return;
this->state.lastUpdate = 0;
if (frame >= this->frameCount) return;
this->state.ticksSinceLastStateSwitch = 0;
if (frame == this->state.currentFrame) return;
this->state.frameState = FIXED;
this->state.currentFrame = frame;
this->state.isIndicatorDrawen = true;
}
void OLEDDisplayUi::transitionToFrame(uint8_t frame) {
if (frame >= this->frameCount || frame != this->state.currentFrame) return;
if (frame >= this->frameCount) return;
this->state.ticksSinceLastStateSwitch = 0;
if (frame == this->state.currentFrame) return;
this->nextFrameNumber = frame;
this->lastTransitionDirection = this->state.frameTransitionDirection;
this->state.manuelControll = true;
this->state.frameState = IN_TRANSITION;
this->state.ticksSinceLastStateSwitch = 0;
this->state.frameTransitionDirection = frame < this->state.currentFrame ? -1 : 1;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment