rename scheduling file
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit

This commit is contained in:
Robin Müller 2022-11-25 11:04:33 +01:00
parent c731418b65
commit f771fefbc9
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
4 changed files with 25 additions and 27 deletions

View File

@ -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)

View File

@ -1,4 +1,4 @@
#include "bsp_q7s/core/InitMission.h"
#include "scheduling.h"
#include <fsfw/devicehandlers/DeviceCommunicationIF.h>
#include <linux/scheduling.h>
@ -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<PeriodicTaskIF*>& taskVec) {
void scheduling::createPstTasks(TaskFactory& factory, TaskDeadlineMissedFunction missedDeadlineFunc,
std::vector<PeriodicTaskIF*>& 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<PeriodicTaskIF*>& taskVec) {
void scheduling::createPusTasks(TaskFactory& factory, TaskDeadlineMissedFunction missedDeadlineFunc,
std::vector<PeriodicTaskIF*>& 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<PeriodicTaskIF*>& taskVec) {
void scheduling::createTestTasks(TaskFactory& factory,
TaskDeadlineMissedFunction missedDeadlineFunc,
std::vector<PeriodicTaskIF*>& taskVec) {
#if OBSW_ADD_TEST_TASK == 1 && OBSW_ADD_TEST_CODE == 1
ReturnValue_t result = returnvalue::OK;
static_cast<void>(result); // supress warning in case it is not used

View File

@ -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<PeriodicTaskIF*>& taskVec);
void createTestTasks(TaskFactory& factory, TaskDeadlineMissedFunction missedDeadlineFunc,
std::vector<PeriodicTaskIF*>& taskVec);
}; // namespace initmission
}; // namespace scheduling
#endif /* BSP_Q7S_INITMISSION_H_ */

View File

@ -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. */