Hi, I'm learning the nrf51-powerdown-example <system_off_wakeup_on_gpiote> from github.
My understanding of the code is:
1) When button 0 (Power down) button is pressed (high to low), in_pin_handler() starts
2) We firstly turn off LED, uninitialize and disable button 0 (Power down)
3) Then, enable button 1 (wakeup button).
4) lastly, Enter the system off.
My question is:
1) When button 1 (wakeup button) is pressed (high to low), why the event handler is NULL? How could the system wake up? Which code makes the system wake up (exist system off mode)?
2) Above example uses 2 buttons to enter/exit the system off mode. I have also tried the pin_change_int and pwr_mgmt example code in SDK. Does Nordic have any "1-button to exit/enter system off mode" example? If no, what's the idea/process to achieve it?
Thanks!