avr: some formatting.
This commit is contained in:
@@ -30,7 +30,7 @@ timerModuleTickCounter: .byte 1
|
||||
timerModuleFlags: .byte 1
|
||||
timerModuleCounterSecs: .byte 4
|
||||
|
||||
timerModuleDerivedCounters: .byte 10 ; must correspond to entries in timer table!
|
||||
timerModuleDerivedCounters: .byte 10 ; size must be number of entries in timer table
|
||||
|
||||
timerModuleData_end:
|
||||
|
||||
@@ -70,7 +70,7 @@ timerTable:
|
||||
; - nothing
|
||||
; USED: r16, r17, x
|
||||
|
||||
Timer_Init: ; setup timer for 15.2588 interrupts per second (e.g. every 65.5 ms)
|
||||
Timer_Init: ; setup timer for IRQ every 100ms
|
||||
; reset data in SDRAM
|
||||
ldi xh, HIGH(timerModuleData)
|
||||
ldi xl, LOW(timerModuleData)
|
||||
@@ -153,7 +153,7 @@ Timer_Run_1s_passed:
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; Increment cascading timer counters.
|
||||
; Increment cascading timer counters. Called once every second.
|
||||
;
|
||||
; This routine starts with the first cascaded counter and increments it.
|
||||
; If that counter value does not overflow (according to timer table entry) then
|
||||
@@ -226,8 +226,6 @@ timerCallFirstOnEveryHandlers:
|
||||
|
||||
ldi zl, LOW(timerTable*2)
|
||||
ldi zh, HIGH(timerTable*2)
|
||||
ldi xl, LOW(timerModuleDerivedCounters) ; points to first counter: timerModuleCounterFor10s
|
||||
ldi xh, HIGH(timerModuleDerivedCounters)
|
||||
|
||||
timerCallFirstOnEveryHandlers_loop:
|
||||
lpm r17, Z ; overflow value
|
||||
@@ -237,16 +235,11 @@ timerCallFirstOnEveryHandlers_loop:
|
||||
lpm r20, Z+ ; read handler address
|
||||
lpm r21, Z+
|
||||
push r16 ; call handler
|
||||
push xl
|
||||
push xh
|
||||
push zl
|
||||
push zh
|
||||
ld r16, X+ ; current counter value
|
||||
rcall timerCallR21R20
|
||||
pop zh
|
||||
pop zl
|
||||
pop xh
|
||||
pop xl
|
||||
pop r16
|
||||
dec r16
|
||||
brne timerCallFirstOnEveryHandlers_loop
|
||||
|
||||
Reference in New Issue
Block a user