Skip to content

Commit 931cdb1

Browse files
[finsh/shell] compatible definition for cube package
1 parent ddd7343 commit 931cdb1

File tree

6 files changed

+32
-8
lines changed

6 files changed

+32
-8
lines changed

components/finsh/cmd.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
*/
2929

3030
#include <rtthread.h>
31+
32+
#ifdef RT_USING_FINSH
33+
3134
#include "finsh.h"
3235

3336
long hello(void)
@@ -831,3 +834,6 @@ void list_prefix(char *prefix)
831834
static int dummy = 0;
832835
FINSH_VAR_EXPORT(dummy, finsh_type_int, dummy variable for finsh)
833836
#endif
837+
838+
#endif /* RT_USING_FINSH */
839+

components/finsh/msh.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
* 2014-01-03 Bernard msh can execute module.
1010
* 2017-07-19 Aubr.Cool limit argc to RT_FINSH_ARG_MAX
1111
*/
12+
#include <rtthread.h>
13+
14+
#ifdef FINSH_USING_MSH
1215

1316
#include "msh.h"
1417
#include <finsh.h>
@@ -610,3 +613,4 @@ void msh_auto_complete(char *prefix)
610613
}
611614
#endif
612615

616+
#endif /* FINSH_USING_MSH */

components/finsh/msh_cmd.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010
*/
1111

1212
#include <rtthread.h>
13-
#include <finsh.h>
1413

14+
#ifdef FINSH_USING_MSH
15+
16+
#include <finsh.h>
1517
#include "msh.h"
1618

17-
#ifdef FINSH_USING_MSH
1819
#ifdef RT_USING_DFS
1920
#include <dfs_posix.h>
2021

@@ -418,5 +419,4 @@ int cmd_free(int argc, char **argv)
418419
FINSH_FUNCTION_EXPORT_ALIAS(cmd_free, __cmd_free, Show the memory usage in the system.);
419420
#endif
420421

421-
#endif
422-
422+
#endif /* FINSH_USING_MSH */

components/finsh/msh_file.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
*/
1010

1111
#include <rtthread.h>
12-
#include <finsh.h>
13-
14-
#include "msh.h"
1512

1613
#if defined(FINSH_USING_MSH) && defined(RT_USING_DFS)
14+
15+
#include <finsh.h>
16+
#include "msh.h"
1717
#include <dfs_posix.h>
1818

1919
static int msh_readline(int fd, char *line_buf, int size)
@@ -137,4 +137,5 @@ int msh_exec_script(const char *cmd_line, int size)
137137
return ret;
138138
}
139139

140-
#endif
140+
#endif /* defined(FINSH_USING_MSH) && defined(RT_USING_DFS) */
141+

components/finsh/shell.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
#include <rthw.h>
2222

23+
#ifdef RT_USING_FINSH
24+
2325
#include "finsh.h"
2426
#include "shell.h"
2527

@@ -847,3 +849,6 @@ int finsh_system_init(void)
847849
return 0;
848850
}
849851
INIT_APP_EXPORT(finsh_system_init);
852+
853+
#endif /* RT_USING_FINSH */
854+

components/finsh/symbol.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
* Date Author Notes
88
* 2010-03-22 Bernard first version
99
*/
10+
11+
#include <rtthread.h>
12+
13+
#ifdef RT_USING_FINSH
14+
1015
#include "finsh.h"
1116

1217
long hello(void);
@@ -63,3 +68,6 @@ struct finsh_syscall *_syscall_table_end = &_syscall_table[sizeof(_syscall_tab
6368
struct finsh_sysvar *_sysvar_table_begin = NULL;
6469
struct finsh_sysvar *_sysvar_table_end = NULL;
6570
#endif
71+
72+
#endif /* RT_USING_FINSH */
73+

0 commit comments

Comments
 (0)