access_tag_interrupt_handler (con't)

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi,

Per the issue that Kwang resolved here in this thread: access_tag_interrupt_handler

I'm having a same problem, but I'm implement the button repress/release on hello_sensor.c, which I can't

find where to add the interrupt handler when the button is released.  By default, the hello_sensor seems only

handles the button press?

Thanks,

0 Likes
1 Solution
Anonymous
Not applicable

Hello.

Here's code that will set up interrupt on on-board button release.

    // Enable on-board Button Interrupt

    UINT16 mask[3] = {0, 0 , 0};

    mask[0] = (1 << 0);

    gpio_registerForInterrupt(mask, basic_interrupt_handler_onboard, NULL);

    gpio_configurePin(0, 0, GPIO_EN_INT_FALLING_EDGE, GPIO_PIN_OUTPUT_LOW);

All you have to do is change the third argument to gpio_configure function to GPIO_EN_INT_FALLING_EDGE

Does this help? Please let us know.

Thank you.

James

View solution in original post

0 Likes
2 Replies
Anonymous
Not applicable

Hello.

Here's code that will set up interrupt on on-board button release.

    // Enable on-board Button Interrupt

    UINT16 mask[3] = {0, 0 , 0};

    mask[0] = (1 << 0);

    gpio_registerForInterrupt(mask, basic_interrupt_handler_onboard, NULL);

    gpio_configurePin(0, 0, GPIO_EN_INT_FALLING_EDGE, GPIO_PIN_OUTPUT_LOW);

All you have to do is change the third argument to gpio_configure function to GPIO_EN_INT_FALLING_EDGE

Does this help? Please let us know.

Thank you.

James

0 Likes
Anonymous
Not applicable

Hi James,

Thanks for the quick reply, this works, the only difference is that I use

GPIO_EN_INT_BOTH_EDGE instead of falling edge only because I need to

handle both press and release interrupts.


Thanks very much.



0 Likes