comparison 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
comparison
equal deleted inserted replaced
946:80ae8ea7f0a0 947:96cf6c53c934
26 ****************************************************************************** 26 ******************************************************************************
27 */ 27 */
28 28
29 #include <string.h> 29 #include <string.h>
30 #include "GNSS.h" 30 #include "GNSS.h"
31 #include "data_exchange.h"
31 32
32 union u_Short uShort; 33 union u_Short uShort;
33 union i_Short iShort; 34 union i_Short iShort;
34 union u_Long uLong; 35 union u_Long uLong;
35 union i_Long iLong; 36 union i_Long iLong;
54 GNSS->hMSL = 0; 55 GNSS->hMSL = 0;
55 GNSS->hAcc = 0; 56 GNSS->hAcc = 0;
56 GNSS->vAcc = 0; 57 GNSS->vAcc = 0;
57 GNSS->gSpeed = 0; 58 GNSS->gSpeed = 0;
58 GNSS->headMot = 0; 59 GNSS->headMot = 0;
60 GNSS->alive = 0;
59 } 61 }
60 62
61 /*! 63 /*!
62 * Parse data to unique chip ID standard. 64 * Parse data to unique chip ID standard.
63 * Look at: 32.19.1.1 u-blox 8 Receiver description 65 * Look at: 32.19.1.1 u-blox 8 Receiver description
137 if((GNSS->fLat == 0.0) && (GNSS->fLon == 0.0)) 139 if((GNSS->fLat == 0.0) && (GNSS->fLon == 0.0))
138 { 140 {
139 GNSS->fLat = searchCnt++; 141 GNSS->fLat = searchCnt++;
140 } 142 }
141 143
142 GNSS->alive = !GNSS->alive; 144 if(GNSS->alive & GNSS_ALIVE_STATE_ALIVE) /* alive */
145 {
146 GNSS->alive &= !GNSS_ALIVE_STATE_ALIVE;
147 }
148 else
149 {
150 GNSS->alive |= GNSS_ALIVE_STATE_ALIVE;
151 }
152 if((GNSS_Handle.uartWorkingBuffer[17] & 0x03) == 0x03) /* date/time valid */
153 {
154 GNSS->alive |= GNSS_ALIVE_STATE_TIME;
155 }
156 else
157 {
158 GNSS->alive &= !GNSS_ALIVE_STATE_TIME;
159 }
143 } 160 }
144 161
145 /*! 162 /*!
146 * Parse data to UTC time solution standard. 163 * Parse data to UTC time solution standard.
147 * Look at: 32.17.30.1 u-blox 8 Receiver description. 164 * Look at: 32.17.30.1 u-blox 8 Receiver description.