2018-06-19 14:20:38 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018 Intel Corporation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2022-05-06 17:12:04 +08:00
|
|
|
#include <zephyr/kernel.h>
|
2018-06-19 14:20:38 +08:00
|
|
|
#include <cmsis_os.h>
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Wait for Timeout (Time Delay in ms).
|
|
|
|
*/
|
|
|
|
osStatus osDelay(uint32_t delay_ms)
|
|
|
|
{
|
2018-11-15 17:57:13 +08:00
|
|
|
if (k_is_in_isr()) {
|
2018-06-19 14:20:38 +08:00
|
|
|
return osErrorISR;
|
|
|
|
}
|
|
|
|
|
2020-05-05 04:39:17 +08:00
|
|
|
k_msleep(delay_ms);
|
2018-06-19 14:20:38 +08:00
|
|
|
return osEventTimeout;
|
|
|
|
}
|