fixed conflicts
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit

This commit is contained in:
2022-04-28 18:33:27 +02:00
25 changed files with 1243 additions and 896 deletions

View File

@ -344,6 +344,11 @@ ReturnValue_t PlocSupervisorHandler::buildCommandFromCommand(DeviceCommandId_t d
result = RETURN_OK;
break;
}
case RESET_PL: {
prepareEmptyCmd(APID_RESET_PL);
result = RETURN_OK;
break;
}
default:
sif::debug << "PlocSupervisorHandler::buildCommandFromCommand: Command not implemented"
<< std::endl;
@ -399,10 +404,11 @@ void PlocSupervisorHandler::fillCommandAndReplyMap() {
this->insertInCommandMap(LOGGING_REQUEST_COUNTERS);
this->insertInCommandMap(LOGGING_CLEAR_COUNTERS);
this->insertInCommandMap(LOGGING_SET_TOPIC);
this->insertInCommandMap(RESET_PL);
this->insertInCommandAndReplyMap(FIRST_MRAM_DUMP, 3);
this->insertInCommandAndReplyMap(CONSECUTIVE_MRAM_DUMP, 3);
this->insertInReplyMap(ACK_REPORT, 3, nullptr, SIZE_ACK_REPORT);
this->insertInReplyMap(EXE_REPORT, 50, nullptr, SIZE_EXE_REPORT);
this->insertInReplyMap(EXE_REPORT, 0, nullptr, SIZE_EXE_REPORT, false, &executionTimeout);
this->insertInReplyMap(HK_REPORT, 3, &hkset, SIZE_HK_REPORT);
this->insertInReplyMap(BOOT_STATUS_REPORT, 3, &bootStatusReport, SIZE_BOOT_STATUS_REPORT);
this->insertInReplyMap(LATCHUP_REPORT, 3, &latchupStatusReport, SIZE_LATCHUP_STATUS_REPORT);
@ -521,6 +527,7 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite
case DISABLE_AUTO_TM:
case LOGGING_CLEAR_COUNTERS:
case LOGGING_SET_TOPIC:
case RESET_PL:
enabledReplies = 2;
break;
default:
@ -546,6 +553,8 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite
<< " not in replyMap" << std::endl;
}
setExecutionTimeout(command->first);
return RETURN_OK;
}
@ -769,10 +778,24 @@ ReturnValue_t PlocSupervisorHandler::initializeLocalDataPool(localpool::DataPool
}
void PlocSupervisorHandler::handleEvent(EventMessage* eventMessage) {
ReturnValue_t result = RETURN_OK;
object_id_t objectId = eventMessage->getReporter();
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 == PlocSupvHelper::SUPV_UPDATE_FAILED ||
event == PlocSupvHelper::SUPV_UPDATE_SUCCESSFUL) {
result = this->executeAction(supv::SHUTDOWN_MPSOC, NO_COMMANDER, nullptr, 0);
if (result != RETURN_OK) {
triggerEvent(SUPV_MPSOC_SHUWDOWN_BUILD_FAILED);
sif::warning << "PlocSupervisorHandler::handleEvent: Failed to build MPSoC shutdown "
"command" << std::endl;
return;
}
}
break;
}
default:
@ -781,6 +804,19 @@ void PlocSupervisorHandler::handleEvent(EventMessage* eventMessage) {
}
}
void PlocSupervisorHandler::setExecutionTimeout(DeviceCommandId_t command) {
using namespace supv;
switch(command) {
case FIRST_MRAM_DUMP:
case CONSECUTIVE_MRAM_DUMP:
executionTimeout.setTimeout(MRAM_DUMP_EXECUTION_TIMEOUT);
break;
default:
executionTimeout.setTimeout(EXECUTION_DEFAULT_TIMEOUT);
break;
}
}
ReturnValue_t PlocSupervisorHandler::verifyPacket(const uint8_t* start, size_t foundLen) {
uint16_t receivedCrc = *(start + foundLen - 2) << 8 | *(start + foundLen - 1);
uint16_t recalculatedCrc = CRC::crc16ccitt(start, foundLen - 2);
@ -1223,7 +1259,8 @@ size_t PlocSupervisorHandler::getNextReplyLength(DeviceCommandId_t commandId) {
DeviceReplyIter iter = deviceReplyMap.find(nextReplyId);
if (iter != deviceReplyMap.end()) {
if (iter->second.delayCycles == 0) {
if ((iter->second.delayCycles == 0 && iter->second.countdown == nullptr) ||
(not iter->second.active && iter->second.countdown != nullptr)) {
/* Reply inactive */
return replyLen;
}