Skip to content

Commit

Permalink
Changes to block until the LCD update has completed if the `LCD_DISPL…
Browse files Browse the repository at this point in the history
…AY_NOW` is set

This fixes issues during firmware update where the incomming data also blocks the CPU and the LCD was not being updated, especcially over Ethernet as the data is received much faster than WiFI
  • Loading branch information
jeremypoulter committed Jul 27, 2023
1 parent ff55cf4 commit af12d48
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/lcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void LcdTask::display(Message *msg, uint32_t flags)
_tail = msg;

if(flags & LCD_DISPLAY_NOW) {
MicroTask.wakeTask(this);
displayNextMessage();
}
}

Expand Down Expand Up @@ -704,7 +704,7 @@ void LcdTask::displayNameValue(int line, const char *name, const char *value)

void LcdTask::showText(int x, int y, const char *msg, bool clear)
{
DBUGF("LCD: %d %d %s", x, y, msg);
DBUGF("LCD: %d %d %s, clear=%s", x, y, msg, clear ? "true" : "false");
_evse->getOpenEVSE().lcdDisplayText(x, y, msg, IGNORE);
if(clear)
{
Expand All @@ -715,6 +715,9 @@ void LcdTask::showText(int x, int y, const char *msg, bool clear)
_evse->getOpenEVSE().lcdDisplayText(i, y, " ", IGNORE);
}
}

// HACK: wait for the display to finish, fixes issues withupdating the display wile updating the firmware
_evse->getSender().flush();
}

void LcdTask::onButton(int long_press)
Expand Down

0 comments on commit af12d48

Please sign in to comment.