@@ -59,8 +59,8 @@ OLEDDisplayUi::OLEDDisplayUi(OLEDDisplay *display) {
5959 state.frameState = FIXED;
6060 state.currentFrame = 0 ;
6161 state.frameTransitionDirection = 1 ;
62- state.isIndicatorDrawen = true ;
63- state.manuelControll = false ;
62+ state.isIndicatorDrawn = true ;
63+ state.manualControl = false ;
6464 state.userData = NULL ;
6565 shouldDrawIndicators = true ;
6666 autoTransition = true ;
@@ -106,11 +106,11 @@ void OLEDDisplayUi::setTimePerTransition(uint16_t time){
106106
107107// -/------ Customize indicator position and style -------\-
108108void OLEDDisplayUi::enableIndicator (){
109- this ->state .isIndicatorDrawen = true ;
109+ this ->state .isIndicatorDrawn = true ;
110110}
111111
112112void OLEDDisplayUi::disableIndicator (){
113- this ->state .isIndicatorDrawen = false ;
113+ this ->state .isIndicatorDrawn = false ;
114114}
115115
116116void OLEDDisplayUi::enableAllIndicators (){
@@ -179,10 +179,10 @@ void OLEDDisplayUi::runLoadingProcess(LoadingStage* stages, uint8_t stagesCount)
179179 delay (150 );
180180}
181181
182- // -/----- Manuel control -----\-
182+ // -/----- Manual control -----\-
183183void OLEDDisplayUi::nextFrame () {
184184 if (this ->state .frameState != IN_TRANSITION) {
185- this ->state .manuelControll = true ;
185+ this ->state .manualControl = true ;
186186 this ->state .frameState = IN_TRANSITION;
187187 this ->state .ticksSinceLastStateSwitch = 0 ;
188188 this ->lastTransitionDirection = this ->state .frameTransitionDirection ;
@@ -191,7 +191,7 @@ void OLEDDisplayUi::nextFrame() {
191191}
192192void OLEDDisplayUi::previousFrame () {
193193 if (this ->state .frameState != IN_TRANSITION) {
194- this ->state .manuelControll = true ;
194+ this ->state .manualControl = true ;
195195 this ->state .frameState = IN_TRANSITION;
196196 this ->state .ticksSinceLastStateSwitch = 0 ;
197197 this ->lastTransitionDirection = this ->state .frameTransitionDirection ;
@@ -205,7 +205,7 @@ void OLEDDisplayUi::switchToFrame(uint8_t frame) {
205205 if (frame == this ->state .currentFrame ) return ;
206206 this ->state .frameState = FIXED;
207207 this ->state .currentFrame = frame;
208- this ->state .isIndicatorDrawen = true ;
208+ this ->state .isIndicatorDrawn = true ;
209209}
210210
211211void OLEDDisplayUi::transitionToFrame (uint8_t frame) {
@@ -214,7 +214,7 @@ void OLEDDisplayUi::transitionToFrame(uint8_t frame) {
214214 if (frame == this ->state .currentFrame ) return ;
215215 this ->nextFrameNumber = frame;
216216 this ->lastTransitionDirection = this ->state .frameTransitionDirection ;
217- this ->state .manuelControll = true ;
217+ this ->state .manualControl = true ;
218218 this ->state .frameState = IN_TRANSITION;
219219 this ->state .frameTransitionDirection = frame < this ->state .currentFrame ? -1 : 1 ;
220220}
@@ -237,7 +237,7 @@ int16_t OLEDDisplayUi::update(){
237237#endif
238238 int32_t timeBudget = this ->updateInterval - (frameStart - this ->state .lastUpdate );
239239 if ( timeBudget <= 0 ) {
240- // Implement frame skipping to ensure time budget is keept
240+ // Implement frame skipping to ensure time budget is kept
241241 if (this ->autoTransition && this ->state .lastUpdate != 0 ) this ->state .ticksSinceLastStateSwitch += ceil ((double )-timeBudget / (double )this ->updateInterval );
242242
243243 this ->state .lastUpdate = frameStart;
@@ -266,10 +266,10 @@ void OLEDDisplayUi::tick() {
266266 }
267267 break ;
268268 case FIXED:
269- // Revert manuelControll
270- if (this ->state .manuelControll ) {
269+ // Revert manualControl
270+ if (this ->state .manualControl ) {
271271 this ->state .frameTransitionDirection = this ->lastTransitionDirection ;
272- this ->state .manuelControll = false ;
272+ this ->state .manualControl = false ;
273273 }
274274 if (this ->state .ticksSinceLastStateSwitch >= this ->ticksPerFrame ){
275275 if (this ->autoTransition ){
@@ -294,7 +294,7 @@ void OLEDDisplayUi::resetState() {
294294 this ->state .ticksSinceLastStateSwitch = 0 ;
295295 this ->state .frameState = FIXED;
296296 this ->state .currentFrame = 0 ;
297- this ->state .isIndicatorDrawen = true ;
297+ this ->state .isIndicatorDrawn = true ;
298298}
299299
300300void OLEDDisplayUi::drawFrame (){
@@ -337,32 +337,32 @@ void OLEDDisplayUi::drawFrame(){
337337 int8_t dir = this ->state .frameTransitionDirection >= 0 ? 1 : -1 ;
338338 x *= dir; y *= dir; x1 *= dir; y1 *= dir;
339339
340- bool drawenCurrentFrame ;
340+ bool drawnCurrentFrame ;
341341
342342
343- // Prope each frameFunction for the indicator Drawen state
343+ // Probe each frameFunction for the indicator drawn state
344344 this ->enableIndicator ();
345345 (this ->frameFunctions [this ->state .currentFrame ])(this ->display , &this ->state , x, y);
346- drawenCurrentFrame = this ->state .isIndicatorDrawen ;
346+ drawnCurrentFrame = this ->state .isIndicatorDrawn ;
347347
348348 this ->enableIndicator ();
349349 (this ->frameFunctions [this ->getNextFrameNumber ()])(this ->display , &this ->state , x1, y1);
350350
351351 // 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
354354 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
357357 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
360360 this ->indicatorDrawState = 3 ;
361361 }
362362
363363 // 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 ;
366366
367367 break ;
368368 }
@@ -381,7 +381,7 @@ void OLEDDisplayUi::drawIndicator() {
381381 // Only draw if the indicator is invisible
382382 // for both frames or
383383 // 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)) {
385385 return ;
386386 }
387387
0 commit comments