diff --git a/firmware/config/engines/nissan_primera.h b/firmware/config/engines/nissan_primera.h index d8caabb311..4d5d316e7a 100644 --- a/firmware/config/engines/nissan_primera.h +++ b/firmware/config/engines/nissan_primera.h @@ -5,8 +5,6 @@ * @author Andrey Belomutskiy, (c) 2012-2017 */ -#include "efifeatures.h" - #ifndef NISSAN_PRIMERA_H_ #define NISSAN_PRIMERA_H_ diff --git a/firmware/config/stm32f4ems/efifeatures.h b/firmware/config/stm32f4ems/efifeatures.h index 997bd5d623..3209a687aa 100644 --- a/firmware/config/stm32f4ems/efifeatures.h +++ b/firmware/config/stm32f4ems/efifeatures.h @@ -14,6 +14,8 @@ #define EFI_FSIO TRUE +#define EFI_TEXT_LOGGING TRUE + #define EFI_PWM_TESTER FALSE #define HAL_USE_USB_MSD FALSE diff --git a/firmware/util/loggingcentral.cpp b/firmware/util/loggingcentral.cpp index 8165f0209e..de4715acc3 100644 --- a/firmware/util/loggingcentral.cpp +++ b/firmware/util/loggingcentral.cpp @@ -41,6 +41,7 @@ static char * outputBuffer; * of logging content */ void scheduleLogging(Logging *logging) { +#if EFI_TEXT_LOGGING || defined(__DOXYGEN__) // this could be done without locking int newLength = efiStrlen(logging->buffer); @@ -63,6 +64,7 @@ void scheduleLogging(Logging *logging) { unlockOutputBuffer(); } resetLogging(logging); +#endif /* EFI_TEXT_LOGGING */ } /** @@ -112,12 +114,14 @@ char * swapOutputBuffers(int *actualOutputBufferSize) { * actual data to console in order to avoid concurrent access to serial hardware. */ void printPending(void) { +#if EFI_TEXT_LOGGING || defined(__DOXYGEN__) int actualOutputBufferSize; char *output = swapOutputBuffers(&actualOutputBufferSize); if (actualOutputBufferSize > 0) { printWithLength(output); } +#endif /* EFI_TEXT_LOGGING */ } void initLoggingCentral(void) { @@ -133,6 +137,7 @@ void initLoggingCentral(void) { * in order to reduce memory usage */ void scheduleMsg(Logging *logging, const char *fmt, ...) { +#if EFI_TEXT_LOGGING || defined(__DOXYGEN__) if (logging == NULL) { warning(CUSTOM_ERR_LOGGING_NULL, "logging NULL"); return; @@ -151,6 +156,7 @@ void scheduleMsg(Logging *logging, const char *fmt, ...) { if (!wasLocked) { unlockAnyContext(); } +#endif /* EFI_TEXT_LOGGING */ } diff --git a/simulator/simulator/efifeatures.h b/simulator/simulator/efifeatures.h index 4ee53edcd0..9662bc5fa1 100644 --- a/simulator/simulator/efifeatures.h +++ b/simulator/simulator/efifeatures.h @@ -22,6 +22,8 @@ #define EFI_FSIO TRUE +#define EFI_TEXT_LOGGING TRUE + #define EFI_MEMS FALSE #define CONSOLE_MAX_ACTIONS 256 diff --git a/unit_tests/efifeatures.h b/unit_tests/efifeatures.h index 1dda22cfcb..119d4a2083 100644 --- a/unit_tests/efifeatures.h +++ b/unit_tests/efifeatures.h @@ -24,6 +24,8 @@ #define EFI_FSIO TRUE +#define EFI_TEXT_LOGGING TRUE + #define EFI_HISTOGRAMS FALSE #define CONSOLE_MAX_ACTIONS 128