X-Git-Url: https://hackdaworld.org/gitweb/?a=blobdiff_plain;f=led_plex%2Ftimer.asm;h=9ef24acda63535213e7d4ef3e85c59e854dd069c;hb=32e3f51bc0f4248019379fe784d38c7fb770f952;hp=e371f65095ab9f87f14599ad602fd1bf0cb594cd;hpb=87ef21d9eacec01abdbf3306dd2493aecf0b4afb;p=my-code%2Fatmel.git diff --git a/led_plex/timer.asm b/led_plex/timer.asm index e371f65..9ef24ac 100644 --- a/led_plex/timer.asm +++ b/led_plex/timer.asm @@ -1,2 +1,39 @@ ; timer functions +TIMER0_INIT: + + ; clock select +.ifdef DEBUG_PORTS + ldi tmp1,0x03 +.else + ldi tmp1,0x02 +.endif + out TCCR0B,tmp1 + + ret + +TIMER1_INIT: + + ; clock select + ldi tmp1,0x04 + out TCCR1B,tmp1 + + ret + +TIMER0_INT_INIT: + + ; overflow interrupt + ldi tmp1,0x02 + out TIMSK,tmp1 + + ret + +TIMER1_INT_INIT: + + ; overflow interrupt + in tmp1,TIMSK + ori tmp1,(1<<7) + out TIMSK,tmp1 + + ret +