Mercurial > public > ostc4
comparison Discovery/Src/base.c @ 373:7b981f8bdd41 MotionDetection
Add scroll event by pitch angle detection:
Add a function to scroll through the custom view in case the computer is not in the typical center position
Refine Pitch Detection:
Changed implementation to use sectors for detection. Increased detection window
author | ideenmodellierer |
---|---|
date | Sun, 08 Sep 2019 13:45:17 +0200 |
parents | fca370f847f8 |
children | 939bc4da6812 |
comparison
equal
deleted
inserted
replaced
372:75eedde05ff6 | 373:7b981f8bdd41 |
---|---|
492 { | 492 { |
493 case MOTION_DETECT_MOVE: pitchstate = detectPitch(stateRealGetPointer()->lifeData.compass_pitch); | 493 case MOTION_DETECT_MOVE: pitchstate = detectPitch(stateRealGetPointer()->lifeData.compass_pitch); |
494 break; | 494 break; |
495 case MOTION_DETECT_SECTOR: pitchstate = detectSectorButtonEvent(stateRealGetPointer()->lifeData.compass_pitch); | 495 case MOTION_DETECT_SECTOR: pitchstate = detectSectorButtonEvent(stateRealGetPointer()->lifeData.compass_pitch); |
496 break; | 496 break; |
497 case MOTION_DETECT_SCROLL: pitchstate = detectScrollButtonEvent(stateRealGetPointer()->lifeData.compass_pitch); | |
498 break; | |
497 default: | 499 default: |
498 pitchstate = DETECT_NOTHING; | 500 pitchstate = DETECT_NOTHING; |
499 break; | 501 break; |
500 } | 502 } |
501 | 503 |
900 { | 902 { |
901 | 903 |
902 if ((status.page == PageDive) && (status.line == 0)) | 904 if ((status.page == PageDive) && (status.line == 0)) |
903 { | 905 { |
904 tHome_change_customview_button_pressed(action); | 906 tHome_change_customview_button_pressed(action); |
905 if((settingsGetPointer()->MotionDetection == MOTION_DETECT_SECTOR) && (action == ACTION_BUTTON_ENTER)) /* Button pressed while sector detection is active => calibrate to current pitch value */ | 907 if((settingsGetPointer()->MotionDetection != MOTION_DETECT_OFF) && (action == ACTION_BUTTON_ENTER)) /* Button pressed while motion detection is active => calibrate to current pitch value */ |
906 { | 908 { |
907 DefinePitchSectors(stateRealGetPointer()->lifeData.compass_pitch,CUSTOMER_DEFINED_VIEWS); | 909 DefinePitchSectors(stateRealGetPointer()->lifeData.compass_pitch,CUSTOMER_KEEP_LAST_SECTORS); |
908 } | 910 } |
909 } | 911 } |
910 else if (status.page == PageSurface) | 912 else if (status.page == PageSurface) |
911 tHome_change_customview_button_pressed(action); | 913 tHome_change_customview_button_pressed(action); |
912 else | 914 else |