mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-22 16:25:45 +08:00
Code restructure to allow for something to come ...
This commit is contained in:
31
HD44780.cpp
31
HD44780.cpp
@@ -569,10 +569,10 @@ void CHD44780::writeDMRInt(unsigned int slotNo, const std::string& src, bool gro
|
|||||||
adafruitLCDColour(AC_RED);
|
adafruitLCDColour(AC_RED);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (m_duplex) {
|
||||||
// 2 x 16
|
// 2 x 16
|
||||||
if (m_rows == 2U && m_cols == 16U) {
|
if (m_rows == 2U && m_cols == 16U) {
|
||||||
char buffer[16U];
|
char buffer[16U];
|
||||||
if (m_duplex) {
|
|
||||||
if (slotNo == 1U) {
|
if (slotNo == 1U) {
|
||||||
::sprintf(buffer, "%s >%s%s", src.c_str(), group ? "TG" : "", dst.c_str());
|
::sprintf(buffer, "%s >%s%s", src.c_str(), group ? "TG" : "", dst.c_str());
|
||||||
::lcdPosition(m_fd, 0, 0);
|
::lcdPosition(m_fd, 0, 0);
|
||||||
@@ -582,21 +582,6 @@ void CHD44780::writeDMRInt(unsigned int slotNo, const std::string& src, bool gro
|
|||||||
::lcdPosition(m_fd, 0, 1);
|
::lcdPosition(m_fd, 0, 1);
|
||||||
::lcdPrintf(m_fd, "2 %.*s", m_cols - 2U, buffer);
|
::lcdPrintf(m_fd, "2 %.*s", m_cols - 2U, buffer);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
::lcdPosition(m_fd, 0, 0);
|
|
||||||
::lcdPutchar(m_fd, 0);
|
|
||||||
::lcdPrintf(m_fd, " %-12s", src.c_str());
|
|
||||||
::lcdCharDef(m_fd, 5, strcmp(type, "R") == 0 ? rfChar : ipChar);
|
|
||||||
::lcdPosition(m_fd, 15, 0);
|
|
||||||
::lcdPutchar(m_fd, 5);
|
|
||||||
|
|
||||||
::lcdPosition(m_fd, 0, 1);
|
|
||||||
::lcdPutchar(m_fd, 1);
|
|
||||||
::lcdPrintf(m_fd, " %-12s", dst.c_str());
|
|
||||||
::lcdCharDef(m_fd, 6, group ? tgChar : privChar);
|
|
||||||
::lcdPosition(m_fd, 15, 1);
|
|
||||||
::lcdPutchar(m_fd, 6);
|
|
||||||
}
|
|
||||||
// 4 x 16
|
// 4 x 16
|
||||||
} else if (m_rows == 4U && m_cols == 16U) {
|
} else if (m_rows == 4U && m_cols == 16U) {
|
||||||
char buffer[16U];
|
char buffer[16U];
|
||||||
@@ -634,7 +619,21 @@ void CHD44780::writeDMRInt(unsigned int slotNo, const std::string& src, bool gro
|
|||||||
::lcdPrintf(m_fd, "2 %.*s", m_cols - 2U, buffer);
|
::lcdPrintf(m_fd, "2 %.*s", m_cols - 2U, buffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
::lcdPosition(m_fd, 0, m_rows == 2 ? 0 : 1);
|
||||||
|
::lcdPutchar(m_fd, 0);
|
||||||
|
::lcdPrintf(m_fd, " %-12s", src.c_str());
|
||||||
|
::lcdCharDef(m_fd, 5, strcmp(type, "R") == 0 ? rfChar : ipChar);
|
||||||
|
::lcdPosition(m_fd, 15, 0);
|
||||||
|
::lcdPutchar(m_fd, 5);
|
||||||
|
|
||||||
|
::lcdPosition(m_fd, 0, m_rows == 2 ? 1 : 2);
|
||||||
|
::lcdPutchar(m_fd, 1);
|
||||||
|
::lcdPrintf(m_fd, " %-12s", dst.c_str());
|
||||||
|
::lcdCharDef(m_fd, 6, group ? tgChar : privChar);
|
||||||
|
::lcdPosition(m_fd, 15, 1);
|
||||||
|
::lcdPutchar(m_fd, 6);
|
||||||
|
}
|
||||||
m_dmr = true;
|
m_dmr = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user