Merge branch 'mueller/master' of https://egit.irs.uni-stuttgart.de/eive/eive_obsw into mueller/master

This commit is contained in:
Robin Müller 2020-11-02 17:55:47 +01:00 committed by Robin Mueller
commit af1a1ed99a
7 changed files with 66 additions and 172 deletions

View File

@ -1,168 +0,0 @@
#include <PollingSequenceFactory.h>
#include <dataPoolInit.h>
#include <Factory.h>
#include <systemObjectList.h>
#include <fsfw/datapool/DataPool.h>
#include <fsfw/objectmanager/ObjectManager.h>
#include <fsfw/tasks/PeriodicTaskIF.h>
#include <fsfw/tasks/TaskFactory.h>
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
#include <ostream>
/* Declare global object manager */
ObjectManagerIF* objectManager;
/* Initialize Data Pool */
DataPool dataPool(datapool::dataPoolInit);
/* Set up output streams */
namespace sif {
ServiceInterfaceStream debug("DEBUG");
ServiceInterfaceStream info("INFO");
ServiceInterfaceStream warning("WARNING");
ServiceInterfaceStream error("ERROR", false, true, true);
}
void initTask();
void initMission() {
sif::info << "Initiating mission specific code." << std::endl;
// Allocate object manager here, as global constructors might not be
// executed, depending on buildchain
sif::info << "Creating objects" << std::endl;
objectManager = new ObjectManager(Factory::produce);
objectManager -> initialize();
initTask();
}
void initTask() {
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
/* Packet Distributor Taks */
PeriodicTaskIF* PacketDistributorTask =
TaskFactory::instance()-> createPeriodicTask(
"PACKET_DIST_TASK", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE,
0.4, nullptr);
result = PacketDistributorTask->
addComponent(objects::CCSDS_PACKET_DISTRIBUTOR);
if(result != HasReturnvaluesIF::RETURN_OK){
sif::error << "Add component CCSDS Packet Distributor failed"
<< std::endl;
}
result = PacketDistributorTask->
addComponent(objects::PUS_PACKET_DISTRIBUTOR);
if(result != HasReturnvaluesIF::RETURN_OK){
sif::error << "Add component PUS Packet Distributor failed"
<< std::endl;
}
result = PacketDistributorTask->addComponent(objects::PUS_FUNNEL);
if(result != HasReturnvaluesIF::RETURN_OK){
sif::error << "Add component PUS Funnel failed" << std::endl;
}
/* UDP bridge */
PeriodicTaskIF* UdpBridgeTask = TaskFactory::instance()->createPeriodicTask(
"UDP_UNIX_BRIDGE", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE,
0.2, nullptr);
result = UdpBridgeTask->addComponent(objects::UDP_BRIDGE);
if(result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "Add component UDP Unix Bridge failed" << std::endl;
}
PeriodicTaskIF* UdpPollingTask = TaskFactory::instance()->
createPeriodicTask("UDP_POLLING", 80,
PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, nullptr);
result = UdpPollingTask->addComponent(objects::UDP_POLLING_TASK);
if(result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "Add component UDP Polling failed" << std::endl;
}
/* PUS Services */
PeriodicTaskIF* PusService1 = TaskFactory::instance()->createPeriodicTask(
"PUS_SRV_1", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE,
0.4, nullptr);
result = PusService1->addComponent(objects::PUS_SERVICE_1);
if(result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "Add component Verification Reporter failed" << std::endl;
}
PeriodicTaskIF* PusService2 = TaskFactory::instance()->createPeriodicTask(
"PUS_SRV_2", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE,
0.2, nullptr);
result = PusService2->addComponent(objects::PUS_SERVICE_2);
if(result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "Add component Device Access failed" << std::endl;
}
PeriodicTaskIF* PusService5 = TaskFactory::instance()->createPeriodicTask(
"PUS_SRV_5", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE,
0.4, nullptr);
result = PusService5->addComponent(objects::PUS_SERVICE_5);
if(result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "Add component Event Service failed" << std::endl;
}
PeriodicTaskIF* PusService8 = TaskFactory::instance()->createPeriodicTask(
"PUS_SRV_8", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE,
0.4, nullptr);
result = PusService2->addComponent(objects::PUS_SERVICE_8);
if(result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "Add component Function MGMT failed" << std::endl;
}
PeriodicTaskIF* PusService17 = TaskFactory::instance()->createPeriodicTask(
"PUS_SRV_17", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE,
0.4, nullptr);
result = PusService17->addComponent(objects::PUS_SERVICE_17);
if(result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "Add component Test Service failed" << std::endl;
}
PeriodicTaskIF* PusService200 = TaskFactory::instance()->createPeriodicTask(
"PUS_SRV_200", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE,
0.4, nullptr);
result = PusService200->addComponent(objects::PUS_SERVICE_200);
if(result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "Add component Mode MGMT failed" << std::endl;
}
/* Test Task */
PeriodicTaskIF* TestTask = TaskFactory::instance()->
createPeriodicTask("TEST_TASK", 80,
PeriodicTaskIF::MINIMUM_STACK_SIZE, 5.0, nullptr);
result = TestTask->addComponent(objects::TEST_TASK);
if (result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "Add component Test Task failed" << std::endl;
}
/* Polling Sequence Table Default */
// FixedTimeslotTaskIF * PollingSequenceTableTaskDefault =
// TaskFactory::instance()-> createFixedTimeslotTask(
// "PST_DEFAULT", 80, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0,
// nullptr);
// result = pst::pollingSequenceInitDefault(PollingSequenceTableTaskDefault);
// if (result != HasReturnvaluesIF::RETURN_OK) {
// sif::error << "creating PST failed" << std::endl;
// }
TestTask->startTask();
PacketDistributorTask->startTask();
//PollingSequenceTableTaskDefault->startTask();
UdpBridgeTask->startTask();
UdpPollingTask->startTask();
PusService1->startTask();
PusService2->startTask();
PusService5->startTask();
PusService8->startTask();
PusService17->startTask();
PusService200->startTask();
}

View File

@ -1,8 +1,54 @@
#ifndef CONFIG_FSFWCONFIG_H_ #ifndef CONFIG_FSFWCONFIG_H_
#define CONFIG_FSFWCONFIG_H_ #define CONFIG_FSFWCONFIG_H_
#include <FSFWVersion.h>
#include <cstddef>
//! Used to determine whether C++ ostreams are used
//! Those can lead to code bloat.
#define FSFW_CPP_OSTREAM_ENABLED 1
//! Reduced printout to further decrese code size
//! Be careful, this also turns off most diagnostic prinouts!
#define FSFW_REDUCED_PRINTOUT 0
//! Can be used to enable debugging printouts for developing the FSFW
#define FSFW_DEBUGGING 0
//! Defines the FIFO depth of each commanding service base which
//! also determines how many commands a CSB service can handle in one cycle
//! simulataneously. This will increase the required RAM for
//! each CSB service !
#define FSFW_CSB_FIFO_DEPTH 6
//! If FSFW_OBJ_EVENT_TRANSLATION is set to one,
//! additional output which requires the translation files translateObjects
//! and translateEvents (and their compiled source files)
#define FSFW_OBJ_EVENT_TRANSLATION 0
#if FSFW_OBJ_EVENT_TRANSLATION == 1
#define FSFW_DEBUG_OUTPUT 1
//! Specify whether info events are printed too.
#define FSFW_DEBUG_INFO 1
#include <translateObjects.h>
#include <translateEvents.h>
#else
#define FSFW_DEBUG_OUTPUT 0
#endif
//! When using the newlib nano library, C99 support for stdio facilities
//! will not be provided. This define should be set to 1 if this is the case.
#define FSFW_NO_C99_IO 1
namespace fsfwconfig {
//! Default timestamp size. The default timestamp will be an eight byte CDC
//! short timestamp.
static constexpr uint8_t FSFW_MISSION_TIMESTAMP_SIZE = 8;
//! Configure the allocated pool sizes for the event manager.
static constexpr size_t FSFW_EVENTMGMR_MATCHTREE_NODES = 240;
static constexpr size_t FSFW_EVENTMGMT_EVENTIDMATCHERS = 120;
static constexpr size_t FSFW_EVENTMGMR_RANGEMATCHERS = 120;
}
#endif /* CONFIG_FSFWCONFIG_H_ */ #endif /* CONFIG_FSFWCONFIG_H_ */

View File

@ -0,0 +1,5 @@
#include "dataPoolInit.h"
void datapool::dataPoolInit(std::map<uint32_t, PoolEntryIF*>* poolMap) {
}

View File

@ -0,0 +1,13 @@
#ifndef CONFIG_CDATAPOOL_DATAPOOLINIT_H_
#define CONFIG_CDATAPOOL_DATAPOOLINIT_H_
#include <fsfw/datapool/DataPool.h>
namespace datapool{
void dataPoolInit(std::map<uint32_t, PoolEntryIF*>* poolMap);
enum datapoolvariables {
NO_PARAMETER = 0,
};
}
#endif /* CONFIG_CDATAPOOL_DATAPOOLINIT_H_ */

2
fsfw

@ -1 +1 @@
Subproject commit 11a351a202464990641c4840569d2beff33a7b8c Subproject commit 3cd0f8f5f026e44477038397a0c9ecac2ce7bacc

View File

@ -158,5 +158,3 @@ void InitMission::initTasks(){
#endif #endif
sif::info << "Tasks started.." << std::endl; sif::info << "Tasks started.." << std::endl;
} }

2
tmtc

@ -1 +1 @@
Subproject commit ee295fa849ec7af33204f437d60742d173ac5c4b Subproject commit 480b0a16456ff09dfdfdd85b945926a73d19c09c