DPL limit scaling: prevent division by zero

this check was removed on error when moving the scaling code into its
own function.
This commit is contained in:
Bernhard Kirchen 2024-03-07 21:16:07 +01:00
parent b0795a2131
commit c42d68812c

View File

@ -655,7 +655,7 @@ static int32_t scalePowerLimit(std::shared_ptr<InverterAbstract> inverter, int32
}
}
if (dcProdChnls == dcTotalChnls) { return newLimit; }
if (dcProdChnls == 0 || dcProdChnls == dcTotalChnls) { return newLimit; }
MessageOutput.printf("[DPL::scalePowerLimit] %d channels total, %d producing "
"channels, scaling power limit\r\n", dcTotalChnls, dcProdChnls);