changelog, updates
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
2023-04-05 16:41:49 +02:00
parent 7549a24f6f
commit 36d5f8fd31
5 changed files with 46 additions and 7 deletions

View File

@ -267,12 +267,45 @@ ReturnValue_t AcsBoardAssembly::checkAndHandleHealthStates(Mode_t commandedMode,
HealthState h1 = healthHelper.healthTable->getHealth(o1);
HealthState h2 = healthHelper.healthTable->getHealth(o2);
HealthState h3 = healthHelper.healthTable->getHealth(o3);
// All device are faulty or permanent faulty, but this is a safe mode assembly, so we need
// to restore the devices.
if ((h0 == FAULTY or h0 == PERMANENT_FAULTY) and (h1 == FAULTY or h1 == PERMANENT_FAULTY) and
(h2 == FAULTY or h2 == PERMANENT_FAULTY) and (h3 == FAULTY or h3 == PERMANENT_FAULTY)) {
overwriteDeviceHealth(o0, h0);
overwriteDeviceHealth(o1, h1);
overwriteDeviceHealth(o2, h2);
overwriteDeviceHealth(o3, h3);
uint8_t numPermFaulty = 0;
if (h0 == PERMANENT_FAULTY) {
numPermFaulty++;
}
if (h1 == PERMANENT_FAULTY) {
numPermFaulty++;
}
if (h2 == PERMANENT_FAULTY) {
numPermFaulty++;
}
if (h3 == PERMANENT_FAULTY) {
numPermFaulty++;
}
if (numPermFaulty < 4) {
// Some are faulty and some are permanent faulty, so only set faulty ones to
// EXTERNAL_CONTROL.
if (h0 == FAULTY) {
overwriteDeviceHealth(o0, h0);
}
if (h1 == FAULTY) {
overwriteDeviceHealth(o0, h0);
}
if (h2 == FAULTY) {
overwriteDeviceHealth(o0, h0);
}
if (h3 == FAULTY) {
overwriteDeviceHealth(o0, h0);
}
} else {
// All permanent faulty, so set all to EXTERNAL_CONTROL
overwriteDeviceHealth(o0, h0);
overwriteDeviceHealth(o1, h1);
overwriteDeviceHealth(o2, h2);
overwriteDeviceHealth(o3, h3);
}
healthNeedsToBeOverwritten = true;
}
if (h0 == EXTERNAL_CONTROL or h1 == EXTERNAL_CONTROL or h2 == EXTERNAL_CONTROL or