From 11fb790b6b3d4a43a171bae46b264ae86e947252 Mon Sep 17 00:00:00 2001 From: zyyfff <12702313@qq.com> Date: Sat, 21 May 2022 18:56:13 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E8=BD=AF=E4=BB=B6=E8=B7=AF=E5=BE=84=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/scripts/get_compiler_path.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build/scripts/get_compiler_path.sh b/build/scripts/get_compiler_path.sh index 6858c9e78..cff4db081 100755 --- a/build/scripts/get_compiler_path.sh +++ b/build/scripts/get_compiler_path.sh @@ -10,7 +10,9 @@ function get_compiler_path() local user_gcc="${TEMP}" local gcc_install_path=$(which "${user_gcc}") if [ "$system" = "Linux" ] ; then - gcc_install_path=${gcc_install_path/\/bin\/"${user_gcc}"/} + #gcc_install_path=${gcc_install_path/\/bin\/"${user_gcc}"/} + gcc_install_path=${gcc_install_path%/*} + gcc_install_path=${gcc_install_path%/*} else gcc_install_path=${gcc_install_path/\/bin\/"${user_gcc}".exe/} fi -- Gitee From a854a443d9c19cfc918772e493aeb83204b0d979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=89=E9=BB=98=E7=9A=84=E4=BA=91?= <12702313@qq.com> Date: Sun, 22 May 2022 21:30:02 +0000 Subject: [PATCH 2/3] update build/scripts/get_compiler_path.sh. --- build/scripts/get_compiler_path.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/build/scripts/get_compiler_path.sh b/build/scripts/get_compiler_path.sh index cff4db081..713d4533d 100755 --- a/build/scripts/get_compiler_path.sh +++ b/build/scripts/get_compiler_path.sh @@ -10,9 +10,7 @@ function get_compiler_path() local user_gcc="${TEMP}" local gcc_install_path=$(which "${user_gcc}") if [ "$system" = "Linux" ] ; then - #gcc_install_path=${gcc_install_path/\/bin\/"${user_gcc}"/} - gcc_install_path=${gcc_install_path%/*} - gcc_install_path=${gcc_install_path%/*} + gcc_install_path=${gcc_install_path%/*/*} else gcc_install_path=${gcc_install_path/\/bin\/"${user_gcc}".exe/} fi -- Gitee From 30a49d47aad63dc062f2edf1ce9abdb714f906e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=89=E9=BB=98=E7=9A=84=E4=BA=91?= <12702313@qq.com> Date: Mon, 23 May 2022 14:04:29 +0000 Subject: [PATCH 3/3] update shell/README_CN.md. --- shell/README_CN.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/shell/README_CN.md b/shell/README_CN.md index b26de5f72..e48c98e8e 100644 --- a/shell/README_CN.md +++ b/shell/README_CN.md @@ -134,6 +134,7 @@ Huawei LiteOS提供的Shell作为在线调试工具,可以通过串口工具 ```c SHELLCMD_ENTRY(test_shellcmd, CMD_TYPE_EX, "test", 0, (CMD_CBK_FUNC)cmd_test); ``` + 该命令项和处理函数放在同一个文件。 3. 在链接选项中添加链接该新增命令项参数: @@ -176,9 +177,10 @@ Huawei LiteOS提供的Shell作为在线调试工具,可以通过串口工具 return 0; } ``` - + 并新建相应的头文件如:test_shellcmd.h。 2. 在app\_init函数中调用osCmdReg函数动态注册命令: - + #include "test_shellcmd.h" + #include "shell.h" ```c void app_init(void) { @@ -188,6 +190,7 @@ Huawei LiteOS提供的Shell作为在线调试工具,可以通过串口工具 .... } ``` + 如果test_shellcmd.h头文件和app\_init函数所在文件不在同一文件夹下,需在开发板或模拟器Makefile中添加头文件路径。 3. 通过make menuconfig使能Shell,即设置LOSCFG\_SHELL=y。 4. 重新编译代码: -- Gitee