started working on AtMega8515 module C1.
This commit is contained in:
@@ -281,7 +281,7 @@ ioRawReceiveByte_error:
|
||||
; @clobbers R16, R22 (R17, R21, X)
|
||||
|
||||
ioRawSendPacket:
|
||||
rcall ioRawAcquireBus
|
||||
rcall ioRawAcquireBus ; (none)
|
||||
brcc ioRawSendPacket_lineBusyError
|
||||
|
||||
rcall ioRawWaitForOneBitLength ; wait for one bit duration (R22)
|
||||
@@ -316,47 +316,6 @@ ioRawSendPacket_lineBusyError:
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine ioRawAcquireBus
|
||||
;
|
||||
; Reserve bus if free (otherwise return error)
|
||||
; Expects interrupts to be disabled.
|
||||
;
|
||||
; @return CFLAG set if okay (bus acquired), cleared on error
|
||||
; @clobbers: none
|
||||
|
||||
ioRawAcquireBus:
|
||||
; check for ATTN line: busy?
|
||||
cbi COM_ATTN_DDR, COM_ATTN_PIN ; set ATTN as input
|
||||
cbi COM_ATTN_OUTPUT, COM_ATTN_PIN ; disable pullup on ATTN
|
||||
nop ; needed to sample current input
|
||||
sbis COM_ATTN_INPUT, COM_ATTN_PIN ; ATTN low?
|
||||
rjmp ioRawAcquireBus_busy ; jump if it is
|
||||
sbi COM_ATTN_DDR, COM_ATTN_PIN ; set ATTN as output
|
||||
cbi COM_ATTN_OUTPUT, COM_ATTN_PIN ; set ATTN low
|
||||
sec
|
||||
ret
|
||||
ioRawAcquireBus_busy:
|
||||
clc
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine ioRawWaitForOneBitLength
|
||||
;
|
||||
; wait for one bit length (minus cycles for call and ret).
|
||||
;
|
||||
; @clobbers r22
|
||||
|
||||
ioRawWaitForOneBitLength:
|
||||
Utils_WaitNanoSecs COM_BIT_LENGTH, 7, r22 ; wait for one bit duration (minus RCALL/RET)
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine ioRawSendByte
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user