ARM Technical Support Knowledge Articles

FLOATING-POINT REENTRANCY IN ISR?

Applies to: C51 C Compiler

Answer


Information in this article applies to:


QUESTION

The documentation states floating-point operations are fully reentrant. Does that apply to interrupt routines as well?

ANSWER

Floating point operations the compiler generates code for (+ - * /) are fully reentrant. But only a few functions in math.h are reentrant.

Those that are not reentrant must be protected from interrupts. One way this can be accomplished is to put a wrapper that disables and re-enables interrupts around the floating point math calls. For example:

#pragma disable        // Disable Interrupts for this function
float ISR_sin (float x)
{
return (sin(x));
}

MORE INFORMATION

SEE ALSO

Article last edited on: 2005-07-15 10:15:58

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential