This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CC2640:传感器控制器语法错误

Guru**** 2553450 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/582150/cc2640-sensor-controller-syntax-error

器件型号:CC2640

您好!

我正在修改 ADC 数据记录器(传感器控制器)以添加新的 ADC 数据,但存在语法错误(adcReadFifo (output.pSamples[output.head[n]):

//启用 ADC

adcEnableSync (ADC_REF_FIXED、ADC_SAMPLE_TIME_2P7_US、ADC_TRIGGER_MANUAL);

//对传感器进行采样

U16 IDx;

对于(U16 n = 0;n < ADC_CH_NUM;n++){

如果(n =0){

adcSelectGpioInput (AUXIO_A_SENSOR_OUTPUT);

}否则{

adcSelectGpioInput (AUXIO_A_VBE);

adcGenManualTrigger();

//idx = n;

//n = output.head[n];

如果(n =0){

adcReadFifo ( output.pSamples[output.head[n]);

utilIncrAndWrap( output.head[n]、buffer_size;output.head[n]); //语法错误

}否则{

adcReadFifo ( output.SAMPLES2[n]);

utilIncrAndWrap( output.head[n]、buffer_size_2;output.head[n]);

//n = idx;

output.cnt[n]= output.cnt[n]+ 1;

//禁用 ADC

adcDisable();

//安排下一次执行

fwScheduleTask (1);

我从编译器收到语法:变量写入访问无效,您知道原因吗?

e2e.ti.com/.../adc_5F00_data_5F00_logger-_2D00_-Support.zip

此致

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、LB、

    变量 n 用于数据结构数组索引。 没有其他变量可用于此目的。 您可以尝试以下操作:

    U16* pSample =#output.pSamples + output.head[n];
    adcReadFifo (* pSample); 

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    问题迎刃而解、谢谢
    此致