2021-06-29 06:38 AM
I want to make an interrupt when power > 2.0V.
STM32CubeIDE generated:
/**
* @brief NVIC Configuration.
* @retval None
*/
static void MX_NVIC_Init(void)
{
/* PVD_IRQn interrupt configuration */
HAL_NVIC_SetPriority(PVD_IRQn, 8, 0);
HAL_NVIC_EnableIRQ(PVD_IRQn);
/* TIM3_IRQn interrupt configuration */
HAL_NVIC_SetPriority(TIM3_IRQn, 5, 0);
HAL_NVIC_EnableIRQ(TIM3_IRQn);
/* LTDC_IRQn interrupt configuration */
HAL_NVIC_SetPriority(LTDC_IRQn, 5, 0);
HAL_NVIC_EnableIRQ(LTDC_IRQn);
}
/**
* @brief CRC Initialization Function
* @param None
* @retval None
*/
Configuration:
/* USER CODE BEGIN SysInit */
PWR_PVDTypeDef sConfigPVD;
sConfigPVD.PVDLevel = PWR_PVDLEVEL_0;
sConfigPVD.Mode = PWR_PVD_MODE_IT_RISING;
HAL_PWR_ConfigPVD(&sConfigPVD);
HAL_PWR_EnablePVD();
/* USER CODE END SysInit */
Initialize:
/* Initialize interrupts */
MX_NVIC_Init();
How and where to call an interrupt so that it sets the variable on = 0?
Andrzej