__STATIC_INLINE void nrf_pwr_mgmt_sleep_init(void) { #ifdef SOFTDEVICE_PRESENT ASSERT(current_int_priority_get() <= APP_IRQ_PRIORITY_LOW); #endif SCB->SCR |= SCB_SCR_SEVONPEND_Msk; }
/**@brief Function for creating a timer user id from the current interrupt level. * * @return Timer user id. */ static timer_user_id_t user_id_get(void) { timer_user_id_t ret; STATIC_ASSERT(APP_TIMER_INT_LEVELS == 3); switch (current_int_priority_get()) { case APP_IRQ_PRIORITY_HIGH: ret = APP_HIGH_USER_ID; break; case APP_IRQ_PRIORITY_LOW: ret = APP_LOW_USER_ID; break; default: ret = THREAD_MODE_USER_ID; break; } return ret; }