zephyr/lib/cmsis_rtos_v1/cmsis_wait.c
Rajavardhan Gundi 2d7619ecf8 lib/cmsis_rtos_v1: Implement support for osDelay
This API is used to specify delay in ms. This is analogous
to k_sleep in the kernel.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-08-13 13:08:07 -07:00

22 lines
326 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 (_is_in_isr()) {
return osErrorISR;
}
k_sleep(delay_ms);
return osEventTimeout;
}