extern void SoftReset(void)
{
__set_FAULTMASK(1); // 关闭所有中断
NVIC_SystemReset();// 复位
}
这两个函数如下,和网上看有些函数不一样啊。。我这固件库好象是V3.1版本的。。
static __INLINE void __set_FAULTMASK(uint32_t faultMask)
{
register uint32_t __regFaultMask __ASM("faultmask");
__regFaultMask = (faultMask & 1);
}
static __INLINE void NVIC_SystemReset(void)
{
SCB->AIRCR = (NVIC_AIRCR_VECTKEY | (SCB->AIRCR & (0x700)) | (1<<NVIC_SYSRESETREQ)); /* Keep priority group unchanged */
__DSB(); /* Ensure completion of memory access */
while(1); /* wait until reset */
}
一运行到复位这里。。就直接死机了,也不重启,除非断电了。。有哪里不对么
|