diff Discovery/Src/base.c @ 108:f561c79b0546 FlipDisplay

Flip key assigment if needed
author Ideenmodellierer
date Tue, 01 Jan 2019 21:00:13 +0100
parents 5f11787b4f42
children 3834b6272ee5
line wrap: on
line diff
--- a/Discovery/Src/base.c	Tue Jan 01 20:59:36 2019 +0100
+++ b/Discovery/Src/base.c	Tue Jan 01 21:00:13 2019 +0100
@@ -781,6 +781,8 @@
 
     uint8_t action = 0;
     SStateList status;
+	SSettings* pSettings;
+	pSettings = settingsGetPointer();
 
     if(GPIO_Pin == VSYNC_IRQ_PIN) // rechts, unten
     {
@@ -816,18 +818,34 @@
         return;
 
     if(GPIO_Pin == BUTTON_BACK_PIN) // links
-        action = ACTION_BUTTON_BACK;
-    else
-    if(GPIO_Pin == BUTTON_ENTER_PIN) // mitte
-        action = ACTION_BUTTON_ENTER;
+    {
+    	if(!pSettings->FlipDisplay)
+    	{
+    		action = ACTION_BUTTON_BACK;
+    	}
+    	else
+    	{
+    		action = ACTION_BUTTON_NEXT;
+    	}
+    }
     else
-    if(GPIO_Pin == BUTTON_NEXT_PIN) // rechts
-        action = ACTION_BUTTON_NEXT;
-#ifdef BUTTON_CUSTOM_PIN
-    else
-    if(GPIO_Pin == BUTTON_CUSTOM_PIN) // extra
-        action = ACTION_BUTTON_CUSTOM;
-#endif
+    {
+		if(GPIO_Pin == BUTTON_ENTER_PIN) // mitte
+			action = ACTION_BUTTON_ENTER;
+		else
+		{
+			if(GPIO_Pin == BUTTON_NEXT_PIN) // rechts
+			{
+				if(!pSettings->FlipDisplay)	action = ACTION_BUTTON_NEXT;
+				 else action = ACTION_BUTTON_BACK;
+			}
+		}
+    }
+	#ifdef BUTTON_CUSTOM_PIN
+		else
+		if(GPIO_Pin == BUTTON_CUSTOM_PIN) // extra
+			action = ACTION_BUTTON_CUSTOM;
+	#endif
 
 #ifdef DEMOMODE // user pressed button ?
     if((!demoMachineCall) && demoModeActive())