Skip to content

Commit 2252af2

Browse files
author
JTrantow
committed
Reverse (baudrate > 19200).
1 parent c025b3f commit 2252af2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/hal/drivers/mesa-hostmot2/hm2_modbus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ static unsigned calc_ifdelay(hm2_modbus_inst_t *inst, unsigned baudrate, unsigne
387387
}
388388

389389
// calculation works for baudrates less than ~24 Mbit/s
390-
if(19200 < baudrate)
390+
if(baudrate > 19200)
391391
return (175u * baudrate + 99999u) / 100000u;
392392
unsigned bits = 1 + 8 + (parity ? 1 : 0) + (stopbits > 1 ? 2 : 1);
393393
return (bits * 35 + 9) / 10; // Ceil of bits in 3.5 characters.

0 commit comments

Comments
 (0)