瀏覽代碼

[add] semaphore reset support for rt-thread

add  semaphore reset support for rt-thread
tyustli 3 年之前
父節點
當前提交
7d76c172db
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/osal/osal_rtthread.h

+ 2 - 1
src/osal/osal_rtthread.h

@@ -63,7 +63,8 @@ TU_ATTR_ALWAYS_INLINE static inline bool osal_semaphore_wait(osal_semaphore_t se
 }
 }
 
 
 TU_ATTR_ALWAYS_INLINE static inline void osal_semaphore_reset(osal_semaphore_t const sem_hdl) {
 TU_ATTR_ALWAYS_INLINE static inline void osal_semaphore_reset(osal_semaphore_t const sem_hdl) {
-    // TODO: implement
+    rt_ubase_t value = 0;
+    rt_sem_control(sem_hdl, RT_IPC_CMD_RESET, &value);
 }
 }
 
 
 //--------------------------------------------------------------------+
 //--------------------------------------------------------------------+