Skip to content

Commit

Permalink
DAC test cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Jan 13, 2020
1 parent 837dd44 commit 4b0b2fc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
20 changes: 0 additions & 20 deletions src/eez/modules/dcpX05/dac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,28 +73,15 @@ bool DigitalAnalogConverter::test(IOExpander &ioexp, AnalogDigitalConverter &adc

m_testing = true;

bool wasCalibrationEnabled = channel.isCalibrationEnabled();
channel.calibrationEnableNoEvent(false);

// disable OE on channel
if (channel.params.features & CH_FEATURE_HW_OVP) {
// OVP has to be disabled before OE deactivation
ioexp.changeBit(IOExpander::DCP405_IO_BIT_OUT_OVP_ENABLE, false);
}
ioexp.changeBit(IOExpander::IO_BIT_OUT_OUTPUT_ENABLE, false);

// set U on DAC and check it on ADC
float uSet = channel.u.max / 2;
float iSet = channel.i.max / 2;

float wasUSet = channel.u.set;
channel.setVoltage(uSet);

float wasISet = channel.i.set;
channel.setCurrent(iSet);

delay(200);

channel.adcMeasureMonDac();

float uMon = channel.u.mon_dac_last;
Expand All @@ -111,13 +98,6 @@ bool DigitalAnalogConverter::test(IOExpander &ioexp, AnalogDigitalConverter &adc
DebugTrace("Ch%d DAC test, I_set failure: expected=%g, got=%g, abs diff=%g\n", channel.channelIndex + 1, iSet, iMon, iDiff);
}

if (wasCalibrationEnabled) {
channel.calibrationEnableNoEvent(true);
}

channel.setVoltage(wasUSet);
channel.setCurrent(wasISet);

if (g_testResult == TEST_FAILED) {
generateError(SCPI_ERROR_CH1_DAC_TEST_FAILED + channel.channelIndex);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="com.atollic.truestudio.mbs.GCCSpecsDetectorAtollicArm" console="false" env-hash="1195080111794097953" id="com.atollic.truestudio.mbs.provider" keep-relative-paths="false" name="Atollic ARM Tools Language Settings" parameter="${COMMAND} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="com.atollic.truestudio.mbs.GCCSpecsDetectorAtollicArm" console="false" env-hash="1882069544101406914" id="com.atollic.truestudio.mbs.provider" keep-relative-paths="false" name="Atollic ARM Tools Language Settings" parameter="${COMMAND} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand Down

0 comments on commit 4b0b2fc

Please sign in to comment.