Mercurial > public > ostc4
diff Discovery/Src/base.c @ 364:3014a698f46d MotionDetection
Update call of motion detection function
author | ideenmodellierer |
---|---|
date | Mon, 17 Jun 2019 19:47:07 +0200 |
parents | b111fc4250e9 |
children | e309f78f89a5 |
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); }