aboutsummaryrefslogtreecommitdiff
path: root/ui.c
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2015-06-09 14:09:22 +0200
committerLars-Dominik Braun <lars@6xq.net>2015-06-09 14:09:22 +0200
commit3708927d2fe15a747270619d1467486c040e57dd (patch)
tree4a25729fe7db3910a3a40e07d4e364c83d3acba9 /ui.c
parent3f861e826d621d43bd05a54dd034c517a999beed (diff)
downloadhourglass-3708927d2fe15a747270619d1467486c040e57dd.tar.gz
hourglass-3708927d2fe15a747270619d1467486c040e57dd.tar.bz2
hourglass-3708927d2fe15a747270619d1467486c040e57dd.zip
Stop alarm when shaking too
Diffstat (limited to 'ui.c')
-rw-r--r--ui.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ui.c b/ui.c
index 3d8a8d2..e71db36 100644
--- a/ui.c
+++ b/ui.c
@@ -318,7 +318,8 @@ static void doFlashOn () {
switch (fmode) {
case FLASH_ALARM:
- if (horizonChanged) {
+ if (horizonChanged || accelGetShakeCount () > 0) {
+ accelResetShakeCount ();
enterIdle ();
stopFlash = true;
}
@@ -367,7 +368,9 @@ static void doFlashOff () {
switch (fmode) {
case FLASH_ALARM:
- if (horizonChanged || flashCount >= FLASH_ALARM_NUM) {
+ if (horizonChanged || accelGetShakeCount () > 0 ||
+ flashCount >= FLASH_ALARM_NUM) {
+ accelResetShakeCount ();
enterIdle ();
stopFlash = true;
}