From 8752a17203126a989680d4b881c98a0caaad5988 Mon Sep 17 00:00:00 2001 From: hyl <1729508169@qq.com> Date: Tue, 24 Dec 2024 02:38:36 +0000 Subject: [PATCH] =?UTF-8?q?console=E5=85=B3=E9=97=AD=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ubiquitous/XiZi_IIoT/easydo.sh | 50 ------------------- Ubiquitous/XiZi_IIoT/kernel/include/xs_base.h | 4 +- Ubiquitous/XiZi_IIoT/kernel/thread/console.c | 40 +++++++-------- 3 files changed, 22 insertions(+), 72 deletions(-) delete mode 100755 Ubiquitous/XiZi_IIoT/easydo.sh diff --git a/Ubiquitous/XiZi_IIoT/easydo.sh b/Ubiquitous/XiZi_IIoT/easydo.sh deleted file mode 100755 index ab393333f..000000000 --- a/Ubiquitous/XiZi_IIoT/easydo.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash - -# 定义目标目录 -target_dir="/mnt/hgfs/share" - -# 检查目标目录是否存在 -if [ ! -d "$target_dir" ]; then - echo "错误: 目标目录 $target_dir 不存在,脚本将退出。" - exit 1 -fi - -# 执行 make clean 操作 -# echo "执行 make BOARD=stm32f103-nano clean..." -# make BOARD=stm32f103-nano clean -# if [ $? -ne 0 ]; then -# echo "错误: make BOARD=stm32f103-nano clean 失败,脚本将退出。" -# exit 1 -# fi - -# 执行 make 操作 -echo "执行 make BOARD=stm32f103-nano ..." -make BOARD=stm32f103-nano -if [ $? -ne 0 ]; then - echo "错误: make BOARD=stm32f103-nano 失败,脚本将退出。" - exit 1 -fi - -arm-none-eabi-objdump -d ./build/XiZi-stm32f103-nano.elf > ./build/obj.S - - -# 定义源文件路径和名称 -source_files=( - "./build/obj.S" - "./build/XiZi-stm32f103-nano.bin" - "./build/XiZi-stm32f103-nano.elf" - "./build/XiZi-stm32f103-nano.hex" - "./build/XiZi-stm32f103-nano.map" -) - - - -# 复制文件,如果有同名文件则覆盖 -for file in "${source_files[@]}"; do - if [ -f "$file" ]; then - cp -f "$file" "$target_dir" - echo "文件 $file 已复制到 $target_dir(如果已存在则被覆盖)" - else - echo "警告: 文件 $file 不存在,跳过复制操作。" - fi -done \ No newline at end of file diff --git a/Ubiquitous/XiZi_IIoT/kernel/include/xs_base.h b/Ubiquitous/XiZi_IIoT/kernel/include/xs_base.h index 5b7f7cede..aed773cb2 100644 --- a/Ubiquitous/XiZi_IIoT/kernel/include/xs_base.h +++ b/Ubiquitous/XiZi_IIoT/kernel/include/xs_base.h @@ -124,8 +124,8 @@ typedef x_base x_OffPos; #endif #define WAITING_FOREVER -1 -// #define KPrintf printf -void KPrintf(const char *fmt, ...); +#define KPrintf printf +// void KPrintf(const char *fmt, ...); #ifdef __cplusplus diff --git a/Ubiquitous/XiZi_IIoT/kernel/thread/console.c b/Ubiquitous/XiZi_IIoT/kernel/thread/console.c index 68f3309f2..6a1a972cb 100644 --- a/Ubiquitous/XiZi_IIoT/kernel/thread/console.c +++ b/Ubiquitous/XiZi_IIoT/kernel/thread/console.c @@ -658,29 +658,29 @@ int VsnPrintf(char *buf, int32 size, const char *fmt, va_list args) #endif -void KPrintf(const char *fmt, ...) -{ -#ifdef KERNEL_CONSOLE - if(_console != NONE) { - va_list args; - x_size_t length = 0; - static char logbuf[KERNEL_CONSOLEBUF_SIZE] = {0}; +// void KPrintf(const char *fmt, ...) +// { +// #ifdef KERNEL_CONSOLE +// if(_console != NONE) { +// va_list args; +// x_size_t length = 0; +// static char logbuf[KERNEL_CONSOLEBUF_SIZE] = {0}; - va_start(args, fmt); +// va_start(args, fmt); - length = VsnPrintf(logbuf, sizeof(logbuf) - 1, fmt, args); - if (length > KERNEL_CONSOLEBUF_SIZE - 1) - length = KERNEL_CONSOLEBUF_SIZE - 1; +// length = VsnPrintf(logbuf, sizeof(logbuf) - 1, fmt, args); +// if (length > KERNEL_CONSOLEBUF_SIZE - 1) +// length = KERNEL_CONSOLEBUF_SIZE - 1; - struct BusBlockWriteParam write_param; - write_param.pos = 0; - write_param.buffer = (void *)logbuf; - write_param.size = length; - BusDevWriteData(_console, (void *)&write_param); +// struct BusBlockWriteParam write_param; +// write_param.pos = 0; +// write_param.buffer = (void *)logbuf; +// write_param.size = length; +// BusDevWriteData(_console, (void *)&write_param); - va_end(args); - } -#endif -} +// va_end(args); +// } +// #endif +// }