From dd2fb48232fd8680bc5728bc5602f4429aa1ee51 Mon Sep 17 00:00:00 2001 From: mculover666 <2412828003@qq.com> Date: Fri, 17 Jul 2020 10:44:48 +0800 Subject: [PATCH] fix a bug in cmsis-os v1.02 implement --- osal/cmsis_os/cmsis_os.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/osal/cmsis_os/cmsis_os.c b/osal/cmsis_os/cmsis_os.c index d2d5f0d9..ade04fe0 100644 --- a/osal/cmsis_os/cmsis_os.c +++ b/osal/cmsis_os/cmsis_os.c @@ -122,6 +122,17 @@ osStatus osThreadSetPriority(osThreadId thread_id, osPriority priority) return errno_knl2cmsis(tos_task_prio_change((k_task_t *)thread_id, priority_cmsis2knl(priority))); } +/** + * @brief Pass control to next thread that is in state READY. + * @return status code that indicates the execution status of the function. + */ +osStatus osThreadYield(void) +{ + tos_task_yield(); + + return osOK; +} + /** * @brief Get current priority of an active thread. * @param[in] thread_id thread ID obtained by \ref osThreadCreate or \ref osThreadGetId.