diff --git a/build/scripts/get_compiler_path.sh b/build/scripts/get_compiler_path.sh index 6858c9e787c1aa67ea6e81f5f09a682a019c953e..713d4533d71c6d6b81323670891a69c15c5602e3 100755 --- a/build/scripts/get_compiler_path.sh +++ b/build/scripts/get_compiler_path.sh @@ -10,7 +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%/*/*} else gcc_install_path=${gcc_install_path/\/bin\/"${user_gcc}".exe/} fi diff --git a/shell/README_CN.md b/shell/README_CN.md index b26de5f726b71225f033c27c02bd0b1c8519b9e2..e48c98e8ee457fe8f6b261894747730ea4964c78 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. 重新编译代码: