comparison 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
comparison
equal deleted inserted replaced
363:bdf978d2a5d4 364:3014a698f46d
363 RTC_TimeTypeDef Stime; 363 RTC_TimeTypeDef Stime;
364 uint8_t measurementindex = 0; 364 uint8_t measurementindex = 0;
365 uint8_t lastsecond = 0xFF; 365 uint8_t lastsecond = 0xFF;
366 #endif 366 #endif
367 367
368 detectionState_t shakestate;
368 369
369 set_globalState( StBoot0 ); 370 set_globalState( StBoot0 );
370 LastButtonPressed = 0; 371 LastButtonPressed = 0;
371 372
372 HAL_Init(); 373 HAL_Init();
516 if(DoDisplayRefresh) 517 if(DoDisplayRefresh)
517 { 518 {
518 DoDisplayRefresh = 0; 519 DoDisplayRefresh = 0;
519 RefreshDisplay(); 520 RefreshDisplay();
520 521
521 if(DETECT_NEG_SHAKE == detectShake(stateRealGetPointer()->lifeData.compass_pitch)) 522 shakestate = detectShake(stateRealGetPointer()->lifeData.compass_pitch);
523 if(DETECT_NEG_SHAKE == shakestate)
522 { 524 {
523 StoreButtonAction((uint8_t)ACTION_SHAKE_NEG); 525 StoreButtonAction((uint8_t)ACTION_SHAKE_NEG);
524 } 526 }
525 if(DETECT_POS_SHAKE == detectShake(stateRealGetPointer()->lifeData.compass_pitch)) 527 if(DETECT_POS_SHAKE == shakestate)
526 { 528 {
527 StoreButtonAction((uint8_t)ACTION_SHAKE_POS); 529 StoreButtonAction((uint8_t)ACTION_SHAKE_POS);
528 } 530 }
529 531
530 // Enable this to make the simulator write a logbook entry 532 // Enable this to make the simulator write a logbook entry