Forum Discussion
Altera_Forum
Honored Contributor
15 years agoIs this what you want to do?
http://www.alteraforum.com/forum/showthread.php?t=21705 Or is it that you want the routine to limit itself when it's in an interrupt context? You could modify alt_irq_handler.c to set a global to indicate the current context. Also, ISRs provide the interrupt ID, which tells you what its priority level is. So you could pass an extra parameter to your routine since, if it's running under an IRQ context, it will have been called from an ISR. If you're using your own peripherals, another possibility is to modify the logic so that you have a "write a register to generate an IRQ". I did this with my Serial-Tx logic, so that "get next character to transmit from the buffer" would only be called from the ISR.