Skip to content

Commit 6736d29

Browse files
committed
RT_TIMER_CTRL_SET_TIME only accept rt_tick_t, pass rt_tick_t instead int/rt_int32_t
1 parent cdf1c43 commit 6736d29

File tree

16 files changed

+49
-27
lines changed

16 files changed

+49
-27
lines changed

bsp/at91/at91sam9260/drivers/at91_mci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ static void at91_mci_process_next(struct at91_mci *mci)
430430
*/
431431
static void at91_mci_request(struct rt_mmcsd_host *host, struct rt_mmcsd_req *req)
432432
{
433-
rt_uint32_t timeout = RT_TICK_PER_SECOND;
433+
rt_tick_t timeout = RT_TICK_PER_SECOND;
434434
struct at91_mci *mci = host->private_data;
435435
mci->req = req;
436436
mci->current_status = REQ_ST_INIT;

bsp/at91/at91sam9g45/drivers/at91_mci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ static void at91_mci_process_next(struct at91_mci *mci)
430430
*/
431431
static void at91_mci_request(struct rt_mmcsd_host *host, struct rt_mmcsd_req *req)
432432
{
433-
rt_uint32_t timeout = RT_TICK_PER_SECOND;
433+
rt_tick_t timeout = RT_TICK_PER_SECOND;
434434
struct at91_mci *mci = host->private_data;
435435
mci->req = req;
436436
mci->current_status = REQ_ST_INIT;

components/drivers/ipc/completion_mp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,11 @@ static rt_err_t _comp_susp_thread(struct rt_completion *completion,
242242
/* start timer */
243243
if (timeout > 0)
244244
{
245+
rt_tick_t timeout_tick = timeout;
245246
/* reset the timeout of thread timer and start it */
246247
rt_timer_control(&(thread->thread_timer),
247248
RT_TIMER_CTRL_SET_TIME,
248-
&timeout);
249+
&timeout_tick);
249250
rt_timer_start(&(thread->thread_timer));
250251
}
251252

components/drivers/ipc/completion_up.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,11 @@ rt_err_t rt_completion_wait_flags(struct rt_completion *completion,
108108
/* start timer */
109109
if (timeout > 0)
110110
{
111+
rt_tick_t timeout_tick = timeout;
111112
/* reset the timeout of thread timer and start it */
112113
rt_timer_control(&(thread->thread_timer),
113114
RT_TIMER_CTRL_SET_TIME,
114-
&timeout);
115+
&timeout_tick);
115116
rt_timer_start(&(thread->thread_timer));
116117
}
117118
/* enable interrupt */

components/drivers/ipc/dataqueue.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,11 @@ rt_err_t rt_data_queue_push(struct rt_data_queue *queue,
129129
/* start timer */
130130
if (timeout > 0)
131131
{
132+
rt_tick_t timeout_tick = timeout;
132133
/* reset the timeout of thread timer and start it */
133134
rt_timer_control(&(thread->thread_timer),
134135
RT_TIMER_CTRL_SET_TIME,
135-
&timeout);
136+
&timeout_tick);
136137
rt_timer_start(&(thread->thread_timer));
137138
}
138139

@@ -247,10 +248,11 @@ rt_err_t rt_data_queue_pop(struct rt_data_queue *queue,
247248
/* start timer */
248249
if (timeout > 0)
249250
{
251+
rt_tick_t timeout_tick = timeout;
250252
/* reset the timeout of thread timer and start it */
251253
rt_timer_control(&(thread->thread_timer),
252254
RT_TIMER_CTRL_SET_TIME,
253-
&timeout);
255+
&timeout_tick);
254256
rt_timer_start(&(thread->thread_timer));
255257
}
256258

components/libc/posix/io/epoll/epoll.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,9 +700,10 @@ static int epoll_wait_timeout(struct rt_eventpoll *ep, int msec)
700700
{
701701
if (timeout > 0)
702702
{
703+
rt_tick_t timeout_tick = timeout;
703704
rt_timer_control(&(thread->thread_timer),
704705
RT_TIMER_CTRL_SET_TIME,
705-
&timeout);
706+
&timeout_tick);
706707
rt_timer_start(&(thread->thread_timer));
707708
}
708709

components/libc/posix/io/poll/poll.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,10 @@ static int poll_wait_timeout(struct rt_poll_table *pt, int msec)
158158
{
159159
if (timeout > 0)
160160
{
161+
rt_tick_t timeout_tick = timeout;
161162
rt_timer_control(&(thread->thread_timer),
162163
RT_TIMER_CTRL_SET_TIME,
163-
&timeout);
164+
&timeout_tick);
164165
rt_timer_start(&(thread->thread_timer));
165166
rt_set_errno(RT_ETIMEOUT);
166167
}

components/libc/posix/pthreads/pthread_cond.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,10 +418,11 @@ rt_err_t _pthread_cond_timedwait(pthread_cond_t *cond,
418418
/* has waiting time, start thread timer */
419419
if (time > 0)
420420
{
421+
rt_tick_t time_tick = time;
421422
/* reset the timeout of thread timer and start it */
422423
rt_timer_control(&(thread->thread_timer),
423424
RT_TIMER_CTRL_SET_TIME,
424-
&time);
425+
&time_tick);
425426
rt_timer_start(&(thread->thread_timer));
426427
}
427428

components/lwp/lwp_ipc.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,7 @@ static rt_err_t _do_send_recv_timeout(rt_channel_t ch, rt_channel_msg_t data, in
553553
rt_thread_wakeup_set(thread_send, wakeup_sender_wait_recv, (void *)ch);
554554
if (time > 0)
555555
{
556+
rt_tick_t time_tick = time;
556557
rt_timer_control(&(thread_send->thread_timer),
557558
RT_TIMER_CTRL_GET_FUNC,
558559
&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
562563
/* reset the timeout of thread timer and start it */
563564
rt_timer_control(&(thread_send->thread_timer),
564565
RT_TIMER_CTRL_SET_TIME,
565-
&time);
566+
&time_tick);
566567
rt_timer_start(&(thread_send->thread_timer));
567568
}
568569
}
@@ -597,6 +598,7 @@ static rt_err_t _do_send_recv_timeout(rt_channel_t ch, rt_channel_msg_t data, in
597598
rt_thread_wakeup_set(thread_send, wakeup_sender_wait_reply, (void *)ch);
598599
if (time > 0)
599600
{
601+
rt_tick_t time_tick = time;
600602
rt_timer_control(&(thread_send->thread_timer),
601603
RT_TIMER_CTRL_GET_FUNC,
602604
&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
606608
/* reset the timeout of thread timer and start it */
607609
rt_timer_control(&(thread_send->thread_timer),
608610
RT_TIMER_CTRL_SET_TIME,
609-
&time);
611+
&time_tick);
610612
rt_timer_start(&(thread_send->thread_timer));
611613
}
612614
}
@@ -870,6 +872,7 @@ static rt_err_t _rt_raw_channel_recv_timeout(rt_channel_t ch, rt_channel_msg_t d
870872
thread->error = RT_EOK;
871873
if (time > 0)
872874
{
875+
rt_tick_t time_tick = time;
873876
rt_timer_control(&(thread->thread_timer),
874877
RT_TIMER_CTRL_GET_FUNC,
875878
&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
879882
/* reset the timeout of thread timer and start it */
880883
rt_timer_control(&(thread->thread_timer),
881884
RT_TIMER_CTRL_SET_TIME,
882-
&time);
885+
&time_tick);
883886
rt_timer_start(&(thread->thread_timer));
884887
}
885888
rt_spin_unlock_irqrestore(&ch->slock, level);

components/utilities/rt-link/src/rtlink.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ static rt_err_t rt_link_frame_send(rt_slist_t *slist)
302302
}
303303
else
304304
{
305-
rt_int32_t timeout = RT_LINK_SENT_FRAME_TIMEOUT;
305+
rt_tick_t timeout = RT_LINK_SENT_FRAME_TIMEOUT;
306306
rt_timer_control(&rt_link_scb->sendtimer, RT_TIMER_CTRL_SET_TIME, &timeout);
307307
rt_timer_start(&rt_link_scb->sendtimer);
308308
}
@@ -536,7 +536,7 @@ static void _long_handle_second(struct rt_link_frame *receive_frame)
536536
}
537537
else if (rt_link_hw_recv_len(rt_link_scb->rx_buffer) < (receive_frame->data_len % RT_LINK_MAX_DATA_LENGTH))
538538
{
539-
rt_int32_t timeout = RT_LINK_LONG_FRAME_TIMEOUT;
539+
rt_tick_t timeout = RT_LINK_LONG_FRAME_TIMEOUT;
540540
rt_timer_control(&rt_link_scb->longframetimer, RT_TIMER_CTRL_SET_TIME, &timeout);
541541
rt_timer_start(&rt_link_scb->longframetimer);
542542
}
@@ -879,7 +879,7 @@ static void rt_link_send_ready(void)
879879
rt_link_command_frame_send(RT_LINK_SERVICE_RTLINK, seq,
880880
RT_LINK_HANDSHAKE_FRAME, rt_link_scb->rx_record.rx_seq);
881881

882-
rt_int32_t timeout = 50;
882+
rt_tick_t timeout = 50;
883883
rt_timer_control(&rt_link_scb->sendtimer, RT_TIMER_CTRL_SET_TIME, &timeout);
884884
rt_timer_start(&rt_link_scb->sendtimer);
885885
}

0 commit comments

Comments
 (0)