testArduino/bsp_linux/fsfwconfig/pollingsequence/PollingSequenceArduinoFunction.cpp

36 lines
1.1 KiB
C++

/*
* PollingSequenceCentroidFunction.cpp
*
* Created on: May 1, 2021
* Author: mala
*/
#include <fsfw/objectmanager/ObjectManagerIF.h>
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
#include <fsfw/tasks/FixedTimeslotTaskIF.h>
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
#include "../../../bsp_linux/fsfwconfig/objects/systemObjectList.h"
#include "../../../bsp_linux/fsfwconfig/OBSWConfig.h"
#include "PollingSequenceArduino.h"
ReturnValue_t pollingSequenceArduinoFunction(
FixedTimeslotTaskIF* thisSequence){
uint32_t length = thisSequence->getPeriodMs();
thisSequence->addSlot(objects::ARDUINO_DEVICE_HANDLER, length * 0, 0);
thisSequence->addSlot(objects::ARDUINO_DEVICE_HANDLER, length * 0.1, 1);
thisSequence->addSlot(objects::ARDUINO_DEVICE_HANDLER, length * 0.15, 2);
thisSequence->addSlot(objects::ARDUINO_DEVICE_HANDLER, length * 0.75, 3);
if (thisSequence->checkSequence() == HasReturnvaluesIF::RETURN_OK) {
return HasReturnvaluesIF::RETURN_OK;
}
else {
sif::error << "pollingSequenceArduinoFunction::initialize has errors!"
<< std::endl;
return HasReturnvaluesIF::RETURN_FAILED;
}
}