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.

[参考译文] C2000WARE:错误:包括.cla 文件中的 adc.h 导致警告。

Guru**** 2589275 points
Other Parts Discussed in Thread: C2000WARE

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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1414802/c2000ware-bug-including-adc-h-in-a-cla-file-results-in-warnings

器件型号:C2000WARE

工具与软件:

你(们)好

我们有一个非常常见的 QA 要求、即 Out SW 编译时不会发出警告。

如果我将 driverlib 中的 adc.h 包含在.cla 文件中、我将收到警告

#173-D invalid type conversion adc.h /IntegratedAfe_CPU1/Src/_External/driverlib line 1892 C/C++ Problem

它源自这一巧妙的声明

        tsSlope = (int16_t)ADC_getTempSlope();
        tsOffset = (int16_t)ADC_getTempOffset();

在内联函数"ADC_getTemperatureC()"中

我假设这源于 CPU 和 CLA 之间的不同类型大小。

我想您可以通过一些#if CLA 预处理来解决这个问题。 或者重新考虑该操作是否需要内联函数。

此致 Martin Otzen

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

    尊敬的 Martin:

    您使用的是哪个 C2000器件和 C2000ware 版本? 我将尝试重现该问题。

    此致、

    Delaney

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

    嗯... 这是我的任务列表上的时间太长了。
    在回复您的请求时、我提取了 c2000Ware 5、03 (我们使用5、01)。

    我现在看到您在5.03中修复了该问题。