#define NVIC_INT_CTRL 0xE000ED04 //系统控制状态寄存器
#define NVIC_SYSPRI2 0xE000ED20 //系统优先级寄存器2
#define NVIC_PENDSV_PRI 0x000000FF //PendSV优先级设置为最低
#define NVIC_PENDSV_SET 0x10000000 //触发PendSV的值
// PendSV异常
void ProductPendSV()
{
*(volatile unsigned long *)NVIC_SYSPRI2 = NVIC_PENDSV_PRI;
*(volatile unsigned long *)NVIC_INT_CTRL = NVIC_PENDSV_SET;
}
|