avr: fixed HW code for tn861.
This commit is contained in:
@@ -72,8 +72,9 @@ systemSleep:
|
||||
; only modify SE, SM1 and SM0
|
||||
cli
|
||||
in r16, MCUCR
|
||||
cbr r16, (1<<SE) | (1<<SM1) | (1<<SM0)
|
||||
out MCUCR, r16
|
||||
; cbr r16, (1<<SE) | (1<<SM1) | (1<<SM0)
|
||||
; out MCUCR, r16
|
||||
cbr r16, (1<<SM1) | (1<<SM0)
|
||||
sbr r16, (1<<SE) | (0<<SM1) | (0<<SM0) ; sleep mode "idle", enable
|
||||
out MCUCR, r16
|
||||
sei ; make sure interrupts really are enabled
|
||||
@@ -125,10 +126,12 @@ systemSetupTimer0: ; setup timer for IRQ every 100ms
|
||||
.endif
|
||||
|
||||
|
||||
ldi r16, (1<<OCF0A) ; clear pending interrupts
|
||||
in r16, TIFR
|
||||
sbr r16, (1<<OCF0A) ; clear pending interrupts
|
||||
out TIFR, r16
|
||||
|
||||
ldi r16, (1<<OCIE0A) ; Timer/Counter0 Output Compare Match A Interrupt Enable
|
||||
|
||||
in r16, TIMSK
|
||||
sbr r16, (1<<OCIE0A) ; Timer/Counter0 Output Compare Match A Interrupt Enable
|
||||
out TIMSK, r16
|
||||
|
||||
sec
|
||||
|
||||
Reference in New Issue
Block a user