com: fixed a bug.
This commit is contained in:
@@ -112,6 +112,7 @@ Com_Init:
|
||||
|
||||
Com_Run:
|
||||
rcall comHandleNextPacketInRingbuffer ; nothing more than handling packages in ringbuffer
|
||||
; clc
|
||||
ret
|
||||
|
||||
|
||||
@@ -229,6 +230,7 @@ comHandleNextPacketInRingbuffer:
|
||||
mov r17, r16 ; check for received message
|
||||
andi r17, COM_BUFFER_FLAGS_RECEIVED
|
||||
brne comHandleNextPacketInRingbuffer_receivedPacket
|
||||
rjmp comHandleNextPacketInRingbuffer_retNc
|
||||
|
||||
comHandleNextPacketInRingbuffer_sendPacket:
|
||||
rcall comSendPacketHandleRepeat ; (R1, R3, R16, R17, R18, R19, R22, X)
|
||||
@@ -299,7 +301,7 @@ comSendPacketHandleRepeat:
|
||||
mov r1, r16 ; r1: ringbuffer packet length
|
||||
rcall RingBuffer_Read ; flags
|
||||
pop r18
|
||||
rcall comSetupRepeat ; setup comRepeatCount if not already done
|
||||
rcall comSetupRepeat ; setup comRepeatCount if not already done (R16, R17)
|
||||
; sbis COM_PIN_ATTN, COM_PINNUM_ATTN ; check ATTN: low?
|
||||
; rjmp comSendPacketHandleRepeat_adjustRepeat ; yes, line is busy, retry later
|
||||
push r18
|
||||
@@ -453,8 +455,6 @@ comSendPacketRaw_sendCrc:
|
||||
mov r16, r11 ; send checksum
|
||||
rcall comSendByte ; send byte
|
||||
brcc comSendPacketRaw_error
|
||||
sbi DDRA, PORTA2 ; debug
|
||||
sbi PINA, PORTA2 ; debug (toggle)
|
||||
sec
|
||||
ret
|
||||
|
||||
|
||||
Reference in New Issue
Block a user