diff --git a/Conf.cpp b/Conf.cpp index 791249c..fbfd217 100644 --- a/Conf.cpp +++ b/Conf.cpp @@ -119,7 +119,6 @@ m_hd44780PWM(false), m_hd44780PWMPin(), m_hd44780PWMBright(), m_hd44780PWMDim(), -m_nextionSize("2.4"), m_nextionPort("/dev/ttyAMA0"), m_nextionBrightness(50U), m_oledType(3), @@ -380,9 +379,7 @@ bool CConf::read() } } } else if (section == SECTION_NEXTION) { - if (::strcmp(key, "Size") == 0) - m_nextionSize = value; - else if (::strcmp(key, "Port") == 0) + if (::strcmp(key, "Port") == 0) m_nextionPort = value; else if (::strcmp(key, "Brightness") == 0) m_nextionBrightness = (unsigned int)::atoi(value); @@ -757,11 +754,6 @@ unsigned int CConf::getHD44780PWMDim() const return m_hd44780PWMDim; } -std::string CConf::getNextionSize() const -{ - return m_nextionSize; -} - std::string CConf::getNextionPort() const { return m_nextionPort; diff --git a/Conf.h b/Conf.h index ae744d3..3ee3a3e 100644 --- a/Conf.h +++ b/Conf.h @@ -128,7 +128,6 @@ public: unsigned int getHD44780PWMDim() const; // The Nextion section - std::string getNextionSize() const; std::string getNextionPort() const; unsigned int getNextionBrightness() const; @@ -223,7 +222,6 @@ private: unsigned int m_hd44780PWMBright; unsigned int m_hd44780PWMDim; - std::string m_nextionSize; std::string m_nextionPort; unsigned int m_nextionBrightness; diff --git a/MMDVM.ini b/MMDVM.ini index b48acf7..5cb9235 100644 --- a/MMDVM.ini +++ b/MMDVM.ini @@ -102,7 +102,6 @@ PWMBright=100 PWMDim=16 [Nextion] -Size=2.4 Port=/dev/ttyAMA0 Brightness=50 diff --git a/MMDVMHost.cpp b/MMDVMHost.cpp index 5f93bab..514605b 100644 --- a/MMDVMHost.cpp +++ b/MMDVMHost.cpp @@ -785,15 +785,13 @@ void CMMDVMHost::createDisplay() m_display = new CTFTSerial(m_callsign, dmrid, port, brightness); } else if (type == "Nextion") { - std::string size = m_conf.getNextionSize(); std::string port = m_conf.getNextionPort(); unsigned int brightness = m_conf.getNextionBrightness(); - LogInfo(" Size: %s\"", size.c_str()); LogInfo(" Port: %s", port.c_str()); LogInfo(" Brightness: %u", brightness); - m_display = new CNextion(m_callsign, dmrid, size, port, brightness); + m_display = new CNextion(m_callsign, dmrid, port, brightness); #if defined(HD44780) } else if (type == "HD44780") { unsigned int rows = m_conf.getHD44780Rows(); diff --git a/Nextion.cpp b/Nextion.cpp index 5f0d8e0..a3e777c 100644 --- a/Nextion.cpp +++ b/Nextion.cpp @@ -23,11 +23,10 @@ #include #include -CNextion::CNextion(const std::string& callsign, unsigned int dmrid, const std::string& size, const std::string& port, unsigned int brightness) : +CNextion::CNextion(const std::string& callsign, unsigned int dmrid, const std::string& port, unsigned int brightness) : CDisplay(), m_callsign(callsign), m_dmrid(dmrid), -m_size(size), m_serial(port, SERIAL_9600), m_brightness(brightness), m_mode(MODE_IDLE) @@ -110,18 +109,11 @@ void CNextion::writeDStarInt(const char* my1, const char* my2, const char* your, ::sprintf(text, "t0.txt=\"%s %.8s/%4.4s\"", type, my1, my2); sendCommand(text); - if (m_size == "2.4" || m_size == "3.2") { - ::sprintf(text, "t1.txt=\"%.8s\"", your); - sendCommand(text); - if (::strcmp(reflector, " ") != 0) { - ::sprintf(text, "t2.txt=\"via %.8s\"", reflector); - sendCommand(text); - } - } else if (m_size == "3.5") { - if (::strcmp(reflector, " ") == 0) - ::sprintf(text, "t1.txt=\"%.8s\"", your); - else - ::sprintf(text, "t1.txt=\"%.8s <- %-8s\"", your, reflector); + ::sprintf(text, "t1.txt=\"%.8s\"", your); + sendCommand(text); + + if (::strcmp(reflector, " ") != 0) { + ::sprintf(text, "t2.txt=\"via %.8s\"", reflector); sendCommand(text); } @@ -132,8 +124,7 @@ void CNextion::clearDStarInt() { sendCommand("t0.txt=\"Listening\""); sendCommand("t1.txt=\"\""); - if (m_size == "2.4" || m_size == "3.2") - sendCommand("t2.txt=\"\""); + sendCommand("t2.txt=\"\""); } void CNextion::writeDMRInt(unsigned int slotNo, const std::string& src, bool group, const std::string& dst, const char* type) diff --git a/Nextion.h b/Nextion.h index 350d3ac..86667e6 100644 --- a/Nextion.h +++ b/Nextion.h @@ -28,7 +28,7 @@ class CNextion : public CDisplay { public: - CNextion(const std::string& callsign, unsigned int dmrid, const std::string& size, const std::string& port, unsigned int brightness); + CNextion(const std::string& callsign, unsigned int dmrid, const std::string& port, unsigned int brightness); virtual ~CNextion(); virtual bool open(); @@ -52,7 +52,6 @@ protected: private: std::string m_callsign; unsigned int m_dmrid; - std::string m_size; CSerialController m_serial; unsigned int m_brightness; unsigned char m_mode; diff --git a/Nextion/MMDVM_3.5.HMI b/Nextion/MMDVM_3.5.HMI index 17d46af..b3eb571 100644 Binary files a/Nextion/MMDVM_3.5.HMI and b/Nextion/MMDVM_3.5.HMI differ diff --git a/Nextion/MMDVM_3.5.tft b/Nextion/MMDVM_3.5.tft index 09b79af..0c4cc62 100644 Binary files a/Nextion/MMDVM_3.5.tft and b/Nextion/MMDVM_3.5.tft differ