some remaining bugfixes
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
|
||||
#include <fsfw/filesystem/HasFileSystemIF.h>
|
||||
#include <fsfw/globalfunctions/arrayprinter.h>
|
||||
#include <fsfw/tasks/TaskFactory.h>
|
||||
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
@ -84,7 +85,7 @@ ReturnValue_t PlocSupervisorHandler::executeAction(ActionId_t actionId,
|
||||
break;
|
||||
}
|
||||
|
||||
if (plocSupvHelperExecuting) {
|
||||
if (uartManager.longerRequestActive()) {
|
||||
return result::SUPV_HELPER_EXECUTING;
|
||||
}
|
||||
|
||||
@ -98,6 +99,7 @@ ReturnValue_t PlocSupervisorHandler::executeAction(ActionId_t actionId,
|
||||
if (size > config::MAX_PATH_SIZE + config::MAX_FILENAME_SIZE) {
|
||||
return result::FILENAME_TOO_LONG;
|
||||
}
|
||||
shutdownCmdSent = false;
|
||||
UpdateParams params;
|
||||
result = extractUpdateCommand(data, size, params);
|
||||
if (result != returnvalue::OK) {
|
||||
@ -107,15 +109,15 @@ ReturnValue_t PlocSupervisorHandler::executeAction(ActionId_t actionId,
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
plocSupvHelperExecuting = true;
|
||||
return EXECUTION_FINISHED;
|
||||
}
|
||||
case CONTINUE_UPDATE: {
|
||||
shutdownCmdSent = false;
|
||||
uartManager.initiateUpdateContinuation();
|
||||
plocSupvHelperExecuting = true;
|
||||
return EXECUTION_FINISHED;
|
||||
}
|
||||
case MEMORY_CHECK_WITH_FILE: {
|
||||
shutdownCmdSent = false;
|
||||
UpdateParams params;
|
||||
ReturnValue_t result = extractBaseParams(&data, size, params);
|
||||
if (result != returnvalue::OK) {
|
||||
@ -125,7 +127,6 @@ ReturnValue_t PlocSupervisorHandler::executeAction(ActionId_t actionId,
|
||||
return HasFileSystemIF::FILE_DOES_NOT_EXIST;
|
||||
}
|
||||
uartManager.performMemCheck(params.file, params.memId, params.startAddr);
|
||||
plocSupvHelperExecuting = true;
|
||||
return EXECUTION_FINISHED;
|
||||
}
|
||||
default:
|
||||
@ -777,7 +778,6 @@ void PlocSupervisorHandler::handleEvent(EventMessage* eventMessage) {
|
||||
Event event = eventMessage->getEvent();
|
||||
switch (objectId) {
|
||||
case objects::PLOC_SUPERVISOR_HELPER: {
|
||||
plocSupvHelperExecuting = false;
|
||||
// After execution of update procedure, PLOC is in a state where it draws approx. 700 mA of
|
||||
// current. To leave this state the shutdown MPSoC command must be sent here.
|
||||
if (event == PlocSupvUartManager::SUPV_UPDATE_FAILED ||
|
||||
@ -786,13 +786,18 @@ void PlocSupervisorHandler::handleEvent(EventMessage* eventMessage) {
|
||||
event == PlocSupvUartManager::SUPV_CONTINUE_UPDATE_SUCCESSFUL ||
|
||||
event == PlocSupvUartManager::SUPV_MEM_CHECK_FAIL ||
|
||||
event == PlocSupvUartManager::SUPV_MEM_CHECK_OK) {
|
||||
result = this->executeAction(supv::SHUTDOWN_MPSOC, NO_COMMANDER, nullptr, 0);
|
||||
if (result != returnvalue::OK) {
|
||||
triggerEvent(SUPV_MPSOC_SHUWDOWN_BUILD_FAILED);
|
||||
sif::warning << "PlocSupervisorHandler::handleEvent: Failed to build MPSoC shutdown "
|
||||
"command"
|
||||
<< std::endl;
|
||||
return;
|
||||
// Wait for a short period for the uart state machine to adjust
|
||||
// TaskFactory::delayTask(5);
|
||||
if (not shutdownCmdSent) {
|
||||
shutdownCmdSent = true;
|
||||
result = this->executeAction(supv::SHUTDOWN_MPSOC, NO_COMMANDER, nullptr, 0);
|
||||
if (result != returnvalue::OK) {
|
||||
triggerEvent(SUPV_MPSOC_SHUTDOWN_BUILD_FAILED);
|
||||
sif::warning << "PlocSupervisorHandler::handleEvent: Failed to build MPSoC shutdown "
|
||||
"command"
|
||||
<< std::endl;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -1217,14 +1222,6 @@ size_t PlocSupervisorHandler::getNextReplyLength(DeviceCommandId_t commandId) {
|
||||
return replyLen;
|
||||
}
|
||||
|
||||
ReturnValue_t PlocSupervisorHandler::doSendReadHook() {
|
||||
// Prevent DHB from polling UART during commands executed by the supervisor helper task
|
||||
if (plocSupvHelperExecuting) {
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
void PlocSupervisorHandler::doOffActivity() {}
|
||||
|
||||
void PlocSupervisorHandler::handleDeviceTm(const uint8_t* data, size_t dataSize,
|
||||
|
Reference in New Issue
Block a user