auto-sync

This commit is contained in:
rusEfi 2015-01-24 15:04:21 -06:00
parent 67ce304d08
commit 2f8c7d18fc
7 changed files with 15 additions and 16 deletions

View File

@ -29,7 +29,7 @@
#include "console_io.h"
#include "svnversion.h"
static LoggingWithStorage logger;
static LoggingWithStorage logger("console");
static char fatalErrorMessage[200];

View File

@ -55,6 +55,8 @@
#include "settings.h"
#include "rusefi_outputs.h"
extern bool_t main_loop_started;
#if EFI_PROD_CODE || defined(__DOXYGEN__)
// todo: move this logic to algo folder!
#include "rtc_helper.h"
@ -87,7 +89,7 @@ static void setWarningEnabled(int value) {
}
#if EFI_FILE_LOGGING || defined(__DOXYGEN__)
static LoggingWithStorage fileLogger;
static LoggingWithStorage fileLogger("file logger");
#endif /* EFI_FILE_LOGGING */
static int logFileLineIndex = 0;
@ -179,7 +181,6 @@ void printSensors(Logging *log, bool fileFormat, Engine *engine) {
reportSensorF(log, fileFormat, "vref", "V", getVRef(engineConfiguration), 2);
reportSensorF(log, fileFormat, "vbatt", "V", getVBatt(engineConfiguration), 2);
reportSensorF(log, fileFormat, "TP", "%", getTPS(PASS_ENGINE_PARAMETER_F), 2);
if (engineConfiguration->hasCltSensor) {
@ -196,6 +197,8 @@ EXTERN_ENGINE
;
void writeLogLine(void) {
if (!main_loop_started)
return;
#if EFI_FILE_LOGGING || defined(__DOXYGEN__)
resetLogging(&fileLogger);
printSensors(&fileLogger, true, engine);
@ -353,7 +356,6 @@ void updateDevConsoleState(Engine *engine) {
chThdSleepMilliseconds(200);
#endif
printState(engine);
#if EFI_WAVE_ANALYZER
@ -607,10 +609,6 @@ void initStatusLoop(Engine *engine) {
addConsoleAction("status", printStatus);
#endif /* EFI_PROD_CODE */
#if EFI_FILE_LOGGING
initLogging(&fileLogger, "file logger");
#endif /* EFI_FILE_LOGGING */
}
void startStatusThreads(Engine *engine) {

View File

@ -20,7 +20,7 @@ static LoggingWithStorage logger;
#define WARNING_PREFIX "WARNING: "
extern int warningEnabled;
extern int main_loop_started;
extern bool_t main_loop_started;
const char *dbg_panic_file;
int dbg_panic_line;

View File

@ -52,7 +52,7 @@ static bool fs_ready = false;
*/
static FATFS MMC_FS;
static LoggingWithStorage logger;
static LoggingWithStorage logger("mmcCard");
// print FAT error function
static void printError(const char *str, FRESULT f_error) {
@ -251,7 +251,6 @@ bool isSdCardAlive(void) {
}
void initMmcCard(void) {
initLogging(&logger, "mmcCard");
addConsoleAction("sdstat", sdStatistics);
if (!boardConfiguration->isSdCardEnabled) {
return;

View File

@ -119,7 +119,7 @@
static LoggingWithStorage sharedLogger;
int main_loop_started = FALSE;
bool_t main_loop_started = false;
static MemoryStream firmwareErrorMessageStream;
static char panicMessage[200];
@ -216,8 +216,6 @@ void scheduleReset(void) {
unlockAnyContext();
}
extern int main_loop_started;
void chDbgStackOverflowPanic(Thread *otp) {
strcpy(panicMessage, "stack overflow: ");
#ifdef CH_USE_REGISTRY

View File

@ -163,7 +163,6 @@ void appendPrintf(Logging *logging, const char *fmt, ...) {
}
void initLoggingExt(Logging *logging, const char *name, char *buffer, int bufferSize) {
print("Init logging %s\r\n", name);
logging->name = name;
logging->buffer = buffer;
logging->bufferSize = bufferSize;
@ -390,6 +389,10 @@ void initIntermediateLoggingBuffer(void) {
#endif /* ! EFI_UNIT_TEST */
// todo: eliminate this constructor
LoggingWithStorage::LoggingWithStorage() {
}
LoggingWithStorage::LoggingWithStorage(const char *name) {
initLogging(this, name);
}

View File

@ -38,6 +38,7 @@ public:
class LoggingWithStorage : public Logging {
public:
LoggingWithStorage();
LoggingWithStorage(const char *name);
char DEFAULT_BUFFER[200];
};