diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f5bb9bb..024903aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Assert that `FixedArrayList` is larger than 0 at compile time. https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/740 - Health functions are virtual now. +- PUS Service Base request queue depth and maximum number of handled packets per cycle is now + configurable. # [v6.0.0] 2023-02-10 diff --git a/src/fsfw/globalfunctions/math/QuaternionOperations.cpp b/src/fsfw/globalfunctions/math/QuaternionOperations.cpp index 293eb168..780a629f 100644 --- a/src/fsfw/globalfunctions/math/QuaternionOperations.cpp +++ b/src/fsfw/globalfunctions/math/QuaternionOperations.cpp @@ -155,8 +155,7 @@ double QuaternionOperations::getAngle(const double* quaternion, bool abs) { } void QuaternionOperations::rotationFromQuaternions(const double qNew[4], const double qOld[4], - const double timeDelta, - double rotRate[3]) { + const double timeDelta, double rotRate[3]) { double qOldInv[4] = {0, 0, 0, 0}; double qDelta[4] = {0, 0, 0, 0}; diff --git a/src/fsfw/globalfunctions/math/QuaternionOperations.h b/src/fsfw/globalfunctions/math/QuaternionOperations.h index 4e302017..2ad842be 100644 --- a/src/fsfw/globalfunctions/math/QuaternionOperations.h +++ b/src/fsfw/globalfunctions/math/QuaternionOperations.h @@ -26,7 +26,7 @@ class QuaternionOperations { static void slerp(const double q1[4], const double q2[4], const double weight, double q[4]); static void rotationFromQuaternions(const double qNew[4], const double qOld[4], - const double timeDelta, double rotRate[3]); + const double timeDelta, double rotRate[3]); /** * returns angle in ]-Pi;Pi] or [0;Pi] if abs == true diff --git a/src/fsfw/pus/Service11TelecommandScheduling.tpp b/src/fsfw/pus/Service11TelecommandScheduling.tpp index 21852b63..38f6c501 100644 --- a/src/fsfw/pus/Service11TelecommandScheduling.tpp +++ b/src/fsfw/pus/Service11TelecommandScheduling.tpp @@ -150,7 +150,7 @@ inline ReturnValue_t Service11TelecommandScheduling::handleResetCom template inline ReturnValue_t Service11TelecommandScheduling::doInsertActivity( const uint8_t *data, size_t size) { - if(telecommandMap.full()) { + if (telecommandMap.full()) { return MAP_IS_FULL; } uint32_t timestamp = 0; diff --git a/src/fsfw/tmtcservices/PusServiceBase.cpp b/src/fsfw/tmtcservices/PusServiceBase.cpp index fbabbd70..a82a6f97 100644 --- a/src/fsfw/tmtcservices/PusServiceBase.cpp +++ b/src/fsfw/tmtcservices/PusServiceBase.cpp @@ -40,7 +40,7 @@ void PusServiceBase::setTaskIF(PeriodicTaskIF* taskHandle_) { this->taskHandle = void PusServiceBase::handleRequestQueue() { TmTcMessage message; ReturnValue_t result; - for (uint8_t count = 0; count < PUS_SERVICE_MAX_RECEPTION; count++) { + for (uint8_t count = 0; count < psbParams.maxPacketsPerCycle; count++) { ReturnValue_t status = psbParams.reqQueue->receiveMessage(&message); if (status == MessageQueueIF::EMPTY) { break; @@ -98,7 +98,7 @@ ReturnValue_t PusServiceBase::initialize() { } if (psbParams.reqQueue == nullptr) { ownedQueue = true; - psbParams.reqQueue = QueueFactory::instance()->createMessageQueue(PSB_DEFAULT_QUEUE_DEPTH); + psbParams.reqQueue = QueueFactory::instance()->createMessageQueue(psbParams.requestQueueDepth); } else { ownedQueue = false; } diff --git a/src/fsfw/tmtcservices/PusServiceBase.h b/src/fsfw/tmtcservices/PusServiceBase.h index 92ce0d99..ed48995e 100644 --- a/src/fsfw/tmtcservices/PusServiceBase.h +++ b/src/fsfw/tmtcservices/PusServiceBase.h @@ -20,6 +20,14 @@ class StorageManagerIF; * Configuration parameters for the PUS Service Base */ struct PsbParams { + static constexpr uint8_t PSB_DEFAULT_QUEUE_DEPTH = 10; + /** + * This constant sets the maximum number of packets accepted per call. + * Remember that one packet must be completely handled in one + * #handleRequest call. + */ + static constexpr uint8_t MAX_PACKETS_PER_CYCLE = 10; + PsbParams() = default; PsbParams(uint16_t apid, AcceptsTelemetryIF* tmReceiver) : apid(apid), tmReceiver(tmReceiver) {} PsbParams(const char* name, uint16_t apid, AcceptsTelemetryIF* tmReceiver) @@ -32,6 +40,9 @@ struct PsbParams { object_id_t objectId = objects::NO_OBJECT; uint16_t apid = 0; uint8_t serviceId = 0; + uint32_t requestQueueDepth = PSB_DEFAULT_QUEUE_DEPTH; + uint32_t maxPacketsPerCycle = MAX_PACKETS_PER_CYCLE; + /** * The default destination ID for generated telemetry. If this is not set, @initialize of PSB * will attempt to find a suitable object with the object ID @PusServiceBase::packetDestination @@ -100,14 +111,6 @@ class PusServiceBase : public ExecutableObjectIF, friend void Factory::setStaticFrameworkObjectIds(); public: - /** - * This constant sets the maximum number of packets accepted per call. - * Remember that one packet must be completely handled in one - * #handleRequest call. - */ - static constexpr uint8_t PUS_SERVICE_MAX_RECEPTION = 10; - static constexpr uint8_t PSB_DEFAULT_QUEUE_DEPTH = 10; - /** * @brief The passed values are set, but inter-object initialization is * done in the initialize method.