"); //-->
Q. I get the error: function * appears in multiple call graphs: rooted at *
What does this mean?
A. It means that there is a function which is being called from an interrupt
and from main code and reentrancy is not supported by the compiler.
Because the function is not reentrant, it leaves open the possibility
of it being called from both locations at the same time. There are several
possible ways to work around this:
1. If the compiler supports the "reentrant" qualifer, then define the function
with this.
2. ROM space permitting, make two copies of the function but give them different
names. One is only called by the interrupt, the other only by main code.
3. Rewrite the function such that it doesn't have any local variables or
parameters. If the function doesn't have these, then it can be called from
the interrupt and main code at the same time.
4. If you can guarantee that the function will not be called simultaneously, then
you can use the #pragma interrupt_level directive. This is detailed in the
user manuals, but in brief it is used like the following:
#pragma interrupt_level 1
void common_func(void)
{
/* local variable definitions */
/* code */
}
#pragma interrupt_level 1
void interrupt isr(void)
{
common_func();
/* more code */
}
void main(void)
{
common_func(); /* gets called before interrupts are turned on */
EI(); /* enable interrupts */
/* more code */
}
专栏文章内容及配图由作者撰写发布,仅供工程师学习之用,如有侵权或者其他违规问题,请联系本站处理。 联系我们
相关推荐
美研制新概念载人小型深潜器
RTI 和 Kinova 为医疗机器人带来智能连接
德州仪器AMC0106M05:先进的电流和电压检测技术如何实现超精密机器人
[推荐]深圳翔源公司专业PCB(线路板)抄板、PCB改板、PCB设计....
斑竹,请问VXWORKS是否支持KE2000 PLUG-PLAY 网卡啊?
美空军计划未来10年采购2000架无人机
[求助]广告机
xMEMS发布μCooling微型气冷式全硅主动散热芯片方案
PIC12F635_PIC16F636_PIC12F639 单片机
为何集体围攻比亚迪?
美批准建造首批DD(X)驱逐舰
简易占空比可调脉冲发生器电路
占空比和频率分别可调的脉冲发生器电路
AVEVA剑维软件中国智能创新中心成立,加速本土工业智能迭代
寻求基于ARM嵌入式系统的软硬件设计项目合作
LC方波发生器电路
人形机器人的产业生态与协同发展探讨
频移键控(F胀)方波发生器电路
“2025京东方投资者日”在沪举办 资本战略转型开启价值创造新阶段
美陆军调整陆航采办计划
如何利用保护电路轻松消除过压
50%占空比的振荡器电路
PIC10F200_Pic10f202_pic10f204_pic10f206 6引脚8位闪存单片机
美研究“多箭一星”发射技术
PIC10F20X 单片机
PHILIPS单片16_32位微控制器-LPC2292_LPC2294
PIC12C5XX单片机
相较于端到端,VLA给智驾带来了哪些改变?
请问,主机与目标机通过那种网线连接起来啊?
意法半导体扩展ISO 26262标准车规负载驱动器产品系列