完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
我试图在程序内存中存储查找表。我到处都读到XC8将在程序内存中存储“const”合格的东西,但这对我来说不起作用。我还试图用用户指南中的@符号强制定位,但这给了我一个语法错误。在项目中是否有一个优化设置或一些不正确的配置,可能会迫使XC8像这样做?我错过了什么?
以上来自于百度翻译 以下为原文 I'm trying to store a lookup table in Program Memory. I've read everywhere that XC8 will store "const" qualified things in Program Memory, but that's not working for me. I've also tried forcing the location with the @ symbol like in the user's guide but it gives me a syntax error. Is there an optimization setting or something configured incorrectly in the project that could be forcing XC8 to be acting like this? What am I missing? |
|
相关推荐
4个回答
|
|
|
当你没有显示任何你实际尝试过的代码,或者你看到的实际错误信息时,很难知道你做错了什么。这将有助于提及XC8的版本,以及你使用的PIC设备。
以上来自于百度翻译 以下为原文 Hard to know what you did wrong when you don't show any code that you actually tried, or the actual error message that you saw. It would be helpful to mention which version of XC8, and which family PIC device you are using too. |
|
|
|
|
|
合格的东西放在闪光灯中。你为什么相信他们不在那里?
以上来自于百度翻译 以下为原文 Const qualified things are placed in flash. Why do you believe they are not there? |
|
|
|
|
|
它通常会做到这一点,但并不总是如此。你不需要@运算符来做。你没有告诉我们你做了什么,你使用的是什么设备,也不是你如何确定它不在程序内存中,所以我们所能做的就是猜测。我的第一个猜测是,你已经在块范围内声明了你的const对象。
以上来自于百度翻译 以下为原文 It will usually do that, but not always. And you don't ever need the @ operator to do that. You haven't shown us what you've done, which device you're using, nor how you determined it wasn't in program memory, so all we can do is guess. My first guess would be you've declared your const object at block scope. |
|
|
|
|
|
+1只是猜测而不看OP的代码,但几乎可以肯定的原因。使变量全局通过移动它的任何函数定义。FYI,第一个地方你应该看到的是XC8用户指南附带的编译器。3.4.3.5如何将变量放在程序内存中?程序空间中的变量5.5.3
以上来自于百度翻译 以下为原文 +1 Only a guess without seeing the OP's code, but almost certainly the reason. Make the variable global by moving it outside of any function definition. FYI, the FIRST place you should look is in the XC8 User Guide that comes with the compiler. 3.4.3.5 HOW DO I PLACE VARIABLES IN PROGRAM MEMORY? and 5.5.3 Variables in Program Space |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475 浏览 0 评论
5794 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1124浏览 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 13:34 , Processed in 0.765143 second(s), Total 78, Slave 61 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1022