区分任务和中断
我的代码中有一点需要检查程序是否来自中断或任务。我正在使用 SMX。任何使用过SMX的人都可以回答他的问题。我没有从文档中获得足够的信息。所以,基本上我想要一些变量/参数来区分 ISR 和任务。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当然,代码路径是唯一的。我不了解 SMX,但它肯定不会覆盖通常的机制,即由中断调用的函数具有特殊处理来建立堆栈帧、保留寄存器,并且可能建立到模块变量的静态链接。在这种情况下,检查 ISR 与另一条路由的明显方法是 ISR 在入口处设置一个标志,并在退出时清除它。
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.