mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-20 22:45:44 +08:00
Change the display for D-Star and Fusion if we have more than two lines.
This commit is contained in:
64
HD44780.cpp
64
HD44780.cpp
@@ -90,17 +90,37 @@ void CHD44780::setDStar()
|
|||||||
|
|
||||||
void CHD44780::writeDStar(const char* my1, const char* my2, const char* your)
|
void CHD44780::writeDStar(const char* my1, const char* my2, const char* your)
|
||||||
{
|
{
|
||||||
char buffer[40U];
|
if (m_rows > 2U) {
|
||||||
::sprintf(buffer, "%s/%s > %s", my1, my2, your);
|
char buffer[40U];
|
||||||
|
|
||||||
::lcdPosition(m_fd, 0, 1);
|
::sprintf(buffer, "%.8s/%.4s >", my1, my2);
|
||||||
::lcdPrintf(m_fd, "%.*s", m_cols, buffer);
|
::lcdPosition(m_fd, 0, 1);
|
||||||
|
::lcdPrintf(m_fd, "%.*s", m_cols, buffer);
|
||||||
|
|
||||||
|
::sprintf(buffer, "%.8s", your);
|
||||||
|
::lcdPosition(m_fd, 0, 2);
|
||||||
|
::lcdPrintf(m_fd, "%.*s", m_cols, buffer);
|
||||||
|
} else {
|
||||||
|
char buffer[40U];
|
||||||
|
::sprintf(buffer, "%.8s/%.4s > %.8s", my1, my2, your);
|
||||||
|
|
||||||
|
::lcdPosition(m_fd, 0, 1);
|
||||||
|
::lcdPrintf(m_fd, "%.*s", m_cols, buffer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHD44780::clearDStar()
|
void CHD44780::clearDStar()
|
||||||
{
|
{
|
||||||
::lcdPosition(m_fd, 0, 1);
|
if (m_rows > 2U) {
|
||||||
::lcdPrintf(m_fd, "%.*s", m_cols, LISTENING);
|
::lcdPosition(m_fd, 0, 1);
|
||||||
|
::lcdPrintf(m_fd, "%.*s", m_cols, LISTENING);
|
||||||
|
|
||||||
|
::lcdPosition(m_fd, 0, 2);
|
||||||
|
::lcdPrintf(m_fd, "%.*s", m_cols, "");
|
||||||
|
} else {
|
||||||
|
::lcdPosition(m_fd, 0, 1);
|
||||||
|
::lcdPrintf(m_fd, "%.*s", m_cols, LISTENING);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHD44780::setDMR()
|
void CHD44780::setDMR()
|
||||||
@@ -170,17 +190,37 @@ void CHD44780::setFusion()
|
|||||||
|
|
||||||
void CHD44780::writeFusion(const char* source, const char* dest)
|
void CHD44780::writeFusion(const char* source, const char* dest)
|
||||||
{
|
{
|
||||||
char buffer[40U];
|
if (m_rows > 2U) {
|
||||||
::sprintf(buffer, "%s > %s", source, dest);
|
char buffer[40U];
|
||||||
|
|
||||||
::lcdPosition(m_fd, 0, 1);
|
::sprintf(buffer, "%.10s >", source);
|
||||||
::lcdPrintf(m_fd, "%.*s", m_cols, buffer);
|
::lcdPosition(m_fd, 0, 1);
|
||||||
|
::lcdPrintf(m_fd, "%.*s", m_cols, buffer);
|
||||||
|
|
||||||
|
::sprintf(buffer, "%.10s", dest);
|
||||||
|
::lcdPosition(m_fd, 0, 2);
|
||||||
|
::lcdPrintf(m_fd, "%.*s", m_cols, buffer);
|
||||||
|
} else {
|
||||||
|
char buffer[40U];
|
||||||
|
::sprintf(buffer, "%.10s > %.10s", source, dest);
|
||||||
|
|
||||||
|
::lcdPosition(m_fd, 0, 1);
|
||||||
|
::lcdPrintf(m_fd, "%.*s", m_cols, buffer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHD44780::clearFusion()
|
void CHD44780::clearFusion()
|
||||||
{
|
{
|
||||||
::lcdPosition(m_fd, 0, 1);
|
if (m_rows > 2U) {
|
||||||
::lcdPrintf(m_fd, "%.*s", m_cols, LISTENING);
|
::lcdPosition(m_fd, 0, 1);
|
||||||
|
::lcdPrintf(m_fd, "%.*s", m_cols, LISTENING);
|
||||||
|
|
||||||
|
::lcdPosition(m_fd, 0, 2);
|
||||||
|
::lcdPrintf(m_fd, "%.*s", m_cols, "");
|
||||||
|
} else {
|
||||||
|
::lcdPosition(m_fd, 0, 1);
|
||||||
|
::lcdPrintf(m_fd, "%.*s", m_cols, LISTENING);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHD44780::close()
|
void CHD44780::close()
|
||||||
|
|||||||
Reference in New Issue
Block a user