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:
@@ -8,6 +8,7 @@ CC=arm-elf-gcc
|
||||
OBJCOPY=arm-elf-objcopy
|
||||
OBJDUMP=arm-elf-objdump
|
||||
AR=arm-elf-ar
|
||||
SIZE = arm-elf-size
|
||||
|
||||
LDSCRIPT=at91sam7s256.ld
|
||||
|
||||
@@ -79,8 +80,9 @@ AOBJ = $(ASRC:.s=.o)
|
||||
COBJ = $(CSRC:.c=.o)
|
||||
COREOBJ = $(CORESRC:.c=.o)
|
||||
|
||||
all: $(TARGET).bin
|
||||
all: $(TARGET).bin $(TARGET).elf
|
||||
$(OBJDUMP) $(ODFLAGS) $(TARGET).elf > $(TARGET).dmp
|
||||
$(SIZE) $(TARGET).elf
|
||||
|
||||
$(TARGET).bin: $(TARGET).elf
|
||||
$(OBJCOPY) $(TARGET).elf $(CPFLAGS) $(TARGET).bin
|
||||
|
||||
@@ -162,11 +162,9 @@ void RS485_Send_Frame(
|
||||
|
||||
/* delay after reception - per MS/TP spec */
|
||||
if (mstp_port) {
|
||||
/* wait about 40 bit times since reception */
|
||||
turnaround_time = (40*1000)/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*1000)/RS485_Baud);
|
||||
while (mstp_port->SilenceTimer() < turnaround_time) {
|
||||
/* do nothing - wait for timer to increment */
|
||||
};
|
||||
|
||||
@@ -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