add 3v3 stack switching
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:
@ -28,25 +28,35 @@ ReturnValue_t PcduHandler::performOperation(uint8_t counter) {
|
||||
if (counter == DeviceHandlerIF::PERFORM_OPERATION) {
|
||||
readCommandQueue();
|
||||
}
|
||||
uint8_t switchState = 0;
|
||||
uint8_t switchState5V = 0;
|
||||
uint8_t switchState3V3 = 0;
|
||||
{
|
||||
PoolReadGuard pg(&p60CoreHk.outputEnables);
|
||||
if (pg.getReadResult() == returnvalue::OK) {
|
||||
switchState = p60CoreHk.outputEnables.value[10];
|
||||
switchState5V = p60CoreHk.outputEnables.value[P60Dock::hk::STACK_5V];
|
||||
switchState3V3 = p60CoreHk.outputEnables.value[P60Dock::hk::STACK_3V3];
|
||||
} else {
|
||||
return returnvalue::OK;
|
||||
}
|
||||
}
|
||||
{
|
||||
PoolReadGuard pg(&switcherSet.p60Dock5VStack);
|
||||
PoolReadGuard pg(&switcherSet);
|
||||
if (pg.getReadResult() == returnvalue::OK) {
|
||||
if (switcherSet.p60Dock5VStack.value != switchState) {
|
||||
triggerEvent(power::SWITCH_HAS_CHANGED, switchState, power::Switches::P60_DOCK_5V_STACK);
|
||||
if (switcherSet.p60Dock5VStack.value != switchState5V) {
|
||||
triggerEvent(power::SWITCH_HAS_CHANGED, switchState5V, power::Switches::P60_DOCK_5V_STACK);
|
||||
MutexGuard mg(pwrLock, LOCK_TYPE, LOCK_TIMEOUT, LOCK_CTX);
|
||||
switchStates[power::P60_DOCK_5V_STACK] = switchState;
|
||||
switchStates[power::P60_DOCK_5V_STACK] = switchState5V;
|
||||
}
|
||||
if (switcherSet.p60Dock3V3Stack.value != switchState3V3) {
|
||||
triggerEvent(power::SWITCH_HAS_CHANGED, switchState3V3,
|
||||
power::Switches::P60_DOCK_3V3_STACK);
|
||||
MutexGuard mg(pwrLock, LOCK_TYPE, LOCK_TIMEOUT, LOCK_CTX);
|
||||
switchStates[power::P60_DOCK_3V3_STACK] = switchState3V3;
|
||||
}
|
||||
switcherSet.p60Dock5VStack.setValid(true);
|
||||
switcherSet.p60Dock5VStack.value = switchState;
|
||||
switcherSet.p60Dock5VStack.value = switchState5V;
|
||||
switcherSet.p60Dock3V3Stack.setValid(true);
|
||||
switcherSet.p60Dock3V3Stack.value = switchState3V3;
|
||||
}
|
||||
}
|
||||
return returnvalue::OK;
|
||||
@ -353,6 +363,11 @@ ReturnValue_t PcduHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t onO
|
||||
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::P60DOCK_HANDLER);
|
||||
break;
|
||||
}
|
||||
case power::P60_DOCK_3V3_STACK: {
|
||||
memoryAddress = P60Dock::CONFIG_ADDRESS_OUT_EN_3V3_STACK;
|
||||
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::P60DOCK_HANDLER);
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
sif::error << "PCDUHandler::sendSwitchCommand: Invalid switch number " << std::endl;
|
||||
@ -430,7 +445,8 @@ ReturnValue_t PcduHandler::initializeLocalDataPool(localpool::DataPool& localDat
|
||||
using namespace pcdu;
|
||||
localDataPoolMap.emplace(PoolIds::PDU1_SWITCHES, &pdu1Switches);
|
||||
localDataPoolMap.emplace(PoolIds::PDU2_SWITCHES, &pdu2Switches);
|
||||
localDataPoolMap.emplace(PoolIds::P60DOCK_SWITCHES, &p60Dock5VSwitch);
|
||||
localDataPoolMap.emplace(PoolIds::P60DOCK_5V, &p60Dock5VSwitch);
|
||||
localDataPoolMap.emplace(PoolIds::P60DOCK_3V3, &p60Dock3V3Switch);
|
||||
poolManager.subscribeForDiagPeriodicPacket(
|
||||
subdp::DiagnosticsHkPeriodicParams(switcherSet.getSid(), false, 5.0));
|
||||
return returnvalue::OK;
|
||||
|
Reference in New Issue
Block a user