add prefix capability to swo_log
This commit is contained in:
parent
9b32e69b6d
commit
babea2e805
@ -19,13 +19,15 @@
|
||||
#define PRINT_TIMESTAMP false // if true, timestamp (from HAL_GetTick) is printed before each log message
|
||||
|
||||
#if !USE_MULTIPLE_CHANNELS
|
||||
#define DEBUG_CHANNEL 0 // channel to output messages on
|
||||
#define USE_CHANNEL_MASK_VARIABLE true
|
||||
#ifndef DEBUG_CHANNEL
|
||||
#define DEBUG_CHANNEL 0 // channel to output messages on
|
||||
#endif
|
||||
#define USE_CHANNEL_MASK_VARIABLE true
|
||||
#endif
|
||||
|
||||
#if USE_CHANNEL_MASK_VARIABLE
|
||||
#define MASK_VARIABLE logging_mask // variable to store the channel mask, must be globally defined somewhere
|
||||
extern volatile uint32_t MASK_VARIABLE;
|
||||
#define MASK_VARIABLE logging_mask // variable to store the channel mask, must be globally defined somewhere
|
||||
extern volatile uint32_t MASK_VARIABLE;
|
||||
#endif
|
||||
|
||||
enum log_level_t {
|
||||
@ -130,6 +132,10 @@ static inline void debug_log(enum log_level_t level, const char *msg, ...) {
|
||||
__swo_print(level, __time_buffer);
|
||||
}
|
||||
|
||||
#ifdef SWO_LOG_PREFIX
|
||||
__swo_print(level, SWO_LOG_PREFIX);
|
||||
#endif
|
||||
|
||||
__swo_print(level, log_level_names[level]);
|
||||
__swo_print(level, __swo_buffer);
|
||||
|
||||
|
@ -4,15 +4,16 @@
|
||||
* Created on: 14.07.2022
|
||||
* Author: max
|
||||
*/
|
||||
|
||||
#include "ADBMS_Abstraction.h"
|
||||
#include "ADBMS_CMD_MAKROS.h"
|
||||
#include "ADBMS_LL_Driver.h"
|
||||
#include "config_ADBMS6830.h"
|
||||
#include "swo_log.h"
|
||||
#include <stddef.h>
|
||||
#include "NTC.h"
|
||||
|
||||
#define SWO_LOG_PREFIX "[ADBMS] "
|
||||
#include "swo_log.h"
|
||||
|
||||
static const char* const HAL_Statuses[] = {"HAL_OK", "HAL_ERROR", "HAL_BUSY", "HAL_TIMEOUT"};
|
||||
|
||||
#define CHECK_RETURN(x) \
|
||||
|
@ -10,10 +10,12 @@
|
||||
#include "ADBMS_Driver.h"
|
||||
#include "config_ADBMS6830.h"
|
||||
#include "stm32h7xx_hal.h"
|
||||
#include "swo_log.h"
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#define SWO_LOG_PREFIX "[ADBMS] "
|
||||
#include "swo_log.h"
|
||||
|
||||
Cell_Module modules[N_BMS] = {};
|
||||
uint32_t balancedCells = 0;
|
||||
bool balancingActive = false;
|
||||
|
@ -8,10 +8,12 @@
|
||||
#include "ADBMS_LL_Driver.h"
|
||||
#include "config_ADBMS6830.h"
|
||||
#include "stm32h7xx_hal.h"
|
||||
#include "swo_log.h"
|
||||
#include <stdint.h>
|
||||
#include <strings.h>
|
||||
|
||||
#define SWO_LOG_PREFIX "[ADBMS] "
|
||||
#include "swo_log.h"
|
||||
|
||||
#define INITIAL_COMMAND_PEC 0x0010
|
||||
#define INITIAL_DATA_PEC 0x0010
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
||||
/* USER CODE BEGIN Includes */
|
||||
#include "ADBMS_Driver.h"
|
||||
#include "config_ADBMS6830.h"
|
||||
#define SWO_LOG_PREFIX "[MAIN] "
|
||||
#include "swo_log.h"
|
||||
#include <string.h>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user