void PVD_Init(void)
{
PWR_PVDTypeDef PWR_PVDStruct;
__HAL_RCC_PWR_CLK_ENABLE();
PWR_PVDStruct.PVDLevel = PWR_PVDLEVEL_7; // 2.9V
//PWR_PVDStruct.Mode = PWR_PVD_MODE_IT_RISING;
PWR_PVDStruct.Mode = PWR_PVD_MODE_IT_RISING_FALLING;
HAL_PWR_ConfigPVD(&PWR_PVDStruct);
HAL_PWR_EnablePVD();
}
void HAL_PWR_PVDCallback(void)
{
HAL_PWR_EnableBkUpAccess();
HAL_PWR_EnableBkUpReg();
__HAL_RCC_BKPSRAM_CLK_ENABLE();
U32CopyToBKP(0xaabbccdd, 0);
}
以上程序进不了 PVD 中断 |