pwr ctrl fdir
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good

This commit is contained in:
2023-09-27 14:46:45 +02:00
parent 1973bd2c5b
commit c486bb2cf3
3 changed files with 31 additions and 1 deletions

View File

@ -54,6 +54,12 @@ ReturnValue_t PowerController::getParameter(uint8_t domainId, uint8_t parameterI
case 0x3:
parameterWrapper->set(maxAllowedTimeDiff);
break;
case 0x4:
parameterWrapper->set(payloadLimit);
break;
case 0x5:
parameterWrapper->set(higherModesLimit);
break;
default:
return INVALID_IDENTIFIER_ID;
}
@ -213,7 +219,20 @@ void PowerController::calculateStateOfCharge() {
}
void PowerController::watchStateOfCharge() {
// ToDo: FDIR
if (pwrCtrlCoreHk.coulombCounterCharge.isValid()) {
if (not pwrLvlLowFlag and pwrCtrlCoreHk.coulombCounterCharge.value < payloadLimit) {
triggerEvent(power::POWER_LEVEL_LOW);
pwrLvlLowFlag = true;
} else {
pwrLvlLowFlag = false;
}
if (not pwrLvlCriticalFlag and pwrCtrlCoreHk.coulombCounterCharge.value < higherModesLimit) {
triggerEvent(power::POWER_LEVEL_CRITICAL);
pwrLvlCriticalFlag = true;
} else {
pwrLvlCriticalFlag = false;
}
}
}
ReturnValue_t PowerController::calculateOpenCircuitVoltageCharge() {