/获取重启原因/
void static RestGet(void)
{
unsigned long val = RCU_RSTSCK;
printf("\r\nRCU_RSTSCK = %lu\r\n",val);
if(rcu_flag_get(RCU_FLAG_BORRST))
{
printf("reboot reson : RCU_FLAG_BORRST\r\n");
}
if(rcu_flag_get(RCU_FLAG_EPRST))
{
printf("reboot reson : RCU_FLAG_EPRST\r\n");
}
if(rcu_flag_get(RCU_FLAG_PORRST))
{
printf("reboot reson : RCU_FLAG_PORRST\r\n");
}
if(rcu_flag_get(RCU_FLAG_SWRST))
{
printf("reboot reson : RCU_FLAG_SWRST\r\n");
}
if(rcu_flag_get(RCU_FLAG_FWDGTRST))
{
printf("reboot reson : RCU_FLAG_FWDGTRST\r\n");
}
if(rcu_flag_get(RCU_FLAG_WWDGTRST))
{
printf("reboot reson : RCU_FLAG_WWDGTRST\r\n");
}
if(rcu_flag_get(RCU_FLAG_LPRST))
{
printf("reboot reson : RCU_FLAG_LPRST\r\n");
}
rcu_all_reset_flag_clear();//清除标志
}