avr: try calculating idle times.

This commit is contained in:
Martin Preuss
2023-04-10 23:33:24 +02:00
parent 6c8f8e19b2
commit eca6fc6efc
15 changed files with 315 additions and 7 deletions

View File

@@ -70,6 +70,8 @@ main_loop:
; sbi PINA, PORTA2 ; debug (toggle)
; cbi PORTA, PORTA2 ; debug (on)
; sbi PORTA, PORTA2 ; debug (off)
rcall Timer_BeforeSleep
; only modify SE, SM1 and SM0
in r16, MCUCR
@@ -79,6 +81,7 @@ main_loop:
ori r16, (1<<SE) ; sleep mode "idle", enable
out MCUCR, r16
sleep ; sleep, wait for interrupt
rcall Timer_AfterSleep
rjmp main_loop