From ddb3206a30c130bd44c24d82229606488b82b494 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Tue, 6 Feb 2018 07:11:00 +0000 Subject: [PATCH] Fix LCDProc and buffer sizes for the Nextion. Thanks to Tony G0WFV. --- LCDproc.cpp | 4 ++-- Nextion.cpp | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/LCDproc.cpp b/LCDproc.cpp index 1ca096f13..ef7c895b0 100644 --- a/LCDproc.cpp +++ b/LCDproc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016, 2017 by Tony Corbett G0WFV + * Copyright (C) 2016, 2017, 2018 by Tony Corbett G0WFV * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -453,7 +453,7 @@ void CLCDproc::clearP25Int() { m_clockDisplayTimer.stop(); // Stop the clock display - socketPrintf(m_socketfd, "widget_set P25 Line3 1 2 15 2 h 3 Listening"); + socketPrintf(m_socketfd, "widget_set P25 Line2 1 2 15 2 h 3 Listening"); socketPrintf(m_socketfd, "widget_set P25 Line3 1 3 15 3 h 3 \"\""); socketPrintf(m_socketfd, "widget_set P25 Line4 1 4 15 4 h 3 \"\""); socketPrintf(m_socketfd, "output 2"); // Set LED2 color green diff --git a/Nextion.cpp b/Nextion.cpp index cbdc9c122..3214a45a1 100644 --- a/Nextion.cpp +++ b/Nextion.cpp @@ -209,7 +209,7 @@ void CNextion::writeDStarRSSIInt(unsigned char rssi) m_rssiCount1++; if (m_rssiCount1 == DSTAR_RSSI_COUNT) { - char text[20U]; + char text[25U]; ::sprintf(text, "t3.txt=\"-%udBm\"", m_rssiAccum1 / DSTAR_RSSI_COUNT); sendCommand(text); sendCommandAction(47U); @@ -224,7 +224,7 @@ void CNextion::writeDStarBERInt(float ber) m_berCount1++; if (m_berCount1 == DSTAR_BER_COUNT) { - char text[20U]; + char text[25U]; ::sprintf(text, "t4.txt=\"%.1f%%\"", m_berAccum1 / float(DSTAR_BER_COUNT)); sendCommand(text); sendCommandAction(48U); @@ -325,7 +325,7 @@ void CNextion::writeDMRRSSIInt(unsigned int slotNo, unsigned char rssi) m_rssiCount1++; if (m_rssiCount1 == DMR_RSSI_COUNT) { - char text[20U]; + char text[25U]; ::sprintf(text, "t4.txt=\"-%udBm\"", m_rssiAccum1 / DMR_RSSI_COUNT); sendCommand(text); sendCommandAction(66U); @@ -337,7 +337,7 @@ void CNextion::writeDMRRSSIInt(unsigned int slotNo, unsigned char rssi) m_rssiCount2++; if (m_rssiCount2 == DMR_RSSI_COUNT) { - char text[20U]; + char text[25U]; ::sprintf(text, "t5.txt=\"-%udBm\"", m_rssiAccum2 / DMR_RSSI_COUNT); sendCommand(text); sendCommandAction(74U); @@ -407,7 +407,7 @@ void CNextion::writeDMRBERInt(unsigned int slotNo, float ber) m_berCount1++; if (m_berCount1 == DMR_BER_COUNT) { - char text[20U]; + char text[25U]; ::sprintf(text, "t6.txt=\"%.1f%%\"", m_berAccum1 / DMR_BER_COUNT); sendCommand(text); sendCommandAction(67U); @@ -419,7 +419,7 @@ void CNextion::writeDMRBERInt(unsigned int slotNo, float ber) m_berCount2++; if (m_berCount2 == DMR_BER_COUNT) { - char text[20U]; + char text[25U]; ::sprintf(text, "t7.txt=\"%.1f%%\"", m_berAccum2 / DMR_BER_COUNT); sendCommand(text); sendCommandAction(75U); @@ -503,7 +503,7 @@ void CNextion::writeFusionRSSIInt(unsigned char rssi) m_rssiCount1++; if (m_rssiCount1 == YSF_RSSI_COUNT) { - char text[20U]; + char text[25U]; ::sprintf(text, "t3.txt=\"-%udBm\"", m_rssiAccum1 / YSF_RSSI_COUNT); sendCommand(text); sendCommandAction(85U); @@ -518,7 +518,7 @@ void CNextion::writeFusionBERInt(float ber) m_berCount1++; if (m_berCount1 == YSF_BER_COUNT) { - char text[20U]; + char text[25U]; ::sprintf(text, "t4.txt=\"%.1f%%\"", m_berAccum1 / float(YSF_BER_COUNT)); sendCommand(text); sendCommandAction(86U); @@ -574,7 +574,7 @@ void CNextion::writeP25RSSIInt(unsigned char rssi) m_rssiCount1++; if (m_rssiCount1 == P25_RSSI_COUNT) { - char text[20U]; + char text[25U]; ::sprintf(text, "t2.txt=\"-%udBm\"", m_rssiAccum1 / P25_RSSI_COUNT); sendCommand(text); sendCommandAction(104U); @@ -589,7 +589,7 @@ void CNextion::writeP25BERInt(float ber) m_berCount1++; if (m_berCount1 == P25_BER_COUNT) { - char text[20U]; + char text[25U]; ::sprintf(text, "t3.txt=\"%.1f%%\"", m_berAccum1 / float(P25_BER_COUNT)); sendCommand(text); sendCommandAction(105U);