Merge pull request #5014 from mysterywolf/finsh

[finsh] 修复由于移除finsh导致__cmd_xxx命令无法使用的问题
This commit is contained in:
guo 2021-09-05 19:49:43 +08:00 committed by GitHub
commit 877bb072cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
30 changed files with 41 additions and 63 deletions

View File

@ -413,7 +413,6 @@ void list_irq(void)
}
#include <finsh.h>
FINSH_FUNCTION_EXPORT(list_irq, list system irq);
#ifdef FINSH_USING_MSH
int cmd_list_irq(int argc, char** argv)
@ -421,8 +420,7 @@ int cmd_list_irq(int argc, char** argv)
list_irq();
return 0;
}
FINSH_FUNCTION_EXPORT_ALIAS(cmd_list_irq, __cmd_list_irq, list system irq.);
MSH_CMD_EXPORT_ALIAS(cmd_list_irq, list_irq, list system irq);
#endif
#endif
#endif

View File

@ -38,15 +38,14 @@ int cmd_reset(int argc, char** argv)
rt_hw_cpu_reset();
return 0;
}
MSH_CMD_EXPORT_ALIAS(cmd_reset, reset, restart the system);
int cmd_shutdown(int argc, char** argv)
{
rt_hw_cpu_shutdown();
return 0;
}
FINSH_FUNCTION_EXPORT_ALIAS(cmd_reset, __cmd_reset, restart the system.);
FINSH_FUNCTION_EXPORT_ALIAS(cmd_shutdown, __cmd_shutdown, shutdown the system.);
MSH_CMD_EXPORT_ALIAS(cmd_shutdown, shutdown, shutdown the system);
#endif
#endif

View File

@ -445,7 +445,6 @@ void list_irq(void)
}
#include <finsh.h>
FINSH_FUNCTION_EXPORT(list_irq, list system irq);
#ifdef FINSH_USING_MSH
int cmd_list_irq(int argc, char** argv)
@ -453,8 +452,7 @@ int cmd_list_irq(int argc, char** argv)
list_irq();
return 0;
}
FINSH_FUNCTION_EXPORT_ALIAS(cmd_list_irq, __cmd_list_irq, list system irq.);
MSH_CMD_EXPORT_ALIAS(cmd_list_irq, list_irq, list system irq);
#endif
#endif
#endif

View File

@ -30,7 +30,6 @@ void machine_shutdown(void)
#ifdef RT_USING_FINSH
#include <finsh.h>
FINSH_FUNCTION_EXPORT_ALIAS(rt_hw_cpu_reset, reset, restart the system);
#ifdef FINSH_USING_MSH
int cmd_reset(int argc, char** argv)
@ -38,15 +37,14 @@ int cmd_reset(int argc, char** argv)
rt_hw_cpu_reset();
return 0;
}
MSH_CMD_EXPORT_ALIAS(cmd_reset, reset, restart the system);
int cmd_shutdown(int argc, char** argv)
{
rt_hw_cpu_shutdown();
return 0;
}
FINSH_FUNCTION_EXPORT_ALIAS(cmd_reset, __cmd_reset, restart the system.);
FINSH_FUNCTION_EXPORT_ALIAS(cmd_shutdown, __cmd_shutdown, shutdown the system.);
MSH_CMD_EXPORT_ALIAS(cmd_shutdown, shutdown, shutdown the system);
#endif
#endif

View File

@ -163,5 +163,4 @@ void rt_hw_cpu_reset(void)
REG32(PRM_DEVICE(prcm_base)) = 0x1;
RT_ASSERT(0);
}
FINSH_FUNCTION_EXPORT_ALIAS(rt_hw_cpu_reset, reboot, reboot the cpu);
FINSH_FUNCTION_EXPORT_ALIAS(rt_hw_cpu_reset, __cmd_reboot, reboot the cpu);
MSH_CMD_EXPORT_ALIAS(rt_hw_cpu_reset, reboot, reboot the cpu);

View File

@ -1751,7 +1751,7 @@ int cmd_dump_emac_stats(int argc, char** argv)
dump_emac_stats();
return 0;
}
FINSH_FUNCTION_EXPORT_ALIAS(cmd_dump_emac_stats, __cmd_dump_emac_stats, dump emac statistics.);
MSH_CMD_EXPORT_ALIAS(cmd_dump_emac_stats, dump_emac_stats, dump emac statistics);
#endif
#endif

