zephyr/lib/cmsis_rtos_v1/cmsis_wait.c
Rajavardhan Gundi 50c0ff6e8c lib/cmsis_rtos_v1: Use k_is_in_isr instead of _is_in_isr
Use the kernel API k_is_in_isr() instead of the internal
_is_in_isr() function.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-11-15 09:20:57 -05:00

22 lines
327 B
C

/*
* Copyright (c) 2018 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <kernel_structs.h>
#include <cmsis_os.h>
/**
* @brief Wait for Timeout (Time Delay in ms).
*/
osStatus osDelay(uint32_t delay_ms)
{
if (k_is_in_isr()) {
return osErrorISR;
}
k_sleep(delay_ms);
return osEventTimeout;
}