Skip to content

Commit 1cee366

Browse files
authored
Merge pull request #17 from maidnl/startup_additional_channel_fix
Opta Controller / Analog Expansion: fixing problems on additional ADC configuration
2 parents 05ab06e + 1b1cbbb commit 1cee366

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/AnalogExpansion.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ void AnalogExpansion::startUp(Controller *ptr) {
8080
if (tx_bytes) {
8181
ptr->send(exp.getI2CAddress(), exp.getIndex(), exp.getType(),
8282
tx_bytes, CTRL_ANS_OA_LEN);
83+
/* channel configuration takes some times on the expansion side*/
84+
delay(50);
8385
}
8486
}
8587
exp.updateAnalogOutputs();
@@ -766,7 +768,6 @@ uint8_t AnalogExpansion::msg_set_dac() {
766768
uint8_t rv = prepareSetMsg(ctrl->getTxBuffer(), ARG_OA_SET_DAC,
767769
LEN_OA_SET_DAC, OA_SET_DAC_LEN);
768770

769-
AnalogExpansion::cfgs[index].resetAdditionalAdcCh(iregs[ADD_OA_PIN]);
770771
AnalogExpansion::cfgs[index].backup(ctrl->getTxBuffer(),
771772
iregs[ADD_OA_PIN] + OFFSET_DAC_VALUE,
772773
rv);

src/DigitalExpansion.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void DigitalExpansion::startUp(Controller *ptr) {
106106
LEN_OPTDIG_DIGITAL_OUT,
107107
MSG_SET_OPTDIG_DIGITAL_OUT_LEN);
108108
if(tx_bytes) {
109-
uint8_t res = ptr->send(exp.getI2CAddress(), exp.getIndex(), exp.getType(), tx_bytes,
109+
ptr->send(exp.getI2CAddress(), exp.getIndex(), exp.getType(), tx_bytes,
110110
CTRL_ANS_MSG_OD_DIGITAL_OUT);
111111
}
112112
}

0 commit comments

Comments
 (0)