summaryrefslogtreecommitdiff
path: root/openpcd
diff options
context:
space:
mode:
author(no author) <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2006-09-10 00:03:40 +0000
committer(no author) <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2006-09-10 00:03:40 +0000
commitb4d004d91c270af30c20d9e30b4087a412b99bbc (patch)
tree442cf19dc13b801c9e33a984269033f82d0963ef /openpcd
parentbb35dd012651e6af069ef0fa549f4abfd533acb0 (diff)
- 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
Diffstat (limited to 'openpcd')
-rw-r--r--openpcd/firmware/src/os/main.c6
-rw-r--r--openpcd/firmware/src/os/power.h8
2 files changed, 13 insertions, 1 deletions
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 <os/led.h>
#include <os/dfu.h>
#include <os/main.h>
+#include <os/power.h>
#include <os/pcd_enumerate.h>
#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
personal git repositories of Harald Welte. Your mileage may vary