Rev 110 | Rev 119 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 110 | Rev 115 | ||
---|---|---|---|
Line 408... | Line 408... | ||
408 | 408 | ||
409 | //---------------------------------------------------------------------------------------------------- |
409 | //---------------------------------------------------------------------------------------------------- |
410 | // gobal logging handler |
410 | // gobal logging handler |
411 | void Logging_Update(void) |
411 | void Logging_Update(void) |
- | 412 | { |
|
412 | { |
413 | static u8 logmodule = 0; |
413 | static u32 logtimer = 0; |
414 | static u32 logtimer = 0; |
Line 414... | Line 415... | ||
414 | static logfilestate_t logstate = LOGFILE_IDLE; |
415 | static logfilestate_t logstate = LOGFILE_IDLE; |
415 | 416 | ||
416 | 417 | ||
417 | if(SD_SWITCH) // a card is in slot |
418 | if(SD_SWITCH) // a card is in slot |
418 | { |
419 | { |
419 | if(CheckDelay(logtimer)) |
420 | if(CheckDelay(logtimer)) |
- | 421 | { |
|
- | 422 | logtimer = SetDelay(10); // faster makes no sense |
|
- | 423 | // call the logger handlers if no error has occured |
|
- | 424 | if(logstate != LOGFILE_ERROR) |
|
- | 425 | { // run oonly one logging handler per loop |
|
420 | { |
426 | switch(logmodule++) |
- | 427 | { |
|
- | 428 | case 0: |
|
421 | logtimer = SetDelay(10); // faster makes no sense |
429 | logstate = Logging_KML(LogCfg.KML_Interval); |
- | 430 | break; |
|
- | 431 | case 1: |
|
- | 432 | logstate = Logging_GPX(LogCfg.GPX_Interval); |
|
- | 433 | logmodule = 0; // resart with first log module |
|
- | 434 | break; |
|
- | 435 | default: |
|
422 | // call the logger handlers if no error has occured |
436 | logmodule = 0; |
423 | if(logstate != LOGFILE_ERROR) logstate = Logging_KML(LogCfg.KML_Interval); |
437 | break; |
424 | if(logstate != LOGFILE_ERROR) logstate = Logging_GPX(LogCfg.GPX_Interval); |
- | |
425 | 438 | } |
|
426 | // a logging error has occured |
439 | } |
427 | if(logstate == LOGFILE_ERROR) |
440 | else // a logging error has occured |
428 | { |
441 | { |
429 | if(Fat16_IsValid()) // wait for reinizialization of fat16 from outside |
442 | if(Fat16_IsValid()) // wait for reinizialization of fat16 from outside |