Microchip
直播中

李秀荣

7年用户 204经验值
私信 关注
[问答]

警告:传递FIR的参数3会丢弃指针目标类型的限定符

有问题发布。一点一点的尝试…我有一个程序,从ADC读取样本,使用微芯片库执行FIR滤波。当缓冲区被ISR处理时,我想我应该声明它是不稳定的(IE):但是当我这样做时,我得到了警告。我假设假设如果是OK,那么我应该做一个演员来摆脱警告吗?(如果我张贴错误,我得到一个拒绝从论坛)我发现了一个类似的线程在这里,但它使我不明智:HTTP://www. McCHIP.COM/FUMMS/M825201.ASPX

以上来自于百度翻译


      以下为原文

    Having problems posting.. trying bit by bit...

I have a program that reads samples from the ADC, performs FIR filtering, using the Microchip libraries. As the buffer is acessed by an ISR, I thought I should declare it as volatile, ie:

volatile fractional inputSignal[NUMSAMP];
FIR(1, &outputSignal[0], &inputSignal[0], &filter1);

but when I do so I get a warning. Am I right in assuming that declaring as volatile if OK and that I should se a cast to get rid of the warning?

(If I post the error, I get an access denied from the forum)

I found a similar thread here, but it made me no wiser: http://www.microchip.com/forums/m825201.aspx

回帖(3)

杨玲

2019-1-21 15:04:55
是的,在这里使用石膏是合理的,包括一个注释来解释你为什么要使用它。

以上来自于百度翻译


      以下为原文

    Yes, it's reasonable to use a cast here; include a comment to explain why you're using it.
举报

乔婧

2019-1-21 15:20:28
谢谢。我会这么做的。

以上来自于百度翻译


      以下为原文

    Thanks. I will do so.
举报

陈晨

2019-1-21 15:39:54
你可以要么抛出,要么进入函数。或者函数应该用指针声明为挥发物。它更适合你的程序。

以上来自于百度翻译


      以下为原文

    You can either cast is as it goes into the function.
Or the function should be declared with the pointer as volatile.
which ever suits your program better.
举报

更多回帖

发帖
×
20
完善资料,
赚取积分