support can and add test case for xidatong-riscv64 on nuttx

This commit is contained in:
wgzAIIT
2022-11-10 14:37:54 +08:00
parent 2bc1de068c
commit 5d6aa56f29
12 changed files with 277 additions and 24 deletions
@@ -671,6 +671,10 @@ config NSH_DISABLE_MUSL_TEST
bool "Disable the musl test."
default n
config NSH_NSH_DISABLE_CAN_TEST
bool "Disable the can test."
default n
endmenu
if MMCSD
@@ -1591,6 +1591,9 @@ int nsh_foreach_var(FAR struct nsh_vtbl_s *vtbl, nsh_foreach_var_t cb,
int cmd_musl(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
#endif
#if defined(CONFIG_BSP_USING_CAN) && !defined(CONFIG_NSH_DISABLE_CAN_TEST)
int cmd_cantest(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
#endif
#if defined(__cplusplus)
}
#endif
@@ -509,4 +509,14 @@ int cmd_musl(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
Testmusl();
return OK;
}
#endif
#if defined(CONFIG_BSP_USING_CAN) && !defined(CONFIG_NSH_DISABLE_CAN_TEST)
extern void can_test(void);
int cmd_cantest(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
nsh_output(vtbl, "Hello, world!\n");
can_test();
return OK;
}
#endif
@@ -736,6 +736,10 @@ static const struct cmdmap_s g_cmdmap[] =
{ "testmusl", cmd_musl, 1, 1, "[test musl function.]" },
#endif
#if defined(CONFIG_BSP_USING_CAN) && !defined(CONFIG_NSH_DISABLE_CAN_TEST)
{ "cantest", cmd_cantest, 1, 1, "[test can function.]" },
#endif
{ NULL, NULL, 1, 1, NULL }
};