From ebe33ceb24131df68a28def974228166ba49ddaf Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 14 Apr 2016 23:21:52 +0200 Subject: [PATCH] Change firs halt of writeDMR function --- HD44780.cpp | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/HD44780.cpp b/HD44780.cpp index 9a60970..d8e8c2f 100644 --- a/HD44780.cpp +++ b/HD44780.cpp @@ -168,17 +168,41 @@ void CHD44780::writeDMR(unsigned int slotNo, const char* src, bool group, unsign if (!m_dmr) { ::lcdClear(m_fd); - if (m_rows > 2U) { + if (m_rows == 2U && m_cols == 16U) { + if (slotNo == 1U) { + ::lcdPosition(m_fd, 0, 0); + ::lcdPrintf(m_fd, "1 %.*s", m_cols - 2U, LISTENING); + } else { + ::lcdPosition(m_fd, 0, 0); + ::lcdPrintf(m_fd, "1 %.*s", m_cols - 2U, LISTENING); + + ::lcdPosition(m_fd, 0, 1); + ::lcdPrintf(m_fd, "2 %.*s", m_cols - 2U, LISTENING); + } + } else if (m_rows == 4U && m_cols == 20U) { ::lcdPosition(m_fd, 0, 0); ::lcdPuts(m_fd, "DMR"); - } + if (slotNo == 1U) { + ::lcdPosition(m_fd, 0, 1); + ::lcdPrintf(m_fd, "1 %.*s", m_cols - 2U, LISTENING); + } else { + ::lcdPosition(m_fd, 0, 1); + ::lcdPrintf(m_fd, "1 %.*s", m_cols - 2U, LISTENING); - if (slotNo == 1U) { - ::lcdPosition(m_fd, 0, m_rows > 2U ? 2 : 1); - ::lcdPrintf(m_fd, "2 %.*s", m_cols - 2U, LISTENING); - } else { - ::lcdPosition(m_fd, 0, m_rows > 2U ? 1 : 0); - ::lcdPrintf(m_fd, "1 %.*s", m_cols - 2U, LISTENING); + ::lcdPosition(m_fd, 0, 2); + ::lcdPrintf(m_fd, "2 %.*s", m_cols - 2U, LISTENING); + } + } else if (m_rows == 2 && m_cols == 40U) { + if (slotNo == 1U) { + ::lcdPosition(m_fd, 0, 0); + ::lcdPrintf(m_fd, "1 %.*s", m_cols - 2U, LISTENING); + } else { + ::lcdPosition(m_fd, 0, 0); + ::lcdPrintf(m_fd, "1 %.*s", m_cols - 2U, LISTENING); + + ::lcdPosition(m_fd, 0, 1); + ::lcdPrintf(m_fd, "2 %.*s", m_cols - 2U, LISTENING); + } } }