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.

RTOS/CC2640R2F: Pin interrupt not working as expected.

Part Number: CC2640R2F

Tool/software: TI-RTOS

Hello,

I am working on a custom designed board, and i used the pin interrupt example to create a interrupt on a button press, the button i use is of the type OFF-(ON)-OFF. The problem is, I m trying to blink led on the button press for a while and switching it off, but the LED goes off as soon as I release the button. Here is small Code snippet from my file: 

 

static const PIN_Config button_pin_table[] = {
BOARD_BUTTON_PIN | PIN_INPUT_EN | PIN_NOPULL | PIN_IRQ_POSEDGE,
PIN_TERMINATE
};


static void LedBlink( UArg a0, UArg a1 ) { uint32_t sleep_us = 50000; int blink_count = 150; for ( int i = 0; i < blink_count; i++ ) { Task_sleep( sleep_us / Clock_tickPeriod ); PIN_setOutputValue( &led_pin_state, BOARD_LED_PIN, 0 ); Task_sleep( sleep_us / Clock_tickPeriod ); PIN_setOutputValue( &led_pin_state, BOARD_LED_PIN, 1 ); } } void ledBlink_createTask(void){ /* create a task that blinks LED! */ Task_Params task_params; Task_Params_init( &task_params ); task_params.stack = LedBlink_stack; task_params.priority = 5; Task_construct( &LedBlink_Struct, LedBlink, &task_params, NULL ); } void ledcallbackfxn ( PIN_Handle handle, PIN_Id pindId ){ ledBlink_createTask(); }

The stack size is 512. 

What is wrong in here, how can i modify this to implement my idea?