avr: improved protocol timing for COM2.

- increased waiting time after lowering ATTN line
- lengthten stop bit for cleaner frames (now recognized by PulseView)
- count "NOTFORME" conditions
- introduce definition COM_HALFBIT_LENGTH (I dont' trust value calculations
  in avrasm)
This commit is contained in:
Martin Preuss
2024-09-29 14:59:19 +02:00
parent b93ead5e5f
commit 5767c1307d
9 changed files with 88 additions and 30 deletions

View File

@@ -26,6 +26,7 @@ com2RecvStatsBegin: ; 12 bytes
com2StatsIoError: .byte 2
com2StatsNoBufferError: .byte 2
com2StatsHandled: .byte 2
com2StatsNotForMe: .byte 2
com2StatsMissed: .byte 2 ; currently not used
com2RecvStatsEnd:
@@ -331,6 +332,8 @@ com2ReceivePacket_error:
breq com2ReceivePacket_ioError
cpi r16, COM2_ERROR_DATAERROR
breq com2ReceivePacket_dataError
cpi r16, COM2_ERROR_NOTFORME
breq com2ReceivePacket_notForMe
rjmp com2ReceivePacket_retnc
com2ReceivePacket_ioError:
ldi xl, LOW(com2StatsIoError)
@@ -340,6 +343,10 @@ com2ReceivePacket_dataError:
ldi xl, LOW(com2StatsContentError)
ldi xh, HIGH(com2StatsContentError)
rjmp com2ReceivePacket_incCounterDeallocNc
com2ReceivePacket_notForMe:
ldi xl, LOW(com2StatsNotForMe)
ldi xh, HIGH(com2StatsNotForMe)
rjmp com2ReceivePacket_incCounterDeallocNc
com2ReceivePacket_incCounterDeallocNc:
rcall Utils_IncrementCounter16 ; (r18, r19, 22)
com2ReceivePacket_deallocRetnc: