cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G0 series ADC Analog Watchdog Interrupt Callback function

danielbathtub
Associate III

Hi, 

I'm developing an application, which require ADC channel changes when an analog watchdog interrupt triggers. 

Now in my IRQ routine, I'm having issues with consistent interrupts triggering, blocking my code outside of the ISR intended to change my channels and run my application. Is there any way to stop this from happening ? 

I've tried __disable_irq(); with no luck. And utilizing __enable_irq(); as well. 

What I want to do is, prevent all the other interrupts occuring while I am in the ISR, control the flow of the code. 

I can't use scan mode scanning multiple channels or the DMA, this is the only way for my application to work. 

Thanks, 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

> What I want to do is, prevent all the other interrupts occuring while I am in the ISR, control the flow of the code. 

__disable_irq() will disable interrupts from occurring. That is the correct method to use to achieve the result. If you're not seeing this, there is another explanation for why that is occurring, perhaps a misunderstanding of what the code is doing.

Or you can set the priority of the interrupt you want to stay in higher (numerically lower) than the other interrupts.

Either method will work.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

1 REPLY 1
TDK
Guru

> What I want to do is, prevent all the other interrupts occuring while I am in the ISR, control the flow of the code. 

__disable_irq() will disable interrupts from occurring. That is the correct method to use to achieve the result. If you're not seeing this, there is another explanation for why that is occurring, perhaps a misunderstanding of what the code is doing.

Or you can set the priority of the interrupt you want to stay in higher (numerically lower) than the other interrupts.

Either method will work.

If you feel a post has answered your question, please click "Accept as Solution".