aboutsummaryrefslogtreecommitdiff
path: root/common.h
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2015-02-26 14:39:30 +0100
committerLars-Dominik Braun <lars@6xq.net>2015-02-26 14:46:23 +0100
commite2e3038c627ea7460915cdd535cb91301af614a7 (patch)
tree392efd367176e57696eac7d21674b262f0cc7997 /common.h
parent1a73da01d68d743d795830a6f7f36a083c7b6ed2 (diff)
downloadhourglass-e2e3038c627ea7460915cdd535cb91301af614a7.tar.gz
hourglass-e2e3038c627ea7460915cdd535cb91301af614a7.tar.bz2
hourglass-e2e3038c627ea7460915cdd535cb91301af614a7.zip
accel: Stop polling
Use freefall interrupts instead. This drop the fancy horizon/shake detection algorithms, but it works surprisingly well and is way more energy-efficient. Shake detection is a little too sensitive imo and horizon detection needs some tweaking too.
Diffstat (limited to 'common.h')
-rw-r--r--common.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/common.h b/common.h
index 5730f47..028817c 100644
--- a/common.h
+++ b/common.h
@@ -27,10 +27,11 @@
extern volatile uint8_t wakeup;
/* wakeup sources */
-#define WAKE_ACCEL 0
-#define WAKE_GYRO 1
-#define WAKE_I2C 2
-#define WAKE_TIMER 3
+#define WAKE_ACCEL_HORIZON 0
+#define WAKE_ACCEL_SHAKE 1
+#define WAKE_GYRO 2
+#define WAKE_I2C 3
+#define WAKE_TIMER 4
#define shouldWakeup(x) (wakeup & (1 << x))
#define enableWakeup(x) wakeup |= 1 << x;