AnsweredAssumed Answered

On a STM32L0 platform - any reason why enabling HAL_NVIC_EnableIRQ(ADC1_COMP_IRQn) would stop / disable EXTI4_15_IRQn ??

Question asked by David Smith on Jun 3, 2018
Latest reply on Jun 4, 2018 by T J

static void EXTILine0_1_Config(void)
{
GPIO_InitTypeDef GPIO_InitStructure;

/* Enable GPIOC clock */
__HAL_RCC_GPIOA_CLK_ENABLE();

/* Configure PA0 pin as input floating */
GPIO_InitStructure.Mode = GPIO_MODE_IT_FALLING;
GPIO_InitStructure.Pull = GPIO_NOPULL;
GPIO_InitStructure.Pin = GPIO_PIN_4; // DAS - To configure MORE than 1 pin - Just "or" them together...
GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_HIGH ;
HAL_GPIO_Init(GPIOA, &GPIO_InitStructure);

/* Enable and set EXTI4_15 Interrupt to the lowest priority */
HAL_NVIC_SetPriority(EXTI4_15_IRQn, 3, 0);
HAL_NVIC_EnableIRQ(EXTI4_15_IRQn);
}

 

 

void HAL_ADC_MspInit(ADC_HandleTypeDef *hadc)
{
GPIO_InitTypeDef GPIO_InitStruct;

//##-1- Enable peripherals and GPIO Clocks #################################
// Enable GPIO clock ****************************************
__HAL_RCC_GPIOA_CLK_ENABLE();
// __HAL_RCC_GPIOB_CLK_ENABLE();

// ADC1 Periph clock enable
__HAL_RCC_ADC1_CLK_ENABLE();

//##- 2- Configure peripheral GPIO #########################################
// ADC3 Channel8 GPIO pin configuration

GPIO_InitStruct.Pin = GPIO_PIN_0; // GPIO_PIN_0
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); //GPIO

//##-3- Configure the NVIC #################################################
// NVIC configuration for ADC EOC interrupt
HAL_NVIC_SetPriority(ADC1_COMP_IRQn, 0, 0);
// HAL_NVIC_EnableIRQ(ADC1_COMP_IRQn);  // <<--- All works until this line is uncommented and executed

}

Outcomes