this is overengineered af
Some checks failed
EIVE/eive-obsw/pipeline/pr-main There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/pr-main There was a failure building this commit
This commit is contained in:
parent
40ee5ddade
commit
f8a7179de6
@ -44,7 +44,12 @@ ReturnValue_t PowerController::getParameter(uint8_t domainId, uint8_t parameterI
|
|||||||
parameterWrapper->set(batteryMaximumCapacity);
|
parameterWrapper->set(batteryMaximumCapacity);
|
||||||
break;
|
break;
|
||||||
case 0x2:
|
case 0x2:
|
||||||
|
float oldCoulombCounterVoltageUpperThreshold = coulombCounterVoltageUpperThreshold;
|
||||||
parameterWrapper->set(coulombCounterVoltageUpperThreshold);
|
parameterWrapper->set(coulombCounterVoltageUpperThreshold);
|
||||||
|
ReturnValue_t result = calculateCoulombCounterChargeUpperThreshold();
|
||||||
|
if (result != returnvalue::OK) {
|
||||||
|
coulombCounterVoltageUpperThreshold = oldCoulombCounterVoltageUpperThreshold;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 0x3:
|
case 0x3:
|
||||||
parameterWrapper->set(maxAllowedTimeDiff);
|
parameterWrapper->set(maxAllowedTimeDiff);
|
||||||
@ -68,6 +73,13 @@ void PowerController::performControlOperation() {
|
|||||||
}
|
}
|
||||||
case InternalState::INITIAL_DELAY: {
|
case InternalState::INITIAL_DELAY: {
|
||||||
if (initialCountdown.hasTimedOut()) {
|
if (initialCountdown.hasTimedOut()) {
|
||||||
|
internalState = InternalState::INIT;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
case InternalState::INIT: {
|
||||||
|
ReturnValue_t result = calculateCoulombCounterChargeUpperThreshold();
|
||||||
|
if (result == returnvalue::OK) {
|
||||||
internalState = InternalState::READY;
|
internalState = InternalState::READY;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -27,7 +27,7 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM
|
|||||||
bool enableHkSets = false;
|
bool enableHkSets = false;
|
||||||
ParameterHelper parameterHelper;
|
ParameterHelper parameterHelper;
|
||||||
|
|
||||||
enum class InternalState { STARTUP, INITIAL_DELAY, READY };
|
enum class InternalState { STARTUP, INITIAL_DELAY, INIT, READY };
|
||||||
InternalState internalState = InternalState::STARTUP;
|
InternalState internalState = InternalState::STARTUP;
|
||||||
|
|
||||||
// Initial delay to make sure all pool variables have been initialized their owners
|
// Initial delay to make sure all pool variables have been initialized their owners
|
||||||
|
Loading…
Reference in New Issue
Block a user