diff Discovery/Src/tMenuEditHardware.c @ 110:cc8e24374b83 FlipDisplay

Added option to handled mirrored display to existing functions
author Ideenmodellierer
date Tue, 01 Jan 2019 21:02:17 +0100
parents 5f11787b4f42
children 3834b6272ee5
line wrap: on
line diff
--- a/Discovery/Src/tMenuEditHardware.c	Tue Jan 01 21:00:55 2019 +0100
+++ b/Discovery/Src/tMenuEditHardware.c	Tue Jan 01 21:02:17 2019 +0100
@@ -44,6 +44,7 @@
 //void openEdit_Luftintegration(void);
 void openEdit_ButtonSens(void);
 void openEdit_ScooterControl(void);
+void openEdit_FlipDisplay(void);
 
 /* Announced function prototypes -----------------------------------------------*/
 uint8_t OnAction_Compass		(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
@@ -88,7 +89,14 @@
         openEdit_ButtonSens();
     break;
     case 6:
-        openEdit_ScooterControl();
+    	if(getLicence() == LICENCEBONEX)
+    	{
+    		openEdit_ScooterControl();
+    	}
+    	else
+    	{
+    		openEdit_FlipDisplay();
+    	}
     break;
     }
 }
@@ -113,6 +121,32 @@
     exitMenuEdit_to_Menu_with_Menu_Update_do_not_write_settings_for_this_only();
 }
 
+void openEdit_FlipDisplay(void)
+{
+/* does not work like this	resetEnterPressedToStateBeforeButtonAction(); */
+
+    SSettings *pSettings = settingsGetPointer();
+
+    if(pSettings->FlipDisplay == 0)
+    {
+        pSettings->FlipDisplay = 1;
+    }
+    else
+    {
+        pSettings->FlipDisplay = 0;
+    }
+    /* reinit all views */
+    tHome_init();
+    tI_init();
+    tM_init();
+    tMenuEdit_init();
+    tInfoLog_init();
+    tM_build_pages();
+
+
+    exitEditWithUpdate();
+    exitMenuEdit_to_Home();
+}
 /*
 void refresh_ScooterControl(void)
 {
@@ -469,7 +503,7 @@
 
 void refresh_O2Sensors(void)
 {
-    char text[10];
+    char text[16];
     uint16_t y_line;
 
     text[0] = '\001';