Rev 747 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 747 | Rev 752 | ||
---|---|---|---|
Line 105... | Line 105... | ||
105 | 105 | ||
106 | 106 | ||
107 | void GPS_Main(void) |
107 | void GPS_Main(void) |
108 | { |
- | |
- | 108 | { |
|
Line 109... | Line 109... | ||
109 | static uint8_t GPS_Task = TSK_IDLE; |
109 | static uint8_t GPS_Task = TSK_IDLE; |
110 | 110 | int16_t satbeep; |
|
111 | 111 | ||
112 | // poti2 enables the gps feature |
112 | // poti2 enables the gps feature |
Line 117... | Line 117... | ||
117 | 117 | ||
118 | switch(GPSInfo.status) |
118 | switch(GPSInfo.status) |
119 | { |
119 | { |
120 | case INVALID: // invalid gps data |
120 | case INVALID: // invalid gps data |
- | 121 | GPS_Neutral(); |
|
- | 122 | if(GPS_Task != TSK_IDLE) |
|
121 | GPS_Neutral(); |
123 | { |
- | 124 | BeepTime = 100; // beep if signal is neccesary |
|
122 | if(GPS_Task != TSK_IDLE) BeepTime = 50; // beep if signal is neccesary |
125 | } |
123 | break; |
126 | break; |
124 | case PROCESSED: // if gps data are already processed |
127 | case PROCESSED: // if gps data are already processed |
125 | // downcount timeout |
128 | // downcount timeout |
126 | if(GPSTimeout) GPSTimeout--; |
129 | if(GPSTimeout) GPSTimeout--; |
Line 197... | Line 200... | ||
197 | } // eof 3D-FIX |
200 | } // eof 3D-FIX |
Line 198... | Line 201... | ||
198 | 201 | ||
199 | else // no 3D-SATFIX |
202 | else // no 3D-SATFIX |
200 | { // disable gps control |
203 | { // disable gps control |
201 | GPS_Neutral(); |
204 | GPS_Neutral(); |
- | 205 | if(GPS_Task != TSK_IDLE) |
|
- | 206 | { |
|
- | 207 | satbeep = 2048 - (int16_t)GPSInfo.satnum * 256; // is zero at 8 sats |
|
- | 208 | if (satbeep < 0) satbeep = 0; |
|
- | 209 | BeepTime = 50 + (uint16_t)satbeep; |
|
202 | if(GPS_Task != TSK_IDLE) BeepTime = 50; |
210 | } |
203 | } |
- | |
204 | 211 | } |
|
205 | // set current data as processed to avoid further calculations on the same gps data |
212 | // set current data as processed to avoid further calculations on the same gps data |
206 | GPSInfo.status = PROCESSED; |
213 | GPSInfo.status = PROCESSED; |
207 | break; |
214 | break; |
208 | } // eof GPSInfo.status |
215 | } // eof GPSInfo.status |