ploc mpsoc mode change soc check
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good

This commit is contained in:
Marius Eggert 2023-09-29 15:33:09 +02:00
parent 2966ee5005
commit cbfcee0b1c
2 changed files with 18 additions and 0 deletions

View File

@ -1505,3 +1505,16 @@ void PlocMpsocHandler::cmdDoneHandler(bool success, ReturnValue_t result) {
} }
disableAllReplies(); disableAllReplies();
} }
ReturnValue_t PlocMpsocHandler::checkModeCommand(Mode_t commandedMode, Submode_t commandedSubmode,
uint32_t* msToReachTheMode) {
if (commandedMode != MODE_OFF) {
PoolReadGuard pg(&enablePl);
if (pg.getReadResult() == returnvalue::OK) {
if (enablePl.plUseAllowed.isValid() and not enablePl.plUseAllowed.value) {
return NON_OP_SOC;
}
}
}
return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, msToReachTheMode);
}

View File

@ -5,6 +5,7 @@
#include <linux/payload/mpsocRetvals.h> #include <linux/payload/mpsocRetvals.h>
#include <linux/payload/plocMpsocHelpers.h> #include <linux/payload/plocMpsocHelpers.h>
#include <linux/payload/plocSupvDefs.h> #include <linux/payload/plocSupvDefs.h>
#include <mission/controller/controllerdefinitions/PowerCtrlDefinitions.h>
#include <string> #include <string>
@ -309,6 +310,10 @@ class PlocMpsocHandler : public DeviceHandlerBase, public CommandsActionsIF {
void stopSpecialComHelper(); void stopSpecialComHelper();
void handleActionCommandFailure(ActionId_t actionId); void handleActionCommandFailure(ActionId_t actionId);
pwrctrl::EnablePl enablePl = pwrctrl::EnablePl(objects::POWER_CONTROLLER);
ReturnValue_t checkModeCommand(Mode_t commandedMode, Submode_t commandedSubmode,
uint32_t* msToReachTheMode) override;
}; };
#endif /* BSP_Q7S_DEVICES_PLOC_PLOCMPSOCHANDLER_H_ */ #endif /* BSP_Q7S_DEVICES_PLOC_PLOCMPSOCHANDLER_H_ */