From 14aae85c7e2ca2279d4f0db0d8fa6168dd79ed36 Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 14 Apr 2016 22:52:03 +0200 Subject: [PATCH] Change display sizes for clearDStar function --- HD44780.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/HD44780.cpp b/HD44780.cpp index 34ce895..953eda1 100644 --- a/HD44780.cpp +++ b/HD44780.cpp @@ -25,7 +25,7 @@ #include #include -const char* LISTENING = "Listening "; +const char* LISTENING = "Listening "; CHD44780::CHD44780(unsigned int rows, unsigned int cols, const char* callsign, unsigned int dmrid, const std::vector& pins) : m_rows(rows), @@ -145,13 +145,16 @@ void CHD44780::writeDStar(const char* my1, const char* my2, const char* your, co void CHD44780::clearDStar() { - if (m_rows > 2U) { + if (m_rows == 2U && m_cols == 16U) { + ::lcdPosition(m_fd, 0, 1); + ::lcdPrintf(m_fd, "%.*s", m_cols, LISTENING); + } else if (m_rows == 4U && m_cols == 20U) { ::lcdPosition(m_fd, 0, 1); ::lcdPrintf(m_fd, "%.*s", m_cols, LISTENING); ::lcdPosition(m_fd, 0, 2); - ::lcdPrintf(m_fd, "%.*s", m_cols, " "); - } else { + ::lcdPrintf(m_fd, "%.*s", m_cols, " "); + } else if (m_rows == 2 && m_cols == 40U) { ::lcdPosition(m_fd, 0, 1); ::lcdPrintf(m_fd, "%.*s", m_cols, LISTENING); }