@@ -59,8 +59,8 @@ OLEDDisplayUi::OLEDDisplayUi(OLEDDisplay *display) {
59
59
state.frameState = FIXED;
60
60
state.currentFrame = 0 ;
61
61
state.frameTransitionDirection = 1 ;
62
- state.isIndicatorDrawen = true ;
63
- state.manuelControll = false ;
62
+ state.isIndicatorDrawn = true ;
63
+ state.manualControl = false ;
64
64
state.userData = NULL ;
65
65
shouldDrawIndicators = true ;
66
66
autoTransition = true ;
@@ -106,11 +106,11 @@ void OLEDDisplayUi::setTimePerTransition(uint16_t time){
106
106
107
107
// -/------ Customize indicator position and style -------\-
108
108
void OLEDDisplayUi::enableIndicator (){
109
- this ->state .isIndicatorDrawen = true ;
109
+ this ->state .isIndicatorDrawn = true ;
110
110
}
111
111
112
112
void OLEDDisplayUi::disableIndicator (){
113
- this ->state .isIndicatorDrawen = false ;
113
+ this ->state .isIndicatorDrawn = false ;
114
114
}
115
115
116
116
void OLEDDisplayUi::enableAllIndicators (){
@@ -179,10 +179,10 @@ void OLEDDisplayUi::runLoadingProcess(LoadingStage* stages, uint8_t stagesCount)
179
179
delay (150 );
180
180
}
181
181
182
- // -/----- Manuel control -----\-
182
+ // -/----- Manual control -----\-
183
183
void OLEDDisplayUi::nextFrame () {
184
184
if (this ->state .frameState != IN_TRANSITION) {
185
- this ->state .manuelControll = true ;
185
+ this ->state .manualControl = true ;
186
186
this ->state .frameState = IN_TRANSITION;
187
187
this ->state .ticksSinceLastStateSwitch = 0 ;
188
188
this ->lastTransitionDirection = this ->state .frameTransitionDirection ;
@@ -191,7 +191,7 @@ void OLEDDisplayUi::nextFrame() {
191
191
}
192
192
void OLEDDisplayUi::previousFrame () {
193
193
if (this ->state .frameState != IN_TRANSITION) {
194
- this ->state .manuelControll = true ;
194
+ this ->state .manualControl = true ;
195
195
this ->state .frameState = IN_TRANSITION;
196
196
this ->state .ticksSinceLastStateSwitch = 0 ;
197
197
this ->lastTransitionDirection = this ->state .frameTransitionDirection ;
@@ -205,7 +205,7 @@ void OLEDDisplayUi::switchToFrame(uint8_t frame) {
205
205
if (frame == this ->state .currentFrame ) return ;
206
206
this ->state .frameState = FIXED;
207
207
this ->state .currentFrame = frame;
208
- this ->state .isIndicatorDrawen = true ;
208
+ this ->state .isIndicatorDrawn = true ;
209
209
}
210
210
211
211
void OLEDDisplayUi::transitionToFrame (uint8_t frame) {
@@ -214,7 +214,7 @@ void OLEDDisplayUi::transitionToFrame(uint8_t frame) {
214
214
if (frame == this ->state .currentFrame ) return ;
215
215
this ->nextFrameNumber = frame;
216
216
this ->lastTransitionDirection = this ->state .frameTransitionDirection ;
217
- this ->state .manuelControll = true ;
217
+ this ->state .manualControl = true ;
218
218
this ->state .frameState = IN_TRANSITION;
219
219
this ->state .frameTransitionDirection = frame < this ->state .currentFrame ? -1 : 1 ;
220
220
}
@@ -237,7 +237,7 @@ int16_t OLEDDisplayUi::update(){
237
237
#endif
238
238
int32_t timeBudget = this ->updateInterval - (frameStart - this ->state .lastUpdate );
239
239
if ( timeBudget <= 0 ) {
240
- // Implement frame skipping to ensure time budget is keept
240
+ // Implement frame skipping to ensure time budget is kept
241
241
if (this ->autoTransition && this ->state .lastUpdate != 0 ) this ->state .ticksSinceLastStateSwitch += ceil ((double )-timeBudget / (double )this ->updateInterval );
242
242
243
243
this ->state .lastUpdate = frameStart;
@@ -266,10 +266,10 @@ void OLEDDisplayUi::tick() {
266
266
}
267
267
break ;
268
268
case FIXED:
269
- // Revert manuelControll
270
- if (this ->state .manuelControll ) {
269
+ // Revert manualControl
270
+ if (this ->state .manualControl ) {
271
271
this ->state .frameTransitionDirection = this ->lastTransitionDirection ;
272
- this ->state .manuelControll = false ;
272
+ this ->state .manualControl = false ;
273
273
}
274
274
if (this ->state .ticksSinceLastStateSwitch >= this ->ticksPerFrame ){
275
275
if (this ->autoTransition ){
@@ -294,7 +294,7 @@ void OLEDDisplayUi::resetState() {
294
294
this ->state .ticksSinceLastStateSwitch = 0 ;
295
295
this ->state .frameState = FIXED;
296
296
this ->state .currentFrame = 0 ;
297
- this ->state .isIndicatorDrawen = true ;
297
+ this ->state .isIndicatorDrawn = true ;
298
298
}
299
299
300
300
void OLEDDisplayUi::drawFrame (){
@@ -337,32 +337,32 @@ void OLEDDisplayUi::drawFrame(){
337
337
int8_t dir = this ->state .frameTransitionDirection >= 0 ? 1 : -1 ;
338
338
x *= dir; y *= dir; x1 *= dir; y1 *= dir;
339
339
340
- bool drawenCurrentFrame ;
340
+ bool drawnCurrentFrame ;
341
341
342
342
343
- // Prope each frameFunction for the indicator Drawen state
343
+ // Probe each frameFunction for the indicator drawn state
344
344
this ->enableIndicator ();
345
345
(this ->frameFunctions [this ->state .currentFrame ])(this ->display , &this ->state , x, y);
346
- drawenCurrentFrame = this ->state .isIndicatorDrawen ;
346
+ drawnCurrentFrame = this ->state .isIndicatorDrawn ;
347
347
348
348
this ->enableIndicator ();
349
349
(this ->frameFunctions [this ->getNextFrameNumber ()])(this ->display , &this ->state , x1, y1);
350
350
351
351
// Build up the indicatorDrawState
352
- if (drawenCurrentFrame && !this ->state .isIndicatorDrawen ) {
353
- // Drawen now but not next
352
+ if (drawnCurrentFrame && !this ->state .isIndicatorDrawn ) {
353
+ // Drawn now but not next
354
354
this ->indicatorDrawState = 2 ;
355
- } else if (!drawenCurrentFrame && this ->state .isIndicatorDrawen ) {
356
- // Not drawen now but next
355
+ } else if (!drawnCurrentFrame && this ->state .isIndicatorDrawn ) {
356
+ // Not drawn now but next
357
357
this ->indicatorDrawState = 1 ;
358
- } else if (!drawenCurrentFrame && !this ->state .isIndicatorDrawen ) {
359
- // Not drawen in both frames
358
+ } else if (!drawnCurrentFrame && !this ->state .isIndicatorDrawn ) {
359
+ // Not drawn in both frames
360
360
this ->indicatorDrawState = 3 ;
361
361
}
362
362
363
363
// If the indicator isn't draw in the current frame
364
- // reflect it in state.isIndicatorDrawen
365
- if (!drawenCurrentFrame ) this ->state .isIndicatorDrawen = false ;
364
+ // reflect it in state.isIndicatorDrawn
365
+ if (!drawnCurrentFrame ) this ->state .isIndicatorDrawn = false ;
366
366
367
367
break ;
368
368
}
@@ -381,7 +381,7 @@ void OLEDDisplayUi::drawIndicator() {
381
381
// Only draw if the indicator is invisible
382
382
// for both frames or
383
383
// the indiactor is shown and we are IN_TRANSITION
384
- if (this ->indicatorDrawState == 3 || (!this ->state .isIndicatorDrawen && this ->state .frameState != IN_TRANSITION)) {
384
+ if (this ->indicatorDrawState == 3 || (!this ->state .isIndicatorDrawn && this ->state .frameState != IN_TRANSITION)) {
385
385
return ;
386
386
}
387
387
0 commit comments