aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}