comparison Discovery/Src/base.c @ 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 7b981f8bdd41
children a7331e4a9ca6
comparison
equal deleted inserted replaced
376:a90100959871 377:939bc4da6812
486 if(DoDisplayRefresh) 486 if(DoDisplayRefresh)
487 { 487 {
488 DoDisplayRefresh = 0; 488 DoDisplayRefresh = 0;
489 RefreshDisplay(); 489 RefreshDisplay();
490 490
491 switch(settingsGetPointer()->MotionDetection) 491 if(stateUsed->mode == MODE_DIVE) /* handle motion events in divemode only */
492 { 492 {
493 case MOTION_DETECT_MOVE: pitchstate = detectPitch(stateRealGetPointer()->lifeData.compass_pitch); 493 switch(settingsGetPointer()->MotionDetection)
494 break; 494 {
495 case MOTION_DETECT_SECTOR: pitchstate = detectSectorButtonEvent(stateRealGetPointer()->lifeData.compass_pitch); 495 case MOTION_DETECT_MOVE: pitchstate = detectPitch(stateRealGetPointer()->lifeData.compass_pitch);
496 break; 496 break;
497 case MOTION_DETECT_SCROLL: pitchstate = detectScrollButtonEvent(stateRealGetPointer()->lifeData.compass_pitch); 497 case MOTION_DETECT_SECTOR: pitchstate = detectSectorButtonEvent(stateRealGetPointer()->lifeData.compass_pitch);
498 break; 498 break;
499 default: 499 case MOTION_DETECT_SCROLL: pitchstate = detectScrollButtonEvent(stateRealGetPointer()->lifeData.compass_pitch);
500 pitchstate = DETECT_NOTHING; 500 break;
501 break; 501 default:
502 pitchstate = DETECT_NOTHING;
503 break;
504 }
502 } 505 }
503 506
504 if(DETECT_NEG_PITCH == pitchstate) 507 if(DETECT_NEG_PITCH == pitchstate)
505 { 508 {
506 StoreButtonAction((uint8_t)ACTION_PITCH_NEG); 509 StoreButtonAction((uint8_t)ACTION_PITCH_NEG);