Revert "Fix universal display slow response"

This reverts commit 98a5bc95a9.
This commit is contained in:
Theo Arends 2024-07-17 16:22:34 +02:00
parent 98a5bc95a9
commit a448f538aa
1 changed files with 17 additions and 26 deletions

View File

@ -533,40 +533,31 @@ int8_t replacepin(char **cp, int16_t pin) {
return res; return res;
} }
/*********************************************************************************************/
#ifdef USE_DISPLAY_MODES1TO5 #ifdef USE_DISPLAY_MODES1TO5
void UDISP_PrintLog(void) { void UDISP_PrintLog(void) {
// This can take over 3 seconds depending on renderer->Updateframe() speed disp_refresh--;
// due to not connected busy pin (configure as MISO) if (!disp_refresh) {
static bool printlog_mutex = false; disp_refresh = Settings->display_refresh;
if (!disp_screen_buffer_cols) { DisplayAllocScreenBuffer(); }
if (disp_refresh) { disp_refresh--; } char* txt = DisplayLogBuffer('\370');
if (disp_refresh || printlog_mutex || TasmotaGlobal.restart_flag || TasmotaGlobal.ota_state_flag) { if (txt != nullptr) {
return; uint8_t last_row = Settings->display_rows -1;
}
printlog_mutex = true;
disp_refresh = Settings->display_refresh;
if (!disp_screen_buffer_cols) { DisplayAllocScreenBuffer(); }
char* txt = DisplayLogBuffer('\370');
if (txt != nullptr) {
uint8_t last_row = Settings->display_rows -1;
// renderer->clearDisplay(); // renderer->clearDisplay();
renderer->setTextSize(Settings->display_size); renderer->setTextSize(Settings->display_size);
renderer->setCursor(0,0); renderer->setCursor(0,0);
for (byte i = 0; i < last_row; i++) { for (byte i = 0; i < last_row; i++) {
strlcpy(disp_screen_buffer[i], disp_screen_buffer[i +1], disp_screen_buffer_cols); strlcpy(disp_screen_buffer[i], disp_screen_buffer[i +1], disp_screen_buffer_cols);
renderer->println(disp_screen_buffer[i]); renderer->println(disp_screen_buffer[i]);
}
strlcpy(disp_screen_buffer[last_row], txt, disp_screen_buffer_cols);
DisplayFillScreen(last_row);
renderer->println(disp_screen_buffer[last_row]);
renderer->Updateframe();
} }
strlcpy(disp_screen_buffer[last_row], txt, disp_screen_buffer_cols);
DisplayFillScreen(last_row);
renderer->println(disp_screen_buffer[last_row]);
renderer->Updateframe();
} }
printlog_mutex = false;
} }
void UDISP_Time(void) { void UDISP_Time(void) {