open and close p[ort on each display loop

This commit is contained in:
Drath
2025-10-23 13:05:39 +02:00
parent 563fe0d2e1
commit 5e78b64574

View File

@@ -99,6 +99,7 @@ void displayThread(std::stop_token st, Sensors* s) {
lcd.setCustomChar(0, {16, 6, 9, 8, 8, 9, 6, 0}); // celcius
lcd.setCustomChar(1, {0, 0, 4, 10, 10, 17, 31, 0}); // delta
lcd.setCustomChar(2, {0, 8, 21, 21, 2, 0, 0, 0}); // home (tilde)
lcd._close();
while (!st.stop_requested()) {
sem::display.acquire(); // holds the loop until sensor data is ready
@@ -145,8 +146,10 @@ void displayThread(std::stop_token st, Sensors* s) {
lcd.flushBuf();
}
lcd._open();
lcd.clear();
lcd.writeStr(2, 0, center("linuxSmartie closed", 40));
lcd._close();
}
int main(int argc, char* argv[]) {