auto-sync
This commit is contained in:
parent
485a2ec8ba
commit
b64987932b
|
@ -2,4 +2,5 @@
|
|||
CONSOLESRC = $(PROJECT_DIR)/console/console_io.c
|
||||
|
||||
CONSOLE_SRC_CPP = $(PROJECT_DIR)/console/status_loop.cpp \
|
||||
$(PROJECT_DIR)/controllers/error_handling.cpp
|
||||
$(PROJECT_DIR)/console/eficonsole.cpp
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @file eficonsole.c
|
||||
* @file eficonsole.cpp
|
||||
* @brief Console package entry point code
|
||||
*
|
||||
*
|
||||
|
@ -29,7 +29,7 @@
|
|||
#include "console_io.h"
|
||||
#include "svnversion.h"
|
||||
|
||||
static Logging logger;
|
||||
static LoggingWithStorage logger;
|
||||
|
||||
static char fatalErrorMessage[200];
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ static void setWarningEnabled(int value) {
|
|||
}
|
||||
|
||||
#if EFI_FILE_LOGGING || defined(__DOXYGEN__)
|
||||
static Logging fileLogger;
|
||||
static LoggingWithStorage fileLogger;
|
||||
#endif /* EFI_FILE_LOGGING */
|
||||
|
||||
static int logFileLineIndex = 0;
|
||||
|
@ -232,7 +232,7 @@ static char LOGGING_BUFFER[700];
|
|||
volatile int needToReportStatus = FALSE;
|
||||
static int prevCkpEventCounter = -1;
|
||||
|
||||
static Logging logger2;
|
||||
static LoggingWithStorage logger2;
|
||||
|
||||
static void printStatus(void) {
|
||||
needToReportStatus = TRUE;
|
||||
|
|
|
@ -72,7 +72,7 @@ BaseChannel * getTsSerialDevice(void) {
|
|||
#endif
|
||||
}
|
||||
|
||||
static Logging logger;
|
||||
static LoggingWithStorage logger;
|
||||
|
||||
extern persistent_config_s configWorkingCopy;
|
||||
extern persistent_config_container_s persistentState;
|
||||
|
|
|
@ -93,22 +93,3 @@ void chVTSetAny(virtual_timer_t *vtp, systime_t time, vtfunc_t vtfunc, void *par
|
|||
;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function knows how to print a histogram_s summary
|
||||
*/
|
||||
void printHistogram(Logging *logging, histogram_s *histogram) {
|
||||
#if EFI_HISTOGRAMS
|
||||
int report[5];
|
||||
int len = hsReport(histogram, report);
|
||||
|
||||
resetLogging(logging);
|
||||
appendMsgPrefix(logging);
|
||||
appendPrintf(logging, "histogram %s *", histogram->name);
|
||||
for (int i = 0; i < len; i++)
|
||||
appendPrintf(logging, "%d ", report[i]);
|
||||
appendPrintf(logging, "*");
|
||||
appendMsgPostfix(logging);
|
||||
scheduleLogging(logging);
|
||||
#endif /* EFI_HISTOGRAMS */
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
#include "global.h"
|
||||
#include "histogram.h"
|
||||
#include "datalogging.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
|
@ -22,10 +21,10 @@ char hexC(int v);
|
|||
int isIsrContext(void);
|
||||
int isLocked(void);
|
||||
void chVTSetAny(virtual_timer_t *vtp, systime_t time, vtfunc_t vtfunc, void *par);
|
||||
void printHistogram(Logging *logging, histogram_s *histogram);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
void printHistogram(Logging *logging, histogram_s *histogram);
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* RFIUTIL_H_ */
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#define isRunningBenchTest() true
|
||||
#endif
|
||||
|
||||
static Logging logger;
|
||||
static LoggingWithStorage logger;
|
||||
|
||||
extern engine_pins_s enginePins;
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ extern WaveChart waveChart;
|
|||
|
||||
#include "efiGpio.h"
|
||||
|
||||
static Logging logger;
|
||||
static LoggingWithStorage logger;
|
||||
|
||||
extern engine_pins_s enginePins;
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ EXTERN_ENGINE;
|
|||
|
||||
|
||||
#if EFI_PROD_CODE || EFI_SIMULATOR
|
||||
static Logging logger;
|
||||
static LoggingWithStorage logger;
|
||||
|
||||
float getLEValue(Engine *engine, calc_stack_t *s, le_action_e action) {
|
||||
efiAssert(engine!=NULL, "getLEValue", NAN);
|
||||
|
|
|
@ -73,7 +73,7 @@ board_configuration_s *boardConfiguration = &persistentState.persistentConfigura
|
|||
|
||||
static VirtualTimer everyMsTimer;
|
||||
|
||||
static Logging logger;
|
||||
static LoggingWithStorage logger;
|
||||
|
||||
#if EFI_ENGINE_CONTROL || defined(__DOXYGEN__)
|
||||
static engine_configuration2_s ec2 CCM_OPTIONAL;
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#endif /* EFI_HD44780_LCD */
|
||||
|
||||
static time_t timeOfPreviousWarning = -10;
|
||||
static Logging logger;
|
||||
static LoggingWithStorage logger;
|
||||
|
||||
#define WARNING_PREFIX "WARNING: "
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
static bool needToWriteConfiguration = false;
|
||||
|
||||
EXTERN_ENGINE;
|
||||
static Logging logger;
|
||||
static LoggingWithStorage logger;
|
||||
|
||||
extern persistent_config_container_s persistentState;
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
static THD_WORKING_AREA(ivThreadStack, UTILITY_THREAD_STACK_SIZE);
|
||||
|
||||
static Logging logger;
|
||||
static LoggingWithStorage logger;
|
||||
EXTERN_ENGINE
|
||||
;
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include "pin_repository.h"
|
||||
#include "efiGpio.h"
|
||||
|
||||
static Logging logger;
|
||||
static LoggingWithStorage logger;
|
||||
EXTERN_ENGINE
|
||||
;
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
#define FAST_MAP_CHART_SKIP_FACTOR 16
|
||||
|
||||
static Logging logger;
|
||||
static LoggingWithStorage logger;
|
||||
|
||||
/**
|
||||
* Running counter of measurements per revolution
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
typedef ArrayList<OutputSignal, OUTPUT_SIGNAL_MAX_SIZE> OutputSignalList;
|
||||
|
||||
void findTriggerPosition(
|
||||
event_trigger_position_s *position, float angleOffset DECLARE_ENGINE_PARAMETER_S);
|
||||
event_trigger_position_s *position, angle_t angleOffset DECLARE_ENGINE_PARAMETER_S);
|
||||
|
||||
int isInjectionEnabled(engine_configuration_s *engineConfiguration);
|
||||
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
|
||||
#include "main.h"
|
||||
#include "scheduler.h"
|
||||
#include "datalogging.h"
|
||||
|
||||
#if EFI_SIGNAL_EXECUTOR_SLEEP || defined(__DOXYGEN__)
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ static IgnitionEvent *iHead = NULL;
|
|||
|
||||
static cyclic_buffer ignitionErrorDetection;
|
||||
|
||||
static Logging logger;
|
||||
static LoggingWithStorage logger;
|
||||
|
||||
// todo: figure out if this even helps?
|
||||
//#if defined __GNUC__
|
||||
|
|
|
@ -37,7 +37,7 @@ extern WaveChart waveChart;
|
|||
|
||||
EXTERN_ENGINE;
|
||||
|
||||
static Logging logger;
|
||||
static LoggingWithStorage logger;
|
||||
|
||||
RpmCalculator::RpmCalculator() {
|
||||
#if !EFI_PROD_CODE
|
||||
|
|
|
@ -38,7 +38,7 @@ static volatile uint64_t previousShaftEventTimeNt = (efitimems_t) -10 * US2NT(US
|
|||
|
||||
TriggerCentral triggerCentral;
|
||||
|
||||
static Logging logger;
|
||||
static LoggingWithStorage logger;
|
||||
|
||||
uint64_t getCrankEventCounter() {
|
||||
return triggerCentral.triggerState.getTotalEventCounter();
|
||||
|
|
|
@ -51,7 +51,7 @@ float actualSynchGap;
|
|||
#endif /* ! EFI_PROD_CODE */
|
||||
|
||||
#if (EFI_PROD_CODE || EFI_SIMULATOR)
|
||||
static Logging logger;
|
||||
static LoggingWithStorage logger;
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
|
@ -68,7 +68,7 @@ PwmConfig triggerSignal(swtchTms, sr);
|
|||
static int stopEmulationAtIndex = DO_NOT_STOP;
|
||||
static bool isEmulating = true;
|
||||
|
||||
static Logging logger;
|
||||
static LoggingWithStorage logger;
|
||||
static LocalVersionHolder localVersion;
|
||||
|
||||
EXTERN_ENGINE;
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
/* Low speed SPI configuration (281.250kHz, CPHA=0, CPOL=0, MSb first).*/
|
||||
#define SPI_POT_CONFIG SPI_CR1_BR_2 | SPI_CR1_BR_1 | SPI_CR1_DFF
|
||||
|
||||
static Logging logger;
|
||||
static LoggingWithStorage logger;
|
||||
|
||||
#if EFI_POTENTIOMETER || defined(__DOXYGEN__)
|
||||
Mcp42010Driver config[DIGIPOT_COUNT];
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#if EFI_PERF_METRICS || defined(__DOXYGEN__)
|
||||
|
||||
static Logging logger;
|
||||
static LoggingWithStorage logger;
|
||||
|
||||
static void testSystemCalls(const int count) {
|
||||
time_t start, time;
|
||||
|
|
|
@ -45,7 +45,7 @@ static int waveReaderCount = 0;
|
|||
static WaveReader readers[MAX_ICU_COUNT];
|
||||
|
||||
static THD_WORKING_AREA(waThreadStack, UTILITY_THREAD_STACK_SIZE);
|
||||
static Logging logger;
|
||||
static LoggingWithStorage logger;
|
||||
|
||||
static void ensureInitialized(WaveReader *reader) {
|
||||
efiAssertVoid(reader->hw.started, "wave analyzer NOT INITIALIZED");
|
||||
|
|
|
@ -62,7 +62,7 @@ int waveChartUsedSize;
|
|||
static Logging debugLogging;
|
||||
#endif /* DEBUG_WAVE */
|
||||
|
||||
static Logging logger;
|
||||
static LoggingWithStorage logger;
|
||||
|
||||
void WaveChart::resetWaveChart() {
|
||||
#if DEBUG_WAVE
|
||||
|
|
|
@ -61,7 +61,7 @@ static bool_t isSendingSpiCommand = false;
|
|||
static scheduling_s startTimer[2];
|
||||
static scheduling_s endTimer[2];
|
||||
|
||||
static Logging logger;
|
||||
static LoggingWithStorage logger;
|
||||
|
||||
// SPI_CR1_BR_1 // 5MHz
|
||||
// SPI_CR1_CPHA Clock Phase
|
||||
|
|
|
@ -30,7 +30,7 @@ EXTERN_ENGINE
|
|||
static int canReadCounter = 0;
|
||||
static int can_write_ok = 0;
|
||||
static int can_write_not_ok = 0;
|
||||
static Logging logger;
|
||||
static LoggingWithStorage logger;
|
||||
static THD_WORKING_AREA(canTreadStack, UTILITY_THREAD_STACK_SIZE);
|
||||
|
||||
/*
|
||||
|
|
|
@ -261,7 +261,7 @@ void initHardware(Logging *l, Engine *engine) {
|
|||
|
||||
#if EFI_HD44780_LCD
|
||||
// initI2Cmodule();
|
||||
lcd_HD44780_init();
|
||||
lcd_HD44780_init(sharedLogger);
|
||||
if (hasFirmwareError())
|
||||
return;
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
extern board_configuration_s *boardConfiguration;
|
||||
|
||||
static Logging logger;
|
||||
static LoggingWithStorage logger;
|
||||
|
||||
static OutputPin sdCsPin;
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
extern engine_configuration_s *engineConfiguration;
|
||||
extern board_configuration_s *boardConfiguration;
|
||||
|
||||
static Logging logger;
|
||||
static Logging *logger;
|
||||
|
||||
enum {
|
||||
LCD_HD44780_DISPLAY_CLEAR = 0x01,
|
||||
|
@ -166,16 +166,16 @@ void lcd_HD44780_print_string(const char* string) {
|
|||
}
|
||||
//getHwPin(boardConfiguration->HD44780_db7)
|
||||
static void lcdInfo(void) {
|
||||
scheduleMsg(&logger, "HD44780 RS=%s E=%s", hwPortname(boardConfiguration->HD44780_rs),
|
||||
scheduleMsg(logger, "HD44780 RS=%s E=%s", hwPortname(boardConfiguration->HD44780_rs),
|
||||
hwPortname(boardConfiguration->HD44780_e));
|
||||
scheduleMsg(&logger, "HD44780 D4=%s D5=%s", hwPortname(boardConfiguration->HD44780_db4),
|
||||
scheduleMsg(logger, "HD44780 D4=%s D5=%s", hwPortname(boardConfiguration->HD44780_db4),
|
||||
hwPortname(boardConfiguration->HD44780_db5));
|
||||
scheduleMsg(&logger, "HD44780 D6=%s D7=%s", hwPortname(boardConfiguration->HD44780_db6),
|
||||
scheduleMsg(logger, "HD44780 D6=%s D7=%s", hwPortname(boardConfiguration->HD44780_db6),
|
||||
hwPortname(boardConfiguration->HD44780_db7));
|
||||
}
|
||||
|
||||
void lcd_HD44780_init(void) {
|
||||
initLogging(&logger, "HD44780 driver");
|
||||
void lcd_HD44780_init(Logging *sharedLogger) {
|
||||
logger = sharedLogger;
|
||||
|
||||
addConsoleAction("lcdinfo", lcdInfo);
|
||||
|
||||
|
@ -184,7 +184,7 @@ void lcd_HD44780_init(void) {
|
|||
return;
|
||||
}
|
||||
|
||||
printMsg(&logger, "lcd_HD44780_init %d", engineConfiguration->displayMode);
|
||||
printMsg(logger, "lcd_HD44780_init %d", engineConfiguration->displayMode);
|
||||
|
||||
if (engineConfiguration->displayMode == DM_HD44780) {
|
||||
// initialize hardware lines
|
||||
|
@ -228,7 +228,7 @@ void lcd_HD44780_init(void) {
|
|||
lcd_HD44780_write_command(LCD_HD44780_DISPLAY_ON);
|
||||
|
||||
lcd_HD44780_set_position(0, 0);
|
||||
printMsg(&logger, "lcd_HD44780_init() done");
|
||||
printMsg(logger, "lcd_HD44780_init() done");
|
||||
}
|
||||
|
||||
void lcdShowFatalMessage(char *message) {
|
||||
|
|
|
@ -13,7 +13,7 @@ extern "C"
|
|||
{
|
||||
#endif /* __cplusplus */
|
||||
|
||||
void lcd_HD44780_init(void);
|
||||
void lcd_HD44780_init(Logging *sharedLogger);
|
||||
void lcd_HD44780_set_position(uint8_t row, uint8_t column);
|
||||
void lcd_HD44780_print_char(char data);
|
||||
void lcd_HD44780_print_string(const char *string);
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
static SPIDriver *driver;
|
||||
|
||||
static Logging logger;
|
||||
static LoggingWithStorage logger;
|
||||
|
||||
static SPIConfig spiConfig[MAX31855_CS_COUNT];
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @file mmc_card.c
|
||||
* @file mmc_card.cpp
|
||||
*
|
||||
* @date Dec 28, 2013
|
||||
* @author Kot_dnz
|
||||
|
@ -52,7 +52,7 @@ static bool fs_ready = false;
|
|||
*/
|
||||
static FATFS MMC_FS;
|
||||
|
||||
static Logging logger;
|
||||
static LoggingWithStorage logger;
|
||||
|
||||
// print FAT error function
|
||||
static void printError(const char *str, FRESULT f_error) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @file neo6m.c
|
||||
* @file neo6m.cpp
|
||||
* @brief Ublox 6M hardware UART driver
|
||||
*
|
||||
* http://www.u-blox.com/en/gps-modules/pvt-modules/previous-generations/neo-6-family.html
|
||||
|
@ -29,7 +29,7 @@
|
|||
extern board_configuration_s *boardConfiguration;
|
||||
extern engine_configuration_s *engineConfiguration;
|
||||
|
||||
static Logging logging;
|
||||
static LoggingWithStorage logging;
|
||||
|
||||
static SerialConfig GPSserialConfig = { GPS_SERIAL_SPEED, 0, USART_CR2_STOP1_BITS | USART_CR2_LINEN, 0 };
|
||||
static THD_WORKING_AREA(gpsThreadStack, UTILITY_THREAD_STACK_SIZE);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @file pin_repository.c
|
||||
* @file pin_repository.cpp
|
||||
* @brief I/O pin registry code
|
||||
*
|
||||
* This job of this class is to make sure that we are not using same hardware pin for two
|
||||
|
@ -20,7 +20,7 @@
|
|||
const char *PIN_USED[PIN_REPO_SIZE];
|
||||
static int initialized = FALSE;
|
||||
|
||||
static Logging logger;
|
||||
static LoggingWithStorage logger;
|
||||
static int totalPinsUsed = 0;
|
||||
|
||||
/**
|
||||
|
@ -106,7 +106,7 @@ brain_pin_e parseBrainPin(const char *str) {
|
|||
return (brain_pin_e)(basePin + pin);
|
||||
}
|
||||
|
||||
char *hwPortname(brain_pin_e brainPin) {
|
||||
const char *hwPortname(brain_pin_e brainPin) {
|
||||
if (brainPin == GPIO_INVALID) {
|
||||
return "INVALID";
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ extern "C"
|
|||
#endif /* __cplusplus */
|
||||
|
||||
void initPinRepository(void);
|
||||
char *hwPortname(brain_pin_e brainPin);
|
||||
const char *hwPortname(brain_pin_e brainPin);
|
||||
brain_pin_e parseBrainPin(const char *str);
|
||||
void mySetPadMode(const char *msg, ioportid_t port, ioportmask_t pin, iomode_t mode);
|
||||
void mySetPadMode2(const char *msg, brain_pin_e pin, iomode_t mode);
|
||||
|
|
|
@ -120,7 +120,7 @@ extern "C" {
|
|||
#include "engine_emulator.h"
|
||||
#endif /* EFI_ENGINE_EMULATOR */
|
||||
|
||||
static Logging logging;
|
||||
static LoggingWithStorage logging;
|
||||
|
||||
int main_loop_started = FALSE;
|
||||
|
||||
|
@ -256,7 +256,7 @@ void firmwareError(const char *fmt, ...) {
|
|||
}
|
||||
}
|
||||
|
||||
static char UNUSED_RAM_SIZE[3000];
|
||||
static char UNUSED_RAM_SIZE[3500];
|
||||
|
||||
static char UNUSED_CCM_SIZE[8000] CCM_OPTIONAL;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// This file was generated by Version2Header
|
||||
// Sat Jan 10 10:38:47 EST 2015
|
||||
// Tue Jan 13 21:00:28 EST 2015
|
||||
#ifndef VCS_VERSION
|
||||
#define VCS_VERSION "6259"
|
||||
#define VCS_VERSION "6353"
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @file cli_registry.c
|
||||
* @file cli_registry.cpp
|
||||
* @brief Command-line interface commands registry
|
||||
*
|
||||
* Here we have a data structure which holds all the dynamically-registered
|
||||
|
@ -27,7 +27,7 @@
|
|||
|
||||
#if ! EFI_UNIT_TEST
|
||||
#include "eficonsole.h"
|
||||
static Logging logging;
|
||||
static LoggingWithStorage logging;
|
||||
#endif /* ! EFI_UNIT_TEST */
|
||||
|
||||
static int consoleActionCount = 0;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @file datalogging.c
|
||||
* @file datalogging.cpp
|
||||
* @brief Buffered console output stream code
|
||||
*
|
||||
* Here we have a memory buffer and method related to
|
||||
|
@ -32,6 +32,8 @@
|
|||
|
||||
#include <stdbool.h>
|
||||
#include "main.h"
|
||||
|
||||
#if ! EFI_UNIT_TEST
|
||||
#include "chprintf.h"
|
||||
#include "chmtx.h"
|
||||
#include "memstreams.h"
|
||||
|
@ -184,7 +186,7 @@ int isInitialized(Logging *logging) {
|
|||
return logging->isInitialized == MAGIC_LOGGING_FLAG;
|
||||
}
|
||||
|
||||
void initLogging(Logging *logging, const char *name) {
|
||||
void initLogging(LoggingWithStorage *logging, const char *name) {
|
||||
initLoggingExt(logging, name, logging->DEFAULT_BUFFER, sizeof(logging->DEFAULT_BUFFER));
|
||||
}
|
||||
|
||||
|
@ -388,3 +390,9 @@ void initIntermediateLoggingBuffer(void) {
|
|||
msObjectInit(&intermediateLoggingBuffer, intermediateLoggingBufferData, INTERMEDIATE_LOGGING_BUFFER_SIZE, 0);
|
||||
intermediateLoggingBufferInited = TRUE;
|
||||
}
|
||||
|
||||
#endif /* ! EFI_UNIT_TEST */
|
||||
|
||||
LoggingWithStorage::LoggingWithStorage() {
|
||||
|
||||
}
|
||||
|
|
|
@ -37,15 +37,14 @@ typedef enum {
|
|||
|
||||
// todo: migrate to external buffer so that different instances have different
|
||||
// size of buffers?
|
||||
typedef struct {
|
||||
class Logging {
|
||||
public:
|
||||
const char *name;
|
||||
char SMALL_BUFFER[40];
|
||||
// todo: explicitly default buffer externally so that we do not have default_buffer where we do not need it?
|
||||
char DEFAULT_BUFFER[200];
|
||||
/**
|
||||
* Zero-terminated buffer of pending debug message
|
||||
*
|
||||
* Unless a larger exteran buffer is specified, this is just a pointer to DEFAULT_BUFFER
|
||||
* Unless a larger external buffer is specified, this is just a pointer to DEFAULT_BUFFER
|
||||
*/
|
||||
char *buffer;
|
||||
/**
|
||||
|
@ -55,7 +54,13 @@ typedef struct {
|
|||
char *linePointer;
|
||||
int bufferSize;
|
||||
volatile int isInitialized;
|
||||
} Logging;
|
||||
};
|
||||
|
||||
class LoggingWithStorage : public Logging {
|
||||
public:
|
||||
LoggingWithStorage();
|
||||
char DEFAULT_BUFFER[200];
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
|
@ -72,7 +77,7 @@ uint32_t remainingSize(Logging *logging);
|
|||
|
||||
int isInitialized(Logging *logging);
|
||||
|
||||
void initLogging(Logging *logging, const char *name);
|
||||
void initLogging(LoggingWithStorage *logging, const char *name);
|
||||
void initLoggingExt(Logging *logging, const char *name, char *buffer, int bufferSize);
|
||||
|
||||
void debugInt(Logging *logging, const char *caption, int value);
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include "efilib.h"
|
||||
#include "datalogging.h"
|
||||
#include "histogram.h"
|
||||
|
||||
#define _MAX_FILLER 11
|
||||
|
||||
|
@ -242,3 +244,23 @@ bool strEqual(const char *str1, const char *str2) {
|
|||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function knows how to print a histogram_s summary
|
||||
*/
|
||||
void printHistogram(Logging *logging, histogram_s *histogram) {
|
||||
#if EFI_HISTOGRAMS && ! EFI_UNIT_TEST
|
||||
int report[5];
|
||||
int len = hsReport(histogram, report);
|
||||
|
||||
resetLogging(logging);
|
||||
appendMsgPrefix(logging);
|
||||
appendPrintf(logging, "histogram %s *", histogram->name);
|
||||
for (int i = 0; i < len; i++)
|
||||
appendPrintf(logging, "%d ", report[i]);
|
||||
appendPrintf(logging, "*");
|
||||
appendMsgPostfix(logging);
|
||||
scheduleLogging(logging);
|
||||
#endif /* EFI_HISTOGRAMS */
|
||||
}
|
||||
|
||||
|
|
|
@ -16,14 +16,11 @@
|
|||
#ifndef HISTOGRAM_H_
|
||||
#define HISTOGRAM_H_
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define BOUND_LENGTH 895
|
||||
|
|
|
@ -2,10 +2,11 @@
|
|||
UTIL_TEST_SRC = $(PROJECT_DIR)/util/crc.c \
|
||||
$(PROJECT_DIR)/util/data_buffer.c \
|
||||
$(PROJECT_DIR)/util/histogram.c
|
||||
|
||||
UTILSRC = $(UTIL_TEST_SRC)
|
||||
|
||||
UTILSRC_CPP = $(PROJECT_DIR)/util/cyclic_buffer.cpp \
|
||||
$(PROJECT_DIR)/console_util/datalogging.cpp \
|
||||
$(PROJECT_DIR)/console_util/datalogging.cpp \
|
||||
$(PROJECT_DIR)/util/listener_array.cpp \
|
||||
$(PROJECT_DIR)/util/cli_registry.cpp \
|
||||
$(PROJECT_DIR)/util/efilib.cpp \
|
||||
|
|
|
@ -179,7 +179,7 @@ bool isCranking(void) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void initLogging(Logging *logging, const char *name) {
|
||||
void initLogging(LoggingWithStorage *logging, const char *name) {
|
||||
}
|
||||
|
||||
void scheduleMsg(Logging *logging, const char *fmt, ...) {
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include "global.h"
|
||||
#include "error_handling.h"
|
||||
#include "efifeatures.h"
|
||||
#include "datalogging.h"
|
||||
|
||||
#include "efilib.h"
|
||||
#include "efitime.h"
|
||||
|
@ -23,6 +22,8 @@
|
|||
#include "boards.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include "datalogging.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue