comparison Discovery/Src/tHome.c @ 387:0dbb74be972f

Merged in Ideenmodellierer/ostc4/MotionDetection (pull request #34) MotionDetection
author heinrichsweikamp <bitbucket@heinrichsweikamp.com>
date Sun, 24 Nov 2019 15:46:58 +0000
parents 39c147e47c1c
children b560e474e319
comparison
equal deleted inserted replaced
358:c6a084d1433f 387:0dbb74be972f
40 #include "timer.h" // for timer_Stopwatch_Restart 40 #include "timer.h" // for timer_Stopwatch_Restart
41 #include "tMenu.h" 41 #include "tMenu.h"
42 #include "tMenuEditGasOC.h" // for openEdit_DiveSelectBetterGas() 42 #include "tMenuEditGasOC.h" // for openEdit_DiveSelectBetterGas()
43 #include "tMenuEditSetpoint.h" // for openEdit_DiveSelectBetterSetpoint() 43 #include "tMenuEditSetpoint.h" // for openEdit_DiveSelectBetterSetpoint()
44 #include "simulation.h" 44 #include "simulation.h"
45 #include "motion.h"
45 46
46 /* Private types -------------------------------------------------------------*/ 47 /* Private types -------------------------------------------------------------*/
47 48
48 /* Exported variables --------------------------------------------------------*/ 49 /* Exported variables --------------------------------------------------------*/
49 _Bool warning_count_high_time = 0; 50 _Bool warning_count_high_time = 0;
54 static uint8_t warning_toogle_count; 55 static uint8_t warning_toogle_count;
55 static uint16_t display_toogle_count; 56 static uint16_t display_toogle_count;
56 static uint16_t tHome_tick_count_cview; 57 static uint16_t tHome_tick_count_cview;
57 static uint16_t tHome_tick_count_field; 58 static uint16_t tHome_tick_count_field;
58 59
59 const uint8_t cv_changelist[6] = {CVIEW_Compass, CVIEW_SummaryOfLeftCorner, CVIEW_Tissues, CVIEW_Profile, CVIEW_EADTime, CVIEW_Gaslist}; 60 const uint8_t cv_changelist[] = {CVIEW_Compass, CVIEW_SummaryOfLeftCorner, CVIEW_Tissues, CVIEW_Profile, CVIEW_EADTime, CVIEW_Gaslist, CVIEW_noneOrDebug, CVIEW_Decolist,CVIEW_sensors,CVIEW_sensors_mV, CVIEW_END};
60 61
61 /* Private function prototypes -----------------------------------------------*/ 62 /* Private function prototypes -----------------------------------------------*/
62 63
63 /* Exported functions --------------------------------------------------------*/ 64 /* Exported functions --------------------------------------------------------*/
64 65
145 { 146 {
146 if(settingsGetPointer()->design == 4) 147 if(settingsGetPointer()->design == 4)
147 return; 148 return;
148 149
149 if(settingsGetPointer()->design == 3) 150 if(settingsGetPointer()->design == 3)
151 {
150 settingsGetPointer()->design = 7; 152 settingsGetPointer()->design = 7;
151 153 if(settingsGetPointer()->MotionDetection == MOTION_DETECT_SECTOR)
154 {
155 DefinePitchSectors(stateRealGetPointer()->lifeData.compass_pitch,CUSTOMER_DEFINED_VIEWS);
156 }
157 }
152 switch(get_globalState()) 158 switch(get_globalState())
153 { 159 {
154 case StD: 160 case StD:
155 if(settingsGetPointer()->design == 6) 161 if(settingsGetPointer()->design == 6)
156 { 162 {
236 if(sendAction == ACTION_BUTTON_ENTER) 242 if(sendAction == ACTION_BUTTON_ENTER)
237 { 243 {
238 if(settingsGetPointer()->design == 4) 244 if(settingsGetPointer()->design == 4)
239 return; 245 return;
240 246
241 if(settingsGetPointer()->design == 3) 247 if(settingsGetPointer()->design == 3) /* switch back to t7 (standard) view */
248 {
242 settingsGetPointer()->design = 7; 249 settingsGetPointer()->design = 7;
250 if(settingsGetPointer()->MotionDetection == MOTION_DETECT_SECTOR)
251 {
252 DefinePitchSectors(stateRealGetPointer()->lifeData.compass_pitch,CUSTOMER_DEFINED_VIEWS);
253 }
254 }
243 255
244 switch(get_globalState()) 256 switch(get_globalState())
245 { 257 {
246 case StDMGAS: 258 case StDMGAS:
247 openEdit_DiveSelectBetterGas(); 259 openEdit_DiveSelectBetterGas();
328 if(settingsGetPointer()->design == 7) 340 if(settingsGetPointer()->design == 7)
329 t7_change_field(); 341 t7_change_field();
330 } 342 }
331 343
332 344
333 void tHome_change_customview_button_pressed(void) 345 void tHome_change_customview_button_pressed(uint8_t action)
334 { 346 {
335 tHome_tick_count_cview = 0; 347 tHome_tick_count_cview = 0;
336 if(settingsGetPointer()->design == 7) 348 if(settingsGetPointer()->design == 7)
337 t7_change_customview(); 349 t7_change_customview(action);
338 else 350 else
339 if(settingsGetPointer()->design == 3) 351 if(settingsGetPointer()->design == 3)
340 t3_change_customview(); 352 t3_change_customview(action);
341 else 353 else
342 if(settingsGetPointer()->design == 5) 354 if(settingsGetPointer()->design == 5)
343 t5_change_customview(); 355 t5_change_customview(action);
344 else 356 else
345 if(settingsGetPointer()->design == 6) 357 if(settingsGetPointer()->design == 6)
346 t6_change_customview(); 358 t6_change_customview(action);
347 } 359 }
348 360
349 361
350 void tHome_tick(void) 362 void tHome_tick(void)
351 { 363 {