Skip to content

Commit

Permalink
#34
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Jun 1, 2020
1 parent 69a9d4b commit f90541e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/eez/modules/dcp405/channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ struct DcpChannel : public Channel {
prot_conf.flags.u_hwOvpDeactivated = 0; // this flag should be 0 while fallingEdge is true
ioexp.changeBit(IOExpander::IO_BIT_OUT_OVP_ENABLE, false);
}
} else if (belowThreshold) {
} else if (belowThreshold) {
if (isHwOvpEnabled(*this)) {
// deactivate HW OVP
prot_conf.flags.u_hwOvpDeactivated = 1;
Expand Down
5 changes: 3 additions & 2 deletions src/eez/modules/psu/channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,14 +478,15 @@ void Channel::enterOvpProtection() {

float Channel::getSwOvpProtectionLevel() {
if (prot_conf.flags.u_type) {
return channel_dispatcher::getUSet(*this) * 1.03f; // 3%
const float CONF_MIN_SW_OVP_PROTECTION_LEVEL = 0.35f; // 350 mV
return MAX(channel_dispatcher::getUSet(*this) * 1.03f, CONF_MIN_SW_OVP_PROTECTION_LEVEL); // 3%
}
return channel_dispatcher::getUProtectionLevel(*this);
}

bool Channel::checkSwOvpCondition() {
float uProtectionLevel = getSwOvpProtectionLevel();
return channel_dispatcher::getUMonLast(*this) >= uProtectionLevel || (flags.rprogEnabled && channel_dispatcher::getUMonDacLast(*this) >= uProtectionLevel);
return channel_dispatcher::getUMonLast(*this) > uProtectionLevel || (flags.rprogEnabled && channel_dispatcher::getUMonDacLast(*this) > uProtectionLevel);
}

void Channel::protectionCheck(ProtectionValue &cpv) {
Expand Down

0 comments on commit f90541e

Please sign in to comment.