Skip to content

Commit

Permalink
[AVR32] Put the chip in "stop" mode when halting the system
Browse files Browse the repository at this point in the history
Make machine_halt() execute a sleep instruction to put the chip in
"stop" mode when the system is halted. This switches off all clocks
except the 32 kHz oscillator, which is needed for the RTC to keep
ticking.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
  • Loading branch information
Haavard Skinnemoen committed Dec 8, 2006
1 parent 01cb087 commit c2eb509
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions arch/avr32/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ void cpu_idle(void)

void machine_halt(void)
{
/*
* Enter Stop mode. The 32 kHz oscillator will keep running so
* the RTC will keep the time properly and the system will
* boot quickly.
*/
asm volatile("sleep 3\n\t"
"sub pc, -2");
}

void machine_power_off(void)
Expand Down

0 comments on commit c2eb509

Please sign in to comment.