Subversion Repositories NaviCtrl

Rev

Rev 82 | Rev 85 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 82 Rev 84
Line 276... Line 276...
276
void Logging_Update(void)
276
void Logging_Update(void)
277
{
277
{
278
        static u32 logtimer = 0;
278
        static u32 logtimer = 0;
279
        static logfilestate_t logstate = LOGFILE_IDLE;
279
        static logfilestate_t logstate = LOGFILE_IDLE;
Line -... Line 280...
-
 
280
       
-
 
281
        if(CheckDelay(logtimer))
-
 
282
        {
280
 
283
                logtimer = SetDelay(10);  // faster makes no sense
281
        // call the sub logger handlers if no error has occured
284
                // call the sub logger handlers if no error has occured
282
        if(logstate != LOGFILE_ERROR) logstate = Logging_KML(LogCfg.KML_Interval);
285
                if(logstate != LOGFILE_ERROR) logstate = Logging_KML(LogCfg.KML_Interval);
-
 
286
                if(logstate != LOGFILE_ERROR) logstate = Logging_GPX(LogCfg.GPX_Interval);
283
        if(logstate != LOGFILE_ERROR) logstate = Logging_GPX(LogCfg.GPX_Interval);
287
               
284
        // a logging error has occured
288
                // a logging error has occured
285
        if(logstate == LOGFILE_ERROR)
289
                if(logstate == LOGFILE_ERROR)
286
        {      
290
                {
287
                Logging_Init(); // initialize the logs
291
                        Logging_Init(); // initialize the logs
288
                // try to initialize the Fat 16 filesystem
292
                        // try to initialize the Fat 16 filesystem
289
                if(0 == Fat16_Init())
293
                        if(0 == Fat16_Init())
290
                {       // Fat 16 successfully initialized
294
                        {       // Fat 16 successfully initialized
291
                        logstate = LOGFILE_IDLE;
295
                                logstate = LOGFILE_IDLE;
292
                        logtimer = SetDelay(10);  // try again in open logfile in 10 mili sec
-
 
293
                        Logging_Init();
296
                                logtimer = SetDelay(10);  // try again in open logfile in 10 mili sec
294
                }
297
                        }
295
                else
298
                        else
296
                {   // retry in 5 seconds
299
                        {   // retry in 5 seconds
297
                        logtimer = SetDelay(5000);  // try again in 5 sec
300
                                logtimer = SetDelay(5000);  // try again in 5 sec
298
                }
301
                        }
299
        }
302
                }
300
               
303
        }