cwalter-at / freemodbus

BSD licensed MODBUS RTU/ASCII and TCP slave
768 stars 393 forks source link

Certain UARTs may disable TX during last byte #39

Open mcurry-va opened 1 year ago

mcurry-va commented 1 year ago

mbrtu.c line 313 may disable the transmitter prematurely on targets that raises a TX buffer empty ISR/event whilst still transmitting: https://github.com/cwalter-at/freemodbus/blob/master/modbus/rtu/mbrtu.c#LL311C1-L313C48

Removing this line on an R7FA2L1 target and raising another buffer empty callback when TX complete event is received allows the RS485 transceiver to change back to receive AFTER the byte is actually sent.