Fill Display Lines to Avoid Artifacts

This commit is contained in:
seiichiro 2021-06-20 18:42:26 +02:00
parent 285ef0bb93
commit d1195efb82

View file

@ -84,6 +84,12 @@ void loraKeySetup(uint8_t keyset) {
lora.setKeys(NwkSkey_2, AppSkey_2, DevAddr_2); lora.setKeys(NwkSkey_2, AppSkey_2, DevAddr_2);
} }
void fillLine() {
for (uint8_t i = oled.tx; i<15; i++)
oled.print(" ");
oled.println("");
}
// Button Handler Function // Button Handler Function
void handler(Button2& btn) { void handler(Button2& btn) {
switch (btn.getClickType()) { switch (btn.getClickType()) {
@ -198,37 +204,49 @@ void updateDisplay() {
oldFix = hasFix; oldFix = hasFix;
} }
oled.print("HDOP: "); oled.print("HDOP: ");
oled.println(buffer[0]); oled.print(buffer[0]);
fillLine();
oled.print("Sats: "); oled.print("Sats: ");
oled.print(buffer[1]); oled.print(buffer[1]);
oled.print("/"); oled.print("/");
oled.println(buffer[2]); oled.print(buffer[2]);
fillLine();
oled.print("Int: "); oled.print("Int: ");
oled.println(interval); oled.print(interval);
fillLine();
oled.print("Packet: "); oled.print("Packet: ");
oled.println(packets); oled.print(packets);
fillLine();
oled.print("Alt: "); oled.print("Alt: ");
oled.println(buffer[3]); oled.print(buffer[3]);
fillLine();
oled.print("Speed: "); oled.print("Speed: ");
oled.println(buffer[4]); oled.print(buffer[4]);
fillLine();
oled.print("Bat: "); oled.print("Bat: ");
oled.println((float)readSupplyVoltage()/1000); oled.print((float)readSupplyVoltage()/1000);
fillLine();
} else { } else {
if (hasFix != oldFix){ if (hasFix != oldFix){
oled.clear(); oled.clear();
oldFix = hasFix; oldFix = hasFix;
} }
oled.println("NO GPS FIX"); oled.print("NO GPS FIX");
fillLine();
oled.print("Sats: "); oled.print("Sats: ");
oled.print(buffer[1]); oled.print(buffer[1]);
oled.print("/"); oled.print("/");
oled.println(buffer[2]); oled.print(buffer[2]);
fillLine();
oled.print("Int: "); oled.print("Int: ");
oled.println(interval); oled.print(interval);
fillLine();
oled.print("Packet: "); oled.print("Packet: ");
oled.println(packets); oled.print(packets);
fillLine();
oled.print("Bat: "); oled.print("Bat: ");
oled.println((float)readSupplyVoltage()/1000); oled.print((float)readSupplyVoltage()/1000);
fillLine();
} }
oled.print(statusmsg); oled.print(statusmsg);
oled.println(" "); oled.println(" ");