diff Discovery/Src/t7.c @ 477:5e6a612d03b5 Improve_Button_Sleep

Only switch between "no fly" and "desaturation" in case there is desaturation time left: In previous versions a switch between the times were performed even desaturation time were 0 causing an empty field (nothing) to be displayed. In that case the remaining no fly time is shown Development option only: Show Pressure update for a short time in the custom field (as warning)
author ideenmodellierer
date Tue, 12 May 2020 23:03:29 +0200
parents 4bd01f48c285
children 89f6857276f8
line wrap: on
line diff
--- a/Discovery/Src/t7.c	Tue May 12 22:54:19 2020 +0200
+++ b/Discovery/Src/t7.c	Tue May 12 23:03:29 2020 +0200
@@ -828,8 +828,7 @@
 */
 
     /* noFlyTime or DesaturationTime */
-
-    if((!display_count_high_time) && (stateUsed->lifeData.no_fly_time_minutes))
+    if((stateUsed->lifeData.no_fly_time_minutes) && ((!display_count_high_time) || (stateUsed->lifeData.desaturation_time_minutes == 0)))
     {
         SSurfacetime NoFlyTime = {0,0,0,0};
         t7_fill_surfacetime_helper(&NoFlyTime,stateUsed->lifeData.no_fly_time_minutes, 0);
@@ -1321,6 +1320,12 @@
     //count += stateUsed->warnings.lowBattery;
     count += stateUsed->warnings.sensorLinkLost;
     count += stateUsed->warnings.fallback;
+#ifdef ENABLE_BOTTLE_SENSOR
+    if(stateUsed->warnings.newPressure)
+    {
+    	count++;
+    }
+#endif
     return count;
 }
 
@@ -1331,6 +1336,12 @@
     count = 0;
     count += stateUsed->cnsHigh_at_the_end_of_dive;
     count += stateUsed->decoMissed_at_the_end_of_dive;
+#ifdef ENABLE_BOTTLE_SENSOR
+    if(stateUsed->warnings.newPressure)
+    {
+    	count++;
+    }
+#endif
     return count;
 }
 
@@ -1369,6 +1380,14 @@
         text[textpointer] = 0;
         lineFree--;
     }
+#ifdef ENABLE_BOTTLE_SENSOR
+    if(stateUsed->warnings.newPressure)
+    {
+    	sprintf(&text[textpointer] ,"  %u Bar\n", stateUsed->warnings.newPressure);
+    	textpointer++;
+        lineFree--;
+    }
+#endif
     if(textpointer != 0)
         GFX_write_string(&FontT48,&t7cW,text,1);
 }
@@ -1438,6 +1457,14 @@
         text[textpointer] = 0;
         lineFree--;
     }
+#ifdef ENABLE_BOTTLE_SENSOR
+    if(stateUsed->warnings.newPressure)
+    {
+    	sprintf(&text[textpointer],"  %u Bar\n", stateUsed->warnings.newPressure);
+    	textpointer++;
+        lineFree--;
+    }
+#endif
 /*
     if(lineFree && stateUsed->warnings.lowBattery)
     {