mirror of https://github.com/thesofproject/sof.git
xtos-wrapper: Add Zephyr k_sleep() API to XTOS using wait_delay()
Add k_sleep() and a minimum set of related typedefs and macros needed to make the API usable. The implementation calls wait_delay(). Commit adds also safeguard not to let Zephyr build include the file. Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
This commit is contained in:
parent
42e0d5e0b5
commit
48b57cd1b8
|
@ -12,6 +12,23 @@
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __ZEPHYR__
|
||||
#error "This file should only be included in XTOS builds."
|
||||
#endif
|
||||
|
||||
typedef uint32_t k_ticks_t;
|
||||
|
||||
typedef struct {
|
||||
k_ticks_t ticks;
|
||||
} k_timeout_t;
|
||||
|
||||
#define Z_TIMEOUT_TICKS(t) ((k_timeout_t) { .ticks = (t) })
|
||||
|
||||
static inline void k_sleep(k_timeout_t timeout)
|
||||
{
|
||||
wait_delay(timeout.ticks);
|
||||
}
|
||||
|
||||
static inline void k_msleep(int32_t ms)
|
||||
{
|
||||
wait_delay_ms(ms);
|
||||
|
|
Loading…
Reference in New Issue