almost done
All checks were successful
EIVE/eive-obsw/pipeline/pr-v2.1.0-dev This commit looks good

This commit is contained in:
2023-05-17 17:33:14 +02:00
parent f9e8dc6e60
commit e03df2ebca
12 changed files with 62 additions and 55 deletions

View File

@@ -53,15 +53,26 @@ ReturnValue_t PlocMpsocHandler::initialize() {
if (result != returnvalue::OK) {
return result;
}
result = manager->subscribeToEventRange(
eventQueue->getId(), event::getEventId(PlocMpsocSpecialComHelper::MPSOC_FLASH_WRITE_FAILED),
result = manager->subscribeToEvent(
eventQueue->getId(), event::getEventId(PlocMpsocSpecialComHelper::MPSOC_FLASH_WRITE_FAILED));
if (result != returnvalue::OK) {
return ObjectManagerIF::CHILD_INIT_FAILED;
}
result = manager->subscribeToEvent(
eventQueue->getId(),
event::getEventId(PlocMpsocSpecialComHelper::MPSOC_FLASH_WRITE_SUCCESSFUL));
if (result != returnvalue::OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "PlocMPSoCHandler::initialize: Failed to subscribe to events from "
" ploc mpsoc helper"
<< std::endl;
#endif
return ObjectManagerIF::CHILD_INIT_FAILED;
}
result = manager->subscribeToEvent(
eventQueue->getId(),
event::getEventId(PlocMpsocSpecialComHelper::MPSOC_FLASH_READ_SUCCESSFUL));
if (result != returnvalue::OK) {
return ObjectManagerIF::CHILD_INIT_FAILED;
}
result = manager->subscribeToEvent(
eventQueue->getId(), event::getEventId(PlocMpsocSpecialComHelper::MPSOC_FLASH_READ_FAILED));
if (result != returnvalue::OK) {
return ObjectManagerIF::CHILD_INIT_FAILED;
}
@@ -125,7 +136,7 @@ ReturnValue_t PlocMpsocHandler::executeAction(ActionId_t actionId, MessageQueueI
}
}
if (plocMPSoCHelperExecuting) {
if (specialComHelperExecuting) {
return MPSoCReturnValuesIF::MPSOC_HELPER_EXECUTING;
}
@@ -141,7 +152,7 @@ ReturnValue_t PlocMpsocHandler::executeAction(ActionId_t actionId, MessageQueueI
if (result != returnvalue::OK) {
return result;
}
plocMPSoCHelperExecuting = true;
specialComHelperExecuting = true;
return EXECUTION_FINISHED;
}
case mpsoc::TC_FLASH_READ_FULL_FILE: {
@@ -156,7 +167,7 @@ ReturnValue_t PlocMpsocHandler::executeAction(ActionId_t actionId, MessageQueueI
if (result != returnvalue::OK) {
return result;
}
plocMPSoCHelperExecuting = true;
specialComHelperExecuting = true;
return EXECUTION_FINISHED;
}
case (mpsoc::OBSW_RESET_SEQ_COUNT): {
@@ -241,12 +252,12 @@ void PlocMpsocHandler::doShutDown() {
setMode(_MODE_POWER_DOWN);
commandIsPending = false;
sequenceCount = 0;
plocMPSoCHelperExecuting = false;
specialComHelperExecuting = false;
startupState = StartupState::IDLE;
}
ReturnValue_t PlocMpsocHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
if (not commandIsPending and not plocMPSoCHelperExecuting) {
if (not commandIsPending and not specialComHelperExecuting) {
*id = mpsoc::TC_GET_HK_REPORT;
commandIsPending = true;
cmdCountdown.resetTimer();
@@ -548,7 +559,7 @@ void PlocMpsocHandler::handleEvent(EventMessage* eventMessage) {
object_id_t objectId = eventMessage->getReporter();
switch (objectId) {
case objects::PLOC_MPSOC_HELPER: {
plocMPSoCHelperExecuting = false;
specialComHelperExecuting = false;
break;
}
default:
@@ -1209,7 +1220,7 @@ size_t PlocMpsocHandler::getNextReplyLength(DeviceCommandId_t commandId) {
ReturnValue_t PlocMpsocHandler::doSendReadHook() {
// Prevent DHB from polling UART during commands executed by the mpsoc helper task
if (plocMPSoCHelperExecuting) {
if (specialComHelperExecuting) {
return returnvalue::FAILED;
}
return returnvalue::OK;