3.27_433:实现并验证RF433模块接收相应指令:新增UART路由核心模块,使程序能响应RF433/RS485指令,并向UART2输出LOG(RS485由于硬件原因未验证)

This commit is contained in:
2026-03-27 16:21:00 +08:00
parent 71027ebc46
commit c809273bd9
78 changed files with 7188 additions and 2811 deletions

61
Core/Inc/debug_log.h Normal file
View File

@ -0,0 +1,61 @@
/**
******************************************************************************
* @file debug_log.h
* @brief 增强型调试日志系统头文件
* @author Application Layer
* @version 1.0
******************************************************************************
* @attention
* 本模块实现增强型调试日志系统
* 设计依据:多通信接口统一指令处理系统开发计划 第3.4节
*
* 日志格式:[LEVEL][MODULE] message
* 示例:[INFO][CMD] Command received: RL
******************************************************************************
*/
#ifndef __DEBUG_LOG_H
#define __DEBUG_LOG_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stdbool.h>
typedef enum {
LOG_LEVEL_DEBUG = 0,
LOG_LEVEL_INFO = 1,
LOG_LEVEL_WARN = 2,
LOG_LEVEL_ERROR = 3,
LOG_LEVEL_NONE = 4
} log_level_t;
void DebugLog_Init(void);
void DebugLog_SetLevel(log_level_t level);
log_level_t DebugLog_GetLevel(void);
void DebugLog_EnableModule(const char *module, bool enable);
void DebugLog_Output(log_level_t level, const char *module, const char *fmt, ...);
#define LOG_DEBUG(module, fmt, ...) \
DebugLog_Output(LOG_LEVEL_DEBUG, module, fmt, ##__VA_ARGS__)
#define LOG_INFO(module, fmt, ...) \
DebugLog_Output(LOG_LEVEL_INFO, module, fmt, ##__VA_ARGS__)
#define LOG_WARN(module, fmt, ...) \
DebugLog_Output(LOG_LEVEL_WARN, module, fmt, ##__VA_ARGS__)
#define LOG_ERROR(module, fmt, ...) \
DebugLog_Output(LOG_LEVEL_ERROR, module, fmt, ##__VA_ARGS__)
#ifdef __cplusplus
}
#endif
#endif