diff Discovery/Src/settings.c @ 111:38785aa95837 FlipDisplay

Added new nvm parameter"FlipDisplay" indicating the screen orientation
author Ideenmodellierer
date Tue, 01 Jan 2019 21:03:10 +0100
parents 2b3f8ed4a0b8
children 3834b6272ee5
line wrap: on
line diff
--- a/Discovery/Src/settings.c	Tue Jan 01 21:02:17 2019 +0100
+++ b/Discovery/Src/settings.c	Tue Jan 01 21:03:10 2019 +0100
@@ -55,7 +55,7 @@
 {
     .versionFirst   = 1,
     .versionSecond 	= 4,
-    .versionThird   = 0,
+    .versionThird   = 3,
     .versionBeta    = 0,
 
     /* 4 bytes with trailing 0 */
@@ -82,7 +82,7 @@
  * There might even be entries with fixed values that have no range
  */
 const SSettings SettingsStandard = {
-    .header = 0xFFFF0017,
+    .header = 0xFFFF0018,
     .warning_blink_dsec = 8 * 2,
     .lastDiveLogId = 0,
     .logFlashNextSampleStartAddress = 0,
@@ -305,6 +305,7 @@
     .FactoryButtonBalance[0] = 3,
     .FactoryButtonBalance[1] = 3,
     .FactoryButtonBalance[2] = 3,
+	.FlipDisplay = 0,
 };
 
 /* Private function prototypes -----------------------------------------------*/
@@ -442,6 +443,9 @@
         pSettings->FactoryButtonBalance[1]          = pStandard->FactoryButtonBalance[1];
         pSettings->FactoryButtonBalance[2]          = pStandard->FactoryButtonBalance[2];
         // no break
+    case 0xFFFF0017:
+    	pSettings->FlipDisplay = 0;
+    	// no break
     default:
         pSettings->header 																= pStandard->header;
         break; // no break before!!
@@ -1381,6 +1385,11 @@
         corrections++;
     }
 
+    if(Settings.FlipDisplay > 1) /* only boolean values allowed */
+   	{
+    	Settings.FlipDisplay = 0;
+	    corrections++;
+   	}
 
     if(corrections > 255)
         return 255;