FAQ: Calling Library Functions From an ISR

Document created by Kader.M Employee on May 8, 2018
Version 1Show Document
  • View in full screen mode

Question:

 

Can I use in ISR the functions defined in the header file math.h? According C/C++ Library Manual for SHARC Processors it's prohibited.

So I can use the functions defined in the header file math.h ONLY in background (main.cpp)

My program use the software interrupt like cyclic task which use the functions (sin, asin, sqrt) defined in the header file math.h.

 

=============================

 

Answer:

 

As mentioned in the manual, It is recommended that none of the functions defined in the header file math.h, nor the string conversion functions defined in stdlib.h, be called from an ISR, as these functions are commonly defined to update the global variable errno. Similarly, the functions defined in the stdio.h header file maintain static tables for currently opened streams and should not be called from an ISR.

Attachments

    Outcomes