Merge pull request #557 from jg1uaa/master

TFTSurenoo: stability fix (workaround for display is not cleared)
This commit is contained in:
Jonathan Naylor 2020-02-25 22:44:56 +00:00 committed by GitHub
commit b0fe8dc607
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -374,6 +374,10 @@ void CTFTSurenoo::refreshDisplay(void)
{ {
if (!m_refresh) return; if (!m_refresh) return;
// send CR+LF to avoid first command is not processed
::snprintf(m_temp, sizeof(m_temp), STR_CRLF);
m_serial->write((unsigned char*)m_temp, (unsigned int)::strlen(m_temp));
// clear display // clear display
::snprintf(m_temp, sizeof(m_temp), "BOXF(%d,%d,%d,%d,%d);", ::snprintf(m_temp, sizeof(m_temp), "BOXF(%d,%d,%d,%d,%d);",
0, 0, X_WIDTH - 1, Y_WIDTH - 1, BG_COLOUR); 0, 0, X_WIDTH - 1, Y_WIDTH - 1, BG_COLOUR);