more work on switching to new COM and TIMER stack.
This commit is contained in:
@@ -148,6 +148,53 @@ Timer_Run_End:
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; Set timer value.
|
||||
;
|
||||
; Setting a timer to 0 effectively stops the timer.
|
||||
;
|
||||
; IN:
|
||||
; - r16: new timer value (low)
|
||||
; - r17: new timer value (high)
|
||||
; - X : pointer to timer value in SRAM
|
||||
; OUT:
|
||||
; - nothing
|
||||
; REGS: X
|
||||
|
||||
Timer_SetValue:
|
||||
push r15
|
||||
in r15, SREG
|
||||
cli
|
||||
st X+, r16
|
||||
st X+, r17
|
||||
out SREG, r15
|
||||
pop r15
|
||||
ret
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; Set timer value to 1s.
|
||||
;
|
||||
; IN:
|
||||
; - X : pointer to timer value in SRAM
|
||||
; OUT:
|
||||
; - nothing
|
||||
; REGS: X
|
||||
|
||||
Timer_SetValueTo1s:
|
||||
push r16
|
||||
push r17
|
||||
ldi r16, 1
|
||||
clr r17
|
||||
rcall Timer_SetValue
|
||||
pop r17
|
||||
pop r16
|
||||
ret
|
||||
|
||||
|
||||
|
||||
|
||||
timerInitTimers:
|
||||
ldi zl, LOW(timerList*2)
|
||||
ldi zh, HIGH(timerList*2)
|
||||
|
||||
Reference in New Issue
Block a user