View File

@ -286,8 +286,7 @@ int cmd_list_irq(int argc, char** argv)
list_irq();
return 0;
}
FINSH_FUNCTION_EXPORT_ALIAS(cmd_list_irq, __cmd_list_irq, list system irq.);
MSH_CMD_EXPORT_ALIAS(cmd_list_irq, list_irq, list system irq);
#endif
#endif
#endif

View File

@ -39,7 +39,6 @@ void machine_shutdown()
#ifdef RT_USING_FINSH
#include <finsh.h>
FINSH_FUNCTION_EXPORT_ALIAS(rt_hw_cpu_reset, reset, restart the system);
#ifdef FINSH_USING_MSH
int cmd_reset(int argc, char** argv)
@ -47,15 +46,14 @@ int cmd_reset(int argc, char** argv)
rt_hw_cpu_reset();
return 0;
}
MSH_CMD_EXPORT_ALIAS(cmd_reset, reset, restart the system);
int cmd_shutdown(int argc, char** argv)
{
rt_hw_cpu_shutdown();
return 0;
}
FINSH_FUNCTION_EXPORT_ALIAS(cmd_reset, __cmd_reset, restart the system.);
FINSH_FUNCTION_EXPORT_ALIAS(cmd_shutdown, __cmd_shutdown, shutdown the system.);
MSH_CMD_EXPORT_ALIAS(cmd_shutdown, shutdown, shutdown the system);
#endif
#endif

View File

@ -22,7 +22,7 @@ static void reboot(uint8_t argc, char **argv)
{
rt_hw_cpu_reset();
}
FINSH_FUNCTION_EXPORT_ALIAS(reboot, __cmd_reboot, Reboot System);
MSH_CMD_EXPORT(reboot, reboot system);
#endif /* RT_USING_FINSH */
/* SysTick configuration */

View File

@ -21,7 +21,7 @@ static void reboot(uint8_t argc, char **argv)
{
rt_hw_cpu_reset();
}
FINSH_FUNCTION_EXPORT_ALIAS(reboot, __cmd_reboot, Reboot System);
MSH_CMD_EXPORT(reboot, reboot system);
#endif /* RT_USING_FINSH */
/** System Clock Configuration

View File

@ -646,7 +646,7 @@ void nand_readoob(int block, int page)
}
FINSH_FUNCTION_EXPORT_ALIAS(nand_readoob, readoob, read oob[block/page]);
void nand_erase_chip()
void nand_erase_chip(void)
{
int i;
unsigned char id;

View File

@ -271,7 +271,6 @@ E_SYS_USB0_ID nu_sys_usb0_role(void)
#ifdef RT_USING_FINSH
#include <finsh.h>
FINSH_FUNCTION_EXPORT_ALIAS(rt_hw_cpu_reset, reset, restart the system);
#ifdef FINSH_USING_MSH
int cmd_reset(int argc, char **argv)
@ -279,15 +278,14 @@ int cmd_reset(int argc, char **argv)
rt_hw_cpu_reset();
return 0;
}
MSH_CMD_EXPORT_ALIAS(cmd_reset, reset, restart the system);
int cmd_shutdown(int argc, char **argv)
{
rt_hw_cpu_shutdown();
return 0;
}
FINSH_FUNCTION_EXPORT_ALIAS(cmd_reset, __cmd_reset, restart the system.);
FINSH_FUNCTION_EXPORT_ALIAS(cmd_shutdown, __cmd_shutdown, shutdown the system.);
MSH_CMD_EXPORT_ALIAS(cmd_shutdown, shutdown, shutdown the system);
int nu_clocks(int argc, char **argv)
{

View File

@ -310,15 +310,14 @@ int cmd_reset(int argc, char **argv)
rt_hw_cpu_reset();
return 0;
}
MSH_CMD_EXPORT_ALIAS(cmd_reset, reset, restart the system);
int cmd_shutdown(int argc, char **argv)
{
rt_hw_cpu_shutdown();
return 0;
}
FINSH_FUNCTION_EXPORT_ALIAS(cmd_reset, __cmd_reset, restart the system.);
FINSH_FUNCTION_EXPORT_ALIAS(cmd_shutdown, __cmd_shutdown, shutdown the system.);
MSH_CMD_EXPORT_ALIAS(cmd_shutdown, shutdown, shutdown the system);
int nu_clocks(int argc, char **argv)
{
@ -345,7 +344,7 @@ int nu_clocks(int argc, char **argv)
return 0;
}
MSH_CMD_EXPORT(nu_clocks, Get all system clocks);
MSH_CMD_EXPORT(nu_clocks, get all system clocks);
#endif
#ifdef RT_USING_INTERRUPT_INFO

View File

@ -98,21 +98,14 @@ void rt_hw_board_init()
#ifdef RT_USING_HEAP
rt_system_heap_init((void*)NV32_SRAM_BEGIN, (void*)NV32_SRAM_END);
#endif
}
long cmd_reset(int argc, char** argv)
int cmd_reset(int argc, char** argv)
{
NVIC_SystemReset();
return 0;
}
FINSH_FUNCTION_EXPORT_ALIAS(cmd_reset, __cmd_reset, Reset Board.);
MSH_CMD_EXPORT_ALIAS(cmd_reset, reset, restart the system);
/*@}*/

