projects
/
my-code
/
atmel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
more control
[my-code/atmel.git]
/
monolyzer
/
timer.asm
diff --git
a/monolyzer/timer.asm
b/monolyzer/timer.asm
index
2f14b69
..
3327547
100644
(file)
--- a/
monolyzer/timer.asm
+++ b/
monolyzer/timer.asm
@@
-3,8
+3,29
@@
TIMER1_INIT:
; clock select, prescaler 8
TIMER1_INIT:
; clock select, prescaler 8
- ldi tmp1,0x02
+ in tmp1,TCCR1B
+ cbr tmp1,(1<<CS12)
+ sbr tmp1,(1<<CS11)
+ cbr tmp1,(1<<CS10)
out TCCR1B,tmp1
ret
out TCCR1B,tmp1
ret
+TIMER1_INT_ENABLE:
+
+ ; overflow interrupt enable
+ in tmp1,TIMSK
+ sbr tmp1,(1<<TOIE1)
+ out TIMSK,tmp1
+
+ ret
+
+TIMER1_INT_DISABLE:
+
+ ; overflow interrupt disable
+ in tmp1,TIMSK
+ cbr tmp1,(1<<TOIE1)
+ out TIMSK,tmp1
+
+ ret
+