summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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