View File

@ -102,6 +102,6 @@ int _ac97_reg_dump(int argc, char **argv)
AC97_DUMP(AC97_ADC_SLOT_MAP);
return 0;
}
FINSH_FUNCTION_EXPORT_ALIAS(_ac97_reg_dump, __cmd_ac97_dump, ac97 dump reg.);
MSH_CMD_EXPORT_ALIAS(_ac97_reg_dump, ac97_dump, ac97 dump reg);
#endif

View File

@ -391,5 +391,6 @@ int _aaci_pl041_reg_dump(int argc, char **argv)
PL041_DUMP(PL041->dr4[0]);
return 0;
}
FINSH_FUNCTION_EXPORT_ALIAS(_aaci_pl041_reg_dump, __cmd_pl041_dump, aaci pl041 dump reg.);
MSH_CMD_EXPORT_ALIAS(_aaci_pl041_reg_dump, pl041_dump, aaci pl041 dump reg);
#endif

View File

@ -84,7 +84,7 @@ void rt_hw_exit(void)
#if defined(RT_USING_FINSH)
#include <finsh.h>
FINSH_FUNCTION_EXPORT_ALIAS(rt_hw_exit, exit, exit rt - thread);
FINSH_FUNCTION_EXPORT_ALIAS(rt_hw_exit, __cmd_quit, exit rt-thread);
MSH_CMD_EXPORT_ALIAS(rt_hw_exit, quit, exit rt-thread);
#endif /* RT_USING_FINSH */
/**

View File

@ -97,7 +97,7 @@ static void standby(uint8_t argc, char **argv)
sys_start_standby(atoi(argv[1]));
}
}
FINSH_FUNCTION_EXPORT_ALIAS(standby, __cmd_standby, sleep System);
MSH_CMD_EXPORT(standby, sleep system);
#endif /* RT_USING_FINSH */
#endif /* BSP_USING_STANDBY */

View File

@ -966,6 +966,5 @@ int cmd_canstat(int argc, void **argv)
}
return 0;
}
FINSH_FUNCTION_EXPORT_ALIAS(cmd_canstat, __cmd_canstat, Stat Can Device Status.);
MSH_CMD_EXPORT_ALIAS(cmd_canstat, canstat, stat can device status);
#endif

View File

@ -777,7 +777,7 @@ void rt_alarm_dump(void)
rt_kprintf("+----+---------------------+------+------+----+\n");
}
FINSH_FUNCTION_EXPORT_ALIAS(rt_alarm_dump, __cmd_alarm_dump, dump alarm info);
MSH_CMD_EXPORT_ALIAS(rt_alarm_dump, rt_alarm_dump, dump alarm info);
/** \brief initialize alarm service system
*

View File

@ -587,7 +587,7 @@ static int wifi_msh(int argc, char *argv[])
}
#if defined(RT_USING_FINSH)
FINSH_FUNCTION_EXPORT_ALIAS(wifi_msh, __cmd_wifi, wifi command.);
MSH_CMD_EXPORT_ALIAS(wifi_msh, wifi, wifi command);
#endif
#endif

View File

@ -236,7 +236,7 @@ int cmd_ping(int argc, char **argv)
return 0;
}
FINSH_FUNCTION_EXPORT_ALIAS(cmd_ping, __cmd_ping, ping network host);
MSH_CMD_EXPORT_ALIAS(cmd_ping, ping, ping network host);
#endif /* RT_USING_FINSH */
#endif /* RT_USING_NETDEV */

