Rev 413 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 413 | Rev 419 | ||
---|---|---|---|
Line 60... | Line 60... | ||
60 | #include "uart1.h" |
60 | #include "uart1.h" |
61 | #include "kml.h" |
61 | #include "kml.h" |
62 | //#include "gpx.h" |
62 | //#include "gpx.h" |
63 | #include "ssc.h" |
63 | #include "ssc.h" |
64 | #include "settings.h" |
64 | #include "settings.h" |
- | 65 | #include "printf_P.h" |
|
Line 65... | Line 66... | ||
65 | 66 | ||
Line 66... | Line 67... | ||
66 | 67 | ||
Line 195... | Line 196... | ||
195 | // try to create the log file |
196 | // try to create the log file |
196 | if(KML_DocumentOpen(logfilename, &logfile)) |
197 | if(KML_DocumentOpen(logfilename, &logfile)) |
197 | { |
198 | { |
198 | flushtimer = SetDelay(LOG_FLUSH_INTERVAL); |
199 | flushtimer = SetDelay(LOG_FLUSH_INTERVAL); |
199 | logfilestate = LOGFILE_OPENED; // goto next step |
200 | logfilestate = LOGFILE_OPENED; // goto next step |
200 | printf("\r\nOpening kml-file:"); |
201 | printf("\r\nOpening kml-file: %s\r\n",logfilename); |
201 | printf(logfilename); |
- | |
202 | printf("\r\n"); |
- | |
203 | } |
202 | } |
204 | else // could not be openend |
203 | else // could not be openend |
205 | { |
204 | { |
206 | logfilestate = LOGFILE_ERROR; |
205 | logfilestate = LOGFILE_ERROR; |
207 | printf("\r\nError opening kml-file: "); |
206 | printf("\r\nError opening kml-file: %s\r\n", logfilename); |
208 | printf(logfilename); |
- | |
209 | printf("\r\n"); |
- | |
210 | logtimer = SetDelay(10); // try again in open logfile in 10 mili sec |
207 | logtimer = SetDelay(10); // try again in open logfile in 10 mili sec |
211 | } |
208 | } |
212 | } |
209 | } |
213 | else |
210 | else |
214 | { |
211 | { |
Line 305... | Line 302... | ||
305 | { |
302 | { |
306 | switch(logfilestate) |
303 | switch(logfilestate) |
307 | { |
304 | { |
308 | case LOGFILE_IDLE: |
305 | case LOGFILE_IDLE: |
309 | case LOGFILE_CLOSED: |
306 | case LOGFILE_CLOSED: |
310 | //if((GPSData.Status != INVALID) && (GPSData.Flags & FLAG_GPSFIXOK) && (GPSData.SatFix == SATFIX_3D) && (FC.MKFlags & MKFLAG_FLY)) |
307 | //if((GPSData.Status != INVALID) && (GPSData.Flags & FLAG_GPSFIXOK) && (GPSData.SatFix == SATFIX_3D) ) |
311 | { |
308 | { |
312 | logfilestate = LOGFILE_START; |
309 | logfilestate = LOGFILE_START; |
313 | } |
310 | } |
314 | break; |
311 | break; |
315 | case LOGFILE_START: |
312 | case LOGFILE_START: |
Line 324... | Line 321... | ||
324 | // try to create the log file |
321 | // try to create the log file |
325 | if(GPX_DocumentOpen(logfilename, &logfile)) |
322 | if(GPX_DocumentOpen(logfilename, &logfile)) |
326 | { |
323 | { |
327 | flushtimer = SetDelay(LOG_FLUSH_INTERVAL); |
324 | flushtimer = SetDelay(LOG_FLUSH_INTERVAL); |
328 | logfilestate = LOGFILE_OPENED; // goto next step |
325 | logfilestate = LOGFILE_OPENED; // goto next step |
329 | printf("\r\nOpening gpx-file:"); |
326 | printf("\r\nOpening gpx-file: %s\r\n", logfilename); |
330 | printf(logfilename); |
- | |
331 | printf("\r\n"); |
- | |
332 | } |
327 | } |
333 | else // could not be openend |
328 | else // could not be openend |
334 | { |
329 | { |
335 | logfilestate = LOGFILE_ERROR; |
330 | logfilestate = LOGFILE_ERROR; |
336 | printf("\r\nError opening gpx-file: "); |
331 | printf("\r\nError opening gpx-file: %s\r\n", logfilename); |
337 | printf(logfilename); |
- | |
338 | printf("\r\n"); |
- | |
339 | logtimer = SetDelay(10); // try again in open logfile in 10 mili sec |
332 | logtimer = SetDelay(10); // try again in open logfile in 10 mili sec |
340 | } |
333 | } |
341 | } |
334 | } |
342 | else |
335 | else |
343 | { |
336 | { |