long push event not working when i pressing button 1 for 5 sec in nrf52832 dev kit board

Hello sir,

              I am using nrf52832 as Dev kit board with using Button 1 for  long press event for an interval of  5 sec .I have defined the BT0_LONG_PUSH  as  BSP_EVENT_KEY_0 which is working  as  Button 1  by using the function as  bsp_event_to_button_action_assign(BSP_BOARD_BUTTON_0, BSP_BUTTON_ACTION_LONG_PUSH, BT0_LONG_PUSH);When i pressing the Button 1  then it does not work for 5 sec, the long push event  work  instantly i pressed the Button 1 . I have also changed  the  BSP_LONG_PUSH_TIMEOUT_MS (5000) but still push button not working for 5 sec.

I have also changed the Button 1 to Button 2 by changing the function bsp_event_to_button_action_assign(BSP_BOARD_BUTTON_1, BSP_BUTTON_ACTION_LONG_PUSH, BT0_LONG_PUSH); but still  long push event not working when i pressed the Button 2 for 5 sec.

What changes i required so that the long push event work when i hold the Button for 5sec.

Parents Reply Children
  • Thankyou for the reply i have to use same button with different event :1 By pressing the button for 5 sec the event should occur it wakeup from systemoff mode .2 By pressing the same button the different event should occur but the function for the button taken as bsp_event_handler(bsp_event_t event) 3.By pressing the same button then it goes again in sleep mode.The purpose of these event to make optimize the power  for customized BLE Device.

    So when i testing the code then 1st event occurs properly i.e it wake up from sleep mode after 5 sec .2nd time when i pressed the event occurs but it the button is pressed instantly .The third event when i again pressed the Button then it doesnt goes in sleep mode.

    The long push button does  not work properly when i used bsp_event_handler(bsp_event_t event) function  for long press event i.e 5sec .It works only when wakeup button use only.

  • Hi, 

    You can take a look at Jørn's answer in this thread, which might be useful, as he is explaining how to achieve what you want.

    -Amanda

Related