From 1df5251bcff5d0809ac3b1fd05aaf66b777fd2a4 Mon Sep 17 00:00:00 2001 From: Tony Corbett G0WFV Date: Sat, 7 Jan 2017 11:33:09 +0000 Subject: [PATCH 1/3] HD44780 RSSI fettling Remove slot titles and fit string into max of 7 characters to allow for display on 16 character screens Add RSSI to clearDMRInt function --- HD44780.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/HD44780.cpp b/HD44780.cpp index b5fbf8f..2ed780e 100644 --- a/HD44780.cpp +++ b/HD44780.cpp @@ -619,7 +619,7 @@ void CHD44780::writeDMRRSSIInt(unsigned int slotNo, unsigned char rssi) if (slotNo == 1U) { if (m_rssiCount1 == 0U) { ::lcdPosition(m_fd, 0, 3); - ::lcdPrintf(m_fd, "S1:-%u""dBm", rssi); + ::lcdPrintf(m_fd, "%3u dBm", rssi); } m_rssiCount1++; @@ -628,7 +628,7 @@ void CHD44780::writeDMRRSSIInt(unsigned int slotNo, unsigned char rssi) } else { if (m_rssiCount2 == 0U) { ::lcdPosition(m_fd, (m_cols / 2), 3); - ::lcdPrintf(m_fd, "S2:-%u""dBm", rssi); + ::lcdPrintf(m_fd, "%3u dBm", rssi); } m_rssiCount2++; @@ -650,9 +650,13 @@ void CHD44780::clearDMRInt(unsigned int slotNo) if (slotNo == 1U) { ::lcdPosition(m_fd, 0, (m_rows / 2) - 1); ::lcdPrintf(m_fd, "1 %.*s", m_cols - 2U, LISTENING); + ::lcdPosition(m_fd, 0, 3); + ::lcdPrintf(m_fd, "%.*s", m_cols / 2, " "); } else { ::lcdPosition(m_fd, 0, (m_rows / 2)); ::lcdPrintf(m_fd, "2 %.*s", m_cols - 2U, LISTENING); + ::lcdPosition(m_fd, m_cols / 2, 3); + ::lcdPrintf(m_fd, "%.*s", m_cols / 2, " "); } } else { From e8010a4515032cd1a268c8aab1567e99d8f3dc67 Mon Sep 17 00:00:00 2001 From: Tony Corbett G0WFV Date: Sat, 7 Jan 2017 11:40:26 +0000 Subject: [PATCH 2/3] More HD44780 RSSI fettling --- HD44780.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/HD44780.cpp b/HD44780.cpp index 2ed780e..c5c25ce 100644 --- a/HD44780.cpp +++ b/HD44780.cpp @@ -650,13 +650,19 @@ void CHD44780::clearDMRInt(unsigned int slotNo) if (slotNo == 1U) { ::lcdPosition(m_fd, 0, (m_rows / 2) - 1); ::lcdPrintf(m_fd, "1 %.*s", m_cols - 2U, LISTENING); - ::lcdPosition(m_fd, 0, 3); - ::lcdPrintf(m_fd, "%.*s", m_cols / 2, " "); + + if (m_rows > 2) { // clear slot 1 RSSI + ::lcdPosition(m_fd, 0, 3); + ::lcdPrintf(m_fd, "%.*s", m_cols / 2, " "); + } } else { ::lcdPosition(m_fd, 0, (m_rows / 2)); ::lcdPrintf(m_fd, "2 %.*s", m_cols - 2U, LISTENING); - ::lcdPosition(m_fd, m_cols / 2, 3); - ::lcdPrintf(m_fd, "%.*s", m_cols / 2, " "); + + if (m_rows > 2) { // cleat slot 2 RSSI + ::lcdPosition(m_fd, m_cols / 2, 3); + ::lcdPrintf(m_fd, "%.*s", m_cols / 2, " "); + } } } else { From 08970c9c7f02c9eb5610796c7b5c75ed4eda4669 Mon Sep 17 00:00:00 2001 From: Tony Corbett G0WFV Date: Sat, 7 Jan 2017 11:42:42 +0000 Subject: [PATCH 3/3] HD44780 RSSI: fix typo --- HD44780.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HD44780.cpp b/HD44780.cpp index c5c25ce..ec615b4 100644 --- a/HD44780.cpp +++ b/HD44780.cpp @@ -615,7 +615,7 @@ void CHD44780::writeDMRInt(unsigned int slotNo, const std::string& src, bool gro void CHD44780::writeDMRRSSIInt(unsigned int slotNo, unsigned char rssi) { - if (m_cols > 2) { + if (m_rows > 2) { if (slotNo == 1U) { if (m_rssiCount1 == 0U) { ::lcdPosition(m_fd, 0, 3);