Skip to content

Commit

Permalink
Fix: Victron MPPT: be happy with at least one that delivers valid data (
Browse files Browse the repository at this point in the history
  • Loading branch information
SW-Niko authored Jul 21, 2024
1 parent 5fee069 commit 415c767
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/VictronMppt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,16 @@ void VictronMpptClass::loop()
}
}

/*
* isDataValid()
* return: true = if at least one of the MPPT controllers delivers valid data
*/
bool VictronMpptClass::isDataValid() const
{
std::lock_guard<std::mutex> lock(_mutex);

for (auto const& upController: _controllers) {
if (!upController->isDataValid()) { return false; }
if (upController->isDataValid()) { return true; }
}

return !_controllers.empty();
Expand Down

0 comments on commit 415c767

Please sign in to comment.