more work on switching to new COM and TIMER stack.

This commit is contained in:
Martin Preuss
2023-04-13 21:16:51 +02:00
parent a61226c3d9
commit c00b90bf28
9 changed files with 168 additions and 64 deletions

View File

@@ -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)