From 70d596fea4223a3aafec161d20a2a495c21db7b9 Mon Sep 17 00:00:00 2001 From: ON7LDS Date: Thu, 13 Aug 2020 21:23:42 +0200 Subject: [PATCH] change tx and rx frequency display precision (to reflect ini file significant figures) --- Nextion.cpp | 8 ++++---- Nextion.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Nextion.cpp b/Nextion.cpp index 44f12ad..ac6e8d7 100644 --- a/Nextion.cpp +++ b/Nextion.cpp @@ -121,8 +121,8 @@ bool CNextion::open() sendCommand("bkcmd=0"); sendCommandAction(0U); - m_fl_txFrequency = float(m_txFrequency) / 1000000.0F; - m_fl_rxFrequency = float(m_rxFrequency) / 1000000.0F; + m_fl_txFrequency = double(m_txFrequency) / 1000000.0F; + m_fl_rxFrequency = double(m_rxFrequency) / 1000000.0F; setIdle(); @@ -152,11 +152,11 @@ void CNextion::setIdleInt() sendCommand(command); sendCommandAction(17U); - ::sprintf(command, "t30.txt=\"%3.4f\"",m_fl_rxFrequency); // RX freq + ::sprintf(command, "t30.txt=\"%3.6f\"",m_fl_rxFrequency); // RX freq sendCommand(command); sendCommandAction(20U); - ::sprintf(command, "t32.txt=\"%3.4f\"",m_fl_txFrequency); // TX freq + ::sprintf(command, "t32.txt=\"%3.6f\"",m_fl_txFrequency); // TX freq sendCommand(command); sendCommandAction(21U); diff --git a/Nextion.h b/Nextion.h index 0e6675d..7217d2a 100644 --- a/Nextion.h +++ b/Nextion.h @@ -100,8 +100,8 @@ private: unsigned int m_berCount2; unsigned int m_txFrequency; unsigned int m_rxFrequency; - float m_fl_txFrequency; - float m_fl_rxFrequency; + double m_fl_txFrequency; + double m_fl_rxFrequency; bool m_displayTempInF; std::string m_location;