zephyr/lib/cmsis_rtos_v1/cmsis_wait.c
Andy Ross 1003ab806c subsys/cmsis_v1: Port to new timeout API
No complexity here.  The CMSIS API was always in milliseconds, needs
nothing but a few wrapper macros for kernel timeout arguments.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-05-06 06:05:03 -04:00

22 lines
320 B
C

/*
* Copyright (c) 2018 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <kernel.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_msleep(delay_ms);
return osEventTimeout;
}