Skip to content

Commit 8a1e6c0

Browse files
committed
Disable FINSH_FUNCTION_EXPORT
1 parent 221da7f commit 8a1e6c0

File tree

6 files changed

+18
-23
lines changed

6 files changed

+18
-23
lines changed

bsp/nuvoton/libraries/m031/rtt_port/drv_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,5 +138,5 @@ static void reboot(uint8_t argc, char **argv)
138138
{
139139
rt_hw_cpu_reset();
140140
}
141-
FINSH_FUNCTION_EXPORT_ALIAS(reboot, __cmd_reboot, Reboot System);
141+
MSH_CMD_EXPORT(reboot, Reboot System);
142142
#endif /* RT_USING_FINSH */

bsp/nuvoton/libraries/m2354/rtt_port/drv_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,6 @@ static void reboot(uint8_t argc, char **argv)
138138
{
139139
rt_hw_cpu_reset();
140140
}
141-
FINSH_FUNCTION_EXPORT_ALIAS(reboot, __cmd_reboot, Reboot System);
141+
MSH_CMD_EXPORT(reboot, Reboot System);
142142
#endif /* RT_USING_FINSH */
143143

bsp/stm32/libraries/HAL_Drivers/drv_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ static void reboot(uint8_t argc, char **argv)
2525
{
2626
rt_hw_cpu_reset();
2727
}
28-
FINSH_FUNCTION_EXPORT_ALIAS(reboot, __cmd_reboot, Reboot System);
28+
MSH_CMD_EXPORT(reboot, Reboot System);
2929
#endif /* RT_USING_FINSH */
3030

3131
/* SysTick configuration */

bsp/w60x/drivers/board.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ static void reboot(uint8_t argc, char **argv)
255255
{
256256
rt_hw_cpu_reset();
257257
}
258-
FINSH_FUNCTION_EXPORT_ALIAS(reboot, __cmd_reboot, Reboot System);
258+
MSH_CMD_EXPORT(reboot, Reboot System);
259259
#endif /* RT_USING_FINSH */
260260

261261
/*@}*/

components/finsh/finsh.h

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ typedef long (*syscall_func)(void);
2323
#endif
2424
#ifdef FINSH_USING_DESCRIPTION
2525
#ifdef _MSC_VER
26-
#define FINSH_FUNCTION_EXPORT_CMD(name, cmd, desc) \
26+
#define MSH_FUNCTION_EXPORT_CMD(name, cmd, desc) \
2727
const char __fsym_##cmd##_name[] = #cmd; \
2828
const char __fsym_##cmd##_desc[] = #desc; \
2929
__declspec(allocate("FSymTab$f")) \
@@ -36,7 +36,7 @@ typedef long (*syscall_func)(void);
3636
#pragma comment(linker, "/merge:FSymTab=mytext")
3737

3838
#elif defined(__TI_COMPILER_VERSION__)
39-
#define FINSH_FUNCTION_EXPORT_CMD(name, cmd, desc) \
39+
#define MSH_FUNCTION_EXPORT_CMD(name, cmd, desc) \
4040
__TI_FINSH_EXPORT_FUNCTION(__fsym_##cmd); \
4141
const char __fsym_##cmd##_name[] = #cmd; \
4242
const char __fsym_##cmd##_desc[] = #desc; \
@@ -48,7 +48,7 @@ typedef long (*syscall_func)(void);
4848
};
4949

5050
#else
51-
#define FINSH_FUNCTION_EXPORT_CMD(name, cmd, desc) \
51+
#define MSH_FUNCTION_EXPORT_CMD(name, cmd, desc) \
5252
const char __fsym_##cmd##_name[] RT_SECTION(".rodata.name") = #cmd; \
5353
const char __fsym_##cmd##_desc[] RT_SECTION(".rodata.name") = #desc; \
5454
RT_USED const struct finsh_syscall __fsym_##cmd RT_SECTION("FSymTab")= \
@@ -61,7 +61,7 @@ typedef long (*syscall_func)(void);
6161
#endif
6262
#else
6363
#ifdef _MSC_VER
64-
#define FINSH_FUNCTION_EXPORT_CMD(name, cmd, desc) \
64+
#define MSH_FUNCTION_EXPORT_CMD(name, cmd, desc) \
6565
const char __fsym_##cmd##_name[] = #cmd; \
6666
__declspec(allocate("FSymTab$f")) \
6767
const struct finsh_syscall __fsym_##cmd = \
@@ -72,7 +72,7 @@ typedef long (*syscall_func)(void);
7272
#pragma comment(linker, "/merge:FSymTab=mytext")
7373

