From 630741184ddc774b5c95a32291768fb0bc0329a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Kub=C3=A1nek?= Date: Fri, 6 Sep 2024 14:01:42 -0400 Subject: [PATCH] Adjusted telemetry to FPGA changes --- doc/version-history.rst | 2 +- include/cRIO/MPUTelemetry.h | 37 ++++------------------------------ src/LSST/cRIO/MPUTelemetry.cpp | 8 +------- 3 files changed, 6 insertions(+), 41 deletions(-) diff --git a/doc/version-history.rst b/doc/version-history.rst index 96642647..23c3c910 100644 --- a/doc/version-history.rst +++ b/doc/version-history.rst @@ -4,7 +4,7 @@ Version History v1.12.0 ------- -* simplified MPU commonication +* simplified MPU communication v1.11.1 ------- diff --git a/include/cRIO/MPUTelemetry.h b/include/cRIO/MPUTelemetry.h index 5373287b..439771c4 100644 --- a/include/cRIO/MPUTelemetry.h +++ b/include/cRIO/MPUTelemetry.h @@ -38,41 +38,12 @@ class MPUTelemetry { * * @param data[45] data as received from FPGA */ - MPUTelemetry(uint8_t* data); - uint32_t writeBytes; /// Number of bytes written - uint32_t readBytes; /// Number of bytes read - uint16_t readTimedout; /// read timedout counter + MPUTelemetry() : writeBytes(0), readBytes(0), readTimedout(false) {} + uint32_t writeBytes; /// Number of bytes written + uint32_t readBytes; /// Number of bytes read + bool readTimedout; /// read timedout counter friend std::ostream& operator<<(std::ostream& os, const MPUTelemetry& tel); - - /** - * Updates MPU telemetry SAL message structure. - * - * @tparam message class with telemetry filed. Shall be SAL declared class - * @param msg message to check and update - * - * @return true if message shall be send, false if updates are minor and it should not be send - */ - template - bool sendUpdates(message* msg) { - return false; - - /** - if (msg->readBytes != readBytes || msg->writeTimedout != writeTimedout || - msg->instructionPointerOnError != instructionPointerOnError || msg->errorCode != errorCode) { - send = true; - } - msg->instructionPointer = instructionPointer; - msg->outputCounter = outputCounter; - msg->inputCounter = inputCounter; - msg->outputTimeouts = outputTimeouts; - msg->inputTimeouts = inputTimeouts; - msg->instructionPointerOnError = instructionPointerOnError; - msg->writeTimeout = writeTimeout; - msg->readTimeout = readTimeout; - msg->errorCode = errorCode; - return send; */ - } }; } // namespace cRIO diff --git a/src/LSST/cRIO/MPUTelemetry.cpp b/src/LSST/cRIO/MPUTelemetry.cpp index 0cbd4fcc..3c1ad91c 100644 --- a/src/LSST/cRIO/MPUTelemetry.cpp +++ b/src/LSST/cRIO/MPUTelemetry.cpp @@ -31,16 +31,10 @@ namespace LSST { namespace cRIO { -MPUTelemetry::MPUTelemetry(uint8_t *data) { - writeBytes = be32toh(*(reinterpret_cast(data + 0))); - readBytes = be32toh(*(reinterpret_cast(data + 4))); - readTimedout = be16toh(*(reinterpret_cast(data + 8))); -} - std::ostream &operator<<(std::ostream &os, const MPUTelemetry &tel) { os << std::setw(20) << "Write bytes: " << tel.writeBytes << std::endl << std::setw(20) << "Read bytes: " << tel.readBytes << std::endl - << std::setw(20) << "Read timedout: " << tel.readTimedout << std::endl; + << std::setw(20) << "Read timedout: " << (tel.readTimedout ? "yes" : "no") << std::endl; return os; }