new configurable option EFI_TEXT_LOGGING

This commit is contained in:
rusefi 2018-09-16 23:54:14 -04:00
parent 5cb6a2b6f0
commit f2165da28e
5 changed files with 12 additions and 2 deletions

View File

@ -5,8 +5,6 @@
* @author Andrey Belomutskiy, (c) 2012-2017 * @author Andrey Belomutskiy, (c) 2012-2017
*/ */
#include "efifeatures.h"
#ifndef NISSAN_PRIMERA_H_ #ifndef NISSAN_PRIMERA_H_
#define NISSAN_PRIMERA_H_ #define NISSAN_PRIMERA_H_

View File

@ -14,6 +14,8 @@
#define EFI_FSIO TRUE #define EFI_FSIO TRUE
#define EFI_TEXT_LOGGING TRUE
#define EFI_PWM_TESTER FALSE #define EFI_PWM_TESTER FALSE
#define HAL_USE_USB_MSD FALSE #define HAL_USE_USB_MSD FALSE

View File

@ -41,6 +41,7 @@ static char * outputBuffer;
* of logging content * of logging content
*/ */
void scheduleLogging(Logging *logging) { void scheduleLogging(Logging *logging) {
#if EFI_TEXT_LOGGING || defined(__DOXYGEN__)
// this could be done without locking // this could be done without locking
int newLength = efiStrlen(logging->buffer); int newLength = efiStrlen(logging->buffer);
@ -63,6 +64,7 @@ void scheduleLogging(Logging *logging) {
unlockOutputBuffer(); unlockOutputBuffer();
} }
resetLogging(logging); 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. * actual data to console in order to avoid concurrent access to serial hardware.
*/ */
void printPending(void) { void printPending(void) {
#if EFI_TEXT_LOGGING || defined(__DOXYGEN__)
int actualOutputBufferSize; int actualOutputBufferSize;
char *output = swapOutputBuffers(&actualOutputBufferSize); char *output = swapOutputBuffers(&actualOutputBufferSize);
if (actualOutputBufferSize > 0) { if (actualOutputBufferSize > 0) {
printWithLength(output); printWithLength(output);
} }
#endif /* EFI_TEXT_LOGGING */
} }
void initLoggingCentral(void) { void initLoggingCentral(void) {
@ -133,6 +137,7 @@ void initLoggingCentral(void) {
* in order to reduce memory usage * in order to reduce memory usage
*/ */
void scheduleMsg(Logging *logging, const char *fmt, ...) { void scheduleMsg(Logging *logging, const char *fmt, ...) {
#if EFI_TEXT_LOGGING || defined(__DOXYGEN__)
if (logging == NULL) { if (logging == NULL) {
warning(CUSTOM_ERR_LOGGING_NULL, "logging NULL"); warning(CUSTOM_ERR_LOGGING_NULL, "logging NULL");
return; return;
@ -151,6 +156,7 @@ void scheduleMsg(Logging *logging, const char *fmt, ...) {
if (!wasLocked) { if (!wasLocked) {
unlockAnyContext(); unlockAnyContext();
} }
#endif /* EFI_TEXT_LOGGING */
} }

View File

@ -22,6 +22,8 @@
#define EFI_FSIO TRUE #define EFI_FSIO TRUE
#define EFI_TEXT_LOGGING TRUE
#define EFI_MEMS FALSE #define EFI_MEMS FALSE
#define CONSOLE_MAX_ACTIONS 256 #define CONSOLE_MAX_ACTIONS 256

View File

@ -24,6 +24,8 @@
#define EFI_FSIO TRUE #define EFI_FSIO TRUE
#define EFI_TEXT_LOGGING TRUE
#define EFI_HISTOGRAMS FALSE #define EFI_HISTOGRAMS FALSE
#define CONSOLE_MAX_ACTIONS 128 #define CONSOLE_MAX_ACTIONS 128