Subversion Repositories NaviCtrl

Compare Revisions

Ignore whitespace Rev 83 → Rev 84

/trunk/logging.c
277,25 → 277,28
{
static u32 logtimer = 0;
static logfilestate_t logstate = LOGFILE_IDLE;
 
// call the sub logger handlers if no error has occured
if(logstate != LOGFILE_ERROR) logstate = Logging_KML(LogCfg.KML_Interval);
if(logstate != LOGFILE_ERROR) logstate = Logging_GPX(LogCfg.GPX_Interval);
// a logging error has occured
if(logstate == LOGFILE_ERROR)
{
Logging_Init(); // initialize the logs
// try to initialize the Fat 16 filesystem
if(0 == Fat16_Init())
{ // Fat 16 successfully initialized
logstate = LOGFILE_IDLE;
logtimer = SetDelay(10); // try again in open logfile in 10 mili sec
Logging_Init();
if(CheckDelay(logtimer))
{
logtimer = SetDelay(10); // faster makes no sense
// call the sub logger handlers if no error has occured
if(logstate != LOGFILE_ERROR) logstate = Logging_KML(LogCfg.KML_Interval);
if(logstate != LOGFILE_ERROR) logstate = Logging_GPX(LogCfg.GPX_Interval);
// a logging error has occured
if(logstate == LOGFILE_ERROR)
{
Logging_Init(); // initialize the logs
// try to initialize the Fat 16 filesystem
if(0 == Fat16_Init())
{ // Fat 16 successfully initialized
logstate = LOGFILE_IDLE;
logtimer = SetDelay(10); // try again in open logfile in 10 mili sec
}
else
{ // retry in 5 seconds
logtimer = SetDelay(5000); // try again in 5 sec
}
}
else
{ // retry in 5 seconds
logtimer = SetDelay(5000); // try again in 5 sec
}
}
}
}