71,7 → 71,7 |
|
u8 SD_LoggingError = 0; |
|
#define LOG_FLUSH_INTERVAL 4000 // 4s //## |
#define LOG_FLUSH_INTERVAL 4000 // 4s // -> and if an Error occures |
|
typedef enum |
{ |
296,7 → 296,7 |
static s8* logfilename = NULL; // the pointer to the logfilename |
static u32 logtimer = 0, flushtimer = 0, appendtimer = 0; // the log update timer |
static GPX_Document_t logfile; // the logfilehandle |
static u8 part = 0, logging_active = 0; |
static u8 part = 0, logging_active = 0, old_errorcode = 0; |
u32 measure_time; |
|
// initialize if LogDelay is zero |
370,6 → 370,7 |
SD_LoggingError = 11; |
logtimer = SetDelay(10); // try again in open logfile in 10 mili sec |
} |
old_errorcode = ErrorCode; |
} |
else |
{ |
394,8 → 395,9 |
} |
else // successful log |
{ |
if(CheckDelay(flushtimer)) |
if(ErrorCode != old_errorcode || CheckDelay(flushtimer)) |
{ |
old_errorcode = ErrorCode; |
flushtimer = SetDelay(LOG_FLUSH_INTERVAL); |
fflush_(logfile.file); |
} |