changeset 810:e6827fcd7604

Only jump to Sensor view during charging if sensors are connected: In the past it could happen that the charger view was replaced by the sensor view which was not displaying values because no sensors were connected => no added value in performing the switch. In the new version the automatic jump to the sensor view will only be performed if sennsors are connected.
author Ideenmodellierer
date Sun, 27 Aug 2023 20:55:57 +0200
parents 9602a7338f28
children 4c41d9a18c7f
files Discovery/Src/tHome.c
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Discovery/Src/tHome.c	Sun Aug 27 20:51:13 2023 +0200
+++ b/Discovery/Src/tHome.c	Sun Aug 27 20:55:57 2023 +0200
@@ -648,13 +648,19 @@
         }
     }
 
-    if((stateUsed->mode == MODE_SURFACE) && (stateUsed->diveSettings.ppo2sensors_deactivated != 0x07) && (stateUsed->diveSettings.ccrOption != 0) && (!t7_customview_disabled(CVIEW_sensors)))
+    if((stateUsed->mode == MODE_SURFACE) && (!t7_customview_disabled(CVIEW_sensors)))
     {
     	tHome_tick_count_o2sens++;
     	if(tHome_tick_count_o2sens > AUTORETURN_O2SENS)
     	{
     		tHome_tick_count_o2sens = 0;
-    		t7_select_customview(CVIEW_sensors);
+    		if((stateUsed->chargeStatus == CHARGER_off)
+    			|| (stateUsed->lifeData.ppO2Sensor_bar[0] != 0.0)
+    			|| (stateUsed->lifeData.ppO2Sensor_bar[1] != 0.0)
+				|| (stateUsed->lifeData.ppO2Sensor_bar[2] != 0.0))
+			{
+    			t7_select_customview(CVIEW_sensors);
+			}
     	}
     }