This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

[nrf_gpio/app_gpiote/nrf_drv_gpiote]

Hello Nordic,

I am following example code [--ble-app-lbs-master] for my application in (keil4.6/sdk8.0.0). Its already consisting (app_gpiote), but I want to add some code module which refer (nrf_drv_gpiote). Is it compulsory to use both files or only file can be used instead of two? How can I do so?

I tried to follow some previous posts but didn't get it well. Also, I am unable to see the icon for "run-time-environment" and "software-pack" icons (showing disabled) in Keil4.6.

Please suggest~

/Thanks n Regards

  • Sir @Stefan Birnir Sverrisson,

    Do I need to create different timer_start (3) for different button_actions like short/long/double push OR One is enough to define? In parallel, where to define the timer_stop ?

    Also, this timer_start for long_button_press is repeatedly sending the data when long press/release the button. I want to work as only one time; at long press do action.....release to do action. How'd be the implementation. Now,the timer is repeating the result after every 3 seconds (long_push_delay) for both the cases (push and release), I just want it for one time, how can I implement this sir?

    Please suggest~

    Thanks n Regards

  • Yes, you need to call app_timer_start for each timer.

    When you create an app_timer with call to app_timer_create, you need to provide three parameters. Parameter number two specifies if the timer mode is repeated (APP_TIMER_MODE_REPEATED) or single shot (APP_TIMER_MODE_SINGLE_SHOT).

  • @Stefan: As there is already a button_detection_delay (considered this as short_push) is defined, and I defined one more for long_push_delay in main.c. button_detection_delay is already defined for button_detection and which calls button_handler with "ble_lbs_on_button_change" which sends (1) when button_push and (0) when button_release.

    As you previously mentioned, I implemented app_timer for long_push (of 3 seconds) in button_event_handler. Defined as [button_detection_delay: 50ms; and long_push_delay: 3s;]......After run, I found that it sends (1) when short_button_push (50ms) and (0) when short_button_release, In continuation, if I keep pressing the button for 3 seconds,it sends (1) when button_push periodically after every 3s and once I release the button, it send (0) after every 3s periodically. I just need it to send (1) only one time when button is pushed for 3s and send (0) only one time when button is released. How can I implement it?

    If I create a new timer, I have to create a handler for it....isnt? Its making me little confused. Sir, please suggest me in little detail.

    Thanks n Regards

Related