2024-03-11 07:48 AM
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,
Solved! Go to Solution.
2024-03-11 08:28 AM
> 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.
2024-03-11 08:28 AM
> 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.