From e31a95d1c47ae5064b33f8ef6e06c2c775081e39 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 26 Apr 2023 16:23:50 +0200 Subject: [PATCH] host build requires dedicated live TM task.. --- bsp_hosted/scheduling.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/bsp_hosted/scheduling.cpp b/bsp_hosted/scheduling.cpp index 0a5f1c35..5b9177f3 100644 --- a/bsp_hosted/scheduling.cpp +++ b/bsp_hosted/scheduling.cpp @@ -59,19 +59,15 @@ void scheduling::initTasks() { "DIST", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc); ReturnValue_t result = tmtcDistributor->addComponent(objects::CCSDS_PACKET_DISTRIBUTOR); if (result != returnvalue::OK) { - sif::error << "adding CCSDS distributor failed" << std::endl; + sif::error << "Adding CCSDS distributor failed" << std::endl; } result = tmtcDistributor->addComponent(objects::PUS_PACKET_DISTRIBUTOR); if (result != returnvalue::OK) { - sif::error << "adding PUS distributor failed" << std::endl; - } - result = tmtcDistributor->addComponent(objects::TM_FUNNEL); - if (result != returnvalue::OK) { - sif::error << "adding TM funnel failed" << std::endl; + sif::error << "Adding PUS distributor failed" << std::endl; } result = tmtcDistributor->addComponent(objects::CFDP_DISTRIBUTOR); if (result != returnvalue::OK) { - sif::error << "adding CFDP distributor failed" << std::endl; + sif::error << "Adding CFDP distributor failed" << std::endl; } result = tmtcDistributor->addComponent(objects::UDP_TMTC_SERVER); if (result != returnvalue::OK) { @@ -94,6 +90,13 @@ void scheduling::initTasks() { if (result != returnvalue::OK) { sif::error << "Add component UDP Polling failed" << std::endl; } + // All the TM store tasks run in permanent loops, frequency does not matter + PeriodicTaskIF* liveTmTask = factory->createPeriodicTask( + "LIVE_TM", 55, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, nullptr, &RR_SCHEDULING); + result = liveTmTask->addComponent(objects::LIVE_TM_TASK); + if (result != returnvalue::OK) { + scheduling::printAddObjectError("LIVE_TM", objects::LIVE_TM_TASK); + } PeriodicTaskIF* pusHighPrio = factory->createPeriodicTask( "PUS_HIGH_PRIO", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc); @@ -149,7 +152,7 @@ void scheduling::initTasks() { "THERMAL_CTL_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, missedDeadlineFunc); result = thermalTask->addComponent(objects::CORE_CONTROLLER); if (result != returnvalue::OK) { - scheduling::printAddObjectError("Core controller dummy", objects::CORE_CONTROLLER); + scheduling::printAddObjectError("CORE_CTRL", objects::CORE_CONTROLLER); } result = thermalTask->addComponent(objects::THERMAL_CONTROLLER); if (result != returnvalue::OK) { @@ -217,6 +220,7 @@ void scheduling::initTasks() { tmtcDistributor->startTask(); udpPollingTask->startTask(); tcpPollingTask->startTask(); + liveTmTask->startTask(); pusHighPrio->startTask(); pusMedPrio->startTask();