Skip to content
Snippets Groups Projects
Commit e3996d84 authored by Carl Philipp Klemm's avatar Carl Philipp Klemm
Browse files

Print maximum current correctly

parent 8e0e4084
No related branches found
No related tags found
No related merge requests found
......@@ -125,13 +125,13 @@ static void currentMonitorThreadFn(Heaters* heaters, Vcpps* psu, float minVoltag
if(maxCurrent < 255 && !status.curent_limited)
{
maxCurrent = std::min(255, maxCurrent+20);
Log(Log::INFO)<<"Voltage has recovered at "<<status.voltage<<". Max current now: "<<maxCurrent;
Log(Log::INFO)<<"Voltage has recovered at "<<status.voltage<<". Max current now: "<<static_cast<int>(maxCurrent);
heaters->setMaxCurrent(maxCurrent);
}
else if(status.voltage < minVoltage && maxCurrent > 100)
else if(status.voltage < minVoltage && maxCurrent > 100 && status.curent_limited)
{
maxCurrent -= 20;
Log(Log::INFO)<<"Voltage low at "<<status.voltage<<", sheading load. Max current now: "<<maxCurrent;
Log(Log::INFO)<<"Voltage low at "<<status.voltage<<", sheading load. Max current now: "<<static_cast<int>(maxCurrent);
heaters->setMaxCurrent(maxCurrent);
}
std::this_thread::sleep_for(std::chrono::seconds(10));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment