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.

C2000中ADCDRV_1ch_Rlt:n: 相当于ADCDRV_1ch_Rlt[ ]?



在HVLLC主程序中,有如下定义

extern volatile long *ADCDRV_1ch_Rlt7; // Vout

volatile long Vout;

ADCDRV_1ch_Rlt7 = &Vout;

在中断程序中,有下面的说明

; publish Terminal Pointers for access from the C environment
  .def  _ADCDRV_1ch_Rlt:n:

C语言和ASM语言是怎么建立起来的联系呢?

  • 我的意思是

    在中断服务中,有下面的程序

    .if(INCR_BUILD = 2)
       ADCDRV_1ch 7 ; Vout

       CNTL_2P2Z 1
      .endif

    ADCDRV_1ch 7这个子程序的输出是如何成为CNTL_2P2Z 1的输入呢?

    在MAIN 主程序中是如何实现,将ASM语言中的变量和C语言中变量统一起来的呢?

  • 请查看对应的库所在路径下的文档说明,每个模块都有定义自己的形式为指针的输入输出,同时会定义各个指针形式的中间变量,将每个模块的输入或输出指针都指向同一个中间变量时,就建立起了联系。

    至于ASM与C中的变量统一,.def是在ASM中使用宏定义,这样C中定义的变量就可以直接对应起来替换了。