add ch376 usb demo on xidatong-riscv64
This commit is contained in:
@@ -547,6 +547,10 @@ config NSH_DISABLE_XD
|
||||
bool "Disable xd"
|
||||
default DEFAULT_SMALL
|
||||
|
||||
config NSH_DISABLE_CH376
|
||||
bool "Disable the ch376 demo."
|
||||
default n
|
||||
|
||||
config NSH_DISABLE_CH438
|
||||
bool "Disable the ch438 demo."
|
||||
default n
|
||||
|
||||
@@ -1450,6 +1450,10 @@ int nsh_foreach_var(FAR struct nsh_vtbl_s *vtbl, nsh_foreach_var_t cb,
|
||||
FAR void *arg);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_BSP_USING_CH376) && !defined(CONFIG_NSH_DISABLE_CH376)
|
||||
int cmd_Ch376(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_BSP_USING_CH438) && !defined(CONFIG_NSH_DISABLE_CH438)
|
||||
int cmd_Ch438(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
|
||||
#endif
|
||||
|
||||
@@ -38,6 +38,19 @@
|
||||
|
||||
extern int FrameworkInit(void);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cmd_Ch376
|
||||
****************************************************************************/
|
||||
#if defined(CONFIG_BSP_USING_CH376) && !defined(CONFIG_NSH_DISABLE_CH376)
|
||||
extern void CH376Demo(void);
|
||||
int cmd_Ch376(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||
{
|
||||
nsh_output(vtbl, "Hello, world!\n");
|
||||
CH376Demo();
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cmd_Ch438
|
||||
****************************************************************************/
|
||||
|
||||
@@ -596,6 +596,10 @@ static const struct cmdmap_s g_cmdmap[] =
|
||||
{ "xd", cmd_xd, 3, 3, "<hex-address> <byte-count>" },
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_BSP_USING_CH376) && !defined(CONFIG_NSH_DISABLE_CH376)
|
||||
{ "ch376", cmd_Ch376, 1, 1, "[ch376 demo cmd.]" },
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_BSP_USING_CH438) && !defined(CONFIG_NSH_DISABLE_CH438)
|
||||
{ "ch438", cmd_Ch438, 1, 1, "[ch438 demo cmd.]" },
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user