movie_freak
Member level 5
Hi all,
How safe it is to call a function within the interrupt?
I have an event which needs to run as soon as it is recognized. It gets recognized in the interrupt.
Now, if I am executing somewhere in the main(); the program execution will recognize the event in the interrupt but only execute when it gets its chance in the Main.
As this event needs to be processed as soon as it gets recognized and it is the highest priority event that i want to process, can we call it in the Interrupt itself (and disabling further interrupts during the execution of this function to stop nesting of interrupts), or is there any other alternative method??
Note: This event need to be processed at real time with fast response. I am not using any RTOS it's only a ATmega based project.
Many Thanks,
Surya
How safe it is to call a function within the interrupt?
I have an event which needs to run as soon as it is recognized. It gets recognized in the interrupt.
Now, if I am executing somewhere in the main(); the program execution will recognize the event in the interrupt but only execute when it gets its chance in the Main.
As this event needs to be processed as soon as it gets recognized and it is the highest priority event that i want to process, can we call it in the Interrupt itself (and disabling further interrupts during the execution of this function to stop nesting of interrupts), or is there any other alternative method??
Note: This event need to be processed at real time with fast response. I am not using any RTOS it's only a ATmega based project.
Many Thanks,
Surya