this is more correct
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good

This commit is contained in:
Robin Müller 2023-08-03 10:16:11 +02:00
parent 6f8ad08e9b
commit 7c3329abb2
Signed by: muellerr
GPG Key ID: A649FB78196E3849

View File

@ -419,33 +419,13 @@ void PayloadPcduHandler::checkAdcValues() {
return; return;
} }
// Now check against voltage and current limits. // Now check against voltage and current limits.
uint8_t submode = getSubmode();
if (((submode >> NormalSubmodeBits::DRO_ON) & 0b1) == 0b1) {
if (ssrToDroInjectionRequested) { if (ssrToDroInjectionRequested) {
handleFailureInjection("SSR to DRO", NEG_V_OUT_OF_BOUNDS); handleFailureInjection("SSR to DRO", NEG_V_OUT_OF_BOUNDS);
ssrToDroInjectionRequested = false; ssrToDroInjectionRequested = false;
return; return;
} }
if (droToX8InjectionRequested) {
handleFailureInjection("X8 to TX", U_X8_OUT_OF_BOUNDS);
droToX8InjectionRequested = false;
return;
}
if (txToMpaInjectionRequested) {
handleFailureInjection("TX to MPA", U_TX_OUT_OF_BOUNDS);
txToMpaInjectionRequested = false;
return;
}
if (mpaToHpaInjectionRequested) {
handleFailureInjection("MPA to HPA", U_HPA_OUT_OF_BOUNDS);
mpaToHpaInjectionRequested = false;
return;
}
if (allOnInjectRequested) {
handleFailureInjection("All On", U_HPA_OUT_OF_BOUNDS);
allOnInjectRequested = false;
return;
}
uint8_t submode = getSubmode();
if (((submode >> NormalSubmodeBits::DRO_ON) & 0b1) == 0b1) {
params.getValue(PARAM_KEY_MAP[NEG_V_LOWER_BOUND], lowerBound); params.getValue(PARAM_KEY_MAP[NEG_V_LOWER_BOUND], lowerBound);
params.getValue(PARAM_KEY_MAP[NEG_V_UPPER_BOUND], upperBound); params.getValue(PARAM_KEY_MAP[NEG_V_UPPER_BOUND], upperBound);
if (not checkVoltage(adcSet.processed[U_NEG_V_FB], lowerBound, upperBound, if (not checkVoltage(adcSet.processed[U_NEG_V_FB], lowerBound, upperBound,
@ -468,6 +448,11 @@ void PayloadPcduHandler::checkAdcValues() {
} }
} }
if (((submode >> NormalSubmodeBits::X8_ON) & 0b1) == 0b1) { if (((submode >> NormalSubmodeBits::X8_ON) & 0b1) == 0b1) {
if (droToX8InjectionRequested) {
handleFailureInjection("X8 to TX", U_X8_OUT_OF_BOUNDS);
droToX8InjectionRequested = false;
return;
}
params.getValue(PARAM_KEY_MAP[X8_U_LOWER_BOUND], lowerBound); params.getValue(PARAM_KEY_MAP[X8_U_LOWER_BOUND], lowerBound);
params.getValue(PARAM_KEY_MAP[X8_U_UPPER_BOUND], upperBound); params.getValue(PARAM_KEY_MAP[X8_U_UPPER_BOUND], upperBound);
if (not checkVoltage(adcSet.processed[U_X8_DIV_6], lowerBound, upperBound, if (not checkVoltage(adcSet.processed[U_X8_DIV_6], lowerBound, upperBound,
@ -480,6 +465,11 @@ void PayloadPcduHandler::checkAdcValues() {
} }
} }
if (((submode >> NormalSubmodeBits::TX_ON) & 0b1) == 0b1) { if (((submode >> NormalSubmodeBits::TX_ON) & 0b1) == 0b1) {
if (txToMpaInjectionRequested) {
handleFailureInjection("TX to MPA", U_TX_OUT_OF_BOUNDS);
txToMpaInjectionRequested = false;
return;
}
params.getValue(PARAM_KEY_MAP[TX_U_LOWER_BOUND], lowerBound); params.getValue(PARAM_KEY_MAP[TX_U_LOWER_BOUND], lowerBound);
params.getValue(PARAM_KEY_MAP[TX_U_UPPER_BOUND], upperBound); params.getValue(PARAM_KEY_MAP[TX_U_UPPER_BOUND], upperBound);
if (not checkVoltage(adcSet.processed[U_TX_DIV_6], lowerBound, upperBound, if (not checkVoltage(adcSet.processed[U_TX_DIV_6], lowerBound, upperBound,
@ -492,6 +482,11 @@ void PayloadPcduHandler::checkAdcValues() {
} }
} }
if (((submode >> NormalSubmodeBits::MPA_ON) & 0b1) == 0b1) { if (((submode >> NormalSubmodeBits::MPA_ON) & 0b1) == 0b1) {
if (mpaToHpaInjectionRequested) {
handleFailureInjection("MPA to HPA", U_HPA_OUT_OF_BOUNDS);
mpaToHpaInjectionRequested = false;
return;
}
params.getValue(PARAM_KEY_MAP[MPA_U_LOWER_BOUND], lowerBound); params.getValue(PARAM_KEY_MAP[MPA_U_LOWER_BOUND], lowerBound);
params.getValue(PARAM_KEY_MAP[MPA_U_UPPER_BOUND], upperBound); params.getValue(PARAM_KEY_MAP[MPA_U_UPPER_BOUND], upperBound);
if (not checkVoltage(adcSet.processed[U_MPA_DIV_6], lowerBound, upperBound, if (not checkVoltage(adcSet.processed[U_MPA_DIV_6], lowerBound, upperBound,
@ -504,6 +499,11 @@ void PayloadPcduHandler::checkAdcValues() {
} }
} }
if (((submode >> NormalSubmodeBits::HPA_ON) & 0b1) == 0b1) { if (((submode >> NormalSubmodeBits::HPA_ON) & 0b1) == 0b1) {
if (allOnInjectRequested) {
handleFailureInjection("All On", U_HPA_OUT_OF_BOUNDS);
allOnInjectRequested = false;
return;
}
params.getValue(PARAM_KEY_MAP[HPA_U_LOWER_BOUND], lowerBound); params.getValue(PARAM_KEY_MAP[HPA_U_LOWER_BOUND], lowerBound);
params.getValue(PARAM_KEY_MAP[HPA_U_UPPER_BOUND], upperBound); params.getValue(PARAM_KEY_MAP[HPA_U_UPPER_BOUND], upperBound);
if (not checkVoltage(adcSet.processed[U_HPA_DIV_6], lowerBound, upperBound, if (not checkVoltage(adcSet.processed[U_HPA_DIV_6], lowerBound, upperBound,