diff options
author | Keith Packard <keithp@keithp.com> | 2011-05-20 01:35:49 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-05-20 01:35:49 -0700 |
commit | d67df9a6dc76ba52f32fa4c0b141825b97a2fbc8 (patch) | |
tree | 02fc0fed6c08ad54afe2a1ed9161132fb2f91d88 /src-avr/ao_timer.c | |
parent | 92fcfc2e8e5a9cb789c8d4be36d38c1a73ddd413 (diff) |
src-avr: Add 'sleep_cpu' to reduce power usage while idle
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src-avr/ao_timer.c')
-rw-r--r-- | src-avr/ao_timer.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src-avr/ao_timer.c b/src-avr/ao_timer.c index cc48dd2a..f0918a7d 100644 --- a/src-avr/ao_timer.c +++ b/src-avr/ao_timer.c @@ -162,6 +162,9 @@ ao_clock_init(void) PLLCSR |= (1 << PLLE); while (!(PLLCSR & (1 << PLOCK))) ; + + set_sleep_mode(SLEEP_MODE_IDLE); + sleep_enable(); #else /* Switch system clock to crystal oscilator */ CLKCON = (CLKCON & ~CLKCON_OSC_MASK) | (CLKCON_OSC_XTAL); |