完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好,我在我的一些函数上有一个奇怪的错误,这个函数不承认它的参数,并抛出我“无法解决标识符”错误。我确保没有键入或包含错误,但无济于事。但是,当我将参数声明为全局变量时,错误似乎消失了,但我不能使用这种方法,因为它甚至不承认局部变量,这是奇怪的。这里是第一个具有那个错误的函数。我使用的是MPLABV3.51(DSSPIC33 EP64 GS804)。我已经附加了源代码和Error的屏幕截图。HTTP://imgur.COM/AJRZZDEDIT:我更新了MPLAB X到3.55和XC16到1.31,但是它没有改变任何东西。
BQ.H(18.52 KB)-下载134次主C(3.07 KB)-下载70次 以上来自于百度翻译 以下为原文 Hello people , ı am having a weird error on some of my functions , the function does not recognise it's parameter and throws me "Unable to resolve identifier" error. I made sure that there is no typo or include faults but to no avail. But when I declare the arguments as global variables also, the error seems to go away but I cant use this approach as it doesnt even recognise the local variables , which is odd. Here is the first of the functions that has that error. I am using mplab v3.51 (Dspic33ep64gs804) . I have attached the source code and the screenshot of the error.uint8_t bq_write (uint8_t device_address , uint8_t register_address , uint8_t data) { STATUS = TRANS_IN_PROGRESS ; crc = 0x00; if ( ( (device_address > MAX_DEVICE_COUNT) && ( device_address != REGVAL_ADDR_BCAST ) ) || (register_address > 75) ) { STATUS = TRANS_INVALID_CALL ; return STATUS ; } device_address = device_address * 2 + 1; // shift right by one , and concatenate with a one because it is a write operation. crc = get_crc(device_address); crc = get_crc(register_address); crc = get_crc(data); CLEAR_CS; spi_write(device_address) ; spi_write(register_address) ; spi_write(data); spi_write(crc); ASSERT_CS; if((device_address != REGVAL_ADDR_BCAST) && (device_address != REGVAL_ADDR_DISCO)) { STATUS_TEMP = bq_read(device_address,register_address,1); if (STATUS_TEMP == TRANS_COMPLETED) { if (BQ_READ_BUFFER[0] == data) { STATUS = STATUS_TEMP; return STATUS ; } else { STATUS = TRANS_WRITE_ERROR; return STATUS ; } } else { STATUS = STATUS_TEMP; return STATUS ; } } else if (device_address == REGVAL_ADDR_BCAST) // if address is either broadcast or discovery { STATUS_TEMP = bq_read(0x01,register_address,1); if (STATUS_TEMP == TRANS_COMPLETED) { if (BQ_READ_BUFFER[0] == data) { STATUS = STATUS_TEMP; return STATUS ; } else { STATUS = TRANS_WRITE_ERROR; return STATUS ; } } else { STATUS = STATUS_TEMP; return STATUS ; } } else { STATUS = TRANS_COMPLETED ; return STATUS ; } } http://imgur.com/AjRszTd Edit : I updated Mplab X to 3.55 and xc16 to 1.31 but it hasnt changed a thing. Attachment(s) BQ.c (13.61 KB) - downloaded 66 times BQ.h (18.52 KB) - downloaded 134 times main.c (3.07 KB) - downloaded 70 times |
|
相关推荐
2个回答
|
|
你收到的第一个错误是什么?(你的屏幕帽没有显示出来)我怀疑UIT88T的定义有问题。
以上来自于百度翻译 以下为原文 What is the FIRST error you receive? (Your screen cap does not show it.) I suspect there is something wrong with the definition of uint8_t. |
|
|
|
我发现了这个问题,这是我在两个宏中所作的注释。*定义CeleScCs{LabbTest.LATB0=0;//y-DelayuUS(2);}定义AsjtTycs{LabbBist.LabB0=1;//Y-DelayuUS(2);}双斜线删除括号的末尾。谢谢您抽出时间来帮助我:
以上来自于百度翻译 以下为原文 I found the problem , it was the comment i put in two of my macros . #define CLEAR_CS {LATBbits.LATB0 = 0 ;//__delay_us(2);} #define ASSERT_CS { LATBbits.LATB0 = 1 ;//__delay_us(2);} double slash deleted the end of the bracket . Thank you for taking your time to help me :) |
|
|
|
只有小组成员才能发言,加入小组>>
5160 浏览 9 评论
1998 浏览 8 评论
1927 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3170 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2225 浏览 5 评论
727浏览 1评论
612浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
501浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
626浏览 0评论
524浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-22 08:32 , Processed in 1.164242 second(s), Total 84, Slave 66 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号