summaryrefslogtreecommitdiff
path: root/common/motion_sense.c
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2014-03-10 12:05:47 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-03-26 19:31:25 +0000
commiteb1406644716d6c3c87fdeea4551eb6ea37be649 (patch)
tree8f5209485fd585aa08f384bca2dd2f9c5d3982ae /common/motion_sense.c
parent9b420804d88a7adf8a1ded8bd12e52e1aa8ddd84 (diff)
downloadchrome-ec-eb1406644716d6c3c87fdeea4551eb6ea37be649.tar.gz
accel: clapper: glimmer: Add support for accelerometer interrupt.stabilize-5696.B
Adding in support for accelerometer interrupt for use currently in clapper and glimmer. This is disabled by default and can be enabled with CONFIG_ACCEL_INTERRUPTS. BUG=none BRANCH=rambi TEST=Manual test on a glimmer using accelint console command. On console enter: accelint 0 32 When you tap the lid, it should fire the interrupt and print msg to console. accelint 1 32 Tap the base and it will fire another interrupt. Change-Id: Iaab324945e34d527140399ec4f06efd812a62840 Original-Change-Id: I0329112fdcae3c8adc0ca07e74fef7a591d4b9a1 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/190099 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/191549
Diffstat (limited to 'common/motion_sense.c')
-rw-r--r--common/motion_sense.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/common/motion_sense.c b/common/motion_sense.c
index 7c7b8a55b5..651215ef34 100644
--- a/common/motion_sense.c
+++ b/common/motion_sense.c
@@ -243,6 +243,24 @@ void motion_sense_task(void)
}
}
+void accel_int_lid(enum gpio_signal signal)
+{
+ /*
+ * Print statement is here for testing with console accelint command.
+ * Remove print statement when interrupt is used for real.
+ */
+ CPRINTF("[%T Accelerometer wake-up interrupt occurred on lid]\n");
+}
+
+void accel_int_base(enum gpio_signal signal)
+{
+ /*
+ * Print statement is here for testing with console accelint command.
+ * Remove print statement when interrupt is used for real.
+ */
+ CPRINTF("[%T Accelerometer wake-up interrupt occurred on base]\n");
+}
+
/*****************************************************************************/
/* Console commands */
#ifdef CONFIG_CMD_LID_ANGLE