Skip to content

Commit

Permalink
when INH show all mon values as zero
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Nov 15, 2019
1 parent a3d9145 commit 1bbd0ad
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/eez/modules/psu/channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ void Channel::Value::resetMonValues() {
}

void Channel::Value::addMonValue(float value, float prec) {
if (io_pins::isInhibited()) {
value = 0;
}
value = roundPrec(value, prec);

mon_last = value;
Expand All @@ -85,7 +88,7 @@ void Channel::Value::addMonValue(float value, float prec) {
mon_total += value;
mon_arr[mon_index] = value;
mon_index = (mon_index + 1) % NUM_ADC_AVERAGING_VALUES;
mon = roundPrec(mon_total / NUM_ADC_AVERAGING_VALUES, prec);
mon = io_pins::isInhibited() ? 0 : roundPrec(mon_total / NUM_ADC_AVERAGING_VALUES, prec);
}

mon_measured = true;
Expand Down

0 comments on commit 1bbd0ad

Please sign in to comment.