Mercurial > public > ostc4
changeset 364:3014a698f46d MotionDetection
Update call of motion detection function
author | ideenmodellierer |
---|---|
date | Mon, 17 Jun 2019 19:47:07 +0200 |
parents | bdf978d2a5d4 |
children | c18aebb03fed |
files | Discovery/Src/base.c |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/Discovery/Src/base.c Mon Jun 17 19:46:18 2019 +0200 +++ b/Discovery/Src/base.c Mon Jun 17 19:47:07 2019 +0200 @@ -365,6 +365,7 @@ uint8_t lastsecond = 0xFF; #endif + detectionState_t shakestate; set_globalState( StBoot0 ); LastButtonPressed = 0; @@ -518,11 +519,12 @@ DoDisplayRefresh = 0; RefreshDisplay(); - if(DETECT_NEG_SHAKE == detectShake(stateRealGetPointer()->lifeData.compass_pitch)) + shakestate = detectShake(stateRealGetPointer()->lifeData.compass_pitch); + if(DETECT_NEG_SHAKE == shakestate) { StoreButtonAction((uint8_t)ACTION_SHAKE_NEG); } - if(DETECT_POS_SHAKE == detectShake(stateRealGetPointer()->lifeData.compass_pitch)) + if(DETECT_POS_SHAKE == shakestate) { StoreButtonAction((uint8_t)ACTION_SHAKE_POS); }