7474
#elif defined(__TI_COMPILER_VERSION__)
75-
#define FINSH_FUNCTION_EXPORT_CMD(name, cmd, desc) \
75+
#define MSH_FUNCTION_EXPORT_CMD(name, cmd, desc) \
7676
__TI_FINSH_EXPORT_FUNCTION(__fsym_##cmd); \
7777
const char __fsym_##cmd##_name[] = #cmd; \
7878
const struct finsh_syscall __fsym_##cmd = \
@@ -82,7 +82,7 @@ typedef long (*syscall_func)(void);
8282
};
8383

8484
#else
85-
#define FINSH_FUNCTION_EXPORT_CMD(name, cmd, desc) \
85+
#define MSH_FUNCTION_EXPORT_CMD(name, cmd, desc) \
8686
const char __fsym_##cmd##_name[] = #cmd; \
8787
RT_USED const struct finsh_syscall __fsym_##cmd RT_SECTION("FSymTab")= \
8888
{ \
@@ -102,8 +102,7 @@ typedef long (*syscall_func)(void);
102102
* @param name the name of function.
103103
* @param desc the description of function, which will show in help.
104104
*/
105-
#define FINSH_FUNCTION_EXPORT(name, desc) \
106-
FINSH_FUNCTION_EXPORT_CMD(name, name, desc)
105+
#define FINSH_FUNCTION_EXPORT(name, desc)
107106

108107
/**
109108
* @ingroup finsh
@@ -114,8 +113,7 @@ typedef long (*syscall_func)(void);
114113
* @param alias the alias name of function.
115114
* @param desc the description of function, which will show in help.
116115
*/
117-
#define FINSH_FUNCTION_EXPORT_ALIAS(name, alias, desc) \
118-
FINSH_FUNCTION_EXPORT_CMD(name, alias, desc)
116+
#define FINSH_FUNCTION_EXPORT_ALIAS(name, alias, desc)
119117

120118
/**
121119
* @ingroup finsh
@@ -126,9 +124,9 @@ typedef long (*syscall_func)(void);
126124
* @param desc the description of command, which will show in help.
127125
*/
128126
#define MSH_CMD_EXPORT(command, desc) \
129-
FINSH_FUNCTION_EXPORT_CMD(command, __cmd_##command, desc)
127+
MSH_FUNCTION_EXPORT_CMD(command, command, desc)
130128
#define MSH_CMD_EXPORT_ALIAS(command, alias, desc) \
131-
FINSH_FUNCTION_EXPORT_ALIAS(command, __cmd_##alias, desc)
129+
MSH_FUNCTION_EXPORT_CMD(command, alias, desc)
132130

133131
/* system call table */
134132
struct finsh_syscall

components/finsh/msh.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,10 @@ int msh_help(int argc, char **argv)
4141
index < _syscall_table_end;
4242
FINSH_NEXT_SYSCALL(index))
4343
{
44-
if (strncmp(index->name, "__cmd_", 6) != 0) continue;
4544
#if defined(FINSH_USING_DESCRIPTION) && defined(FINSH_USING_SYMTAB)
46-
rt_kprintf("%-16s - %s\n", &index->name[6], index->desc);
45+
rt_kprintf("%-16s - %s\n", index->name, index->desc);
4746
#else
48-
rt_kprintf("%s ", &index->name[6]);
47+
rt_kprintf("%s ", index->name);
4948
#endif
5049
}
5150
}
@@ -174,10 +173,8 @@ static cmd_function_t msh_get_cmd(char *cmd, int size)
174173
index < _syscall_table_end;
175174
FINSH_NEXT_SYSCALL(index))
176175
{
177-
if (strncmp(index->name, "__cmd_", 6) != 0) continue;
178-
179-
if (strncmp(&index->name[6], cmd, size) == 0 &&
180-
index->name[6 + size] == '\0')
176+
if (strncmp(index->name, cmd, size) == 0 &&
177+
index->name[size] == '\0')
181178
{
182179
cmd_func = (cmd_function_t)index->func;
183180
break;

0 commit comments

Comments
 (0)