Skip to main content
Graduate II
March 11, 2024
Solved

STM32G0 series ADC Analog Watchdog Interrupt Callback function

  • March 11, 2024
  • 1 reply
  • 989 views

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, 

 

 

    This topic has been closed for replies.
    Best answer by TDK

    > 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.

    1 reply

    TDKAnswer
    Super User
    March 11, 2024

    > 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.