diff options
author | Mike Fiore <mfiore@multitech.com> | 2015-11-24 11:44:06 -0600 |
---|---|---|
committer | Mike Fiore <mfiore@multitech.com> | 2015-11-24 11:44:06 -0600 |
commit | 9a00517bb35952e672284aa15d0304c1d75f698f (patch) | |
tree | 88914ac428e544fbe68fb25f7fbe4543125b309e /Layout/LayoutSurveySuccess.cpp | |
parent | cf6730142a9d6783abb950979d5a60aea3eb9451 (diff) | |
download | mtdot-box-evb-factory-firmware-9a00517bb35952e672284aa15d0304c1d75f698f.tar.gz mtdot-box-evb-factory-firmware-9a00517bb35952e672284aa15d0304c1d75f698f.tar.bz2 mtdot-box-evb-factory-firmware-9a00517bb35952e672284aa15d0304c1d75f698f.zip |
use floats for SNR values - will be supported in next mbed release, add logging to surveySingle, stub out function to parse index from data file
Diffstat (limited to 'Layout/LayoutSurveySuccess.cpp')
-rw-r--r-- | Layout/LayoutSurveySuccess.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Layout/LayoutSurveySuccess.cpp b/Layout/LayoutSurveySuccess.cpp index 02dd197..68ef1dc 100644 --- a/Layout/LayoutSurveySuccess.cpp +++ b/Layout/LayoutSurveySuccess.cpp @@ -1,4 +1,5 @@ #include "LayoutSurveySuccess.h" +#include "MTSLog.h" LayoutSurveySuccess::LayoutSurveySuccess(DOGS102* lcd) : Layout(lcd), @@ -67,7 +68,7 @@ void LayoutSurveySuccess::updateStats(LoRaHandler::LoRaPing ping) { writeField(_fUpRssi, buf, size); memset(buf, 0, sizeof(buf)); - size = snprintf(buf, sizeof(buf), "%2d.%1d", ping.up.snr / 10, abs(ping.up.snr) % 10); + size = snprintf(buf, sizeof(buf), "%2.1f", (float)ping.up.snr / 10.0); writeField(_fUpSnr, buf, size); memset(buf, 0, sizeof(buf)); @@ -75,7 +76,7 @@ void LayoutSurveySuccess::updateStats(LoRaHandler::LoRaPing ping) { writeField(_fDownRssi, buf, size); memset(buf, 0, sizeof(buf)); - size = snprintf(buf, sizeof(buf), "%2d.%1d", ping.down.snr / 4, abs(ping.down.snr) % 10 * 25); + size = snprintf(buf, sizeof(buf), "%2.1f", (float)ping.down.snr / 4.0); writeField(_fDownSnr, buf, size); endUpdate(); |