/* Enter energy mode 2 (EM2). 
However, prior to entering EM2, the core may have been using another oscillator than HFRCO. The  */
void EMU_EnterEM2(bool restore)
/* Enter energy mode 2 (EM2). 
However, prior to entering EM2, the core may have been using another oscillator than HFRCO. The  */
void EMU_EnterEM2(bool restore)
{
  cmuStatus = (uint16_t)(CMU->STATUS);
  SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
  __WFI();
  if (restore)
  {
    EMU_Restore();
  }
  else if (!(cmuStatus & CMU_STATUS_HFRCOSEL))
  {
    SystemCoreClockUpdate();
  }
}