diff Discovery/Src/t7.c @ 857:ba1aebc6d5af Evo_2_23

Developer feature debug warning: The debug warnings are only available to developers who activate the feature via compile switch. After that it is possible to define a condition and a content of a warning which will be shown if a special situation occure (visualized in the main view as already done for other warnings like ppo2). In the first implementation details regarding the error state of the DiveO2 will be shown in case the sensor reports a problem. Feel free to change the implementation in case you want to observe another behavior.
author Ideenmodellierer
date Sun, 05 May 2024 17:27:28 +0200
parents 7e714662b93f
children d32901746950
line wrap: on
line diff
--- a/Discovery/Src/t7.c	Sun May 05 17:20:56 2024 +0200
+++ b/Discovery/Src/t7.c	Sun May 05 17:27:28 2024 +0200
@@ -1419,6 +1419,9 @@
     	count++;
     }
 #endif
+#ifdef HAVE_DEBUG_WARNINGS
+    count += stateUsed->warnings.debug;
+#endif
     return count;
 }
 
@@ -1490,6 +1493,7 @@
 {
     char text[256];
     uint8_t textpointer, lineFree;
+    uint8_t index = 0;
 
     text[0] = '\025';
     text[1] = '\f';
@@ -1576,6 +1580,19 @@
         lineFree--;
     }
 #endif
+#ifdef HAVE_DEBUG_WARNINGS
+    if(lineFree && stateUsed->warnings.debug)
+    {
+	    for(index=0; index<3; index++)
+	    {
+        	if(((stateUsed->lifeData.extIf_sensor_map[index] == SENSOR_DIGO2M) && (((SSensorDataDiveO2*)(stateUsed->lifeData.extIf_sensor_data[index]))->status & DVO2_FATAL_ERROR)))
+        	{
+        		textpointer += snprintf(&text[textpointer],32,"\001Debug: %lx\n",((SSensorDataDiveO2*)(stateUsed->lifeData.extIf_sensor_data[index]))->status);
+        	}
+	    }
+        lineFree--;
+    }
+#endif
 /*
     if(lineFree && stateUsed->warnings.lowBattery)
     {