/* Delays number of milliseconds in sleep mode (EM2) using the RTC.  */
void UTIL_sleep(uint32_t ms)
/* Delays number of milliseconds in sleep mode (EM2) using the RTC.  */
void UTIL_sleep(uint32_t ms)
{
   rtcComplete = false;
   RTCDRV_StartTimer( rtcId, rtcdrvTimerTypeOneshot, ms, rtcCb, 0 );
   while( !rtcComplete )
      EMU_EnterEM2(true);
   return;
}