完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
我发现了类似的帖子,但由于某种原因,我无法在这些线程中发布。我的代码编译了一些时间(并且在目标上运行),但是IDE显示了一个结构TyPulf,以及所有定义的类型的使用,在边距中有波形线和灯泡。有时代码不编译,我得到这个错误消息:AdcIsCaltual.C:27∶1:错误:“AccChhannLeNurt'之前的预期的‘=’,‘,’,‘,’,‘ASM’或‘y’属性”,[**[Bug/Deule/Deutial/AdcIOffuff.O]错误255]使[2 ]:***等待未完成的作业…NBPosi/MaFixFieldDuauLT.MK:204:目标“构建/默认/生产/ ADCI函数”的配方。O'FrimeDebug(1):**[构建CONF]错误2i也有其他类似的消息。有时IDE也会显示“UTI1616T”和“UIT88T”作为“错误”。调试和发布版本都是相同的行为,对于它是否构建,似乎是随机的。内置代码运行,但我不能确信,当它不能建立一些时间时,一切都很好。删除Cache(C:用户\MPLABIDIDCache DEVV4.15var)删除文件夹VAR及其内容是没有帮助的。一个.c文件(而不是a .h),因为它们对于那个模块是私有的。项目正在开发中,而不是很大。我使用MCC作为系统,计时器,引脚和ADC设置-所有看起来都是预期的,当它运行。目标是PIC24FJ256GB206。我的程序和调试工具是一个拾取3。使用MPLAB X IDE V4.15,XC V1.33和MCC V3.55.1在Win 10笔记本电脑上。
以上来自于百度翻译 以下为原文 I found similar posts but I was unable to post in those threads for some reason. My code compiles some of the time (and runs on the target) but the IDE shows a structure typedef, and all uses of that defined type, with wavy lines and light bulbs in the margin. Sometimes the code does not compile, and I get this error message: ADC_Functions.c:27:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ADC_Channel_t' make[2]: *** [build/default/production/ADC_Functions.o] Error 255 make[2]: *** Waiting for unfinished jobs.... nbproject/Makefile-default.mk:204: recipe for target 'build/default/production/ADC_Functions.o' failed make[1]: *** [.build-conf] Error 2 I have also had other, similar, messages. Sometimes the IDE displays 'uint16_t' and 'uint8_t' as "errors" too. It's the same behavior for both debug and release builds, and it seems random as to whether it will build or not. The built code runs, but I can't be confident that all is well when it fails to build some of the time. Deleting cache (C:Users....mplab_ideCachedevv4.15var) - deleting folder var and its contents - does not help. One thing that may be a little unusual is that the typedef and its usages are in a .c file (and not a .h) since they are private to that module. The project is under development and not big yet. I used MCC for system, timer, pins, and ADC setup - all that appears to be as expected when it runs. The target is a PIC24FJ256GB206. My program and debug tool is a PICkit 3. Using MPLAB X IDE v4.15, XC v1.33 and MCC v3.55.1 on a Win 10 laptop. |
|
相关推荐
14个回答
|
|
|
你愿意分享你的整个项目吗?不看实际代码很难猜测。
以上来自于百度翻译 以下为原文 Are you willing to share your entire project? It's hard to guess without seeing the actual code. |
|
|
|
|
|
是的,做这件事最好的方法是什么?我不认为问题在代码文件中,但是我很乐意发布任何有帮助的东西。例如,我能把整个项目拉开吗?
以上来自于百度翻译 以下为原文 Yes - what's the best way to do it? I don't think the problem is in the code files but I''m happy to post anything and everything that might help. Can I zip up the entire project, for example? |
|
|
|
|
|
MPLAX X中的红波线通常是错误的,可以忽略。ADC^函数。C:27∶1:错误:……来自编译器。这是一个真实的错误。告诉我该往哪里看。
以上来自于百度翻译 以下为原文 The red wave lines in MPLax X are often wrong, and can be ignored. ADC_Functions.c:27:1: error: ... Is from the compiler. It is a real error. and is telling where to look. |
|
|
|
|
|
感谢你的回应,这个“错误”并不是真正的错误。下面是代码(复制/粘贴损坏缩进):*定义Bufh深度8 //索引0 -7TyPulfFrase.AdcChanChans{Unt1616t缓冲器[BufiStime];uTn8}t索引;} AccChhannLyt;/*ADC结果缓冲;为每个ADC通道*选择单独命名的数组,而不是指针/名称索引*///^(如果0ADC)AccChnelixAgCangLePOS;AdcChhanelyt AdcHeHePoPs;AdcChhanelyt AdcHeHealAMPS;AdcChhanelyt AdcLoC1AAMPS;//行76ADCChanelyt AdcLoC2OAMPS;//On.EndifEngIn突出线76行-见图像。它编译大约一半的时间。如果我取消注释,如果每次都编译。没有隐藏的字符。我也试着重新打字。请注意,它并没有抱怨之前和之后的几乎相同的行。我可以生活在波浪线等,虽然它们是恼人的,当不是真的。BTW当我尝试和发布时,我得到随机访问被拒绝的错误和失去我尝试发布:Access否认您没有权限访问“http://www. McCys.com /论坛/ POST.ASPX”在这个服务器上。参考文献18.D5C8DE41.152304692830336460。
以上来自于百度翻译 以下为原文 NKurzman - thanks for responding. The 'error' is not a real error. Here's the code (copy/paste messed up the indentation): #define BUF_DEPTH 8 // index 0 - 7 typedef struct _ADC_Channel { uint16_t buffer[BUF_DEPTH]; uint8_t index; } ADC_Channel_t; /* ADC Result Buffering; choose separate named arrays for each ADC channel * rather than pointer/name indexing */ //#if 0 ADC_Channel_t ADC_AnglePos; ADC_Channel_t ADC_AngleAmps; ADC_Channel_t ADC_HeightPos; ADC_Channel_t ADC_HeightAmps; ADC_Channel_t ADC_Lock1Amps; // line 76 ADC_Channel_t ADC_Lock2Amps; //#endif The highlighted line is line 76 - see image. It compiles OK about half the time. If I uncomment the #if and #endif it will compile every time. There's no hidden characters. I also tried re-typing it. And note it doesn't complain about the almost identical lines before and after. I can live with the wavy lines, etc. although they are annoying when not real. But failure to compile with 'fake' error messages is very difficult to live with. BTW when I try and post I get random Access Denied errors and lose what I tried posting: Access Denied You don't have permission to access "http://www.microchip.com/forums/post.aspx?" on this server. Reference #18.d5c8de41.1523046928.30336460 Attached Image(s) |
|
|
|
|
|
我有一个工作。我回到了以前保存的项目版本,并制作了一个OS拷贝。我用复印件验证我没有错误。我把问题代码(剪切/粘贴)添加到“旧”的AdcIsActual.C中,它显示了OK,同时构建了调试(模拟器)和发布版本OK。我已经添加了更多的代码,到目前为止,一切都很好。我相信在一些“幕后”(非代码)项目文件中的一个或多个中有些东西“失步”,但我不能证明这一点。不管它是什么,IDE似乎没有能力从中恢复。事实上,它有时标志着Untu16t和Ctrl空间不起作用,支持这个想法。如果我找到原因,我会发布它。
以上来自于百度翻译 以下为原文 I have a work-around. I went back to the previously saved version of the project and made an OS copy of it. Working with the copy, I verified I didn't have the error. I added the problematic code (cut/paste) to the 'old' ADC_Functions.c, and it displayed OK and built both debug (simulator) and release versions OK. I have since added more code and (so far) all is well. I believe something got 'out of step' in one or more of the many 'behind the scenes' (non-code) project files but I can't prove this. Whatever it is, the IDE does not seem to have the ability to recover from it. The facts that it was sometimes flagging uint16_t and that ctrl-space didn't work support this idea. If I do find the cause I will post it. Thanks to all... |
|
|
|
|
|
禁用拼写检查器以消除波形线。无法记住工具-gt选项中的位置,因为我在工具-gt;插件-& gt中禁用了它。SPECELCHECK英文。它删除Opth.It16yt在Stdit.h头文件中。我不知道它的意思是编译一半的时间。为什么要烦扰评论?如果…No.EndifEclipse Cache不会修复代码错误。
以上来自于百度翻译 以下为原文 Disable the spell-checker to get rid of wavy lines. Can't remember the location in tools->options because I disabled it in Tools -> Plugins -> Installed . Spellchecker English. That removes the option. int16_t is in the stdint.h header file. I don't know what you mean by it compiles half the time. Why bother with the comments? #if ... #endif Deleting cache won't fix code errors. |
|
|
|
|
|
GoT2015—感谢拼写检查器提示。是的,我知道在哪里定义了I1616T,但是编辑器显然忘记了一些时候(在错误状态),它不认识它并且认为它是我发明的东西。(必须有一个动态的‘构建字典’过程参与后台SC。在代码输入时重新编码。这可以识别定义的类型和其他东西,如C关键字。这是明显打破,因为定义和关键字没有显示在屏幕上被识别。更糟的是,这个错误显然会传播到预处理器和/或编译器的一些时间中,然后将该类型视为一个左值,并抱怨有一个丢失的运算符。请参阅Op.文件中保存的项目,并记住该错误条件。一个不同的项目与相同的源文件-没有问题。搜索这个论坛,你会发现其他人发现“新项目”(或“核”)的解决方案。GOTT2015知道这一点——他是作者之一))编译一半时间:如果我做了一个微小的改变,比如说添加或删除一条空行并建立,或者做一个干净的所有构建,它会编译一些次而失败。没有明显的因果关系。我知道它确实是确定的,但它的行为却不是这样。评论:通过排除那个代码块(见OP),它将一直在构建。如果0…EnEnEnf是排除代码块的首选方法,没有代码错误。如果我将代码复制粘贴到一个旧的项目实例中的同一个源文件名中,它就可以正常工作。哦,直到我添加了ADC TyPulf(见OP)并尝试使用它时,它才正常工作。这就是它破裂的原因,但我不知道是什么破坏了它。我不相信它添加了Type。我想知道它是否甚至可能是Windows OS缓存磁盘写入,因此如果在更改后立即关闭磁盘映像就损坏了。
以上来自于百度翻译 以下为原文 Gort2015 - Thanks for the spell checker tip. Yes, I know where int16_t is defined, but the editor apparently forgets because some times (in the error state) it doesn't recognize it and thinks it's something I invented. ((There must be a dynamic 'build dictionary' process involved in the background scanning the code as it's typed. This recognizes defined types and other things like C keywords. This is what is apparently breaking because definitions and keywords are not shown on-screen as being recognized. Worse, this error apparently propagates into the preprocessor and/or the compiler some of the time, which then treats the type as an lvalue and complains that there's a missing operator. See OP. Something in a file that's saved along with the project 'remembers' this error condition. A different project with the same source files - no problem. Search this forum and you'll find others have found the 'new project (or 'nuclear') workaround. Gort2015 knows this - he's one of the authors.)) Compiles half the time: if I make a trivial change - say add or delete a blank line and build, or do a clean-all-build, it will compile some times and fail others. No apparent cause and effect. I know it's really deterministic but it doesn't behave like it. Comments: by excluding that block of code (see OP) it would build all the time. #if 0 .... #endif is the preferred way to exclude a block of code. There are no code errors. If I copy and paste the code into the same source file name in an older instance of the project it works just fine. Oh - it was all working fine until I added the ADC typedef (see OP) and tried to use it. That was the point at which it broke but I don't know what broke it. I don't believe it was adding the typedef. I'm wondering if it might even be the Windows OS caching disk writes so the disk image is corrupt if you shut down immediately after making a change. |
|
|
|
|
|
这个想法是你把0改成1,反之亦然,不要评论/取消评论“如果”和“
以上来自于百度翻译 以下为原文 The idea is you change the 0 to 1 or vice versa, not comment out/uncomment the #if and #endif ;-) |
|
|
|
|
|
西蒙格123:对!谢谢你的回应。(在这个阶段,我正在评论一些东西,试图找出是什么东西打破了它。我从来没有这样做过,至少现在还没有。我希望我能得到报酬来找出发生了什么,但我不是,所以这将不得不做的时候,我有空闲时间-这可能意味着永远不会。
以上来自于百度翻译 以下为原文 simong123: Right! :) And thanks for responding. (At this stage I was commenting stuff to try and find what was breaking it. I never did - at least, not yet. I wish I could be paid to find out what's happening, but I'm not, so this will have to be done when I have spare time - which probably means never.) |
|
|
|
|
|
使用预处理器的常数来定义Texton 1πIFDEF TeXTRON。你没有展示它是如何填充的。
以上来自于百度翻译 以下为原文 Use a constant for the pre-processor #define TEXTON 1 #ifdef TEXTON #endif Could be that the buffer is too small. You have not shown how it is filled. |
|
|
|
|
|
如果你编译一个编译错误,因为编译器是混乱的,然后使用构建所有(清洁和构建),将建立每一件事情,并应该清除这个问题。
以上来自于百度翻译 以下为原文 If you diet a build error for good because the compiler is confused, then use build all( clean and build) that will build every thing and should clear up the issue. |
|
|
|
|
|
不是一个缓冲区大小的问题:所有的代码都运行在OK问题上,在修复文件之后(没有工作),没有达到可运行代码的目的,所有的代码都运行正常。干净和构建都没有修复它:我确信问题不在代码(.c和h)文件中,而是在IDE SUP中的一个。ORT文件。让它今天再次运行(使用上面描述的工作),但最终发现它运行得太慢:应该是FoCC/2=16兆赫,但在“范围I是4兆赫”。进入MCC,发现振荡器被设置为“外部”而不是“初级”。这个项目从来没有使用外部时钟(以前运行在16兆赫)。使用MCC I将其设置为主、8 MHz PLL(给Fosc 32 MHz和FUSB 48 MHz),并且再生后的速度是正确的。看起来无论发生什么错误,也会破坏MCC振荡器的设置。(我不知道外部是否是默认的:如果是的话,这是一个奇怪的选择)。
以上来自于百度翻译 以下为原文 Not a buffer size issue:
Got it all running again today (using the work-around described above) but eventually noticed that it was running too slow: should have been Fosc/2 = 16 MHz but on the 'scope I was getting 4 MHz. Went into MCC and found that the oscillator was set to "External" and not "Primary". This project has never used an external clock (and was previously running at 16 MHz). Using MCC I set it to Primary, 8 MHz PLL (to give Fosc 32 MHz and Fu*** 48 MHz) and after regenerating the speed was correct. Looks like whatever went wrong also clobbered the MCC oscillator setup. (I don't know if External is a default: if so, it's an odd choice). |
|
|
|
|
|
AdcChhannLyt是ADCiStudio.C中的第一行的声明吗?C不是注释或预处理器指令吗?如果是这样的话,你的头文件有点可疑,我会怀疑重复的文件名。进入项目的编译器全局选项,并检查“不删除中间文件”选项。这将节省预处理的源文件,因此您可以准确地看到正在编译的内容。
以上来自于百度翻译 以下为原文 Is the declaration of ADC_Channel_t the first line in ADC_Functions.c that is not a comment or a preprocessor directive? If that is the case, there's something fishy about your header files, and I would suspect duplicated file names. Go into the project's compiler global options and check the option "Don't delete intermediate files". That will save the preprocessed source files, so you can see exactly what is being fed into the compiler. |
|
|
|
|
|
谢谢你的评论。这就是以前的情况。正如我所说,一切都在起作用。版面设计并没有保存在拷贝/粘贴中,但是你不需要它,并且感谢保存中间文件的有用提示。在旧的MPLAB中,这是用一个-E编译器开关做的,很好地知道如何再做一次。
以上来自于百度翻译 以下为原文 Thanks for your comments. Here's what comes before. And as I said, all now works. The layout did not get preserved in the copy/paste but you don't need it. And thanks for the useful hint about preserving intermediate files. In the old MPLAB this used to be done with a -E compiler switch - good to know how to do it again. #include "ADC_Functions.h" #define BUF_SIZE 8 #define ADC_CHANNELS 6 /* A note on the ADC implementation * The actual ADC conversion takes place asynchronously in hardware, * including sequencing from one channel to the next. * As initially set up it's about 12 us per conversion or around 60 us to * convert 6 channels. So let's allow 100 us for a complete set of conversions. * There is no guarantee that we will buffer every conversion if the convertor * is running significantly faster than the superloop. Likewise - though * unlikely - if the ADC is running more slowly than the superloop we might * read the exact same converted value more than once. This does not appear * to be a problem, but it's good to note it. */ /* ADC_Channel is intended to be a circular buffer. When it is not being * written to, index points to the oldest value, which is the one which * will be written to next. When we write we immediately increment index * (modulo buffer size) so that it still points to the oldest data. Keeping * the buffer and the index together in a struct allows a variety of functions * to manipulate it asynchronously. */ typedef struct _ADC_Channel { uint16_t buffer[BUF_SIZE]; uint8_t index; } ADC_Channel_t; /* ADC_Buffer is an array of circular buffers, one for each ADC channel * of interest. Here's the layout: * Initially index is 0. We read Angle, ..., Lock2 in turn storing them in * buffer[index], which is buffer[0]. We then increment index modulo BUF_SIZE. * Next time round we again store in buffer[index] which is now buffer[1], * then buffer[2], and so on. When index is > BUF_SIZE - 1 we reset it to 0. * * ADC_Buffer |---------- buffer ---------| index * 0 1 2 3 4 5 6 7 * 0 ANGLE_POS . . . . . . . . . * 1 HEIGHT_POS . . . . . . . . . * 2 ANGLE_AMPS . . . . . . . . . * 3 HEIGHT_AMPS . . . . . . . . . * 4 LOCK1_AMPS . . . . . . . . . * 5 LOCK2_AMPS . . . . . . . . . * * Strictly speaking there is no need for each channel to have its own index * in the initial implementation as they would normally all be the same. * However it's possible that a future change may read some channels more * often than others, in which case the separate index variables would be * needed. Note that buffer plus index is the basis for a circular buffer. * */ ADC_Channel_t ADC_Buffer[ADC_CHANNELS]; |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
508 浏览 0 评论
5813 浏览 9 评论
2351 浏览 8 评论
2238 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3545 浏览 3 评论
1163浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1122浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
890浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
508浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-15 12:11 , Processed in 1.328343 second(s), Total 70, Slave 63 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
382