STM32 获取系统重启原因(STM32F407VET6为例)

在stm32f4xx_hal_rcc.h中,有如下重启的原因
#define RCC_FLAG_BORRST ((uint8_t)0x79)
#define RCC_FLAG_PINRST ((uint8_t)0x7A)
#define RCC_FLAG_PORRST ((uint8_t)0x7B)
#define RCC_FLAG_SFTRST ((uint8_t)0x7C)
#define RCC_FLAG_IWDGRST ((uint8_t)0x7D)
#define RCC_FLAG_WWDGRST ((uint8_t)0x7E)
#define RCC_FLAG_LPWRRST ((uint8_t)0x7F)
RCC_FLAG_BORRST : POR/PDR or BOR reset //Power-on/power-down reset (POR/PDR reset) or brownout (BOR) reset
STM32 获取系统重启原因(STM32F407VET6为例)_第1张图片
清除复位Flag:__HAL_RCC_CLEAR_RESET_FLAGS(void);
获取复位Flag:__HAL_RCC_GET_FLAG(FLAG)

你可能感兴趣的:(STM32)