完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
|
今天,我发现了XC8(版本1.36——MPLAB X IDE V3.30)调试器的奇怪行为。这是一段代码(我添加了行号来解释):运行调试时,在比特位中的值为800,调试步骤为:0、1、2、7、3…4,在比特时的值为1700,调试步骤为:0,1,4,5,6,3,7…执行是正确的,只有显示受到影响。有什么解释吗?
以上来自于百度翻译 以下为原文 Today I discovered an odd behaviour of the XC8 (version 1.36 - MPLAB X IDE v3.30) debugger. This is the piece of code (I added line numbers to explain): #define short_min 590 #define short_max 1180 #define long_min 1480 #define long_max 2072 /* i.e. test with bittime = 800 and bitTime 1700 .... 0 fIRerror = TRUE; 1 if (bitTime > short_min && bitTime < short_max) { 2 fShortPulse = TRUE; 3 fIRerror = FALSE; 4 } else { 5 if (bitTime > long_min && bitTime < long_max) { 6 fShortPulse = FALSE; 7 fIRerror = FALSE; 8 } 9 } .... Running the debug, with a value of 800 in bitTime, the debugging steps are: 0,1,2,7,3,4... With a value of 1700 in bitTime, the debugging steps are: 0,1,4,5,6,3,7... Execution is correct, only the display is affected. Any explanation? |
|
相关推荐
2个回答
|
|
|
我相信它遵循生成的代码,它也可能受到优化的影响:您能看一下反汇编视图吗?
以上来自于百度翻译 以下为原文 I believe it follows the generated code, which may also be affecxted by optimizations: could you take a look at the Disassembly View? |
|
|
|
|
|
就像达里奥所说的,这是因为这两个陈述被优化到一个。
以上来自于百度翻译 以下为原文 Like Dario said, it is because the two statements of fIRerror = FALSE; got optimized to one. |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475 浏览 0 评论
5795 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1125浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1098浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
873浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 22:43 , Processed in 0.436402 second(s), Total 44, Slave 37 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
752