Implement _dispX as function local variable
This commit is contained in:
parent
1d07574f8a
commit
592dd73fca
@ -22,7 +22,6 @@ private:
|
||||
|
||||
uint8_t _mExtra;
|
||||
uint8_t _display_type = 0;
|
||||
uint16_t _dispX = 0;
|
||||
uint16_t _dispY = 0;
|
||||
uint16_t _period = 1000;
|
||||
uint16_t _interval = 60000; // interval at which to power save (milliseconds)
|
||||
|
||||
@ -95,14 +95,15 @@ void DisplayGraphicClass::printText(const char* text, uint8_t line)
|
||||
_dispY += (_display->getMaxCharHeight()) + 1;
|
||||
|
||||
// calculate the starting position of the text
|
||||
uint16_t dispX;
|
||||
if (line == 1) {
|
||||
_dispX = 20 + ex;
|
||||
dispX = 20 + ex;
|
||||
} else {
|
||||
_dispX = 5 + ex;
|
||||
dispX = 5 + ex;
|
||||
}
|
||||
|
||||
// draw the Text, on the calculated pos
|
||||
_display->drawStr(_dispX, _dispY, text);
|
||||
_display->drawStr(dispX, _dispY, text);
|
||||
}
|
||||
|
||||
void DisplayGraphicClass::loop()
|
||||
@ -191,7 +192,6 @@ void DisplayGraphicClass::loop()
|
||||
}
|
||||
_display->sendBuffer();
|
||||
|
||||
_dispX = 0;
|
||||
_dispY = 0;
|
||||
_mExtra++;
|
||||
_lastDisplayUpdate = millis();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user