Punit
Punit

Reputation: 11

To distinguish between a Task and an Interrupt

I have a point in my code where I need to check if program came here from an interrupt or a task. I am using SMX. Anyone used SMX can answer his question. I didn't get enough info from docs. So, basically I want some variable/parameter in order to distinguish between an ISR and a task.

Upvotes: 0

Views: 1228

Answers (1)

wallyk
wallyk

Reputation: 57774

Surely the code path is unique. I don't know about SMX, but surely it doesn't override the usual mechanism whereby a function called by an interrupt has special handling to establish the stack frame, preserve registers, and maybe establish a static link to the module variables. In such cases, the obvious means to check ISR vs. another route is for the ISR to set a flag at entry and clear it when it exits.

Upvotes: 1

Related Questions