changeset 449:91a939915bfa minor_improvments

Added initialization of bottle sensor data age counter
author ideenmodellierer
date Mon, 23 Mar 2020 21:14:54 +0100
parents f7c66593ab82
children b2f8a39c11ea
files Discovery/Src/tCCR.c
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;
+    }
 }