reset_fc 实现

Signed-off-by: a1012112796 <1012112796@qq.com>
This commit is contained in:
2022-11-08 13:57:41 +08:00
parent 8903a09f2c
commit 53c63690da

View File

@@ -72,3 +72,23 @@ INIT_ENV_EXPORT(fal_init);
extern int iap_main_entry(void); extern int iap_main_entry(void);
INIT_ENV_EXPORT(iap_main_entry); INIT_ENV_EXPORT(iap_main_entry);
#include <stdlib.h>
static void reset_fc(int argc, char **argv)
{
int second = 20; // default 20s
if (argc > 1)
{
second = atoi(argv[1]);
}
rt_kprintf("\n the system will be reset after %ds\n", second);
rt_enter_critical();
rt_console_set_device(RT_NULL);
rt_exit_critical();
rt_thread_delay(1000 * second);
rt_hw_cpu_reset();
}
MSH_CMD_EXPORT(reset_fc, resetfc cmd);