| 12345678910111213141516171819202122232425262728293031323334353637 |
- ;Incs and Defs----------------------------------------------------------
- .include "atm328p.inc"
- .include "global.inc"
- ;Initialisierungen------------------------------------------------------
- .global timer1_reset
- timer1_reset:
- sts TCCR1A, false ;clear Registers
- sts TCCR1B, false
- sts TCCR1C, false
- sts TCNT1H, false
- sts TCNT1L, false
- sts TIMSK1, false
- sts timer1_cnt, false ;set Variables
- sts timer1_bool, false
- ret
- ;Interrupt-Handler------------------------------------------------------
- .global timer1_OVF
- timer1_OVF:
- push timer1_r
- lds timer1_r, timer1_cnt ;Timer-Scaling
- inc timer1_r
- lds temp, timer1_MAX
- cp timer1_r, temp
- brne .+6
- clr timer1_r ;timed instructions
- sts timer1_bool, true
- sts timer1_cnt, timer1_r
- pop timer1_r
- reti
|