From d226726a27825ae2df6322bd6a2c828552b971e2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 24 Mar 2023 11:58:45 +0100 Subject: [PATCH] this is going to be annyoing --- bsp_q7s/core/scheduling.cpp | 8 +++++--- fsfw | 2 +- linux/devices/startracker/StrComHandler.cpp | 4 +--- linux/scheduling.cpp | 5 +++-- linux/scheduling.h | 5 +++++ 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index aee99b76..1ef14d41 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -68,12 +68,14 @@ void scheduling::initTasks() { #else void (*missedDeadlineFunc)(void) = nullptr; #endif + RR_SCHEDULING.policy = SchedulingPolicy::RR; #if OBSW_ADD_SA_DEPL == 1 // Could add this to the core controller but the core controller does so many thing that I would // prefer to have the solar array deployment in a seprate task. - PeriodicTaskIF* solarArrayDeplTask = factory->createPeriodicTask( - "SOLAR_ARRAY_DEPL", 65, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.4, missedDeadlineFunc); + PeriodicTaskIF* solarArrayDeplTask = + factory->createPeriodicTask("SOLAR_ARRAY_DEPL", 65, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.4, + missedDeadlineFunc, &RR_SCHEDULING); result = solarArrayDeplTask->addComponent(objects::SOLAR_ARRAY_DEPL_HANDLER); if (result != returnvalue::OK) { scheduling::printAddObjectError("SOLAR_ARRAY_DEPL", objects::SOLAR_ARRAY_DEPL_HANDLER); @@ -81,7 +83,7 @@ void scheduling::initTasks() { #endif PeriodicTaskIF* coreCtrlTask = factory->createPeriodicTask( - "CORE_CTRL", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.4, missedDeadlineFunc); + "CORE_CTRL", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.4, missedDeadlineFunc, &RR_SCHEDULING); result = coreCtrlTask->addComponent(objects::CORE_CONTROLLER); if (result != returnvalue::OK) { scheduling::printAddObjectError("CORE_CTRL", objects::CORE_CONTROLLER); diff --git a/fsfw b/fsfw index 7ed75ea8..e704295c 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 7ed75ea87b81ac071c1e2ec0f16633487b8300fd +Subproject commit e704295cce76048d65bbb8893840b9ecedb05c94 diff --git a/linux/devices/startracker/StrComHandler.cpp b/linux/devices/startracker/StrComHandler.cpp index 85be7871..fb11be27 100644 --- a/linux/devices/startracker/StrComHandler.cpp +++ b/linux/devices/startracker/StrComHandler.cpp @@ -155,9 +155,7 @@ ReturnValue_t StrComHandler::startImageDownload(std::string path) { return returnvalue::OK; } -void StrComHandler::stopProcess() { - terminate = true; -} +void StrComHandler::stopProcess() { terminate = true; } void StrComHandler::setDownloadImageName(std::string filename) { downloadImage.filename = filename; diff --git a/linux/scheduling.cpp b/linux/scheduling.cpp index 85735729..d3b88661 100644 --- a/linux/scheduling.cpp +++ b/linux/scheduling.cpp @@ -18,8 +18,9 @@ void scheduling::scheduleScexReader(TaskFactory& factory, PeriodicTaskIF*& scexR #endif result = returnvalue::OK; - scexReaderTask = factory.createPeriodicTask( - "SCEX_UART_READER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc); + scexReaderTask = + factory.createPeriodicTask("SCEX_UART_READER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, + missedDeadlineFunc, &NORMAL_SCHEDULING); result = scexReaderTask->addComponent(objects::SCEX_UART_READER); if (result != returnvalue::OK) { printAddObjectError("SCEX_UART_READER", objects::SCEX_UART_READER); diff --git a/linux/scheduling.h b/linux/scheduling.h index b5ec8ef2..d6c5b1f1 100644 --- a/linux/scheduling.h +++ b/linux/scheduling.h @@ -1,8 +1,13 @@ #pragma once +#include #include namespace scheduling { + +extern PosixThreadArgs RR_SCHEDULING; +extern PosixThreadArgs NORMAL_SCHEDULING; + void scheduleScexDev(PeriodicTaskIF*& scexDevHandler); void scheduleScexReader(TaskFactory& factory, PeriodicTaskIF*& scexReaderTask); void addMpsocSupvHandlers(PeriodicTaskIF* task);