diff --git a/linux/devices/ploc/PlocMPSoCHandler.cpp b/linux/devices/ploc/PlocMPSoCHandler.cpp index 0d943cc2..f1430580 100644 --- a/linux/devices/ploc/PlocMPSoCHandler.cpp +++ b/linux/devices/ploc/PlocMPSoCHandler.cpp @@ -830,6 +830,14 @@ size_t PlocMPSoCHandler::getNextReplyLength(DeviceCommandId_t commandId) { return replyLen; } +ReturnValue_t PlocMPSoCHandler::doSendReadHook() { + // Prevent DHB from polling UART during commands executed by the mpsoc helper task + if (plocMPSoCHelperExecuting) { + return RETURN_FAILED; + } + return RETURN_OK; +} + MessageQueueIF* PlocMPSoCHandler::getCommandQueuePtr() { return commandActionHelperQueue; } void PlocMPSoCHandler::stepSuccessfulReceived(ActionId_t actionId, uint8_t step) { return; } @@ -840,12 +848,13 @@ void PlocMPSoCHandler::stepFailedReceived(ActionId_t actionId, uint8_t step, case supv::START_MPSOC: sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to start MPSoC" << std::endl; powerState = PowerState::OFF; + setMode(_MODE_SHUT_DOWN); break; case supv::SHUTDOWN_MPSOC: triggerEvent(MPSOC_SHUTDOWN_FAILED); sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to shutdown MPSoC" << std::endl; - // TODO: Setting state to on or off here? - powerState = PowerState::ON; + // FDIR will intercept event and switch PLOC power off + powerState = PowerState::OFF; break; default: sif::debug << "PlocMPSoCHandler::stepFailedReceived: Received unexpected action reply" diff --git a/linux/devices/ploc/PlocMPSoCHandler.h b/linux/devices/ploc/PlocMPSoCHandler.h index d5ea231b..92b5d03f 100644 --- a/linux/devices/ploc/PlocMPSoCHandler.h +++ b/linux/devices/ploc/PlocMPSoCHandler.h @@ -76,6 +76,7 @@ class PlocMPSoCHandler : public DeviceHandlerBase, public CommandsActionsIF { uint8_t expectedReplies = 1, bool useAlternateId = false, DeviceCommandId_t alternateReplyID = 0) override; size_t getNextReplyLength(DeviceCommandId_t deviceCommand) override; + virtual ReturnValue_t doSendReadHook() override; private: static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PLOC_MPSOC_HANDLER;