mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-24 09:35:40 +08:00
Changed second half of writeDMR function
This commit is contained in:
39
HD44780.cpp
39
HD44780.cpp
@@ -206,25 +206,40 @@ void CHD44780::writeDMR(unsigned int slotNo, const char* src, bool group, unsign
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_rows == 2U && m_cols == 16U) {
|
||||||
|
char buffer[16U];
|
||||||
if (slotNo == 1U) {
|
if (slotNo == 1U) {
|
||||||
char buffer[40U];
|
|
||||||
if (m_cols > 16U)
|
|
||||||
::sprintf(buffer, "%s %s > %s%u", type, src, group ? "TG" : "", dstId);
|
|
||||||
else
|
|
||||||
::sprintf(buffer, "%s > %s%u", src, group ? "TG" : "", dstId);
|
::sprintf(buffer, "%s > %s%u", src, group ? "TG" : "", dstId);
|
||||||
|
::lcdPosition(m_fd, 0, 0);
|
||||||
::lcdPosition(m_fd, 0, m_rows > 2U ? 1 : 0);
|
|
||||||
::lcdPrintf(m_fd, "1 %.*s", m_cols - 2U, buffer);
|
::lcdPrintf(m_fd, "1 %.*s", m_cols - 2U, buffer);
|
||||||
} else {
|
} else {
|
||||||
char buffer[40U];
|
|
||||||
if (m_cols > 16U)
|
|
||||||
::sprintf(buffer, "%s %s > %s%u", type, src, group ? "TG" : "", dstId);
|
|
||||||
else
|
|
||||||
::sprintf(buffer, "%s > %s%u", src, group ? "TG" : "", dstId);
|
::sprintf(buffer, "%s > %s%u", src, group ? "TG" : "", dstId);
|
||||||
|
::lcdPosition(m_fd, 0, 1);
|
||||||
::lcdPosition(m_fd, 0, m_rows > 2U ? 2 : 1);
|
|
||||||
::lcdPrintf(m_fd, "2 %.*s", m_cols - 2U, buffer);
|
::lcdPrintf(m_fd, "2 %.*s", m_cols - 2U, buffer);
|
||||||
}
|
}
|
||||||
|
} else if (m_rows == 4U && m_cols == 20U) {
|
||||||
|
char buffer[20U];
|
||||||
|
if (slotNo == 1U) {
|
||||||
|
::sprintf(buffer, "%s %s > %s%u", type, src, group ? "TG" : "", dstId);
|
||||||
|
::lcdPosition(m_fd, 0, 1);
|
||||||
|
::lcdPrintf(m_fd, "1 %.*s", m_cols - 2U, buffer);
|
||||||
|
} else {
|
||||||
|
::sprintf(buffer, "%s %s > %s%u", type, src, group ? "TG" : "", dstId);
|
||||||
|
::lcdPosition(m_fd, 0, 2);
|
||||||
|
::lcdPrintf(m_fd, "2 %.*s", m_cols - 2U, buffer);
|
||||||
|
}
|
||||||
|
} else if (m_rows == 2 && m_cols == 40U) {
|
||||||
|
char buffer[40U];
|
||||||
|
if (slotNo == 1U) {
|
||||||
|
::sprintf(buffer, "%s %s > %s%u", type, src, group ? "TG" : "", dstId);
|
||||||
|
::lcdPosition(m_fd, 0, 0);
|
||||||
|
::lcdPrintf(m_fd, "1 %.*s", m_cols - 2U, buffer);
|
||||||
|
} else {
|
||||||
|
::sprintf(buffer, "%s %s > %s%u", type, src, group ? "TG" : "", dstId);
|
||||||
|
::lcdPosition(m_fd, 0, 1);
|
||||||
|
::lcdPrintf(m_fd, "2 %.*s", m_cols - 2U, buffer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m_dmr = true;
|
m_dmr = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user