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.

[参考译文] CCS/TMS320F28379D:类型#515类型"int"不能分配给类型"联合 DBFED_REG"

Guru**** 2595160 points


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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/669910/ccs-tms320f28379d-type-515-a-value-of-type-int-cannot-be-assigned-to-an-entity-of-type-union-dbfed_reg

器件型号:TMS320F28379D

工具/软件:Code Composer Studio

我收到以下错误:

说明资源路径位置类型
#515无法将类型"int"的值分配给类型为"UNION DBFED_REG"的实体 untitled3.c /hbl880第174 C/C++行问题 

相应的行为:

EPwm1Regs.DBRED = 0; //死区发生器上升沿延迟计数寄存器
EPwm1Regs.DBFED = 0; //死区发生器下降沿延迟计数寄存器 

如何解决此问题? 感谢你的帮助。  

注意:我使用的是 CCS 6.2

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

    将两个代码行更改为:

    EPwm1Regs.DBRED.bit.DBRED = 0;
    EPwm1Regs.DBFED.bit.DBRED = 0;

    使用.all 也应起作用:

    EPwm1Regs.DBRED.ALL = 0;
    EPwm1Regs.DBFED.ALL = 0;

    请告诉我这是否可以修复您的错误。

    但愿这对您有所帮助。 如果您的问题得到了解答、请单击绿色的"验证答案"按钮。 谢谢。

    - Ken