# HG changeset patch
# User ideenmodellierer
# Date 1584994494 -3600
# Node ID 91a939915bfa8cf77e55bf62cfc56f0953e15151
# Parent  f7c66593ab82496468fec59abc3b6fce1351ac0f
Added initialization of bottle sensor data age counter

diff -r f7c66593ab82 -r 91a939915bfa Discovery/Src/tCCR.c
--- a/Discovery/Src/tCCR.c	Mon Mar 23 21:13:52 2020 +0100
+++ b/Discovery/Src/tCCR.c	Mon Mar 23 21:14:54 2020 +0100
@@ -53,6 +53,8 @@
 #define HUD_RX_START_DELAY_MS		(500u)		/* Delay for start of RX function to avoid start of reception while a transmission is ongoing. */
 												/* Based on an assumed cycle time by the sensor of 1 second. Started at time of last RX */
 
+#define BOTTLE_SENSOR_TIMEOUT		(6000u)     /* signal pressure budget as not received after 10 minutes (6000 * 100ms) */
+
 /* Private variables ---------------------------------------------------------*/
 static SIrLink receiveHUD[2];
 static uint8_t boolHUDdata = 0;
@@ -290,7 +292,15 @@
 
 void tCCR_init(void)
 {
+	uint8_t loop;
+
     StartListeningToUART_HUD = 1;
+
+    SDiveState* pDiveData = stateRealGetPointerWrite();
+    for(loop=0;loop<(2*NUM_GASES+1);loop++)
+    {
+    	pDiveData->lifeData.bottle_bar_age_MilliSeconds[loop] =  BOTTLE_SENSOR_TIMEOUT;
+    }
 }