Compare commits
1 Commits
master
...
reset_hook
Author | SHA1 | Date | |
---|---|---|---|
6ea6bf90d9 |
@ -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,
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user