D-Star: Reformat HD44780 screens after disabling scrolling

This commit is contained in:
Tony Corbett G0WFV 2016-09-29 19:44:13 +01:00
parent 983b0b9142
commit 5bc68fdef1

View file

@ -404,7 +404,8 @@ void CHD44780::writeDStarInt(const char* my1, const char* my2, const char* your,
}
::lcdPosition(m_fd, 0, (m_rows / 2) - 1);
::lcdPrintf(m_fd, "%.8s/%.4s", my1, my2);
::lcdPutchar(m_fd, 0);
::lcdPrintf(m_fd, " %.8s/%.4s", my1, my2);
::lcdPosition(m_fd, m_cols - 1, (m_rows / 2) - 1);
if (strcmp(type, "R") == 0) {
@ -422,12 +423,19 @@ void CHD44780::writeDStarInt(const char* my1, const char* my2, const char* your,
}
if (strcmp(reflector, " ") != 0) {
::sprintf(m_buffer3, " via %.8s", reflector);
strcat(m_buffer1, m_buffer3);
if (m_rows == 2 && m_cols == 40) {
::sprintf(m_buffer3, " via %.8s", reflector);
strcat(m_buffer1, m_buffer3);
} else if (m_rows > 2) {
::sprintf(m_buffer3, "via %.8s", reflector);
::lcdPosition(m_fd, 0, (m_rows / 2) + 1);
::lcdPrintf(m_fd, "%.*s", m_cols, m_buffer3);
}
}
::lcdPosition(m_fd, 0, (m_rows / 2));
::lcdPrintf(m_fd, "%.*s", m_cols, m_buffer1);
::lcdPutchar(m_fd, 1);
::lcdPrintf(m_fd, " %.*s", m_cols, m_buffer1);
// Start the D-Star scroll timer if text in m_buffer1 will not fit in the space available
if (strlen(m_buffer1) > m_cols) {