only print current screen if it is active

This commit is contained in:
Wolfgang Hottgenroth 2020-11-20 12:39:06 +01:00
parent 63f993c130
commit aff85b6d3e
Signed by: wn
GPG Key ID: 6C1E5E531E0D5D7F

View File

@ -427,10 +427,12 @@ void oledPrint(oledScreen_t screen, char msg[]) {
lines[screen][MAX_LINES - 1][MAX_CHARS - 1] = 0; lines[screen][MAX_LINES - 1][MAX_CHARS - 1] = 0;
} }
if (screen == activeScreen) {
for (uint8_t line = 0; line < MAX_LINES; line++) { for (uint8_t line = 0; line < MAX_LINES; line++) {
oled_P6x8Str(1, line, lines[activeScreen][line]); oled_P6x8Str(1, line, lines[activeScreen][line]);
} }
} }
}
static void oledSwitchBackToScreen0(void *handle) { static void oledSwitchBackToScreen0(void *handle) {
oledSetActiveScreen(OLED_SCREEN0); oledSetActiveScreen(OLED_SCREEN0);