This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

What does a FUNC_INTERRUPT_THRESHOLD of 0 mean?

Hi,

We've come across some code that has #pragma FUNC_INTERRUPT_THRESHOLD(function, 0) and, looking at the documentation, it is not entirely clear what this means.

The compiler UG states that a value of less than 0 means that the compiler "assumes that the function is never interrupted, which is equivalent to an interrupt threshold of infinity", which I believe means that the developer is responsible for ensuring that the code cannot be interrupted.

For other values, it refers to the --interrupt_threshold option. This suggests that, for values >= 1, the compiler may mask interrupts for up to that number of cycles. Note that this means that compiler is responsible for masking interrupts should that be required.

For a value of 0, there is the following statement: "The --interrupt_threshold=0 option generates the same code to disable interrupts around software-pipelined loops as when the --interrupt_threshold option is not used". From this, I assume that FUNC_INTERRUPT_THRESHOLD(function, 0) means that the compiler is permitted to produce code in that function that masks interrupts (even if the -mi option has been used) for an arbitrarily long period of time but, if the code produced requires interrupts to be masked, it is the compiler that is responsible for masking them.

Is my understanding of this #pragma correct?

Thanks in advance,

SPH.