minor beautifications.

This commit is contained in:
Martin Preuss
2025-05-17 14:24:23 +02:00
parent 550967c176
commit 44b8848996

View File

@@ -68,20 +68,27 @@ systemSetSpeed:
systemSleep:
; only modify SE, SM2, SM1 and SM0
cli
M_IO_READ r16, MCUCR
cbr r16, (1<<SE) | (1<<SM2) | (1<<SM1)
M_IO_WRITE MCUCR, r16
M_IO_READ r16, EMCUCR
cbr r16, (1<<SM0)
M_IO_WRITE EMCUCR, r16
sei ; make sure interrupts really are enabled
M_IO_READ r16, MCUCR ; enable sleep mode
sbr r16, (1<<SE)
M_IO_WRITE MCUCR, r16
sleep ; sleep, wait for interrupt
M_IO_READ r16, MCUCR ; disable sleep mode
cbr r16, (1<<SE)
M_IO_WRITE MCUCR, r16
ret
; @end