-
Notifications
You must be signed in to change notification settings - Fork 450
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c2fd7b1
commit ef1bde9
Showing
3 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* @file shell_cpp.cpp | ||
* @author Letter | ||
* @brief shell cpp support test | ||
* @version 0.1 | ||
* @date 2021-01-17 | ||
* | ||
* @copyright (c) 2021 Letter | ||
* | ||
*/ | ||
|
||
#include <shell_cpp.h> | ||
|
||
void cppTest(void) | ||
{ | ||
Shell *shell = shellGetCurrent(); | ||
shellPrint(shell, "hello world from cpp\r\n"); | ||
} | ||
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC), | ||
cppTest, cppTest, cpp test); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# cpp suport | ||
|
||
![standard](https://img.shields.io/badge/standard-c99-brightgreen.svg) | ||
![build](https://img.shields.io/badge/build-2021.01.17-brightgreen.svg) | ||
![license](https://img.shields.io/badge/license-MIT-brightgreen.svg) | ||
|
||
`letter shell`cpp支持 | ||
|
||
## 简介 | ||
|
||
`cpp support`是用于扩展`letter shell`,使其可以在cpp环境中生效的组件,`cpp support`仅仅包含一个头文件 | ||
|
||
## 使用 | ||
|
||
`cpp support`仅仅提供了一个`shell_cpp.h`的头文件,用于在cpp文件中使用`letter shell`的命令导出,在使用时,需要在`.cpp`文件中包含`shell_cpp.h`,而不是`shell.h`,如果一个工程同时包含`.c`和`.cpp`文件,只需要分别包含对应的头文件即可 | ||
|
||
注意,对于cpp,`letter shell`也仅支持函数的导出,不适用于类的成员函数 |