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

button interrupt with long push

Hello, I am using nrf52832 custom board, with SDK 11.0.0 and s132_nrf52_2.0.0, and trying to create an interrupt event on wake up from system off by pressing BSP_BUTTON_0 (only one button available). Following the nrf51-powerdown examples (github.com/.../system_off_wakeup_on_gpiote), I was able to setup GPIOTE to generate an interrupt event and wakeup task on pin signal low. But have noticed I need a second button press to generate an interrupt. The original interrupt is missed possibly as the application is not ready to process it.

Could you please confirm if this is possible or maybe a long button press can be used to generate "two events": one task to wake up from system off and the other to turn on an LED for example. Instead of two button presses for each. Thanks in advanced.

Parents
  • Thank you for your comment Petter. Yes I am aware that reset (wakeup mechanism) is the only functionality when the system is in the deep power saving mode. My question is with button state detection. I have the button_0 setup to wake up the device fine. But trying to use the same button in the already "pressed state" to get a notification, and not a state transition from low to high.

    I am wondering if it is possible with only a long press and not a second press: user only has to hold the button to have the chip go through reset, and on wake up application detects the button is in "pressed state" so triggers a notification.

    Currently in my code I am using bsp_init call and in bsp_event_handler I get BSP_EVENT_KEY_0 even when the button is pressed (state change) but if I use the app_button_init call similar to the "way 2" suggested in the post below, would I be able to detect the button state (APP_BUTTON_PUSH/APP_BUTTON_RELEASE) to trigger an event or this would still need a state transition to work?

    devzone.nordicsemi.com/.../

    Many thanks.

Reply
  • Thank you for your comment Petter. Yes I am aware that reset (wakeup mechanism) is the only functionality when the system is in the deep power saving mode. My question is with button state detection. I have the button_0 setup to wake up the device fine. But trying to use the same button in the already "pressed state" to get a notification, and not a state transition from low to high.

    I am wondering if it is possible with only a long press and not a second press: user only has to hold the button to have the chip go through reset, and on wake up application detects the button is in "pressed state" so triggers a notification.

    Currently in my code I am using bsp_init call and in bsp_event_handler I get BSP_EVENT_KEY_0 even when the button is pressed (state change) but if I use the app_button_init call similar to the "way 2" suggested in the post below, would I be able to detect the button state (APP_BUTTON_PUSH/APP_BUTTON_RELEASE) to trigger an event or this would still need a state transition to work?

    devzone.nordicsemi.com/.../

    Many thanks.

Children
No Data
Related