Use the duplex flag to indicate that a DVMega is being used.

This commit is contained in:
Jonathan Naylor
2016-05-05 17:08:23 +01:00
parent 925f29a982
commit dd5e86a66d
6 changed files with 12 additions and 29 deletions

View File

@@ -29,7 +29,7 @@
const char* LISTENING = "Listening ";
CHD44780::CHD44780(unsigned int rows, unsigned int cols, const std::string& callsign, unsigned int dmrid, const std::vector<unsigned int>& pins, bool pwm, unsigned int pwmPin, unsigned int pwmBright, unsigned int pwmDim, bool dvmegaDisplay) :
CHD44780::CHD44780(unsigned int rows, unsigned int cols, const std::string& callsign, unsigned int dmrid, const std::vector<unsigned int>& pins, bool pwm, unsigned int pwmPin, unsigned int pwmBright, unsigned int pwmDim, bool duplex) :
m_rows(rows),
m_cols(cols),
m_callsign(callsign),
@@ -44,7 +44,7 @@ m_pwm(pwm),
m_pwmPin(pwmPin),
m_pwmBright(pwmBright),
m_pwmDim(pwmDim),
m_dvmegaDisplay(dvmegaDisplay),
m_duplex(duplex),
m_fd(-1),
m_dmr(false)
{
@@ -341,7 +341,7 @@ void CHD44780::writeDMR(unsigned int slotNo, const std::string& src, bool group,
}
if (m_rows == 2U && m_cols == 16U) {
if (!m_dvmegaDisplay) {
if (m_duplex) {
if (slotNo == 1U) {
::lcdPosition(m_fd, 0, 1);
::lcdPrintf(m_fd, "2 %.*s", m_cols - 2U, LISTENING);
@@ -395,7 +395,7 @@ void CHD44780::writeDMR(unsigned int slotNo, const std::string& src, bool group,
#endif
char buffer[16U];
if (!m_dvmegaDisplay) {
if (m_duplex) {
if (slotNo == 1U) {
::sprintf(buffer, "%s > %s%s", src.c_str(), group ? "TG" : "", dst.c_str());
::lcdPosition(m_fd, 0, 0);
@@ -473,7 +473,7 @@ void CHD44780::clearDMR(unsigned int slotNo)
#endif
if (m_rows == 2U && m_cols == 16U) {
if (!m_dvmegaDisplay) {
if (m_duplex) {
if (slotNo == 1U) {
::lcdPosition(m_fd, 0, 0);
::lcdPrintf(m_fd, "1 %.*s", m_cols - 2U, LISTENING);