Rev 171 | Rev 199 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 171 | Rev 176 | ||
---|---|---|---|
Line 412... | Line 412... | ||
412 | { |
412 | { |
413 | static u8 logmodule = 0; |
413 | static u8 logmodule = 0; |
414 | static u32 logtimer = 0; |
414 | static u32 logtimer = 0; |
415 | static logfilestate_t logstate = LOGFILE_IDLE; |
415 | static logfilestate_t logstate = LOGFILE_IDLE; |
Line 416... | Line -... | ||
416 | - | ||
417 | 416 | ||
418 | if(SD_SWITCH) // a card is in slot |
417 | if(SD_SWITCH) // a card is in slot |
419 | { |
418 | { |
420 | if(CheckDelay(logtimer)) |
419 | if(CheckDelay(logtimer)) |
421 | { |
420 | { |
422 | logtimer = SetDelay(10); // faster makes no sense |
421 | logtimer = SetDelay(10); // faster makes no sense |
423 | // call the logger handlers if no error has occured |
422 | // call the logger handlers if no error has occured |
424 | if(logstate != LOGFILE_ERROR) |
423 | if(logstate != LOGFILE_ERROR) |
425 | { // run oonly one logging handler per loop |
424 | { // run only one logging handler per loop |
426 | switch(logmodule++) |
425 | switch(logmodule++) |
427 | { |
426 | { |
428 | case 0: |
427 | case 0: |
429 | logstate = Logging_KML(LogCfg.KML_Interval); |
428 | logstate = Logging_KML(LogCfg.KML_Interval); |
Line 436... | Line 435... | ||
436 | logmodule = 0; |
435 | logmodule = 0; |
437 | break; |
436 | break; |
438 | } |
437 | } |
439 | } |
438 | } |
440 | else // a logging error has occured |
439 | else // a logging error has occured |
- | 440 | { |
|
- | 441 | /* |
|
441 | { // try to reinitialize sd-card when motors are not running |
442 | // try to reinitialize sd-card when motors are not running |
442 | if(!(FC.MKFlags & MKFLAG_MOTOR_RUN)) |
443 | if(!(FC.MKFlags & MKFLAG_MOTOR_RUN)) |
443 | { |
444 | { |
444 | if(Fat16_IsValid()) // wait for reinizialization of fat16 from outside |
445 | if(Fat16_IsValid()) // wait for reinizialization of fat16 from outside |
445 | { |
446 | { |
446 | Logging_Init(); // initialize the logs |
447 | Logging_Init(); // initialize the logs |
Line 450... | Line 451... | ||
450 | else |
451 | else |
451 | { // retry in 5 seconds |
452 | { // retry in 5 seconds |
452 | logtimer = SetDelay(5000); // try again in 5 sec |
453 | logtimer = SetDelay(5000); // try again in 5 sec |
453 | } |
454 | } |
454 | } // EOF motors are not running |
455 | } // EOF motors are not running |
- | 456 | */ |
|
455 | } //EOF logfile error |
457 | } //EOF logfile error |
456 | } // EOF CheckDelay |
458 | } // EOF CheckDelay |
457 | }// EOF Card in Slot |
459 | }// EOF Card in Slot |
458 | } |
460 | } |