diff Small_CPU/Src/GNSS.c @ 947:96cf6c53c934 Evo_2_23

GNSS sleep mode: Backup voltage is now enabled during initialization. Power saving interval has been changed to 20 second active in a 60 minutes cycle.
author Ideenmodellierer
date Sun, 22 Dec 2024 21:14:41 +0100
parents 06aaccaf2e02
children
line wrap: on
line diff
--- a/Small_CPU/Src/GNSS.c	Sun Dec 22 20:52:08 2024 +0100
+++ b/Small_CPU/Src/GNSS.c	Sun Dec 22 21:14:41 2024 +0100
@@ -28,6 +28,7 @@
 
 #include <string.h>
 #include "GNSS.h"
+#include "data_exchange.h"
 
 union u_Short uShort;
 union i_Short iShort;
@@ -56,6 +57,7 @@
 	GNSS->vAcc = 0;
 	GNSS->gSpeed = 0;
 	GNSS->headMot = 0;
+	GNSS->alive = 0;
 }
 
 /*!
@@ -139,7 +141,22 @@
 		GNSS->fLat = searchCnt++;
 	}
 
-	GNSS->alive = !GNSS->alive;
+	if(GNSS->alive & GNSS_ALIVE_STATE_ALIVE)							/* alive */
+	{
+		GNSS->alive &= !GNSS_ALIVE_STATE_ALIVE;
+	}
+	else
+	{
+		GNSS->alive |= GNSS_ALIVE_STATE_ALIVE;
+	}
+	if((GNSS_Handle.uartWorkingBuffer[17] & 0x03) == 0x03)	/* date/time valid */
+	{
+		GNSS->alive |= GNSS_ALIVE_STATE_TIME;
+	}
+	else
+	{
+		GNSS->alive &= !GNSS_ALIVE_STATE_TIME;
+	}
 }
 
 /*!