@@ -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 );
0 commit comments