# Any function to know whether the code run from interrupt or not

**URL:** <https://forums.freertos.org/t/any-function-to-know-whether-the-code-run-from-interrupt-or-not/18136>\
**Category:** Texas Instruments\
**Tags:** debug\
**Created:** [September 5, 2023, 8:40am UTC](https://forums.freertos.org/t/any-function-to-know-whether-the-code-run-from-interrupt-or-not/18136 "2023-09-05T08:40:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Strong\_zhang](https://avatars.discourse-cdn.com/v4/letter/s/e9a140/32.png) [@Strong\_zhang](https://forums.freertos.org/u/Strong_zhang)\
**Post date:** [September 5, 2023, 8:40am UTC](https://forums.freertos.org/t/any-function-to-know-whether-the-code-run-from-interrupt-or-not/18136/1 "2023-09-05T08:40:09Z")

</div>

Hi Expert,

For BIOS system, there have a function that called TSK\_isTSK that know whether the code run from interrupt code or other non-interrupt task code, any API function for FreeRTOS have the same function?

---

<div class="post-metadata">

**Author:** ![aggarg](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/aggarg/32/4245_2.png) [@aggarg](https://forums.freertos.org/u/aggarg)\
**Post date:** [September 5, 2023, 8:44am UTC](https://forums.freertos.org/t/any-function-to-know-whether-the-code-run-from-interrupt-or-not/18136/2 "2023-09-05T08:44:46Z")

</div>

Which FreeRTOS port are you using? Many FreeRTOS ports have the function [xPortIsInsideInterrupt](https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/V10.6.1/portable/GCC/ARM_CM4F/portmacro.h#L179).
