diff Discovery/Src/tCCR.c @ 582:64bf41faab83

Show Fallback if no valid sensor value is available: In previous version fallback was shown when communication to HUD was lost. Now it will be displayed in case no sensor value ist judged as valid. In case of a fallback event ppo2 warnings as well as the data readings are no longer displayed.
author Ideenmodellierer
date Sat, 12 Dec 2020 20:52:58 +0100
parents d97f0e395058
children 7c73f066cd16
line wrap: on
line diff
--- a/Discovery/Src/tCCR.c	Sat Dec 12 19:18:57 2020 +0100
+++ b/Discovery/Src/tCCR.c	Sat Dec 12 20:52:58 2020 +0100
@@ -193,8 +193,6 @@
 
         if(!sensorActive[2])
             *outOfBouds3 = 1;
-
-        return;
     }
     else
     {
@@ -264,6 +262,7 @@
             }
         }
     }
+
 }
 
 
@@ -272,6 +271,7 @@
     int8_t sensorOutOfBound[3];
     uint16_t result = 0;
     uint8_t count = 0;
+    uint8_t retVal = 0;
 
     test_O2_sensor_values_outOfBounds(&sensorOutOfBound[0], &sensorOutOfBound[1], &sensorOutOfBound[2]);
 
@@ -284,9 +284,14 @@
         }
     }
     if(count == 0) // all sensors out of bounds!
-        return 0;
+    {
+    	set_warning_fallback();
+    }
     else
-        return (uint8_t)(result / count);
+    {
+       retVal = (uint8_t)(result / count);
+    }
+    return retVal;
 }