changeset 640:f735f1123526

Development bugfix Viewport settings: Settings of the viewport have been reset after every update. Root cause: plausibility check value has not been adapted to latest implementation. In addition settings for frame have been overwritten while focus was changed because of an invalid and combination. Both issues have been solved
author Ideenmodellierer
date Thu, 11 Mar 2021 21:43:43 +0100
parents 13ded99ecd56
children ed5422ac4ffb
files Common/Inc/settings.h Discovery/Src/tMenuEditCustom.c
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/Common/Inc/settings.h	Thu Feb 25 12:20:43 2021 +0100
+++ b/Common/Inc/settings.h	Thu Mar 11 21:43:43 2021 +0100
@@ -69,7 +69,7 @@
 #define PRESSURE_OFFSET_LIMIT_MBAR	50
 
 #define MAX_COMPASS_COMP 		(2u)
-#define MAX_VIEWPORT_MODE 		(0x1F)
+#define MAX_VIEWPORT_MODE 		(0x7F)
 
 typedef enum
 {
--- a/Discovery/Src/tMenuEditCustom.c	Thu Feb 25 12:20:43 2021 +0100
+++ b/Discovery/Src/tMenuEditCustom.c	Thu Mar 11 21:43:43 2021 +0100
@@ -709,9 +709,9 @@
 uint8_t OnAction_CViewPortLayout(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
 {
 	SSettings* pSettings = settingsGetPointer();
-	if(pSettings->viewPortMode >> 4 != 0)
+	if((pSettings->viewPortMode >> 4) & 0x10 != 0)
 	{
-		pSettings->viewPortMode &= 0x0F;
+		pSettings->viewPortMode &= 0xEF;	/* 1110 1111 */
 	}
 	else
 	{
@@ -772,7 +772,7 @@
     {
     	newValue = 0;
     }
-    pSettings->viewPortMode &= 0x9F;
+    pSettings->viewPortMode &= 0x9F;		/* 1001 1111 */
     pSettings->viewPortMode |= (newValue << 5);
     return UPDATE_DIVESETTINGS;
 }