We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9c2ab7e commit a90a4e6Copy full SHA for a90a4e6
1 file changed
src/hal/drivers/mesa-hostmot2/hm2_modbus.c
@@ -1472,9 +1472,9 @@ static int build_data_frame(hm2_modbus_inst_t *inst)
1472
for(unsigned i = 0; i < cc->cmd.cpincnt; i++) {
1473
// Stuff empty space with zeros.
1474
// The device must allow writes at the address(es).
1475
- while(regpos != cc->typeptr[i].regofs) {
+ while(regpos < cc->typeptr[i].regofs) {
1476
CHK_RV(ch_append16(cc, 0));
1477
- regpos += 2;
+ regpos++;
1478
}
1479
switch(cc->typeptr[i].htype) {
1480
case HAL_BIT:
@@ -1546,6 +1546,7 @@ static int build_data_frame(hm2_modbus_inst_t *inst)
1546
// Oops...
1547
break;
1548
1549
+ regpos += mtypesize(cc->typeptr[i].mtype);
1550
p++;
1551
1552
0 commit comments