mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-22 16:25:45 +08:00
Attempt to fix scrolling issues reported on 20x4 LCD
Please test and report in the the exisiting issue on git - I don't have a 20x4 LCD to hand, so am unable to test this myself!
This commit is contained in:
10
HD44780.cpp
10
HD44780.cpp
@@ -295,6 +295,8 @@ void CHD44780::adafruitLCDColour(ADAFRUIT_COLOUR colour)
|
|||||||
|
|
||||||
void CHD44780::setIdleInt()
|
void CHD44780::setIdleInt()
|
||||||
{
|
{
|
||||||
|
m_scrollTimer1.stop(); // Stop the scroll timer on slot 1
|
||||||
|
m_scrollTimer2.stop(); // Stop the scroll timer on slot 2
|
||||||
m_clockDisplayTimer.start(); // Start the clock display in IDLE only
|
m_clockDisplayTimer.start(); // Start the clock display in IDLE only
|
||||||
::lcdClear(m_fd);
|
::lcdClear(m_fd);
|
||||||
|
|
||||||
@@ -516,13 +518,16 @@ void CHD44780::writeDMRInt(unsigned int slotNo, const std::string& src, bool gro
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (slotNo == 1U) {
|
if (slotNo == 1U) {
|
||||||
|
m_scrollTimer2.stop();
|
||||||
::lcdPosition(m_fd, 0, (m_rows / 2));
|
::lcdPosition(m_fd, 0, (m_rows / 2));
|
||||||
::lcdPrintf(m_fd, "2 %.*s", m_cols - 2U, LISTENING);
|
::lcdPrintf(m_fd, "2 %.*s", m_cols - 2U, LISTENING);
|
||||||
} else {
|
} else {
|
||||||
|
m_scrollTimer1.stop();
|
||||||
::lcdPosition(m_fd, 0, (m_rows / 2) - 1);
|
::lcdPosition(m_fd, 0, (m_rows / 2) - 1);
|
||||||
::lcdPrintf(m_fd, "1 %.*s", m_cols - 2U, LISTENING);
|
::lcdPrintf(m_fd, "1 %.*s", m_cols - 2U, LISTENING);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
m_scrollTimer2.stop();
|
||||||
::lcdPosition(m_fd, 0, (m_rows / 2) - 1);
|
::lcdPosition(m_fd, 0, (m_rows / 2) - 1);
|
||||||
::sprintf(m_buffer1, "%s%s", "DMR", DEADSPACE);
|
::sprintf(m_buffer1, "%s%s", "DMR", DEADSPACE);
|
||||||
::lcdPrintf(m_fd, "%.*s", m_cols, m_buffer1);
|
::lcdPrintf(m_fd, "%.*s", m_cols, m_buffer1);
|
||||||
@@ -598,18 +603,19 @@ void CHD44780::clearDMRInt(unsigned int slotNo)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_clockDisplayTimer.stop(); // Stop the clock display
|
m_clockDisplayTimer.stop(); // Stop the clock display
|
||||||
m_scrollTimer1.stop(); // Stop the scroll timer on slot 1
|
|
||||||
m_scrollTimer2.stop(); // Stop the scroll timer on slot 2
|
|
||||||
|
|
||||||
if (m_duplex) {
|
if (m_duplex) {
|
||||||
if (slotNo == 1U) {
|
if (slotNo == 1U) {
|
||||||
|
m_scrollTimer1.stop(); // Stop the scroll timer on slot 1
|
||||||
::lcdPosition(m_fd, 0, 0);
|
::lcdPosition(m_fd, 0, 0);
|
||||||
::lcdPrintf(m_fd, "1 %.*s", m_cols - 2U, LISTENING);
|
::lcdPrintf(m_fd, "1 %.*s", m_cols - 2U, LISTENING);
|
||||||
} else {
|
} else {
|
||||||
|
m_scrollTimer2.stop(); // Stop the scroll timer on slot 2
|
||||||
::lcdPosition(m_fd, 0, 1);
|
::lcdPosition(m_fd, 0, 1);
|
||||||
::lcdPrintf(m_fd, "2 %.*s", m_cols - 2U, LISTENING);
|
::lcdPrintf(m_fd, "2 %.*s", m_cols - 2U, LISTENING);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
m_scrollTimer2.stop(); // Stop the scroll timer on slot 2
|
||||||
::lcdPosition(m_fd, 0, (m_rows / 2) - 1);
|
::lcdPosition(m_fd, 0, (m_rows / 2) - 1);
|
||||||
::sprintf(m_buffer2, "%s%s", "DMR", DEADSPACE);
|
::sprintf(m_buffer2, "%s%s", "DMR", DEADSPACE);
|
||||||
::lcdPrintf(m_fd, "%.*s", m_cols, m_buffer2);
|
::lcdPrintf(m_fd, "%.*s", m_cols, m_buffer2);
|
||||||
|
|||||||
Reference in New Issue
Block a user