Skip to content

Commit

Permalink
#84
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Oct 21, 2020
1 parent 30180af commit 5594861
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/eez/modules/dib-dcp405/dib-dcp405.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include <eez/modules/dib-dcp405/dac.h>
#include <eez/modules/dib-dcp405/ioexp.h>

#include <eez/unit.h>

#include <eez/modules/psu/psu.h>
#include <eez/modules/psu/debug.h>
#include <eez/modules/psu/profile.h>
Expand Down Expand Up @@ -771,7 +773,14 @@ struct DcpChannel : public Channel {
dcpChannel.uBeforeBalancing = channel.u.set;
}
dcpChannel.valueBalancing = true;
channel.doSetVoltage((psu::Channel::get(0).u.mon_last + psu::Channel::get(1).u.mon_last) / 2);

channel.doSetVoltage(
channel.roundChannelValue(
UNIT_VOLT,
(psu::Channel::get(0).u.mon_last + psu::Channel::get(1).u.mon_last) / 2
)
);

dcpChannel.valueBalancing = false;
}

Expand All @@ -781,7 +790,14 @@ struct DcpChannel : public Channel {
dcpChannel.iBeforeBalancing = channel.i.set;
}
dcpChannel.valueBalancing = true;
channel.doSetCurrent((psu::Channel::get(0).i.mon_last + psu::Channel::get(1).i.mon_last) / 2);

channel.doSetCurrent(
channel.roundChannelValue(
UNIT_AMPER,
(psu::Channel::get(0).i.mon_last + psu::Channel::get(1).i.mon_last) / 2
)
);

dcpChannel.valueBalancing = false;
}

Expand Down

0 comments on commit 5594861

Please sign in to comment.