Compare commits

...

1 Commits

Author SHA1 Message Date
6ea6bf90d9 rt_hw_cpu_reset_hook M4 2025-01-12 12:30:55 +08:00
3 changed files with 16 additions and 1 deletions

View File

@ -90,8 +90,9 @@ void rt_hw_cpu_dcache_ops(int ops, void* addr, int size);
#endif
void rt_hw_cpu_reset(void);
void rt_hw_cpu_reset_hook(void);
void rt_hw_cpu_shutdown(void);
void rt_hw_cpu_shutdown_hook(void);
const char *rt_hw_cpu_arch(void);
rt_uint8_t *rt_hw_stack_init(void *entry,

View File

@ -433,6 +433,8 @@ void rt_hw_hard_fault_exception(struct exception_info *exception_info)
*/
void rt_hw_cpu_reset(void)
{
rt_kprintf("Reset ...\n");
rt_hw_cpu_reset_hook();
SCB_AIRCR = SCB_RESET_VALUE;
}

View File

@ -69,18 +69,30 @@ rt_weak void rt_hw_us_delay(rt_uint32_t us)
"Please consider implementing rt_hw_us_delay() in another file.");
}
rt_weak void rt_hw_cpu_reset_hook(void)
{
;
}
rt_weak void rt_hw_cpu_reset(void)
{
LOG_W("rt_hw_cpu_reset() doesn't support for this board."
"Please consider implementing rt_hw_cpu_reset() in another file.");
rt_hw_cpu_reset_hook();
return;
}
rt_weak void rt_hw_cpu_shutdown_hook(void)
{
;
}
rt_weak void rt_hw_cpu_shutdown(void)
{
LOG_I("CPU shutdown...");
LOG_W("Using default rt_hw_cpu_shutdown()."
"Please consider implementing rt_hw_cpu_shutdown() in another file.");
rt_hw_cpu_shutdown_hook();
rt_hw_interrupt_disable();
RT_ASSERT(0);
return;