fsfw-example-hosted/bsp_hosted/main.cpp

52 lines
1.4 KiB
C++
Raw Normal View History

2021-06-08 13:36:08 +02:00
#include <bsp_hosted/core/InitMission.h>
#include <bsp_hosted/core/ObjectFactory.h>
#include <fsfw/objectmanager/ObjectManager.h>
2022-05-05 20:55:48 +02:00
#include <fsfw/platform.h>
2022-05-09 01:15:11 +02:00
#include <fsfw/serviceinterface.h>
2021-06-08 13:36:08 +02:00
#include <fsfw/tasks/TaskFactory.h>
2022-05-05 20:55:48 +02:00
#include "example/test/MutexExample.h"
#include "example/utility/utility.h"
2021-06-08 17:38:04 +02:00
#ifdef PLATFORM_WIN
2021-06-08 13:36:08 +02:00
static const char* COMPILE_PRINTOUT = "Windows";
2021-06-08 17:38:04 +02:00
#elif defined(PLATFORM_UNIX)
2021-06-08 13:36:08 +02:00
static const char* COMPILE_PRINTOUT = "Linux";
#else
static const char* COMPILE_PRINTOUT = "unknown OS";
#endif
#if FSFW_CPP_OSTREAM_ENABLED == 1
2022-05-09 00:10:01 +02:00
// ServiceInterfaceStream sif::debug("DEBUG", false);
// ServiceInterfaceStream sif::info("INFO", false);
// ServiceInterfaceStream sif::warning("WARNING", false);
// ServiceInterfaceStream sif::error("ERROR", false, true, true);
2021-06-08 13:36:08 +02:00
#endif
int main() {
2022-05-05 20:55:48 +02:00
utility::commonInitPrint("Hosted", COMPILE_PRINTOUT);
2021-06-08 13:36:08 +02:00
2022-05-09 01:15:11 +02:00
FSFW_LOGI("Producing system objects\n");
2021-06-08 13:36:08 +02:00
2022-05-05 20:55:48 +02:00
ObjectManager* objManager = ObjectManager::instance();
objManager->setObjectFactoryFunction(ObjectFactory::produce, nullptr);
2021-06-08 13:36:08 +02:00
2022-05-09 01:15:11 +02:00
FSFW_LOGI("Objects created successfully, initializing objects\n");
2021-06-08 13:36:08 +02:00
2022-05-05 20:55:48 +02:00
objManager->initialize();
2021-06-08 13:36:08 +02:00
2022-05-09 01:15:11 +02:00
FSFW_LOGI("Creating tasks\n");
2021-06-08 13:36:08 +02:00
2022-05-05 20:55:48 +02:00
InitMission::createTasks();
2021-06-08 13:36:08 +02:00
2022-05-05 20:55:48 +02:00
MutexExample::example();
// PusPacketCreator::createPusPacketAndPrint();
2021-06-08 13:36:08 +02:00
2022-05-05 20:55:48 +02:00
/* Permanent loop. */
for (;;) {
/* Sleep main thread, not needed anymore. */
TaskFactory::delayTask(5000);
}
return 0;
2021-06-08 13:36:08 +02:00
}