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.

GPIO input interrupt

In the CCS debug interface, when I "step into (F5)", it goes well.

However, if I "Resume(F8)" from any line below, the debug mode stops even there is another breaking point in the next line .

///GPIO input interrupt  PC4 PC5 PC6 PC7
GPIOPinTypeGPIOInput(GPIO_PORTC_BASE, GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7);
GPIOPadConfigSet(GPIO_PORTC_BASE, GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD);
GPIOIntTypeSet(GPIO_PORTC_BASE, GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7, GPIO_HIGH_LEVEL);
GPIOIntRegister(GPIO_PORTC_BASE, GPIOCIntHandler);
GPIOIntEnable(GPIO_PORTC_BASE, GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7);
IntEnable(Int_GPIOC);

  • Hi,

        Do you have a infinite loop at the end of your main function?

    - kel

  • Yes ,there is. The codes above is in the function init()

    The main function is

    init();
    player.is_over = 0;
    GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1);
    GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1, 0xFF);
    GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_2 | GPIO_PIN_3, 0x00);
    while(player.is_over == 0) //waiting for the antema receiving data and change the
    ;
    TimerEnable(TIMER2_BASE, TIMER_A);
    TimerEnable(TIMER3_BASE, TIMER_A); // start capture
    TimerEnable(TIMER3_BASE, TIMER_B); // start capture
    IntEnable(INT_GPIOC); /* enable GPIO PC interrupt */
    while(player.is_over == 1)
    {
    Motion();
    }
    UARTIntDisable(UART2_BASE, UART_INT_RX);
    TimerDisable(TIMER2_BASE, TIMER_A);
    GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_2 | GPIO_PIN_3, 0x00);
    TimerDisable(TIMER3_BASE, TIMER_A); //关闭捕捉模块
    TimerDisable(TIMER3_BASE, TIMER_B); //关闭捕捉模块
    IntDisable(INT_GPIOC); /* 使能GPIO PC 口中断 */
    return 0;