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.

CC2340R2: ISR callback and the handling of processor state

Part Number: CC2340R2
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

This question is to confirm whether the CC2340R2 handles the store/restore of data when handling ISR. In this particular example, a GPIO is used to invoke an interrupt using the function GPIO_setCallback() . Should anything be added to the ISR code snippet below?

static void example_ISR(uint8_t LoopCounter)
{
    uint8_t level;
    if(LoopCounter == _ITERATIONS)
    {
        level = GPIO_read(_ITERATIONS);
        if (level == 0)
        {
            RLLTransport_PostEvt(RLL_MASTER_FLOW_ASSERT_SIG);   /* post event */
        }
        else
        {
             RLLTransport_PostEvt(RLL_MASTER_FLOW_CLEAR_SIG);   /* post event */
        }
    }
}   

Thank you!

  • Hi Lenio,

    You can refer to the gpiointerrupt example and GPIO TI Driver API.  The GPIO_CallbackFxn is the index which was passed during GPIO_setCallback.  This allows you to use the same callback function for multiple GPIO interrupts, by using the index to identify the GPIO that caused the interrupt.  So long as _ITERATIONS reflects this expectation, then the callback appears as though it should function as intended (I assume the Interrupt Trigger is selected as Both Edges in SysConfig).  Please let me know if any unexpected behavior occurs during testing.

    Regards,
    Ryan