Nachdem die Zeile neu geschrieben wurde, muss auch der Cursor neu gesetzt werden.

This commit is contained in:
Carsten Keller 2024-06-09 18:07:20 +02:00
parent e068d199bb
commit 8b070887e9
Signed by: carsten
GPG Key ID: DF06343A3A9B8868

View File

@ -311,6 +311,7 @@ namespace ElektronischeLast
switch(this->configurations)
{
case 0UL:
cursor = 0U;
soll = get_current_sollstrom();
len = snprintf(data, sizeof(data) - 1, "%05" PRIu32 "mA", soll);
std::memset(&data[len], (int)' ', 16U - len);
@ -320,13 +321,12 @@ namespace ElektronischeLast
this->configurations++;
break;
case 1UL:
cursor = 0U;
lcd.set_cursor(Display::Line2, cursor);
this->configurations++;
break;
case 2UL:
lcd.lcd_set_display(Display::eDispalyOn, Display::eCursorOn, Display::eCursorBlinkOn);
this->configurations++;
break;
case 2UL:
lcd.set_cursor(Display::Line2, cursor);
this->configurations++;
break;
default:
if(ok.isReleased())
@ -373,6 +373,7 @@ namespace ElektronischeLast
std::memset(&data[len], (int)' ', 16U - len);
data[16] = '\0';
lcd.print(Display::Line2, data);
this->configurations = 2U;
}
break;
}