simplified message handling, switch from XOR checksum to CRC8 with polynomial 0x97.
0x97 allows for detection of all 1-3 bit errors in a message of up to 119 bytes (see https://www.faa.gov/aircraft/air_cert/design_approvals/air_software/media/TC-14-49.pdf)
This commit is contained in:
10
avr/com.asm
10
avr/com.asm
@@ -63,13 +63,15 @@ comDataBegin:
|
||||
|
||||
comStatsRecvErrs: .byte 2
|
||||
comStatsRecvCrcErrs: .byte 2
|
||||
comStatsCollisions: .byte 2
|
||||
comStatsMissed: .byte 2
|
||||
comStatsAborted: .byte 2
|
||||
comStatsIgnored: .byte 2
|
||||
comStatsHandled: .byte 2
|
||||
|
||||
comStatsCollisions: .byte 2
|
||||
comStatsAborted: .byte 2
|
||||
|
||||
comStatsNoBuffer: .byte 2
|
||||
comStatsSendNoBuffer: .byte 2
|
||||
comStatsRecvNoBuffer: .byte 2
|
||||
|
||||
comRecvBuffersReadPos: .byte 1
|
||||
comRecvBuffersWritePos: .byte 1
|
||||
@@ -223,6 +225,8 @@ COM_AllocBufferAndGetXY:
|
||||
sec
|
||||
ret
|
||||
COM_AllocBufferAndGetXY_error:
|
||||
ldi xl, LOW(comStatsSendNoBuffer)
|
||||
ldi xh, HIGH(comStatsSendNoBuffer)
|
||||
clc
|
||||
ret
|
||||
|
||||
|
||||
Reference in New Issue
Block a user