第一版代码,为了在EEPROM保存参数的时候走STM32的CRC,让Codex修改了一下,现在的效果是无法存储,codex表示原因是CRC方法不同,修改到一半今天的额度使用完了,有待后续解决CRC的bug
This commit is contained in:
31
Common/Com_debug.h
Normal file
31
Common/Com_debug.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef __COM_DEBUG__
|
||||
#define __COM_DEBUG__
|
||||
|
||||
#include "usart.h"
|
||||
#include "stdio.h"
|
||||
#include "stdarg.h"
|
||||
#include "string.h"
|
||||
#define DEBUG_ENABLE
|
||||
|
||||
#ifdef DEBUG_ENABLE
|
||||
|
||||
// 修改输出文件的全路径名称 => 只有文件名
|
||||
#define __FILENAME (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
|
||||
|
||||
#define __FILENAME__ (strrchr(__FILENAME, '\\') ? strrchr(__FILENAME, '\\') + 1 : __FILENAME)
|
||||
|
||||
// 调用宏定义打印的时候 => 需要打印出日志输出的文件和行号
|
||||
#define debug_printf(format, ...) printf("[%s:%d] " format "\r\n", __FILENAME__, __LINE__, ##__VA_ARGS__)
|
||||
|
||||
#else
|
||||
#define debug_printf(format, ...)
|
||||
|
||||
#endif // DEBUG_ENABLE
|
||||
|
||||
/**
|
||||
* @brief 日志输出初始化
|
||||
*
|
||||
*/
|
||||
void Com_debug_init(void);
|
||||
|
||||
#endif // __COM_DEBUG__
|
||||
Reference in New Issue
Block a user