# HG changeset patch # User Ideenmodellierer # Date 1607880700 -3600 # Node ID bb5ce239741f1569b2510d87405cab59595cd0d6 # Parent 4dfdf230d8ba53913cc1fd0a7a459c72da745c2b Motion control: Jump back to primary view if focus is lost: The modes sector and scroll are tipically used to have a short look at other information pages (e.g. compass). By automatically jumping back to the primary view, there is no longer the need to select the preferred view when leaving focus mode diff -r 4dfdf230d8ba -r bb5ce239741f Discovery/Src/base.c --- a/Discovery/Src/base.c Sun Dec 13 18:29:12 2020 +0100 +++ b/Discovery/Src/base.c Sun Dec 13 18:31:40 2020 +0100 @@ -232,6 +232,8 @@ #include "test_vpm.h" #include "tDebug.h" #include "motion.h" +#include "t7.h" +#include "t3.h" #ifdef DEMOMODE #include "demo.h" @@ -347,6 +349,7 @@ { uint32_t pLayerInvisible; uint16_t totalDiveCounterFound; + uint8_t wasInFocus = 0; SStateList status; #ifdef ENABLE_MOTION_CONTROL @@ -512,6 +515,7 @@ if(viewInFocus()) { + wasInFocus = 1; set_Backlight_Boost(settingsGetPointer()->viewPortMode & 0x03); switch(settingsGetPointer()->MotionDetection) { @@ -536,6 +540,19 @@ } else { + if(wasInFocus) + { + wasInFocus = 0; + if(settingsGetPointer()->design == 7) + { + t7_set_customview_to_primary(); + } + else + { + t3_set_customview_to_primary(); + } + } + set_Backlight_Boost(0); } } @@ -772,6 +789,10 @@ else /* return to t7 view */ { settingsGetPointer()->design = 7; + if(settingsGetPointer()->MotionDetection == MOTION_DETECT_SECTOR) + { + DefinePitchSectors(settingsGetPointer()->viewPitch,CUSTOMER_DEFINED_VIEWS); + } } } else @@ -785,7 +806,7 @@ settingsGetPointer()->design = 3; if(settingsGetPointer()->MotionDetection == MOTION_DETECT_SECTOR) { - DefinePitchSectors(stateRealGetPointer()->lifeData.compass_pitch,CUSTOMER_DEFINED_VIEWS); + DefinePitchSectors(settingsGetPointer()->viewPitch,CUSTOMER_DEFINED_VIEWS); } } else if (settingsGetPointer()->extraDisplay == EXTRADISPLAY_DECOGAME)