@@ -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);
|
||||||
|
Reference in New Issue
Block a user