summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorYonggang Luo <[email protected]>2025-09-22 01:04:46 +0800
committerR b b666 <[email protected]>2025-09-24 18:12:36 +0800
commit66b2bcc080b39750cc69a2f00f0d951f94967712 (patch)
tree8b93349cd771af71a55bfce5b0afe87cf296e2cf /components
parent5bba332e23c6d5e859b4fe00cc5aea5ea6e26a73 (diff)
RT_TIMER_CTRL_SET_TIME only accept rt_tick_t, pass rt_tick_t instead int/rt_int32_t
Diffstat (limited to 'components')
-rw-r--r--components/drivers/ipc/completion_mp.c3
-rw-r--r--components/drivers/ipc/completion_up.c3
-rw-r--r--components/drivers/ipc/dataqueue.c6
-rw-r--r--components/libc/posix/io/epoll/epoll.c3
-rw-r--r--components/libc/posix/io/poll/poll.c3
-rw-r--r--components/libc/posix/pthreads/pthread_cond.c3
-rw-r--r--components/lwp/lwp_ipc.c9
-rw-r--r--components/utilities/rt-link/src/rtlink.c6
-rw-r--r--components/vbus/prio_queue.c3
-rw-r--r--components/vbus/vbus.c3
-rw-r--r--components/vbus/watermark_queue.h3
11 files changed, 29 insertions, 16 deletions
diff --git a/components/drivers/ipc/completion_mp.c b/components/drivers/ipc/completion_mp.c
index 38ffc6f3fd..3c9c65d58b 100644
--- a/components/drivers/ipc/completion_mp.c
+++ b/components/drivers/ipc/completion_mp.c
@@ -242,10 +242,11 @@ static rt_err_t _comp_susp_thread(struct rt_completion *completion,
/* start timer */
if (timeout > 0)
{
+ rt_tick_t timeout_tick = timeout;
/* reset the timeout of thread timer and start it */
rt_timer_control(&(thread->thread_timer),
RT_TIMER_CTRL_SET_TIME,
- &timeout);
+ &timeout_tick);
rt_timer_start(&(thread->thread_timer));
}
diff --git a/components/drivers/ipc/completion_up.c b/components/drivers/ipc/completion_up.c
index 8c3bbbffa1..ce11bd00af 100644
--- a/components/drivers/ipc/completion_up.c
+++ b/components/drivers/ipc/completion_up.c
@@ -108,10 +108,11 @@ __try_again:
/* start timer */
if (timeout > 0)
{
+ rt_tick_t timeout_tick = timeout;
/* reset the timeout of thread timer and start it */
rt_timer_control(&(thread->thread_timer),
RT_TIMER_CTRL_SET_TIME,
- &timeout);
+ &timeout_tick);
rt_timer_start(&(thread->thread_timer));
}
/* enable interrupt */
diff --git a/components/drivers/ipc/dataqueue.c b/components/drivers/ipc/dataqueue.c
index 337c5114bf..f1ee2bd576 100644
--- a/components/drivers/ipc/dataqueue.c
+++ b/components/drivers/ipc/dataqueue.c
@@ -129,10 +129,11 @@ rt_err_t rt_data_queue_push(struct rt_data_queue *queue,
/* start timer */
if (timeout > 0)
{
+ rt_tick_t timeout_tick = timeout;
/* reset the timeout of thread timer and start it */
rt_timer_control(&(thread->thread_timer),
RT_TIMER_CTRL_SET_TIME,
- &timeout);
+ &timeout_tick);
rt_timer_start(&(thread->thread_timer));
}
@@ -247,10 +248,11 @@ rt_err_t rt_data_queue_pop(struct rt_data_queue *queue,
/* start timer */
if (timeout > 0)
{
+ rt_tick_t timeout_tick = timeout;
/* reset the timeout of thread timer and start it */
rt_timer_control(&(thread->thread_timer),
RT_TIMER_CTRL_SET_TIME,
- &timeout);
+ &timeout_tick);
rt_timer_start(&(thread->thread_timer));
}
diff --git a/components/libc/posix/io/epoll/epoll.c b/components/libc/posix/io/epoll/epoll.c
index 7677b8deea..a4c9dcfc06 100644
--- a/components/libc/posix/io/epoll/epoll.c
+++ b/components/libc/posix/io/epoll/epoll.c
@@ -700,9 +700,10 @@ static int epoll_wait_timeout(struct rt_eventpoll *ep, int msec)
{
if (timeout > 0)
{
+ rt_tick_t timeout_tick = timeout;
rt_timer_control(&(thread->thread_timer),
RT_TIMER_CTRL_SET_TIME,
- &timeout);
+ &timeout_tick);
rt_timer_start(&(thread->thread_timer));
}
diff --git a/components/libc/posix/io/poll/poll.c b/components/libc/posix/io/poll/poll.c
index 8be654ed3b..3667216081 100644
--- a/components/libc/posix/io/poll/poll.c
+++ b/components/libc/posix/io/poll/poll.c
@@ -158,9 +158,10 @@ static int poll_wait_timeout(struct rt_poll_table *pt, int msec)
{
if (timeout > 0)
{
+ rt_tick_t timeout_tick = timeout;
rt_timer_control(&(thread->thread_timer),
RT_TIMER_CTRL_SET_TIME,
- &timeout);
+ &timeout_tick);
rt_timer_start(&(thread->thread_timer));
rt_set_errno(RT_ETIMEOUT);
}
diff --git a/components/libc/posix/pthreads/pthread_cond.c b/components/libc/posix/pthreads/pthread_cond.c
index caedec7601..69cad1fa2e 100644
--- a/components/libc/posix/pthreads/pthread_cond.c
+++ b/components/libc/posix/pthreads/pthread_cond.c
@@ -418,10 +418,11 @@ rt_err_t _pthread_cond_timedwait(pthread_cond_t *cond,
/* has waiting time, start thread timer */
if (time > 0)
{
+ rt_tick_t time_tick = time;
/* reset the timeout of thread timer and start it */
rt_timer_control(&(thread->thread_timer),
RT_TIMER_CTRL_SET_TIME,
- &time);
+ &time_tick);
rt_timer_start(&(thread->thread_timer));
}
diff --git a/components/lwp/lwp_ipc.c b/components/lwp/lwp_ipc.c
index f75597376d..b995188b0c 100644
--- a/components/lwp/lwp_ipc.c
+++ b/components/lwp/lwp_ipc.c
@@ -553,6 +553,7 @@ static rt_err_t _do_send_recv_timeout(rt_channel_t ch, rt_channel_msg_t data, in
rt_thread_wakeup_set(thread_send, wakeup_sender_wait_recv, (void *)ch);
if (time > 0)
{
+ rt_tick_t time_tick = time;
rt_timer_control(&(thread_send->thread_timer),
RT_TIMER_CTRL_GET_FUNC,
&old_timeout_func);
@@ -562,7 +563,7 @@ static rt_err_t _do_send_recv_timeout(rt_channel_t ch, rt_channel_msg_t data, in
/* reset the timeout of thread timer and start it */
rt_timer_control(&(thread_send->thread_timer),
RT_TIMER_CTRL_SET_TIME,
- &time);
+ &time_tick);
rt_timer_start(&(thread_send->thread_timer));
}
}
@@ -597,6 +598,7 @@ static rt_err_t _do_send_recv_timeout(rt_channel_t ch, rt_channel_msg_t data, in
rt_thread_wakeup_set(thread_send, wakeup_sender_wait_reply, (void *)ch);
if (time > 0)
{
+ rt_tick_t time_tick = time;
rt_timer_control(&(thread_send->thread_timer),
RT_TIMER_CTRL_GET_FUNC,
&old_timeout_func);
@@ -606,7 +608,7 @@ static rt_err_t _do_send_recv_timeout(rt_channel_t ch, rt_channel_msg_t data, in
/* reset the timeout of thread timer and start it */
rt_timer_control(&(thread_send->thread_timer),
RT_TIMER_CTRL_SET_TIME,
- &time);
+ &time_tick);
rt_timer_start(&(thread_send->thread_timer));
}
}
@@ -870,6 +872,7 @@ static rt_err_t _rt_raw_channel_recv_timeout(rt_channel_t ch, rt_channel_msg_t d
thread->error = RT_EOK;
if (time > 0)
{
+ rt_tick_t time_tick = time;
rt_timer_control(&(thread->thread_timer),
RT_TIMER_CTRL_GET_FUNC,
&old_timeout_func);
@@ -879,7 +882,7 @@ static rt_err_t _rt_raw_channel_recv_timeout(rt_channel_t ch, rt_channel_msg_t d
/* reset the timeout of thread timer and start it */
rt_timer_control(&(thread->thread_timer),
RT_TIMER_CTRL_SET_TIME,
- &time);
+ &time_tick);
rt_timer_start(&(thread->thread_timer));
}
rt_spin_unlock_irqrestore(&ch->slock, level);
diff --git a/components/utilities/rt-link/src/rtlink.c b/components/utilities/rt-link/src/rtlink.c
index 48d91fc94b..9c7bc1513c 100644
--- a/components/utilities/rt-link/src/rtlink.c
+++ b/components/utilities/rt-link/src/rtlink.c
@@ -302,7 +302,7 @@ static rt_err_t rt_link_frame_send(rt_slist_t *slist)
}
else
{
- rt_int32_t timeout = RT_LINK_SENT_FRAME_TIMEOUT;
+ rt_tick_t timeout = RT_LINK_SENT_FRAME_TIMEOUT;
rt_timer_control(&rt_link_scb->sendtimer, RT_TIMER_CTRL_SET_TIME, &timeout);
rt_timer_start(&rt_link_scb->sendtimer);
}
@@ -536,7 +536,7 @@ static void _long_handle_second(struct rt_link_frame *receive_frame)
}
else if (rt_link_hw_recv_len(rt_link_scb->rx_buffer) < (receive_frame->data_len % RT_LINK_MAX_DATA_LENGTH))
{
- rt_int32_t timeout = RT_LINK_LONG_FRAME_TIMEOUT;
+ rt_tick_t timeout = RT_LINK_LONG_FRAME_TIMEOUT;
rt_timer_control(&rt_link_scb->longframetimer, RT_TIMER_CTRL_SET_TIME, &timeout);
rt_timer_start(&rt_link_scb->longframetimer);
}
@@ -879,7 +879,7 @@ static void rt_link_send_ready(void)
rt_link_command_frame_send(RT_LINK_SERVICE_RTLINK, seq,
RT_LINK_HANDSHAKE_FRAME, rt_link_scb->rx_record.rx_seq);
- rt_int32_t timeout = 50;
+ rt_tick_t timeout = 50;
rt_timer_control(&rt_link_scb->sendtimer, RT_TIMER_CTRL_SET_TIME, &timeout);
rt_timer_start(&rt_link_scb->sendtimer);
}
diff --git a/components/vbus/prio_queue.c b/components/vbus/prio_queue.c
index f7691f49cd..9c8dca5157 100644
--- a/components/vbus/prio_queue.c
+++ b/components/vbus/prio_queue.c
@@ -209,9 +209,10 @@ rt_err_t rt_prio_queue_pop(struct rt_prio_queue *que,
if (timeout > 0)
{
+ rt_tick_t timeout_tick = timeout;
rt_timer_control(&(thread->thread_timer),
RT_TIMER_CTRL_SET_TIME,
- &timeout);
+ &timeout_tick);
rt_timer_start(&(thread->thread_timer));
}
diff --git a/components/vbus/vbus.c b/components/vbus/vbus.c
index 46edd63a4f..2adaac8dda 100644
--- a/components/vbus/vbus.c
+++ b/components/vbus/vbus.c
@@ -339,9 +339,10 @@ rt_err_t rt_vbus_post(rt_uint8_t id,
rt_list_insert_after(&_chn_suspended_threads[id], &RT_THREAD_LIST_NODE(thread));
if (timeout > 0)
{
+ rt_tick_t timeout_tick = timeout;
rt_timer_control(&(thread->thread_timer),
RT_TIMER_CTRL_SET_TIME,
- &timeout);
+ &timeout_tick);
rt_timer_start(&(thread->thread_timer));
}
/* rt_exit_critical will do schedule on need. */
diff --git a/components/vbus/watermark_queue.h b/components/vbus/watermark_queue.h
index 2e659058dd..d03ef9eeba 100644
--- a/components/vbus/watermark_queue.h
+++ b/components/vbus/watermark_queue.h
@@ -67,9 +67,10 @@ rt_inline rt_err_t rt_wm_que_inc(struct rt_watermark_queue *wg,
rt_list_insert_after(&wg->suspended_threads, &RT_THREAD_LIST_NODE(thread));
if (timeout > 0)
{
+ rt_tick_t timeout_tick = timeout;
rt_timer_control(&(thread->thread_timer),
RT_TIMER_CTRL_SET_TIME,
- &timeout);
+ &timeout_tick);
rt_timer_start(&(thread->thread_timer));
}
rt_hw_interrupt_enable(level);