diff 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
line wrap: on
line diff
--- a/Discovery/Src/settings.c	Tue Nov 03 12:47:51 2020 +0100
+++ b/Discovery/Src/settings.c	Mon Nov 02 21:15:42 2020 +0100
@@ -85,7 +85,7 @@
  * There might even be entries with fixed values that have no range
  */
 const SSettings SettingsStandard = {
-    .header = 0xFFFF001C,
+    .header = 0xFFFF001D,
     .warning_blink_dsec = 8 * 2,
     .lastDiveLogId = 0,
     .logFlashNextSampleStartAddress = 0,
@@ -314,6 +314,10 @@
 	.cv_config_BigScreen = 0xFFFFFFFF,
 	.compassInertia = 0,
 	.tX_customViewPrimaryBF = CVIEW_T3_Decostop,
+	.viewPortMode = 0,
+	.viewRoll = 0,
+	.viewPitch = 0,
+	.viewYaw = 0,
 };
 
 /* Private function prototypes -----------------------------------------------*/
@@ -472,6 +476,12 @@
     	pSettings->tX_customViewPrimaryBF = CVIEW_T3_Decostop;
     	pSettings->cv_config_BigScreen &= pSettings->cv_configuration ^= 1 << CVIEW_T3_DecoTTS;
         // no break
+    case 0xFFFF001C:
+    	pSettings->viewPortMode = 0;
+    	pSettings->viewRoll = 0;
+    	pSettings->viewPitch = 0;
+    	pSettings->viewYaw = 0;
+    	// no break
     default:
         pSettings->header = pStandard->header;
         break; // no break before!!
@@ -1395,6 +1405,11 @@
     	Settings.tX_customViewPrimaryBF = CVIEW_T3_Decostop;
     	corrections++;
     }
+    if(Settings.viewPortMode > MAX_VIEWPORT_MODE)
+    {
+    	Settings.viewPortMode = 0;
+    	corrections++;
+    }
 
     if(corrections > 255)
         return 255;