From f6e3913f80ec15f2a554dc2ad1fe219cefd1f5d2 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 12 Mar 2019 15:59:29 +0100 Subject: Lime: show fifo fill percent in RC --- src/output/Lime.cpp | 6 +++--- src/output/Lime.h | 4 ++-- src/output/SDR.cpp | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/output/Lime.cpp b/src/output/Lime.cpp index fff3dd4..1d4c581 100644 --- a/src/output/Lime.cpp +++ b/src/output/Lime.cpp @@ -355,9 +355,9 @@ double Lime::get_temperature(void) const return temp; } -uint32_t Lime::get_fifo_fill_count(void) const +float Lime::get_fifo_fill_percent(void) const { - return m_last_fifo_filled_count; + return m_last_fifo_fill_percent * 100; } void Lime::transmit_frame(const struct FrameData &frame) @@ -383,7 +383,7 @@ void Lime::transmit_frame(const struct FrameData &frame) etiLog.level(info) << "overrun" << LimeStatus.overrun << "underun" << LimeStatus.underrun << "drop" << LimeStatus.droppedPackets; #endif - m_last_fifo_filled_count.store(LimeStatus.fifoFilledCount); + m_last_fifo_fill_percent.store((float)LimeStatus.fifoFilledCount / (float)LimeStatus.fifoSize); /* if(LimeStatus.fifoFilledCount>=5*FRAME_LENGTH*m_interpolate) // Start if FIFO is half full { diff --git a/src/output/Lime.h b/src/output/Lime.h index febb878..48fb648 100644 --- a/src/output/Lime.h +++ b/src/output/Lime.h @@ -81,7 +81,7 @@ class Lime : public Output::SDRDevice virtual const char *device_name(void) const override; virtual double get_temperature(void) const override; - virtual uint32_t get_fifo_fill_count(void) const; + virtual float get_fifo_fill_percent(void) const; private: SDRDeviceConfig &m_conf; @@ -92,7 +92,7 @@ class Lime : public Output::SDRDevice size_t m_interpolate = 1; std::vector interpolatebuf; - std::atomic m_last_fifo_filled_count = ATOMIC_VAR_INIT(0); + std::atomic m_last_fifo_fill_percent = ATOMIC_VAR_INIT(0); size_t underflows = 0; size_t overflows = 0; diff --git a/src/output/SDR.cpp b/src/output/SDR.cpp index 31a5c79..95b54f9 100644 --- a/src/output/SDR.cpp +++ b/src/output/SDR.cpp @@ -86,7 +86,7 @@ SDR::SDR(SDRDeviceConfig& config, std::shared_ptr device) : RC_ADD_PARAMETER(gpsdo_holdover, "1 if the GPSDO is in holdover, 0 if it is using gnss"); if (std::dynamic_pointer_cast(device)) { - RC_ADD_PARAMETER(fifo_fill, "A value representing the Lime FIFO fullness"); + RC_ADD_PARAMETER(fifo_fill, "A value representing the Lime FIFO fullness [percent]"); } } @@ -463,7 +463,7 @@ const string SDR::get_parameter(const string& parameter) const const auto dev = std::dynamic_pointer_cast(m_device); if (dev) { - ss << dev->get_fifo_fill_count(); + ss << dev->get_fifo_fill_percent(); } else { ss << "Parameter '" << parameter << -- cgit v1.2.3