summaryrefslogtreecommitdiff
path: root/board/keyborg/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/keyborg/board.c')
-rw-r--r--board/keyborg/board.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/board/keyborg/board.c b/board/keyborg/board.c
index 6db3d5cd66..e5491a90f4 100644
--- a/board/keyborg/board.c
+++ b/board/keyborg/board.c
@@ -5,6 +5,7 @@
/* Keyborg board-specific configuration */
#include "common.h"
+#include "cpu.h"
#include "debug.h"
#include "master_slave.h"
#include "registers.h"
@@ -130,6 +131,27 @@ static const char *get_version(void)
return version_data.version;
}
+static void low_power(void)
+{
+ touch_scan_enable_interrupt();
+ master_slave_enable_interrupt();
+
+ CPU_SCB_SYSCTRL |= 0x4;
+ asm volatile("wfi");
+ CPU_SCB_SYSCTRL &= ~0x4;
+
+ hardware_clock_init();
+
+ touch_scan_disable_interrupt();
+ master_slave_disable_interrupt();
+ master_slave_wake_other();
+
+ /* Wait for the other chip to wake */
+ udelay(2 * MSEC);
+
+ master_slave_sync(5);
+}
+
int main(void)
{
int i = 0;
@@ -151,6 +173,10 @@ int main(void)
master_slave_sync(100);
+ debug_printf("Touch to start...");
+ low_power();
+ debug_printf("\n");
+
while (1) {
i++;
task_wait_event(SECOND);