MCPcopy Create free account
hub / github.com/PricelessToolkit/MailBoxGuard / tick

Method tick

Code/Arduino_libraries/SSD1306/OLEDDisplayUi.cpp:256–290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254
255
256void OLEDDisplayUi::tick() {
257 this->state.ticksSinceLastStateSwitch++;
258
259 switch (this->state.frameState) {
260 case IN_TRANSITION:
261 if (this->state.ticksSinceLastStateSwitch >= this->ticksPerTransition){
262 this->state.frameState = FIXED;
263 this->state.currentFrame = getNextFrameNumber();
264 this->state.ticksSinceLastStateSwitch = 0;
265 this->nextFrameNumber = -1;
266 }
267 break;
268 case FIXED:
269 // Revert manualControl
270 if (this->state.manualControl) {
271 this->state.frameTransitionDirection = this->lastTransitionDirection;
272 this->state.manualControl = false;
273 }
274 if (this->state.ticksSinceLastStateSwitch >= this->ticksPerFrame){
275 if (this->autoTransition){
276 this->state.frameState = IN_TRANSITION;
277 }
278 this->state.ticksSinceLastStateSwitch = 0;
279 }
280 break;
281 }
282
283 this->display->clear();
284 this->drawFrame();
285 if (shouldDrawIndicators) {
286 this->drawIndicator();
287 }
288 this->drawOverlays();
289 this->display->display();
290}
291
292void OLEDDisplayUi::resetState() {
293 this->state.lastUpdate = 0;

Callers 1

updateMethod · 0.95

Calls 5

drawFrameMethod · 0.95
drawIndicatorMethod · 0.95
drawOverlaysMethod · 0.95
clearMethod · 0.45
displayMethod · 0.45

Tested by

no test coverage detected