stoyanoff
Joined: 20 Jul 2011 Posts: 375
|
Question about RS485 driver file |
Posted: Mon May 18, 2015 12:40 pm |
|
|
Greetings! I'm looking at RS485.c driver file. This is part of the send message procedure:
Code: |
for(try=0; try<5; ++try) {
rs485_collision = 0;
fputc((int16)0x100|rs485_id, RS485_CD);
fputc((int16)0x100|to, RS485_CD);
fputc(len, RS485_CD);
for(i=0, cs=rs485_id^to^len; i<len; ++i) {
cs ^= *data;
fputc(*data, RS485_CD);
++data;
}
fputc(cs, RS485_CD);
if(!rs485_collision) {
ret = TRUE;
break;
}
delay_ms(RS485_ID);
}
|
Can anyone explain to me how it finds if there is a collision?
Thanks! |
|