Files
CCSModuleSW30Web/Core/Inc/debug.h

35 lines
709 B
C
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* debug.h
*
* Created on: Apr 16, 2024
* Author: colorbass
*/
#ifndef SRC_DEBUG_H_
#define SRC_DEBUG_H_
#include <stdint.h>
#include <stdarg.h>
typedef enum {
LOG_EMERG = 1,
LOG_ALERT = 2,
LOG_CRIT = 3,
LOG_ERR = 4,
LOG_WARN = 5,
LOG_NOTICE = 6,
LOG_INFO = 7,
LOG_DEBUG = 8,
} LogLevel_t;
// Функции для работы с кольцевым буфером отладочных сообщений
void debug_buffer_add(const uint8_t* data, uint16_t len);
uint16_t debug_buffer_available(void);
void debug_buffer_send(void);
// Кастомный printf с приоритетом лога
int log_printf(LogLevel_t level, const char *format, ...);
#endif /* SRC_DEBUG_H_ */