Skip to content

Commit de5aa5b

Browse files
committed
mesa_modbus: Only wait between packets that cause a write
Signed-off-by: andypugh <andy@bodgesoc.org>
1 parent 3537b5c commit de5aa5b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/hal/drivers/mesa-hostmot2/modbus/mesa_modbus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,6 @@ void process(void *arg, long period) {
517517
case START:
518518

519519
if (inst->hal->rate > 0 && (timer -= period) > 0) break;
520-
timer = 1e9 / inst->hal->rate;
521520

522521
rtapi_print_msg(RTAPI_MSG_INFO, "START txstatus = %08X rxstatus = %08X\n", txstatus, rxstatus);
523522

@@ -538,6 +537,7 @@ void process(void *arg, long period) {
538537
if (build_data_frame(inst)){ // if data has changed
539538
r = send_modbus_pkt(inst);
540539
inst->state = WAIT_FOR_SEND_BEGIN;
540+
timer = 1e9 / inst->hal->rate;
541541
}
542542

543543
break;

0 commit comments

Comments
 (0)