diff Small_CPU/Src/GNSS.c @ 919:c0553dd70608 Evo_2_23

GNSS support for external UART interface: An ubox gps module may now be connected to the external UART. Per default the functionality is disabled using the compile switch ENABLE_GNSS_SUPPORT
author Ideenmodellierer
date Sun, 03 Nov 2024 15:43:04 +0100
parents 2225c467f1e9
children 5a9bc2e6112d
line wrap: on
line diff
--- a/Small_CPU/Src/GNSS.c	Sun Nov 03 15:40:55 2024 +0100
+++ b/Small_CPU/Src/GNSS.c	Sun Nov 03 15:43:04 2024 +0100
@@ -171,6 +171,9 @@
  * @param GNSS Pointer to main GNSS structure.
  */
 void GNSS_ParsePVTData(GNSS_StateHandle *GNSS) {
+
+	static float searchCnt = 1.0;
+
 	uShort.bytes[0] = GNSS_Handle.uartWorkingBuffer[10];
 	GNSS->yearBytes[0]=GNSS_Handle.uartWorkingBuffer[10];
 	uShort.bytes[1] = GNSS_Handle.uartWorkingBuffer[11];
@@ -226,6 +229,11 @@
 		iLong.bytes[var] = GNSS_Handle.uartWorkingBuffer[var + 70];
 	}
 	GNSS->headMot = iLong.iLong * 1e-5; // todo I'm not sure this good options.
+
+	if((GNSS->fLat == 0.0) && (GNSS->fLon == 0.0))
+	{
+		GNSS->fLat = searchCnt++;
+	}
 }
 
 /*!