comparison Discovery/Src/settings.c @ 546:daa8d4474ba0

Added new settings for Viewport: A parameter for enabling/disabling is needed as well as the angle values used to define the viewport
author Ideenmodellierer
date Mon, 02 Nov 2020 21:15:42 +0100
parents 6960df7ddb09
children af1c3e3abd5f
comparison
equal deleted inserted replaced
545:e595d2d1f77f 546:daa8d4474ba0
83 83
84 /* always adjust check_and_correct_settings() accordingly 84 /* always adjust check_and_correct_settings() accordingly
85 * There might even be entries with fixed values that have no range 85 * There might even be entries with fixed values that have no range
86 */ 86 */
87 const SSettings SettingsStandard = { 87 const SSettings SettingsStandard = {
88 .header = 0xFFFF001C, 88 .header = 0xFFFF001D,
89 .warning_blink_dsec = 8 * 2, 89 .warning_blink_dsec = 8 * 2,
90 .lastDiveLogId = 0, 90 .lastDiveLogId = 0,
91 .logFlashNextSampleStartAddress = 0, 91 .logFlashNextSampleStartAddress = 0,
92 92
93 .gas[0].oxygen_percentage = 21, 93 .gas[0].oxygen_percentage = 21,
312 .cv_configuration = 0xFFFFFFFF, 312 .cv_configuration = 0xFFFFFFFF,
313 .MotionDetection = MOTION_DETECT_OFF, 313 .MotionDetection = MOTION_DETECT_OFF,
314 .cv_config_BigScreen = 0xFFFFFFFF, 314 .cv_config_BigScreen = 0xFFFFFFFF,
315 .compassInertia = 0, 315 .compassInertia = 0,
316 .tX_customViewPrimaryBF = CVIEW_T3_Decostop, 316 .tX_customViewPrimaryBF = CVIEW_T3_Decostop,
317 .viewPortMode = 0,
318 .viewRoll = 0,
319 .viewPitch = 0,
320 .viewYaw = 0,
317 }; 321 };
318 322
319 /* Private function prototypes -----------------------------------------------*/ 323 /* Private function prototypes -----------------------------------------------*/
320 uint8_t checkValue(uint8_t value,uint8_t from, uint8_t to); 324 uint8_t checkValue(uint8_t value,uint8_t from, uint8_t to);
321 325
470 case 0xFFFF001B: 474 case 0xFFFF001B:
471 pSettings->compassInertia = 0; /* no inertia */ 475 pSettings->compassInertia = 0; /* no inertia */
472 pSettings->tX_customViewPrimaryBF = CVIEW_T3_Decostop; 476 pSettings->tX_customViewPrimaryBF = CVIEW_T3_Decostop;
473 pSettings->cv_config_BigScreen &= pSettings->cv_configuration ^= 1 << CVIEW_T3_DecoTTS; 477 pSettings->cv_config_BigScreen &= pSettings->cv_configuration ^= 1 << CVIEW_T3_DecoTTS;
474 // no break 478 // no break
479 case 0xFFFF001C:
480 pSettings->viewPortMode = 0;
481 pSettings->viewRoll = 0;
482 pSettings->viewPitch = 0;
483 pSettings->viewYaw = 0;
484 // no break
475 default: 485 default:
476 pSettings->header = pStandard->header; 486 pSettings->header = pStandard->header;
477 break; // no break before!! 487 break; // no break before!!
478 } 488 }
479 } 489 }
1391 corrections++; 1401 corrections++;
1392 } 1402 }
1393 if(Settings.tX_customViewPrimaryBF > CVIEW_T3_END) 1403 if(Settings.tX_customViewPrimaryBF > CVIEW_T3_END)
1394 { 1404 {
1395 Settings.tX_customViewPrimaryBF = CVIEW_T3_Decostop; 1405 Settings.tX_customViewPrimaryBF = CVIEW_T3_Decostop;
1406 corrections++;
1407 }
1408 if(Settings.viewPortMode > MAX_VIEWPORT_MODE)
1409 {
1410 Settings.viewPortMode = 0;
1396 corrections++; 1411 corrections++;
1397 } 1412 }
1398 1413
1399 if(corrections > 255) 1414 if(corrections > 255)
1400 return 255; 1415 return 255;