From a76b2fadf6ad4adf86e241e3753a63efe03ef80c Mon Sep 17 00:00:00 2001
From: huangcm <1263938474@qq.com>
Date: Thu, 03 Jul 2025 02:49:16 +0000
Subject: [PATCH] feat(fix): close ar100s uart7 debug

---
 longan/brandy/arisc/ar100s/system/debugger/debugger.c |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/longan/brandy/arisc/ar100s/system/debugger/debugger.c b/longan/brandy/arisc/ar100s/system/debugger/debugger.c
index d5e14d0..e9e5fc2 100644
--- a/longan/brandy/arisc/ar100s/system/debugger/debugger.c
+++ b/longan/brandy/arisc/ar100s/system/debugger/debugger.c
@@ -35,6 +35,7 @@
 */
 s32 debugger_init(void)
 {
+#ifdef CFG_DEBUGGER_PRINTF
 	/* initialize serial module */
 	uart_init();
 #ifdef CFG_SHELL_USED
@@ -44,6 +45,9 @@
 #endif
 
 	return OK;
+#else
+	return -ENOSYS;
+#endif
 }
 
 /*
@@ -59,7 +63,11 @@
 */
 s32 debugger_exit(void)
 {
+#ifdef CFG_DEBUGGER_PRINTF
 	return OK;
+#else
+	return -ENOSYS;
+#endif
 }
 
 /*
@@ -75,9 +83,13 @@
 */
 s32 debugger_putc(char ch)
 {
+#ifdef CFG_DEBUGGER_PRINTF
 	uart_putc(ch);
 
 	return OK;
+#else
+	return -ENOSYS;
+#endif
 }
 
 /*
@@ -93,7 +105,11 @@
 */
 u32 debugger_get(char *buf)
 {
+#ifdef CFG_DEBUGGER_PRINTF
 	return uart_get(buf);
+#else
+	return -ENOSYS;
+#endif
 }
 
 /*
@@ -109,9 +125,13 @@
 */
 s32 debugger_puts(char *string)
 {
+#ifdef CFG_DEBUGGER_PRINTF
 	uart_puts(string);
 
 	return OK;
+#else
+	return -ENOSYS;
+#endif
 }
 
 /*
@@ -137,6 +157,7 @@
 char debugger_buffer[DEBUG_BUFFER_SIZE];
 s32 debugger_printf(u32 level, const char *format, ...)
 {
+#ifdef CFG_DEBUGGER_PRINTF
 	va_list  args;
 	char     string[16];    /* align by cpu word */
 	char    *pdest;
@@ -237,8 +258,12 @@
 		return (pdest - debugger_buffer);
 	}
 	return OK;
+#else
+	return -ENOSYS;
+#endif
 }
 
+#ifdef CFG_DEBUGGER_PRINTF
 static s32 print_align(char *string, s32 len, s32 align)
 {
 	/*
@@ -254,6 +279,7 @@
 	/* not fill anything */
 	return 0;
 }
+#endif
 
 /*
 *********************************************************************************************************
@@ -266,6 +292,7 @@
 * Returns    :  OK if print current time succeeded, others if failed.
 *********************************************************************************************************
 */
+#ifdef CFG_DEBUGGER_PRINTF
 static s32 print_current_time(void)
 {
 	char time[12];
@@ -309,6 +336,7 @@
 
 	return OK;
 }
+#endif
 
 /*
 *********************************************************************************************************
@@ -323,8 +351,12 @@
 */
 s32 set_debug_level(u32 level)
 {
+#ifdef CFG_DEBUGGER_PRINTF
 	LOG("debug_mask from %d to %d\n", debug_level, level);
 	debug_level  = level;
 
 	return OK;
+#else
+	return -ENOSYS;
+#endif
 }

--
Gitblit v1.6.2