diff --git a/bsp_q7s/core/CMakeLists.txt b/bsp_q7s/core/CMakeLists.txt index b4050d73..66b65c62 100644 --- a/bsp_q7s/core/CMakeLists.txt +++ b/bsp_q7s/core/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(${OBSW_NAME} PRIVATE CoreController.cpp InitMission.cpp +target_sources(${OBSW_NAME} PRIVATE CoreController.cpp scheduling.cpp ObjectFactory.cpp) target_sources(${SIMPLE_OBSW_NAME} PRIVATE InitMission.cpp) diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/scheduling.cpp similarity index 94% rename from bsp_q7s/core/InitMission.cpp rename to bsp_q7s/core/scheduling.cpp index 3b1eb357..f07eda32 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -1,4 +1,4 @@ -#include "bsp_q7s/core/InitMission.h" +#include "scheduling.h" #include #include @@ -35,13 +35,13 @@ ServiceInterfaceStream sif::error("ERROR", true, false, true); ObjectManagerIF* objectManager = nullptr; -void initmission::initMission() { +void scheduling::initMission() { sif::info << "Building global objects.." << std::endl; try { /* Instantiate global object manager and also create all objects */ ObjectManager::instance()->setObjectFactoryFunction(ObjectFactory::produce, nullptr); } catch (const std::invalid_argument& e) { - sif::error << "initmission::initMission: Object Construction failed with an " + sif::error << "scheduling::initMission: Object Construction failed with an " "invalid argument: " << e.what(); std::exit(1); @@ -54,7 +54,7 @@ void initmission::initMission() { initTasks(); } -void initmission::initTasks() { +void scheduling::initTasks() { TaskFactory* factory = TaskFactory::instance(); ReturnValue_t result = returnvalue::OK; if (factory == nullptr) { @@ -373,9 +373,8 @@ void initmission::initTasks() { sif::info << "Tasks started.." << std::endl; } -void initmission::createPstTasks(TaskFactory& factory, - TaskDeadlineMissedFunction missedDeadlineFunc, - std::vector& taskVec) { +void scheduling::createPstTasks(TaskFactory& factory, TaskDeadlineMissedFunction missedDeadlineFunc, + std::vector& taskVec) { ReturnValue_t result = returnvalue::OK; /* Polling Sequence Table Default */ #if OBSW_ADD_SPI_TEST_CODE == 0 @@ -384,9 +383,9 @@ void initmission::createPstTasks(TaskFactory& factory, result = pst::pstSpi(spiPst); if (result != returnvalue::OK) { if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { - sif::warning << "InitMission::initTasks: SPI PST is empty" << std::endl; + sif::warning << "scheduling::initTasks: SPI PST is empty" << std::endl; } else { - sif::error << "InitMission::initTasks: Creating SPI PST failed!" << std::endl; + sif::error << "scheduling::initTasks: Creating SPI PST failed!" << std::endl; } } else { taskVec.push_back(spiPst); @@ -399,9 +398,9 @@ void initmission::createPstTasks(TaskFactory& factory, result = pst::pstSpiRw(rwPstTask); if (result != returnvalue::OK) { if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { - sif::warning << "InitMission::initTasks: SPI PST is empty" << std::endl; + sif::warning << "scheduling::initTasks: SPI PST is empty" << std::endl; } else { - sif::error << "InitMission::initTasks: Creating SPI PST failed!" << std::endl; + sif::error << "scheduling::initTasks: Creating SPI PST failed!" << std::endl; } } else { taskVec.push_back(rwPstTask); @@ -413,9 +412,9 @@ void initmission::createPstTasks(TaskFactory& factory, result = pst::pstUart(uartPst); if (result != returnvalue::OK) { if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { - sif::warning << "InitMission::initTasks: UART PST is empty" << std::endl; + sif::warning << "scheduling::initTasks: UART PST is empty" << std::endl; } else { - sif::error << "InitMission::initTasks: Creating UART PST failed!" << std::endl; + sif::error << "scheduling::initTasks: Creating UART PST failed!" << std::endl; } } else { taskVec.push_back(uartPst); @@ -427,9 +426,9 @@ void initmission::createPstTasks(TaskFactory& factory, result = pst::pstI2c(i2cPst); if (result != returnvalue::OK) { if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { - sif::warning << "InitMission::initTasks: I2C PST is empty" << std::endl; + sif::warning << "scheduling::initTasks: I2C PST is empty" << std::endl; } else { - sif::error << "InitMission::initTasks: Creating I2C PST failed!" << std::endl; + sif::error << "scheduling::initTasks: Creating I2C PST failed!" << std::endl; } } else { taskVec.push_back(i2cPst); @@ -442,16 +441,15 @@ void initmission::createPstTasks(TaskFactory& factory, result = pst::pstGompaceCan(gomSpacePstTask); if (result != returnvalue::OK) { if (result != FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { - sif::error << "InitMission::initTasks: GomSpace PST initialization failed!" << std::endl; + sif::error << "scheduling::initTasks: GomSpace PST initialization failed!" << std::endl; } } taskVec.push_back(gomSpacePstTask); #endif } -void initmission::createPusTasks(TaskFactory& factory, - TaskDeadlineMissedFunction missedDeadlineFunc, - std::vector& taskVec) { +void scheduling::createPusTasks(TaskFactory& factory, TaskDeadlineMissedFunction missedDeadlineFunc, + std::vector& taskVec) { ReturnValue_t result = returnvalue::OK; /* PUS Services */ PeriodicTaskIF* pusVerification = factory.createPeriodicTask( @@ -530,9 +528,9 @@ void initmission::createPusTasks(TaskFactory& factory, taskVec.push_back(pusLowPrio); } -void initmission::createTestTasks(TaskFactory& factory, - TaskDeadlineMissedFunction missedDeadlineFunc, - std::vector& taskVec) { +void scheduling::createTestTasks(TaskFactory& factory, + TaskDeadlineMissedFunction missedDeadlineFunc, + std::vector& taskVec) { #if OBSW_ADD_TEST_TASK == 1 && OBSW_ADD_TEST_CODE == 1 ReturnValue_t result = returnvalue::OK; static_cast(result); // supress warning in case it is not used diff --git a/bsp_q7s/core/InitMission.h b/bsp_q7s/core/scheduling.h similarity index 92% rename from bsp_q7s/core/InitMission.h rename to bsp_q7s/core/scheduling.h index e0b1d8f2..d43575dc 100644 --- a/bsp_q7s/core/InitMission.h +++ b/bsp_q7s/core/scheduling.h @@ -8,7 +8,7 @@ class PeriodicTaskIF; class TaskFactory; -namespace initmission { +namespace scheduling { void initMission(); void initTasks(); @@ -18,6 +18,6 @@ void createPusTasks(TaskFactory& factory, TaskDeadlineMissedFunction missedDeadl std::vector& taskVec); void createTestTasks(TaskFactory& factory, TaskDeadlineMissedFunction missedDeadlineFunc, std::vector& taskVec); -}; // namespace initmission +}; // namespace scheduling #endif /* BSP_Q7S_INITMISSION_H_ */ diff --git a/bsp_q7s/obsw.cpp b/bsp_q7s/obsw.cpp index 530c4904..d497eceb 100644 --- a/bsp_q7s/obsw.cpp +++ b/bsp_q7s/obsw.cpp @@ -5,7 +5,7 @@ #include "OBSWConfig.h" #include "commonConfig.h" -#include "core/InitMission.h" +#include "core/scheduling.h" #include "fsfw/tasks/TaskFactory.h" #include "fsfw/version.h" #include "q7sConfig.h" @@ -36,7 +36,7 @@ int obsw::obsw() { return OBSW_ALREADY_RUNNING; } #endif - initmission::initMission(); + scheduling::initMission(); for (;;) { /* Suspend main thread by sleeping it. */