This commit is contained in:
Robin Müller 2022-04-11 17:14:04 +02:00
parent 9947a648df
commit cb78fefbb3
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
11 changed files with 48 additions and 53 deletions

View File

@ -1,9 +1,9 @@
#include "MgmLIS3MDLHandler.h" #include "MgmLIS3MDLHandler.h"
#include "fsfw/datapool/PoolReadGuard.h"
#include <cmath> #include <cmath>
#include "fsfw/datapool/PoolReadGuard.h"
MgmLIS3MDLHandler::MgmLIS3MDLHandler(object_id_t objectId, object_id_t deviceCommunication, MgmLIS3MDLHandler::MgmLIS3MDLHandler(object_id_t objectId, object_id_t deviceCommunication,
CookieIF *comCookie, uint32_t transitionDelay) CookieIF *comCookie, uint32_t transitionDelay)
: DeviceHandlerBase(objectId, deviceCommunication, comCookie), : DeviceHandlerBase(objectId, deviceCommunication, comCookie),

View File

@ -24,9 +24,7 @@ void UartCookie::setParityEven() { parity = Parity::EVEN; }
Parity UartCookie::getParity() const { return parity; } Parity UartCookie::getParity() const { return parity; }
void UartCookie::setBitsPerWord(BitsPerWord bitsPerWord_) { void UartCookie::setBitsPerWord(BitsPerWord bitsPerWord_) { bitsPerWord = bitsPerWord_; }
bitsPerWord = bitsPerWord_;
}
BitsPerWord UartCookie::getBitsPerWord() const { return bitsPerWord; } BitsPerWord UartCookie::getBitsPerWord() const { return bitsPerWord; }

View File

@ -11,14 +11,13 @@ class HybridIterator : public LinkedElement<T>::Iterator, public ArrayList<T, co
HybridIterator(typename LinkedElement<T>::Iterator *iter) HybridIterator(typename LinkedElement<T>::Iterator *iter)
: LinkedElement<T>::Iterator(*iter), value(iter->value), linked(true) { : LinkedElement<T>::Iterator(*iter), value(iter->value), linked(true) {
if(iter != nullptr) { if (iter != nullptr) {
value = iter->value; value = iter->value;
} }
} }
HybridIterator(LinkedElement<T> *start) HybridIterator(LinkedElement<T> *start) : LinkedElement<T>::Iterator(start), linked(true) {
: LinkedElement<T>::Iterator(start), linked(true) { if (start != nullptr) {
if(start != nullptr) {
value = start->value; value = start->value;
} }
} }

View File

