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.

[参考译文] TMS320F280039C:#148声明与 UNION 不兼容

Guru**** 2826755 points

Other Parts Discussed in Thread: SYSCONFIG

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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1334836/tms320f280039c-148-declaration-incompatible-with-union

器件型号:TMS320F280039C
主题中讨论的其他器件:SysConfig

#pragma DATA_SECTION(Rdata, "ramgs0");

typedef union {
St_EAdcResults EAdcResults_st[2];
uint32_t EAdcResults_a16;
} Un_EAdcResults;

volatile Un_EAdcResults ADC_Sys_eADCResults_un = {0};

const uint16_t *Rdata = NULL;
ADC_Sys_eADCResults_un.EAdcResults_a16 = (uint32_t *)&Rdata;

我已将 DMA 通道配置为从 Rxbuff 接收数据到一个变量、RDATA 是 SysConfig 中分配的变量。
在上面的代码中、我尝试将 RDATA 分配给 ADC_Sys_eADCResults_un。 EAdcResults_a16;

//*****************************************************************************
//
// DMA Configurations
//
//*****************************************************************************
extern const uint16_t *Rdata;
#define PFC_SPI_RX_DMA_BASE DMA_CH1_BASE
#define PFC_SPI_RX_DMA_BURSTSIZE 2U
#define PFC_SPI_RX_DMA_TRANSFERSIZE 1U
void PFC_SPI_RX_DMA_init();

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

    尊敬的 Tejas:

    看起来联合体具有 uint32_t、而不是 uint32_t *变量类型。

    您是否可以将联合结构体更改为 uint32_t *?

    此致!

    马瑞安