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.

EDMA3CC_COMPL_HANDLER_RETRY_COUNT的值是不是bug

EDMA3CC_COMPL_HANDLER_RETRY_COUNT的值在库中是10u

而IPR与ICR寄存器的都是32位的。

这里是不是bug,是不是应该是0x10u

  • 10u的u表示unsigned int,在c6000 compiler data type里是32bit的。
    7.4 Data Types
    www.ti.com/.../sprui04b.pdf
  • 与32bit 没有关系吧,不管是几位的,10u的10进制就是10,而不是0x10=32吧。

    我的问题不是你理解的这样的,是中断函数中的这个while。

    void edma3CCComplIsr()

    {

       volatile unsigned int pendingIrqs;

       volatile unsigned int isIPR = 0;

       unsigned int indexl;

       unsigned int Cnt = 0;

       indexl = 1u;

    #ifdef _TMS320C6X

       IntEventClear(SYS_INT_EDMA3_0_CC0_INT1);

    #else

       IntSystemStatusClear(SYS_INT_CCINT0);

    #endif

       isIPR = EDMA3GetIntrStatus(SOC_EDMA30CC_0_REGS);

       if(isIPR)

       {

           while ((Cnt < EDMA3CC_COMPL_HANDLER_RETRY_COUNT)&& (indexl != 0u))

       {

           indexl = 0u;

           pendingIrqs = EDMA3GetIntrStatus(SOC_EDMA30CC_0_REGS);

           while (pendingIrqs)

           {

           if(TRUE == (pendingIrqs & 1u))

                   {

                   /**

                    * If the user has not given any callback function

                    * while requesting the TCC, its TCC specific bit

                    * in the IPR register will NOT be cleared.

                    */

                   /* Here write to ICR to clear the corresponding IPR bits */

                   EDMA3ClrIntr(SOC_EDMA30CC_0_REGS, indexl);

                         (*cb_Fxn[indexl])(indexl, EDMA3_XFER_COMPLETE, NULL);

                   }

                   ++indexl;

                   pendingIrqs >>= 1u;

           }

               Cnt++;

       }

       }

    }

  • 这是设置的retry的次数,与通道数无关。

    通道的检查是由下面这个while完成的。

    while (pendingIrqs)

           {

           if(TRUE == (pendingIrqs & 1u))

                   {

                   /**

                    * If the user has not given any callback function

                    * while requesting the TCC, its TCC specific bit

                    * in the IPR register will NOT be cleared.

                    */

                   /* Here write to ICR to clear the corresponding IPR bits */

                   EDMA3ClrIntr(SOC_EDMA30CC_0_REGS, indexl);

                         (*cb_Fxn[indexl])(indexl, EDMA3_XFER_COMPLETE, NULL);

                   }

                   ++indexl;

                   pendingIrqs >>= 1u;

           }

  • 这个值是与什么有关,还是说只是库中默认设置的一个值,其实设置成1次,2次也是可以的?
  • 不清楚这个作者对这个值是怎么设的. 但是从TRM手册对于EDMA中断的处理的描述如下: