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

sd_app_evt_wait() does not put the cpu in sleep

Hi,

I have a similar problem as described in

devzone.nordicsemi.com/.../

I have eliminated my program to be:

int main(void) {
  setupLEDPins();
  BluetoothPeripheral::instance().initialize();
  int counter = 0;
  while (1) {
    delayMs(100);
    pinToggle(LED_GREEN);
    if (counter == 10) {
      pinSet(LED_ORANGE);
      sd_app_evt_wait();
    }
    counter++;
  }
}

As you see this code basically toggles a LED 10 times and then lits an orange LED and put the cpu to sleep with sd_app_evt_wait which should stop the LED from blinking.

However, when I run this code the green LED blinks and after a while the orange LED comes on but after that the green LED keeps blinking! I have tried putting delays before and after and also calling the sd_app_evt_wait() multiple times in a row but nothing helps.

What have I missed?

Thanks!

Related