完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
您好,我正在修改已经可以使用的STM8S003的代码。
但是代码停止了工作,即使我还没有做任何改动。 STVD显示以下错误消息: #error clnk Debug ajk_strobo_lps_st.lkf:函数f_EXti_PORTA_IRQHandler缺少1个@svlreg 此代码已经有效,我找不到任何错误,任何人都可以帮助我吗? 以上来自于谷歌翻译 以下为原文 Hello, I am modifying the code of an STM8S003 that already works. But the code stopped working, even though I have not made any changes yet. The STVD displays the following error message: #error clnk Debugajk_strobo_lps_st.lkf:1 @svlreg missing for function f_EXTI_PORTA_IRQHandler This code already worked and I can not find any errors, can anyone help me? |
|
相关推荐
2个回答
|
|
你好,
在中断函数名称之前添加@svlreg关键字,一切都将恢复正常。 之前工作的原因是工具链在过去无法检测到这种潜在的危险情况(如果没有@svlreg用于使用32位数学运算的中断函数,内部寄存器c_lreg可能会在某些不完整的情况下被修复并导致应用程序崩溃/错误行为):我们已经对它进行了改进,现在它告诉您,为了安全起见,您的代码需要进行这种小修改。 问候, 卢卡(宇宙) 以上来自于谷歌翻译 以下为原文 Hello, add the @svlreg keyword before your interrupt function name and everything will go back to normal. The reason why this worked before is that the toolchain was not able, in the past, to detect this potentially dangerous situation (without @svlreg for interrupt functions that use 32 bits math the internal register c_lreg can become corrutped in some unluky cases and lead to application crash/mi***ehavior): we have improved it since and now it tells you that your code needs this minor modification in order to be safe. Regards, Luca (Cosmic) |
|
|
|
但是@svlreg导致从堆栈中推送和“弹出”某些东西,当中断对32位值进行计算时,它是必要的。
如果中断函数不调用ohter文件中的其他函数,则编译器能够确定您是否正在进行32位操作。在这种情况下这是可以的,因为如果使用或不使用svlreg,编译器会为您提供良好的信息。 但是如果你在其他文件中调用其他函数,那么编译器不知道将在那里做什么。 并强制使用@svlreg。 我知道怎么办,在中断中我永远不会进行32位计算。如何强制编译器在没有@svlreg的情况下传递中断函数声明,以避免不需要使用堆栈? 以上来自于谷歌翻译 以下为原文 But @svlreg causing pushing and "poping" something from stack and it is neccesary when interrupt makes calculations on 32bit values. If interrupt function doesn't call other functions in ohter files then compiler is able to determinate if you are making 32bit operations or not. In this case is this ok because compiler gives you good information if svlreg shall be used or not. But if you are calling other function in other file then compiler don't know what will be done there. And forcing to use @svlreg. What to do when I know, that in interrupt I will never make 32bit calculations. How to force compiler to pass interrupt function declaration without @svlreg to avoid not neccesary stack usage ? |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
1671 浏览 1 评论
2377 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1524 浏览 1 评论
2929 浏览 6 评论
5410 浏览 21 评论
410浏览 4评论
728浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
298浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
754浏览 3评论
672浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-5-21 12:32 , Processed in 0.667064 second(s), Total 49, Slave 42 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号