Hi my goal is to put the NRF into system on low power mode every other second. I have a repeated app_timer that increments counter variable m_custom_value every second. I thought of two possible ways to do this by calling sd_app_evt_wait() if/while m_custom_value % 2 == 0.
1. I was wondering if there is any difference if I use an if statement vs while loop to call sd_app_evt_wait(). If I use an if statement then sd_app_evt_wait() is only called once every other second, but if I use a while loop then sd_app_evt_wait() is called continuously for the duration of one second (or approximately one second), every other second. Will using a while loop just interrupt the NRF CPU from sleep or is there no difference between calling sd_app_evt_wait() once or calling sd_app_evt_wait() continuously for the duration where I want the NRF CPU to be sleeping?
2. Do I need to make sure the NRF is done advertising or force the NRF to stop advertising before calling sd_app_evt_wait() if I want the NRF CPU to go to system on low power mode?
I noticed that if I start BLE advertising then call sd_app_evt_wait() the NRF DK will continue advertising until the advertising timeout or idle power-management code is called. So my current assumption is that if BLE advertising is still active when sd_app_evt_wait() is called, then the NRF CPU will not go to sleep and the active BLE advertising will continue draining significant power.