Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a different overlay for each page #415

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/OLEDDisplayUi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ void OLEDDisplayUi::setFrames(FrameCallback* frameFunctions, uint8_t frameCount)
}

// -/----- Overlays ------\-
void OLEDDisplayUi::setOverlays(OverlayCallback* overlayFunctions, uint8_t overlayCount){
void OLEDDisplayUi::setOverlays(OverlayCallback* overlayFunctions, uint8_t* overlayCount){
this->overlayFunctions = overlayFunctions;
this->overlayCount = overlayCount;
}
Expand Down Expand Up @@ -460,9 +460,7 @@ void OLEDDisplayUi::drawIndicator() {
}

void OLEDDisplayUi::drawOverlays() {
for (uint8_t i=0;i<this->overlayCount;i++){
(this->overlayFunctions[i])(this->display, &this->state);
}
this->overlayFunctions[this->overlayCount[this->state.currentFrame]](this->display, &this->state);
}

uint8_t OLEDDisplayUi::getNextFrameNumber(){
Expand Down
4 changes: 2 additions & 2 deletions src/OLEDDisplayUi.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class OLEDDisplayUi {

// Values for Overlays
OverlayCallback* overlayFunctions;
uint8_t overlayCount;
uint8_t* overlayCount;

// Will the Indicator be drawn
// 3 Not drawn in both frames
Expand Down Expand Up @@ -275,7 +275,7 @@ class OLEDDisplayUi {
/**
* Add overlays drawing functions that are draw independent of the Frames
*/
void setOverlays(OverlayCallback* overlayFunctions, uint8_t overlayCount);
void setOverlays(OverlayCallback *overlayFunctions, uint8_t* overlayCount);


// Loading animation
Expand Down