Mercurial > public > ostc4
changeset 377:939bc4da6812 MotionDetection
Motion events effect custom view in dive mode only
For faster tests motion detection was also applied to the surface menu. On surface users will most likly use the buttons for operation => deactivated detection to avoid jumping views
author | ideenmodellierer |
---|---|
date | Mon, 16 Sep 2019 20:57:40 +0200 |
parents | a90100959871 |
children | 834e087505ec |
files | Discovery/Src/base.c |
diffstat | 1 files changed, 13 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/Discovery/Src/base.c Mon Sep 16 20:21:06 2019 +0200 +++ b/Discovery/Src/base.c Mon Sep 16 20:57:40 2019 +0200 @@ -488,17 +488,20 @@ DoDisplayRefresh = 0; RefreshDisplay(); - switch(settingsGetPointer()->MotionDetection) + if(stateUsed->mode == MODE_DIVE) /* handle motion events in divemode only */ { - case MOTION_DETECT_MOVE: pitchstate = detectPitch(stateRealGetPointer()->lifeData.compass_pitch); - break; - case MOTION_DETECT_SECTOR: pitchstate = detectSectorButtonEvent(stateRealGetPointer()->lifeData.compass_pitch); - break; - case MOTION_DETECT_SCROLL: pitchstate = detectScrollButtonEvent(stateRealGetPointer()->lifeData.compass_pitch); - break; - default: - pitchstate = DETECT_NOTHING; - break; + switch(settingsGetPointer()->MotionDetection) + { + case MOTION_DETECT_MOVE: pitchstate = detectPitch(stateRealGetPointer()->lifeData.compass_pitch); + break; + case MOTION_DETECT_SECTOR: pitchstate = detectSectorButtonEvent(stateRealGetPointer()->lifeData.compass_pitch); + break; + case MOTION_DETECT_SCROLL: pitchstate = detectScrollButtonEvent(stateRealGetPointer()->lifeData.compass_pitch); + break; + default: + pitchstate = DETECT_NOTHING; + break; + } } if(DETECT_NEG_PITCH == pitchstate)