these queue sizes are sufficient
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good

This commit is contained in:
2023-09-14 10:38:43 +02:00
parent 9243f917cc
commit 8071a5713f
3 changed files with 26 additions and 3 deletions

View File

@ -7,6 +7,7 @@
#include "mission/sysDefs.h"
static constexpr bool DEBUG_TM_QUEUE_SPEED = false;
std::atomic_bool signals::CFDP_CHANNEL_THROTTLE_SIGNAL = false;
LiveTmTask::LiveTmTask(object_id_t objectId, PusTmFunnel& pusFunnel, CfdpTmFunnel& cfdpFunnel,
@ -27,7 +28,11 @@ ReturnValue_t LiveTmTask::performOperation(uint8_t opCode) {
readCommandQueue();
bool handledTm;
ReturnValue_t result;
uint32_t consecutiveRegularCounter = 0;
uint32_t consecutiveCfdpCounter = 0;
bool isCfdp = false;
while (true) {
isCfdp = false;
// TODO: Must read CFDP TM queue and regular TM queue and forward them. Handle regular queue
// first.
handledTm = false;
@ -35,9 +40,17 @@ ReturnValue_t LiveTmTask::performOperation(uint8_t opCode) {
result = handleRegularTmQueue();
if (result == MessageQueueIF::EMPTY) {
result = handleCfdpTmQueue();
isCfdp = true;
}
if (result == returnvalue::OK) {
handledTm = true;
if (DEBUG_TM_QUEUE_SPEED) {
if (isCfdp) {
consecutiveCfdpCounter++;
} else {
consecutiveRegularCounter++;
}
}
}
}
if (channel.isBusy()) {
@ -54,6 +67,17 @@ ReturnValue_t LiveTmTask::performOperation(uint8_t opCode) {
}
// Read command queue during idle times.
readCommandQueue();
if (DEBUG_TM_QUEUE_SPEED) {
if (consecutiveCfdpCounter > 0) {
sif::debug << "Concecutive CFDP TM handled: " << consecutiveCfdpCounter << std::endl;
}
if (consecutiveRegularCounter > 0) {
sif::debug << "Concecutive regular TM handled: " << consecutiveRegularCounter
<< std::endl;
}
consecutiveRegularCounter = 0;
consecutiveCfdpCounter = 0;
}
// 40 ms IDLE delay. Might tweak this in the future.
TaskFactory::delayTask(40);
} else {