From b4d004d91c270af30c20d9e30b4087a412b99bbc Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> Date: Sun, 10 Sep 2006 00:03:40 +0000 Subject: - add (currently unused) ability to put CPU in idle mode - enable LED2 (red) after startup git-svn-id: https://svn.openpcd.org:2342/trunk@164 6dc7ffe9-61d6-0310-9af1-9938baff3ed1 --- openpcd/firmware/src/os/main.c | 6 +++++- openpcd/firmware/src/os/power.h | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 openpcd/firmware/src/os/power.h diff --git a/openpcd/firmware/src/os/main.c b/openpcd/firmware/src/os/main.c index 4f637e5..66cac8b 100644 --- a/openpcd/firmware/src/os/main.c +++ b/openpcd/firmware/src/os/main.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include "../openpcd.h" @@ -31,12 +32,15 @@ int main(void) #endif /* switch on first led */ - led_switch(1, 1); + led_switch(2, 1); DEBUGPCRF("entering main (idle) loop"); while (1) { /* Call application specific main idle function */ _main_func(); dbgu_rb_flush(); +#ifdef CONFIG_IDLE + //cpu_idle(); +#endif } } diff --git a/openpcd/firmware/src/os/power.h b/openpcd/firmware/src/os/power.h new file mode 100644 index 0000000..bfc6989 --- /dev/null +++ b/openpcd/firmware/src/os/power.h @@ -0,0 +1,8 @@ +#ifndef _POWER_H + +static inline void cpu_idle(void) +{ + AT91F_PMC_DisablePCK(AT91C_BASE_PMC, AT91C_PMC_PCK); +} + +#endif -- cgit v1.2.3