new retval for empty slot list

This commit is contained in:
Robin Müller 2021-09-23 17:33:45 +02:00
parent e1a85b47c5
commit 0987a160c9
4 changed files with 11 additions and 5 deletions

View File

@ -77,6 +77,7 @@ enum: uint8_t {
HAL_UART, //HURT
HAL_I2C, //HI2C
HAL_GPIO, //HGIO
FIXED_SLOT_TASK_IF, //FTIF
FW_CLASS_ID_COUNT // [EXPORT] : [END]
};

View File

@ -1,4 +1,5 @@
#include "fsfw/tasks/FixedSlotSequence.h"
#include "fsfw/tasks/FixedTimeslotTaskIF.h"
#include "fsfw/serviceinterface/ServiceInterface.h"
#include <cstdlib>
@ -92,10 +93,9 @@ void FixedSlotSequence::addSlot(object_id_t componentId, uint32_t slotTimeMs,
ReturnValue_t FixedSlotSequence::checkSequence() const {
if(slotList.empty()) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "FixedSlotSequence::checkSequence:"
<< " Slot list is empty!" << std::endl;
sif::warning << "FixedSlotSequence::checkSequence: Slot list is empty!" << std::endl;
#endif
return HasReturnvaluesIF::RETURN_FAILED;
return FixedTimeslotTaskIF::SLOT_LIST_EMPTY;
}
if(customCheckFunction != nullptr) {

View File

@ -2,7 +2,7 @@
#define FSFW_TASKS_FIXEDSLOTSEQUENCE_H_
#include "FixedSequenceSlot.h"
#include "../objectmanager/SystemObject.h"
#include "fsfw/objectmanager/SystemObject.h"
#include <set>
@ -136,6 +136,7 @@ public:
* @details
* Checks if timing is ok (must be ascending) and if all handlers were found.
* @return
* - SLOT_LIST_EMPTY if the slot list is empty
*/
ReturnValue_t checkSequence() const;
@ -147,6 +148,7 @@ public:
* The general check will be continued for now if the custom check function
* fails but a diagnostic debug output will be given.
* @param customCheckFunction
*
*/
void addCustomCheck(ReturnValue_t (*customCheckFunction)(const SlotList &));

View File

@ -2,7 +2,8 @@
#define FRAMEWORK_TASKS_FIXEDTIMESLOTTASKIF_H_
#include "PeriodicTaskIF.h"
#include "../objectmanager/ObjectManagerIF.h"
#include "fsfw/objectmanager/ObjectManagerIF.h"
#include "fsfw/returnvalues/FwClassIds.h"
/**
* @brief Following the same principle as the base class IF.
@ -12,6 +13,8 @@ class FixedTimeslotTaskIF : public PeriodicTaskIF {
public:
virtual ~FixedTimeslotTaskIF() {}
static constexpr ReturnValue_t SLOT_LIST_EMPTY = HasReturnvaluesIF::makeReturnCode(
CLASS_ID::FIXED_SLOT_TASK_IF, 0);
/**
* Add an object with a slot time and the execution step to the task.
* The execution step will be passed to the object (e.g. as an operation