avr: split code in multiple files and routines.

This commit is contained in:
Martin Preuss
2023-04-22 11:54:09 +02:00
parent 3e6501c834
commit 3b44fb9c5b
12 changed files with 656 additions and 498 deletions

View File

@@ -74,11 +74,11 @@ com2ReceivePacketRaw_error:
; - x : ptr to buffer to send
; OUT:
; - CFLAGS: set if okay, cleared otherwise (errorcode in R16)
; REGS: R15, R16, R22 (R17, R21, X)
; REGS: R16, R22 (R17, R21, X)
COM2_SendPacketWithAttn:
in r15, SREG
push r15
in r15, SREG
cli
Utils_WaitNanoSecs COM_BIT_LENGTH, 0, r22 ; wait for one bit duration
; check for ATTN line: busy?
@@ -103,8 +103,8 @@ COM2_SendPacketWithAttn:
cbi COM_DDR_ATTN, COM_PINNUM_ATTN ; release ATTN line (by setting direction to IN)
brcc COM2_SendPacketWithAttn_ioError
; packet successfully sent
out SREG, r15
pop r15
out SREG, r15
sec
ret