Skip to content

Commit

Permalink
Adjusted telemetry to FPGA changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pkubanek committed Sep 6, 2024
1 parent 5168ddd commit 6307411
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 41 deletions.
2 changes: 1 addition & 1 deletion doc/version-history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Version History

v1.12.0
-------
* simplified MPU commonication
* simplified MPU communication

v1.11.1
-------
Expand Down
37 changes: 4 additions & 33 deletions include/cRIO/MPUTelemetry.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <class message>
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
Expand Down
8 changes: 1 addition & 7 deletions src/LSST/cRIO/MPUTelemetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,10 @@
namespace LSST {
namespace cRIO {

MPUTelemetry::MPUTelemetry(uint8_t *data) {
writeBytes = be32toh(*(reinterpret_cast<uint32_t *>(data + 0)));
readBytes = be32toh(*(reinterpret_cast<uint32_t *>(data + 4)));
readTimedout = be16toh(*(reinterpret_cast<uint16_t *>(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;
}

Expand Down

0 comments on commit 6307411

Please sign in to comment.