Subversion Repositories NaviCtrl

Rev

Rev 434 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 434 Rev 516
Line 58... Line 58...
58
#include "91x_lib.h"
58
#include "91x_lib.h"
59
#include "kml.h"
59
#include "kml.h"
60
#include "kml_header.h"
60
#include "kml_header.h"
61
#include "uart1.h"
61
#include "uart1.h"
62
#include "logging.h"
62
#include "logging.h"
-
 
63
#include "timer1.h"
-
 
64
 
Line 63... Line 65...
63
 
65
 
64
//________________________________________________________________________________________________________________________________________
66
//________________________________________________________________________________________________________________________________________
65
// Module name:                 kml.c
67
// Module name:                 kml.c
66
// Compiler used:               avr-gcc 3.4.5
68
// Compiler used:               avr-gcc 3.4.5
Line 117... Line 119...
117
 
119
 
118
u8 KML_DocumentOpen(s8 *name, KML_Document_t *doc)
120
u8 KML_DocumentOpen(s8 *name, KML_Document_t *doc)
Line 119... Line 121...
119
{
121
{
-
 
122
 
Line 120... Line 123...
120
 
123
        u8 retvalue = 0;
Line 121... Line 124...
121
        u8 retvalue = 0;
124
        s8 string[50];
122
 
125
 
Line 123... Line 126...
123
        if(doc == NULL) return(0);
126
        if(doc == NULL) return(0);
124
 
127
 
125
        KML_DocumentInit(doc);                                                                                                          // intialize the document with resetvalues
128
        KML_DocumentInit(doc);                                                                                                          // intialize the document with resetvalues
126
        doc->file = fopen_(name,'a');                                                                                           // open a new file with the specified filename on the memorycard.
129
        doc->file = fopen_(name,'a');                                                                                           // open a new file with the specified filename on the memorycard.
127
 
130
 
-
 
131
        if(doc->file != NULL)                                                                                                           // could the file be opened?
-
 
132
        {
-
 
133
                retvalue = 1;                                                                                                                   // the document could be created on the drive.
128
        if(doc->file != NULL)                                                                                                           // could the file be opened?
134
                doc->state = KML_DOC_OPENED;                                                                                            // change document state to opened. At next a placemark has to be opened.
Line 129... Line 135...
129
        {
135
                fwrite_((void*)KML_DOCUMENT_HEADER1, sizeof(KML_DOCUMENT_HEADER1)-1,1,doc->file);// write the KML-header to the document.
130
                retvalue = 1;                                                                                                                   // the document could be created on the drive.
136
                sprintf(string, "%4i.%02i.%02i Nr:%i (%02i%02i%02i%02i)", SystemTime.Year, SystemTime.Month, SystemTime.Day, KML_Filenum, SystemTime.Year%100, SystemTime.Month, SystemTime.Day, KML_Filenum);