From f98c683cd339b3d9357a7bd7d32d53c19ddfba5c Mon Sep 17 00:00:00 2001 From: Martin Vladic Date: Mon, 18 Jan 2021 16:20:03 +0100 Subject: [PATCH] calibration fixes --- src/eez/modules/psu/calibration.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/eez/modules/psu/calibration.cpp b/src/eez/modules/psu/calibration.cpp index 94a210630..ea48cb357 100644 --- a/src/eez/modules/psu/calibration.cpp +++ b/src/eez/modules/psu/calibration.cpp @@ -130,9 +130,11 @@ float Value::getDacValue() { bool Value::readAdcValue(float &adcValue, int *err) { Channel *channel = Channel::getBySlotIndex(editor.m_slotIndex, editor.m_subchannelIndex); - return channel ? - (type == CALIBRATION_VALUE_U ? channel->u.mon_last : channel->i.mon_last) : - g_slots[editor.m_slotIndex]->calibrationReadAdcValue(editor.m_subchannelIndex, adcValue, err); + if (channel) { + adcValue = type == CALIBRATION_VALUE_U ? channel->u.mon_last : channel->i.mon_last; + return true; + } + return g_slots[editor.m_slotIndex]->calibrationReadAdcValue(editor.m_subchannelIndex, adcValue, err); } bool Value::checkValueAndAdc(float value, float adc) { @@ -379,8 +381,6 @@ void CalibrationEditor::doStart() { profile::saveToLocation(10); profile::setFreezeState(true); - reset(); - selectCurrentRange(0); m_enabled = true;