Rev 82 | Rev 85 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 82 | Rev 84 | ||
---|---|---|---|
Line 275... | Line 275... | ||
275 | // gobal logging handler |
275 | // gobal logging handler |
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; |
280 | 280 | ||
281 | // call the sub logger handlers if no error has occured |
- | |
282 | if(logstate != LOGFILE_ERROR) logstate = Logging_KML(LogCfg.KML_Interval); |
- | |
283 | if(logstate != LOGFILE_ERROR) logstate = Logging_GPX(LogCfg.GPX_Interval); |
- | |
284 | // a logging error has occured |
- | |
285 | if(logstate == LOGFILE_ERROR) |
281 | if(CheckDelay(logtimer)) |
286 | { |
282 | { |
287 | Logging_Init(); // initialize the logs |
283 | logtimer = SetDelay(10); // faster makes no sense |
288 | // try to initialize the Fat 16 filesystem |
284 | // call the sub logger handlers if no error has occured |
289 | if(0 == Fat16_Init()) |
- | |
290 | { // Fat 16 successfully initialized |
- | |
291 | logstate = LOGFILE_IDLE; |
- | |
292 | logtimer = SetDelay(10); // try again in open logfile in 10 mili sec |
285 | if(logstate != LOGFILE_ERROR) logstate = Logging_KML(LogCfg.KML_Interval); |
293 | Logging_Init(); |
- | |
294 | } |
- | |
295 | else |
- | |
296 | { // retry in 5 seconds |
- | |
297 | logtimer = SetDelay(5000); // try again in 5 sec |
286 | if(logstate != LOGFILE_ERROR) logstate = Logging_GPX(LogCfg.GPX_Interval); |
298 | } |
- | |
299 | } |
- | |
Line -... | Line 287... | ||
- | 287 | ||
- | 288 | // a logging error has occured |
|
- | 289 | if(logstate == LOGFILE_ERROR) |
|
- | 290 | { |
|
- | 291 | Logging_Init(); // initialize the logs |
|
- | 292 | // try to initialize the Fat 16 filesystem |
|
- | 293 | if(0 == Fat16_Init()) |
|
- | 294 | { // Fat 16 successfully initialized |
|
- | 295 | logstate = LOGFILE_IDLE; |
|
- | 296 | logtimer = SetDelay(10); // try again in open logfile in 10 mili sec |
|
- | 297 | } |
|
- | 298 | else |
|
- | 299 | { // retry in 5 seconds |
|
- | 300 | logtimer = SetDelay(5000); // try again in 5 sec |
|
- | 301 | } |
|
- | 302 | } |
|
300 | 303 | } |