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.

DSP/BIOS中断问题

 

串口中断程序,在DSP/BIOS 的发送ISR中断中调用C64_disableIER关闭中断,但是调用后不起作用,中断照常进入,问应如何进行操作,是何原因?谢谢!

代码如下:

void SerialPortSendInt()

{

CSL_mcbspWrite (hMcbsp, CSL_MCBSP_WORDLEN_16, &xmitbuf[loopIndex]);

loopIndex++;

if(loopIndex == BUFFER)

{

loopIndex = 0;

C64_disableIER(MCBSP_XINT1_INT_FLAG);//这里失败

}

}

 

  • 您好

    您能不能单步跟到这步时,检查下全局中断标志位寄存器是否置上?

    谢谢!

  • 问题解决,将C64_disableIER(MCBSP_XINT1_INT_FLAG);放在任务线程可以生效。但不知是何原因,中断程序不能disable自身的中断吗?

    解决后代码如下:

    中断程序:

    void SerialPortSendInt()

    {

    CSL_mcbspWrite (hMcbsp, CSL_MCBSP_WORDLEN_16, &xmitbuf[loopIndex]);

    loopIndex++;

    if(loopIndex == BUFFER)

    {

    loopIndex = 0;

                   SEM_post(&SEM_TEST);//发送消息到任务线程,在任务线程内disable

    }

    }

    任务线程L

    void tskForTest()

    {

           while(1)

           {

                   SEM_pend(&SEM_TEST, SYS_FOREVER);

                  C64_disableIER(MCBSP_XINT1_INT_FLAG);

           }

    }

  • depeng kong

    您好,在中断程序中是可以关闭全局中断的,您可以尝试下

    谢谢