Skip to content

Commit 10bb6b7

Browse files
committed
mio168 cal fixed
1 parent 708fc66 commit 10bb6b7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/eez/modules/dib-mio168/dib-mio168.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ struct AinChannel {
739739
}
740740

741741
float getValue() {
742-
return roundPrec(calConf[getCalConfIndex()].toCalibratedValue(m_value), getResolution());
742+
return roundPrec(ongoingCal ? m_value : calConf[getCalConfIndex()].toCalibratedValue(m_value), getResolution());
743743
}
744744

745745
static uint8_t getCurrentRangeMaxValue(int subchannelIndex) {
@@ -1000,7 +1000,7 @@ struct AoutDac7760Channel {
10001000
}
10011001

10021002
float getCalibratedValue() {
1003-
return getCalConf()->toCalibratedValue(getValue());
1003+
return ongoingCal ? getValue() : getCalConf()->toCalibratedValue(getValue());
10041004
}
10051005

10061006
Unit getUnit() {
@@ -1156,7 +1156,7 @@ struct AoutDac7563Channel {
11561156
};
11571157

11581158
float getCalibratedValue() {
1159-
return calConf.toCalibratedValue(m_value);
1159+
return ongoingCal ? m_value : calConf.toCalibratedValue(m_value);
11601160
}
11611161

11621162
void resetProfileToDefaults(ProfileParameters &parameters) {
@@ -1353,7 +1353,7 @@ struct Mio168Module : public Module {
13531353
EVENT_TIMEOUT
13541354
};
13551355

1356-
const CommandDef *currentCommand;
1356+
const CommandDef *currentCommand = nullptr;
13571357
uint32_t refreshStartTime;
13581358
State state;
13591359
uint32_t lastStateTransitionTime;
@@ -1460,6 +1460,8 @@ struct Mio168Module : public Module {
14601460

14611461
if (!g_isBooted) {
14621462
while (state != STATE_IDLE) {
1463+
WATCHDOG_RESET(WATCHDOG_LONG_OPERATION);
1464+
14631465
#if defined(EEZ_PLATFORM_STM32)
14641466
if (HAL_GPIO_ReadPin(spi::IRQ_GPIO_Port[slotIndex], spi::IRQ_Pin[slotIndex]) == GPIO_PIN_RESET) {
14651467
osDelay(1);

0 commit comments

Comments
 (0)