Embed/microCLib

剔除COM口
JiuHuan authored at 2025-08-26 13:28:11
de2e88c
Tree
1 Parent(s) 6eebb72
Summary: 2 changed files with 20 additions and 21 deletions.
Modified +19 -16
Modified +1 -5
Modified +19 -16
diff --git a/Core/Debug.c b/Core/Debug.c
index b87ebef..5666351 100644
--- a/Core/Debug.c
+++ b/Core/Debug.c
@@ -1,5 +1,5 @@
 #include "Debug.h"
-#include "Uart.h"
+// #include "Uart.h"
 
 #ifdef DEBUG
 
@@ -7,7 +7,7 @@
 static volatile DebugLevel  PubLevel = DebugOff;
 
 // 最多2种方式进行。
-static FPutcFunc Fputs[2] = {NULL};
+static FPutcFunc Fputs[4] = {NULL};
 
 // 注册
 bool FputcRegister(FPutcFunc func)
@@ -57,13 +57,13 @@ int fputc(int ch, FILE* f)
 		}
 	}
 
-	if (out)return ch;
+	return ch;
 
 	// 兼容以前的方式。 避免底层修改影响上层。
-	return ComFputc(ch, f);
+	// return ComFputc(ch, f);
 }
 
-
+/*
 static ComName DebugPort = COM_NONE;
 int ComFputc(int ch, FILE* f)
 {
@@ -74,17 +74,6 @@ int ComFputc(int ch, FILE* f)
 	return	ch;
 }
 
-#ifdef TRACE
-
-// 堆栈跟踪
-static struct
-{
-	const char* Table[16];
-	int Index;
-}TraceStack;
-
-#endif
-
 void SetDebugPort(ComName port)
 {
 	// assert_param(IS_USART_ALL_PERIPH(port));
@@ -100,6 +89,20 @@ void SetDebugPort(ComName port)
 #endif
 }
 
+*/
+
+#ifdef TRACE
+
+// 堆栈跟踪
+static struct
+{
+	const char* Table[16];
+	int Index;
+}TraceStack;
+
+#endif
+
+
 void SetDebugLevel(DebugLevel level)
 {
 	// 只有一条汇编 (传送指令) 无需上锁
Modified +1 -5
diff --git a/Core/Debug.h b/Core/Debug.h
index 3039bc0..cb8bc35 100644
--- a/Core/Debug.h
+++ b/Core/Debug.h
@@ -2,10 +2,6 @@
 #define __DEBUG_H__
 
 #include "Type.h"
-#ifdef DEBUG
-#include "Uart.h"
-void SetDebugPort(ComName port);
-#endif
 
 typedef enum
 {
@@ -23,7 +19,7 @@ bool FputcRegister(FPutcFunc func);
 bool FputcUnRegister(FPutcFunc func);
 
 // 原来的串口输出方式。 拉出来。 使用新的方式的时候注册进去即可。
-int ComFputc(int ch, FILE* f);
+// int ComFputc(int ch, FILE* f);
 
 // 设置日志输出的串口
 void SetDebugLevel(DebugLevel level);