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.

EALLOW; EDIS;指令可以在CLA代码内执行吗

Other Parts Discussed in Thread: C2000WARE

HI:

问题如题,谢谢。

  • 可以的,cla.c中就有用到

        EALLOW;
    
        //
        // Write trigger selection to the appropriate register.
        //
        HWREG(srcSelReg) &= ~((uint32_t)SYSCTL_CLA1TASKSRCSEL1_TASK1_M
                               << shiftVal);
        HWREG(srcSelReg) = HWREG(srcSelReg) | ((uint32_t)trigger << shiftVal);
    
        EDIS;

  • 在这个路径下D:\ti\c2000\C2000Ware_2_01_00_00\driverlib\f28004x\driverlib的cpu.h文件内可以看到这段代码:
    //
    // Define to allow writes to protected registers
    //
    #ifndef EALLOW
    #ifndef __TMS320C28XX_CLA__
    #define EALLOW __eallow()
    #else
    #define EALLOW __meallow()
    #endif // __TMS320C28XX_CLA__
    #endif // EALLOW

    //
    // Define to disable writes to protected registers
    //
    #ifndef EDIS
    #ifndef __TMS320C28XX_CLA__
    #define EDIS __edis()
    #else
    #define EDIS __medis()
    #endif // __TMS320C28XX_CLA__
    #endif // EDIS

    意思是说CPU和CLA执行的EALLOW和EDIS指令实际上是对应不同的接口吗?为什么有不同的宏定义?如果我在CPU内和CLA内都需要操作EALLOW和EDIS指令要怎样操作呢?
  • 没了解过这方面的区别。你是在CLA里使用这两个指令有问题吗?