I just updated my project from SDK 15.3 to 16.0. I am using the nRF52840.
I am not receiving the APP_BUTTON_RELEASE event when waking up from a button press. It used to work on 15.3.
To help isolate the problem, I recreated it in the ble_app_template example project and ran it in both SDK 15.3 and 16.0 on the Nordic dev board. I made the following changes in each SDK:
In bsp.c, in the bsp_button_event_handler() , I added the following serial debug line of code:
In main.c, I modified the sleep_mode_enter() with a serial debug line of code and removed the APP_ERROR_CHECK() to simulate sleep while debugging:
In main.c, I also decreased advertising time to 10 seconds for convenience so that it will go to sleep sooner:
I run the app by:
- Start the ble_app_template example.
- Allow advertising to time out so that it goes into sleep mode.
- Press the button to wake it back up.
When I run the ble_app_template example in 15.3, I get the following Debug Terminal Output:
The app resets upon button press as expected. Notice "button release". This means that I get the button release event.
When I run the ble_app_template example in 16.0, I get the following Debug Terminal Output:
The app resets upon button press as expected. Although, I do not get a button release event.
It is very important to my project to get this event. I need to detect the release event so that I can differentiate between a short and long press upon wakeup from a button press.