From 2fa40dd602692a4c18d72b76eb97c3e7bf28058b Mon Sep 17 00:00:00 2001 From: Stanley <98496195+byte-me-stan@users.noreply.github.com> Date: Fri, 15 Apr 2022 00:32:07 -0700 Subject: [PATCH] Fix/parameter name (#5815) * Update ipc.c Parameter name standardization Co-authored-by: Stanley --- src/ipc.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/ipc.c b/src/ipc.c index ad179d56ee..e7e92976e5 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -467,7 +467,7 @@ RTM_EXPORT(rt_sem_delete); * * @param sem is a pointer to a semaphore object. * - * @param time is a timeout period (unit: an OS tick). If the semaphore is unavailable, the thread will wait for + * @param timeout is a timeout period (unit: an OS tick). If the semaphore is unavailable, the thread will wait for * the semaphore up to the amount of time specified by this parameter. * * NOTE: @@ -481,7 +481,7 @@ RTM_EXPORT(rt_sem_delete); * * @warning This function can ONLY be called in the thread context. It MUST NOT BE called in interrupt context. */ -rt_err_t rt_sem_take(rt_sem_t sem, rt_int32_t time) +rt_err_t rt_sem_take(rt_sem_t sem, rt_int32_t timeout) { register rt_base_t temp; struct rt_thread *thread; @@ -511,7 +511,7 @@ rt_err_t rt_sem_take(rt_sem_t sem, rt_int32_t time) else { /* no waiting, return with timeout */ - if (time == 0) + if (timeout == 0) { rt_hw_interrupt_enable(temp); @@ -538,7 +538,7 @@ rt_err_t rt_sem_take(rt_sem_t sem, rt_int32_t time) sem->parent.parent.flag); /* has waiting time, start thread timer */ - if (time > 0) + if (timeout > 0) { RT_DEBUG_LOG(RT_DEBUG_IPC, ("set thread:%s to timer list\n", thread->name)); @@ -546,7 +546,7 @@ rt_err_t rt_sem_take(rt_sem_t sem, rt_int32_t time) /* reset the timeout of thread timer and start it */ rt_timer_control(&(thread->thread_timer), RT_TIMER_CTRL_SET_TIME, - &time); + &timeout); rt_timer_start(&(thread->thread_timer)); } @@ -901,7 +901,7 @@ RTM_EXPORT(rt_mutex_delete); * * @param mutex is a pointer to a mutex object. * - * @param time is a timeout period (unit: an OS tick). If the mutex is unavailable, the thread will wait for + * @param timeout is a timeout period (unit: an OS tick). If the mutex is unavailable, the thread will wait for * the mutex up to the amount of time specified by the argument. * NOTE: Generally, we set this parameter to RT_WAITING_FOREVER, which means that when the mutex is unavailable, * the thread will be waitting forever. @@ -911,7 +911,7 @@ RTM_EXPORT(rt_mutex_delete); * * @warning This function can ONLY be called in the thread context. It MUST NOT BE called in interrupt context. */ -rt_err_t rt_mutex_take(rt_mutex_t mutex, rt_int32_t time) +rt_err_t rt_mutex_take(rt_mutex_t mutex, rt_int32_t timeout) { register rt_base_t temp; struct rt_thread *thread; @@ -978,7 +978,7 @@ rt_err_t rt_mutex_take(rt_mutex_t mutex, rt_int32_t time) else { /* no waiting, return with timeout */ - if (time == 0) + if (timeout == 0) { /* set error as timeout */ thread->error = -RT_ETIMEOUT; @@ -1009,7 +1009,7 @@ rt_err_t rt_mutex_take(rt_mutex_t mutex, rt_int32_t time) mutex->parent.parent.flag); /* has waiting time, start thread timer */ - if (time > 0) + if (timeout > 0) { RT_DEBUG_LOG(RT_DEBUG_IPC, ("mutex_take: start the timer of thread:%s\n", @@ -1018,7 +1018,7 @@ rt_err_t rt_mutex_take(rt_mutex_t mutex, rt_int32_t time) /* reset the timeout of thread timer and start it */ rt_timer_control(&(thread->thread_timer), RT_TIMER_CTRL_SET_TIME, - &time); + &timeout); rt_timer_start(&(thread->thread_timer)); } -- GitLab