changeset 749:9334bdc30d60

Added enum for Co2 display
author Ideenmodellierer
date Mon, 13 Mar 2023 22:18:28 +0100
parents be25ab2d902c
children 6bd21ebe1a93
files Discovery/Inc/t7.h Discovery/Src/t7.c
diffstat 2 files changed, 21 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Discovery/Inc/t7.h	Sun Mar 05 22:14:53 2023 +0100
+++ b/Discovery/Inc/t7.h	Mon Mar 13 22:18:28 2023 +0100
@@ -52,7 +52,10 @@
 #ifdef ENABLE_PSCR_MODE
 		LCC_SimPpo2,
 #endif
-        LLC_Compass,
+		LLC_Compass,
+#ifdef ENABLE_CO2_SUPPORT
+		LCC_CO2,
+#endif
 		LLC_END
 
 } customview_llc_t;
--- a/Discovery/Src/t7.c	Sun Mar 05 22:14:53 2023 +0100
+++ b/Discovery/Src/t7.c	Mon Mar 13 22:18:28 2023 +0100
@@ -2929,6 +2929,23 @@
         snprintf(text,TEXTSIZE,"%d\016\016\017", stateUsed->lifeData.bottle_bar[stateUsed->lifeData.actualGas.GasIdInSettings]);
         break;
 #endif
+#ifdef ENABLE_CO2_SUPPORT
+    case LCC_CO2:
+        headerText[2] = TXT_CO2Sensor;
+        if(stateUsed->lifeData.CO2_data.CO2_ppm < CO2_WARNING_LEVEL_PPM)
+        {
+        	text[textpointer++] = '\020';
+        }
+        else if(stateUsed->lifeData.CO2_data.CO2_ppm < CO2_ALARM_LEVEL_PPM)
+        {
+        	text[textpointer++] = '\024';	/* yellow */
+        }
+        else
+        {
+        	text[textpointer++] = '\025'; 	/* red */
+        }
+        snprintf(&text[textpointer],TEXTSIZE,"\%5ldppm", stateUsed->lifeData.CO2_data.CO2_ppm);
+#endif
     case LLC_Compass:
         headerText[2] = TXT_2BYTE;
         headerText[3] = TXT2BYTE_Compass;