Skip to content

Commit

Permalink
mio168 cal fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Jan 14, 2021
1 parent 708fc66 commit 10bb6b7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/eez/modules/dib-mio168/dib-mio168.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ struct AinChannel {
}

float getValue() {
return roundPrec(calConf[getCalConfIndex()].toCalibratedValue(m_value), getResolution());
return roundPrec(ongoingCal ? m_value : calConf[getCalConfIndex()].toCalibratedValue(m_value), getResolution());
}

static uint8_t getCurrentRangeMaxValue(int subchannelIndex) {
Expand Down Expand Up @@ -1000,7 +1000,7 @@ struct AoutDac7760Channel {
}

float getCalibratedValue() {
return getCalConf()->toCalibratedValue(getValue());
return ongoingCal ? getValue() : getCalConf()->toCalibratedValue(getValue());
}

Unit getUnit() {
Expand Down Expand Up @@ -1156,7 +1156,7 @@ struct AoutDac7563Channel {
};

float getCalibratedValue() {
return calConf.toCalibratedValue(m_value);
return ongoingCal ? m_value : calConf.toCalibratedValue(m_value);
}

void resetProfileToDefaults(ProfileParameters &parameters) {
Expand Down Expand Up @@ -1353,7 +1353,7 @@ struct Mio168Module : public Module {
EVENT_TIMEOUT
};

const CommandDef *currentCommand;
const CommandDef *currentCommand = nullptr;
uint32_t refreshStartTime;
State state;
uint32_t lastStateTransitionTime;
Expand Down Expand Up @@ -1460,6 +1460,8 @@ struct Mio168Module : public Module {

if (!g_isBooted) {
while (state != STATE_IDLE) {
WATCHDOG_RESET(WATCHDOG_LONG_OPERATION);

#if defined(EEZ_PLATFORM_STM32)
if (HAL_GPIO_ReadPin(spi::IRQ_GPIO_Port[slotIndex], spi::IRQ_Pin[slotIndex]) == GPIO_PIN_RESET) {
osDelay(1);
Expand Down

0 comments on commit 10bb6b7

Please sign in to comment.