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

improve psu startup checks

parent 8719717b
No related branches found
No related tags found
No related merge requests found
......@@ -58,9 +58,15 @@ bool Expirament::preparePsu()
std::this_thread::sleep_for(std::chrono::seconds(2));
ret = psu->getStatus(status);
if(!ret || status.curent_limited)
if(!ret)
{
Log(Log::ERROR)<<"Unable to read psu state, abort";
psu->setEnabled(false);
return false;
}
else if(status.curent_limited)
{
Log(Log::ERROR)<<"Psu is overcurrent, abort";
Log(Log::ERROR)<<"Psu is overcurrent at "<<status.current<<" abort";
psu->setEnabled(false);
return false;
}
......
......@@ -53,9 +53,16 @@ bool preparePsu(Vcpps* psu, float voltage, float current)
std::this_thread::sleep_for(std::chrono::seconds(2));
ret = psu->getStatus(status);
if(!ret || status.curent_limited)
ret = psu->getStatus(status);
if(!ret)
{
Log(Log::ERROR)<<"Unable to read psu state, abort";
psu->setEnabled(false);
return false;
}
else if(status.curent_limited)
{
Log(Log::ERROR, true, false)<<"Psu is overcurrent, abort";
Log(Log::ERROR)<<"Psu is overcurrent at "<<status.current<<" abort";
psu->setEnabled(false);
return false;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment