restructure repository
This commit is contained in:
53
misc/defaultcfg/fsfwconfig/objects/FsfwFactory.cpp
Normal file
53
misc/defaultcfg/fsfwconfig/objects/FsfwFactory.cpp
Normal file
@ -0,0 +1,53 @@
|
||||
#include "FsfwFactory.h"
|
||||
#include <OBSWConfig.h>
|
||||
|
||||
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
|
||||
#include <fsfw/events/EventManager.h>
|
||||
#include <fsfw/health/HealthTable.h>
|
||||
#include <fsfw/tmtcpacket/pus/TmPacketStored.h>
|
||||
#include <fsfw/tmtcservices/CommandingServiceBase.h>
|
||||
#include <fsfw/tmtcservices/PusServiceBase.h>
|
||||
#include <fsfw/internalError/InternalErrorReporter.h>
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
/**
|
||||
* This function builds all system objects required for using
|
||||
* the FSFW. It is recommended to build all other required objects
|
||||
* in a function with an identical prototype, call this function in it and
|
||||
* then pass the function to the object manager so it builds all system
|
||||
* objects on software startup.
|
||||
*
|
||||
* All system objects are registered in the internal object manager
|
||||
* automatically. The objects should be added to tasks at a later stage, using
|
||||
* their objects IDs.
|
||||
*
|
||||
* This function also sets static framework IDs.
|
||||
*
|
||||
* Framework should be created first before creating mission system objects.
|
||||
* @ingroup init
|
||||
*/
|
||||
void Factory::produceFsfwObjects(void) {
|
||||
setStaticFrameworkObjectIds();
|
||||
new EventManager(objects::EVENT_MANAGER);
|
||||
new HealthTable(objects::HEALTH_TABLE);
|
||||
new InternalErrorReporter(objects::INTERNAL_ERROR_REPORTER);
|
||||
}
|
||||
|
||||
void Factory::setStaticFrameworkObjectIds() {
|
||||
PusServiceBase::packetSource = objects::NO_OBJECT;
|
||||
PusServiceBase::packetDestination = objects::NO_OBJECT;
|
||||
|
||||
CommandingServiceBase::defaultPacketSource = objects::NO_OBJECT;
|
||||
CommandingServiceBase::defaultPacketDestination = objects::NO_OBJECT;
|
||||
|
||||
VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION;
|
||||
|
||||
DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT;
|
||||
DeviceHandlerBase::rawDataReceiverId = objects::PUS_SERVICE_2_DEVICE_ACCESS;
|
||||
|
||||
DeviceHandlerFailureIsolation::powerConfirmationId = objects::NO_OBJECT;
|
||||
|
||||
TmPacketStored::timeStamperId = objects::NO_OBJECT;
|
||||
}
|
||||
|
17
misc/defaultcfg/fsfwconfig/objects/FsfwFactory.h
Normal file
17
misc/defaultcfg/fsfwconfig/objects/FsfwFactory.h
Normal file
@ -0,0 +1,17 @@
|
||||
#ifndef FSFWCONFIG_OBJECTS_FACTORY_H_
|
||||
#define FSFWCONFIG_OBJECTS_FACTORY_H_
|
||||
|
||||
#include <fsfw/objectmanager/SystemObjectIF.h>
|
||||
#include <cstddef>
|
||||
|
||||
namespace Factory {
|
||||
/**
|
||||
* @brief Creates all SystemObject elements which are persistent
|
||||
* during execution.
|
||||
*/
|
||||
void produceFsfwObjects();
|
||||
void setStaticFrameworkObjectIds();
|
||||
}
|
||||
|
||||
|
||||
#endif /* FSFWCONFIG_OBJECTS_FACTORY_H_ */
|
16
misc/defaultcfg/fsfwconfig/objects/systemObjectList.h
Normal file
16
misc/defaultcfg/fsfwconfig/objects/systemObjectList.h
Normal file
@ -0,0 +1,16 @@
|
||||
#ifndef CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_
|
||||
#define CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_
|
||||
|
||||
#include <cstdint>
|
||||
#include <fsfw/objectmanager/frameworkObjects.h>
|
||||
|
||||
// The objects will be instantiated in the ID order
|
||||
namespace objects {
|
||||
enum sourceObjects: uint32_t {
|
||||
/* All addresses between start and end are reserved for the FSFW */
|
||||
FSFW_CONFIG_RESERVED_START = PUS_SERVICE_1_VERIFICATION,
|
||||
FSFW_CONFIG_RESERVED_END = TM_STORE
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* BSP_CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_ */
|
Reference in New Issue
Block a user