access_tag_interrupt_handler

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

cross mob
Anonymous
Not applicable

Hi

I am trying to make a firmware for the WICED sense tag that only adv. when one of the buttons on the side is pressed. I have used the wizard to generate code that supports 'button' only. However the method 'access_tag_interrupt_handler' is only called when pressing the button and not when the button is depressed. Another thing is that the method is only called when pressing the lower button (named 'App Button') and not the top button (named 'Wake Button').

This bring me down to the two questions:

1. How can I get the app to react separately on both buttons?

2. How can I get the app to react when one of the buttons is depressed?

0 Likes
1 Solution
Anonymous
Not applicable

Hi thomas_bonde,

Don't know if you still have this problem but I have just created a short demo on using interrupts with with the WICED Sense.  In my video you can see that when I press the bottom button, the LED will flash, once from when I press the button and once for when I release.  In my code as you will see, I put for both both edges.  Similarly, you can register two difference interrupt handlers, one for rising one for falling.  Then in my video, I use the top button to beep the buzzer, again once for pressed and once for depress.

Hope this helps,

Kevin

void ble_tx_create(void){

  bleprofile_GPIOInit(bleprofile_gpio_p_cfg);

    bleprofile_Init(bleprofile_p_cfg);

    gpio_configurePin(0, 0, GPIO_EN_INT_BOTH_EDGE, GPIO_PIN_OUTPUT_LOW);

    gpio_configurePin(0, 4, GPIO_EN_INT_BOTH_EDGE, GPIO_PIN_OUTPUT_LOW);

    //register for interrupts on pins 0 and 4 (push button)

    {

         UINT16 masks1[3] = {(1 << 0), 0 , 0};

         gpio_registerForInterrupt(masks1, interrupt_handler1, 0);

         UINT16 masks2[3] = {(1 << 4), 0 , 0};

         gpio_registerForInterrupt(masks2, interrupt_handler2, 0);

    }

}

void interrupt_handler1(void* parameter, UINT8 arg) {

       bleprofile_LEDBlink (50, 50, 3);

}

void interrupt_handler2(void* parameter, UINT8 arg) {

       bleprofile_BUZBeep(100);

}

Video Link : 1349

View solution in original post

0 Likes
8 Replies