View File

@ -236,7 +236,7 @@ int cmd_ping(int argc, char **argv)
return 0;
}
FINSH_FUNCTION_EXPORT_ALIAS(cmd_ping, __cmd_ping, ping network host);
MSH_CMD_EXPORT_ALIAS(cmd_ping, ping, ping network host);
#endif /* RT_USING_FINSH */
#endif /* RT_USING_NETDEV */

View File

@ -236,7 +236,7 @@ int cmd_ping(int argc, char **argv)
return 0;
}
FINSH_FUNCTION_EXPORT_ALIAS(cmd_ping, __cmd_ping, ping network host);
MSH_CMD_EXPORT_ALIAS(cmd_ping, ping, ping network host);
#endif /* RT_USING_FINSH */
#endif /* RT_USING_NETDEV */

View File

@ -236,7 +236,7 @@ int cmd_ping(int argc, char **argv)
return 0;
}
FINSH_FUNCTION_EXPORT_ALIAS(cmd_ping, __cmd_ping, ping network host);
MSH_CMD_EXPORT_ALIAS(cmd_ping, ping, ping network host);
#endif /* RT_USING_FINSH */
#endif /* RT_USING_NETDEV */

View File

@ -1047,7 +1047,7 @@ int netdev_ifconfig(int argc, char **argv)
return 0;
}
FINSH_FUNCTION_EXPORT_ALIAS(netdev_ifconfig, __cmd_ifconfig, list the information of all network interfaces);
MSH_CMD_EXPORT_ALIAS(netdev_ifconfig, ifconfig, list the information of all network interfaces);
#endif /* NETDEV_USING_IFCONFIG */
#ifdef NETDEV_USING_PING
@ -1152,7 +1152,7 @@ int netdev_ping(int argc, char **argv)
return 0;
}
FINSH_FUNCTION_EXPORT_ALIAS(netdev_ping, __cmd_ping, ping network host);
MSH_CMD_EXPORT_ALIAS(netdev_ping, ping, ping network host);
#endif /* NETDEV_USING_IFCONFIG */
static void netdev_list_dns(void)
@ -1222,8 +1222,7 @@ int netdev_dns(int argc, char **argv)
return 0;
}
FINSH_FUNCTION_EXPORT_ALIAS(netdev_dns, __cmd_dns, list and set the information of dns);
MSH_CMD_EXPORT_ALIAS(netdev_dns, dns, list and set the information of dns);
#ifdef NETDEV_USING_NETSTAT
static void netdev_cmd_netstat(void)
{
@ -1270,7 +1269,7 @@ int netdev_netstat(int argc, char **argv)
return 0;
}
FINSH_FUNCTION_EXPORT_ALIAS(netdev_netstat, __cmd_netstat, list the information of TCP / IP);
MSH_CMD_EXPORT_ALIAS(netdev_netstat, netstat, list the information of TCP / IP);
#endif /* NETDEV_USING_NETSTAT */
#endif /* RT_USING_FINSH */

View File

@ -81,5 +81,5 @@ static void cmd_readspeed(int argc, char *argv[])
}
readspeed(filename, block_size);
}
FINSH_FUNCTION_EXPORT_ALIAS(cmd_readspeed, __cmd_readspeed, test file system read speed);
MSH_CMD_EXPORT_ALIAS(cmd_readspeed, readspeed, test file system read speed);
#endif /* RT_USING_FINSH */

View File

@ -162,5 +162,5 @@ static void cmd_readwrite(int argc, char *argv[])
}
readwrite(filename);
}
FINSH_FUNCTION_EXPORT_ALIAS(cmd_readwrite, __cmd_readwrite, perform file read and write test);
MSH_CMD_EXPORT_ALIAS(cmd_readwrite, readwrite, perform file read and write test);
#endif /* RT_USING_FINSH */

View File

@ -92,5 +92,5 @@ static void cmd_writespeed(int argc, char *argv[])
}
writespeed(filename, length, block_size);
}
FINSH_FUNCTION_EXPORT_ALIAS(cmd_writespeed, __cmd_writespeed, test file system write speed);
MSH_CMD_EXPORT_ALIAS(cmd_writespeed, writespeed, test file system write speed);
#endif /* RT_USING_FINSH */