- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.