Adjusted the minimum Turnaround time for ARM and AVR ports to give a minimum since there are errors induced from the clock and from rounding.
This commit is contained in:
@@ -123,11 +123,9 @@ void RS485_Send_Frame(
|
||||
|
||||
/* delay after reception - per MS/TP spec */
|
||||
if (mstp_port) {
|
||||
/* wait about 40 bit times since reception */
|
||||
turnaround_time = (Tturnaround*1000UL)/RS485_Baud;
|
||||
if (!turnaround_time) {
|
||||
turnaround_time = 1;
|
||||
}
|
||||
/* wait a minimum 40 bit times since reception */
|
||||
/* at least 1 ms for errors: rounding, clock tick */
|
||||
turnaround_time = 1 + ((Tturnaround*1000UL)/RS485_Baud);
|
||||
while (mstp_port->SilenceTimer() < turnaround_time) {
|
||||
/* do nothing - wait for timer to increment */
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user