@ -459,8 +459,7 @@ size_t DeviceHandlerBase::getNextReplyLength(DeviceCommandId_t commandId) {
DeviceCommandMap::iterator command = cookieInfo.pendingCommand; DeviceCommandMap::iterator command = cookieInfo.pendingCommand;
if (command->second.useAlternativeReplyId) { if (command->second.useAlternativeReplyId) {
replyId = command->second.alternativeReplyId; replyId = command->second.alternativeReplyId;
} } else {
else {
replyId = commandId; replyId = commandId;
} }
DeviceReplyIter iter = deviceReplyMap.find(replyId); DeviceReplyIter iter = deviceReplyMap.find(replyId);

View File

@ -179,7 +179,7 @@ class MatchTree : public SerializeableMatcherIF<T>, public BinaryTree<Serializea
virtual ReturnValue_t cleanUpElement(iterator position) { return HasReturnvaluesIF::RETURN_OK; } virtual ReturnValue_t cleanUpElement(iterator position) { return HasReturnvaluesIF::RETURN_OK; }
bool matchSubtree(iterator iter, T number) { bool matchSubtree(iterator iter, T number) {
if(iter == nullptr) { if (iter == nullptr) {
return false; return false;
} }
bool isMatch = iter->match(number); bool isMatch = iter->match(number);

View File

@ -59,14 +59,13 @@ class PeriodicTask : public RTEMSTaskBase, public PeriodicTaskIF {
*/ */
ReturnValue_t addComponent(object_id_t object) override; ReturnValue_t addComponent(object_id_t object) override;
/** /**
* Adds an object to the list of objects to be executed. * Adds an object to the list of objects to be executed.
* The objects are executed in the order added. * The objects are executed in the order added.
* @param object pointer to the object to add. * @param object pointer to the object to add.
* @return RETURN_OK on success, RETURN_FAILED if the object could not be added. * @return RETURN_OK on success, RETURN_FAILED if the object could not be added.
*/ */
ReturnValue_t addComponent(ExecutableObjectIF* object) override; ReturnValue_t addComponent(ExecutableObjectIF *object) override;
uint32_t getPeriodMs() const override; uint32_t getPeriodMs() const override;

View File

@ -30,7 +30,7 @@ ReturnValue_t Subsystem::checkSequence(HybridIterator<ModeListEntry> iter,
return FALLBACK_SEQUENCE_DOES_NOT_EXIST; return FALLBACK_SEQUENCE_DOES_NOT_EXIST;
} }
if (iter.value ==nullptr) { if (iter.value == nullptr) {
return NO_TARGET_TABLE; return NO_TARGET_TABLE;
} }
@ -74,7 +74,7 @@ void Subsystem::performChildOperation() {
} else { } else {
Mode_t tableId = 0; Mode_t tableId = 0;
auto seq = getSequence(targetMode); auto seq = getSequence(targetMode);
if(seq.value != nullptr) { if (seq.value != nullptr) {
tableId = seq->getTableId(); tableId = seq->getTableId();
} }
transitionFailed(TARGET_TABLE_NOT_REACHED, tableId); transitionFailed(TARGET_TABLE_NOT_REACHED, tableId);
@ -257,7 +257,7 @@ ReturnValue_t Subsystem::handleCommandMessage(CommandMessage *message) {
result = modeTables.find(table, &entry); result = modeTables.find(table, &entry);
if (result != RETURN_OK or entry == nullptr) { if (result != RETURN_OK or entry == nullptr) {
replyToCommand(result, 0); replyToCommand(result, 0);
if(entry == nullptr) { if (entry == nullptr) {
return result; return result;
} }
} }

View File

@ -1,14 +1,13 @@
#ifndef FSFW_SUBSYSTEM_SUBSYSTEM_H_ #ifndef FSFW_SUBSYSTEM_SUBSYSTEM_H_
#define FSFW_SUBSYSTEM_SUBSYSTEM_H_ #define FSFW_SUBSYSTEM_SUBSYSTEM_H_
#include "fsfw/FSFW.h"
#include "../container/FixedArrayList.h" #include "../container/FixedArrayList.h"
#include "../container/FixedMap.h" #include "../container/FixedMap.h"
#include "../container/HybridIterator.h" #include "../container/HybridIterator.h"
#include "../container/SinglyLinkedList.h" #include "../container/SinglyLinkedList.h"
#include "../serialize/SerialArrayListAdapter.h" #include "../serialize/SerialArrayListAdapter.h"
#include "SubsystemBase.h" #include "SubsystemBase.h"
#include "fsfw/FSFW.h"
#include "modes/ModeDefinitions.h" #include "modes/ModeDefinitions.h"
/** /**

View File

@ -1,8 +1,9 @@
#include "version.h" #include "version.h"
#include "fsfw/FSFWVersion.h"
#include <cstdio> #include <cstdio>
#include "fsfw/FSFWVersion.h"
#ifdef major #ifdef major
#undef major #undef major
#endif #endif

View File

@ -29,7 +29,7 @@ class Version {
} }
friend bool operator>(const Version& v1, const Version& v2) { friend bool operator>(const Version& v1, const Version& v2) {
return not (v1 < v2) and not (v1 == v2); return not(v1 < v2) and not(v1 == v2);
} }
friend bool operator<=(const Version& v1, const Version& v2) { return ((v1 == v2) or (v1 < v2)); } friend bool operator<=(const Version& v1, const Version& v2) { return ((v1 == v2) or (v1 < v2)); }

View File

@ -17,15 +17,15 @@ TEST_CASE("Version API Tests", "[TestVersionAPI]") {
fsfw::Version v1 = fsfw::Version(1, 1, 1); fsfw::Version v1 = fsfw::Version(1, 1, 1);
fsfw::Version v2 = fsfw::Version(1, 1, 1); fsfw::Version v2 = fsfw::Version(1, 1, 1);
REQUIRE(v1 == v2); REQUIRE(v1 == v2);
REQUIRE(not (v1 < v2)); REQUIRE(not(v1 < v2));
REQUIRE(not (v1 > v2)); REQUIRE(not(v1 > v2));
REQUIRE(v1 <= v2); REQUIRE(v1 <= v2);
REQUIRE(v1 >= v2); REQUIRE(v1 >= v2);
v1.revision -= 1; v1.revision -= 1;
REQUIRE(v1 != v2); REQUIRE(v1 != v2);
REQUIRE(not (v1 == v2)); REQUIRE(not(v1 == v2));
REQUIRE(not (v1 > v2)); REQUIRE(not(v1 > v2));
REQUIRE(not (v1 >= v2)); REQUIRE(not(v1 >= v2));
REQUIRE(v1 < v2); REQUIRE(v1 < v2);
REQUIRE(v1 <= v2); REQUIRE(v1 <= v2);
v1.revision += 1; v1.revision += 1;
@ -33,60 +33,60 @@ TEST_CASE("Version API Tests", "[TestVersionAPI]") {
REQUIRE(v1 != v2); REQUIRE(v1 != v2);
REQUIRE(v1 < v2); REQUIRE(v1 < v2);
REQUIRE(v1 <= v2); REQUIRE(v1 <= v2);
REQUIRE(not (v1 == v2)); REQUIRE(not(v1 == v2));
REQUIRE(not (v1 > v2)); REQUIRE(not(v1 > v2));
REQUIRE(not (v1 >= v2)); REQUIRE(not(v1 >= v2));
v1.minor += 1; v1.minor += 1;
v1.major -= 1; v1.major -= 1;
REQUIRE(v1 != v2); REQUIRE(v1 != v2);
REQUIRE(v1 < v2); REQUIRE(v1 < v2);
REQUIRE(v1 <= v2); REQUIRE(v1 <= v2);
REQUIRE(not (v1 == v2)); REQUIRE(not(v1 == v2));
REQUIRE(not (v1 > v2)); REQUIRE(not(v1 > v2));
REQUIRE(not (v1 >= v2)); REQUIRE(not(v1 >= v2));
v1.major += 1; v1.major += 1;
REQUIRE(v1 == v2); REQUIRE(v1 == v2);
REQUIRE(v1 <= v2); REQUIRE(v1 <= v2);
REQUIRE(v1 >= v2); REQUIRE(v1 >= v2);
REQUIRE(not (v1 != v2)); REQUIRE(not(v1 != v2));
REQUIRE(not (v1 > v2)); REQUIRE(not(v1 > v2));
REQUIRE(not (v1 < v2)); REQUIRE(not(v1 < v2));
v1.major += 1; v1.major += 1;
v1.minor -= 1; v1.minor -= 1;
REQUIRE(v1 != v2); REQUIRE(v1 != v2);
REQUIRE(v1 > v2); REQUIRE(v1 > v2);
REQUIRE(v1 >= v2); REQUIRE(v1 >= v2);
REQUIRE(not (v1 == v2)); REQUIRE(not(v1 == v2));
REQUIRE(not (v1 < v2)); REQUIRE(not(v1 < v2));
REQUIRE(not (v1 <= v2)); REQUIRE(not(v1 <= v2));
v1.major -= 1; v1.major -= 1;
v1.minor += 2; v1.minor += 2;
v1.revision -= 1; v1.revision -= 1;
REQUIRE(v1 != v2); REQUIRE(v1 != v2);
REQUIRE(v1 > v2); REQUIRE(v1 > v2);
REQUIRE(v1 >= v2); REQUIRE(v1 >= v2);
REQUIRE(not (v1 == v2)); REQUIRE(not(v1 == v2));
REQUIRE(not (v1 < v2)); REQUIRE(not(v1 < v2));
REQUIRE(not (v1 <= v2)); REQUIRE(not(v1 <= v2));
v1.minor -= 1; v1.minor -= 1;
v1.revision += 2; v1.revision += 2;
REQUIRE(v1 != v2); REQUIRE(v1 != v2);
REQUIRE(v1 > v2); REQUIRE(v1 > v2);
REQUIRE(v1 >= v2); REQUIRE(v1 >= v2);
REQUIRE(not (v1 == v2)); REQUIRE(not(v1 == v2));
REQUIRE(not (v1 < v2)); REQUIRE(not(v1 < v2));
REQUIRE(not (v1 <= v2)); REQUIRE(not(v1 <= v2));
v1.revision -= 1; v1.revision -= 1;
REQUIRE(v1 == v2); REQUIRE(v1 == v2);
REQUIRE(v1 <= v2); REQUIRE(v1 <= v2);
REQUIRE(v1 >= v2); REQUIRE(v1 >= v2);
REQUIRE(not (v1 != v2)); REQUIRE(not(v1 != v2));
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
sif::info << "v" << fsfw::FSFW_VERSION << std::endl; sif::info << "v" << fsfw::FSFW_VERSION << std::endl;
#endif #endif
char verString[10] = {}; char verString[10] = {};
fsfw::FSFW_VERSION.getVersion(verString, sizeof(verString)); fsfw::FSFW_VERSION.getVersion(verString, sizeof(verString));
#if FSFW_DISABLE_PRINTOUT == 0 #if FSFW_DISABLE_PRINTOUT == 0
printf("v%s\n",verString); printf("v%s\n", verString);
#endif #endif
} }