SoC Calculator #754

Merged
muellerr merged 74 commits from soc-calculator into main 2023-10-11 10:50:48 +02:00
Showing only changes of commit 98a1ce5380 - Show all commits

View File

@ -44,12 +44,17 @@ ReturnValue_t PowerController::getParameter(uint8_t domainId, uint8_t parameterI
break;
case 0x2: {
float oldCoulombCounterVoltageUpperThreshold = coulombCounterVoltageUpperThreshold;
parameterWrapper->set(coulombCounterVoltageUpperThreshold);
ReturnValue_t result = calculateCoulombCounterChargeUpperThreshold();
ReturnValue_t result = newValues->getElement(&coulombCounterVoltageUpperThreshold);
if (result != returnvalue::OK) {
coulombCounterVoltageUpperThreshold = oldCoulombCounterVoltageUpperThreshold;
return returnvalue::FAILED;
return result;
}
result = calculateCoulombCounterChargeUpperThreshold();
if (result != returnvalue::OK) {
coulombCounterVoltageUpperThreshold = oldCoulombCounterVoltageUpperThreshold;
return result;
}
// parameterWrapper->set(coulombCounterVoltageUpperThreshold);
break;
}
case 0x3:
@ -230,6 +235,11 @@ void PowerController::calculateStateOfCharge() {
}
void PowerController::watchStateOfCharge() {
if (test < 100) {
test++;
} else if (test == 100) {
// pwrCtrlCoreHk.coulombCounterCharge.value = 0.7;
}
if (pwrCtrlCoreHk.coulombCounterCharge.isValid()) {
if (pwrCtrlCoreHk.coulombCounterCharge.value < payloadOpLimitOn) {
PoolReadGuard pg(&enablePl);