Skip to content

Commit

Permalink
current limit on fan or temp failure fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Jan 30, 2020
1 parent 1ce1b51 commit 2df4502
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
6 changes: 1 addition & 5 deletions src/eez/modules/psu/channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1447,12 +1447,8 @@ void Channel::limitMaxCurrent(MaxCurrentLimitCause cause) {
maxCurrentLimitCause = cause;

if (isMaxCurrentLimited()) {
if (isOutputEnabled() && i.mon_last > ERR_MAX_CURRENT) {
setCurrent(0);
}

if (i.limit > ERR_MAX_CURRENT) {
setCurrentLimit(ERR_MAX_CURRENT);
channel_dispatcher::setCurrentLimit(*this, ERR_MAX_CURRENT);
}
}
}
Expand Down
9 changes: 2 additions & 7 deletions src/eez/modules/psu/psu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -798,13 +798,8 @@ void limitMaxCurrent(MaxCurrentLimitCause cause) {

if (isMaxCurrentLimited()) {
for (int i = 0; i < CH_NUM; ++i) {
if (Channel::get(i).isOutputEnabled() &&
Channel::get(i).i.mon_last > ERR_MAX_CURRENT) {
Channel::get(i).setCurrent(Channel::get(i).i.min);
}

if (ERR_MAX_CURRENT < Channel::get(i).getCurrentLimit()) {
Channel::get(i).setCurrentLimit(ERR_MAX_CURRENT);
if (Channel::get(i).getCurrentLimit() > ERR_MAX_CURRENT) {
channel_dispatcher::setCurrentLimit(Channel::get(i), ERR_MAX_CURRENT);
}
}
}
Expand Down

0 comments on commit 2df4502

Please sign in to comment.