Просмотр исходного кода

RT_TIMER_CTRL_SET_TIME only accept rt_tick_t, pass rt_tick_t instead int/rt_int32_t

Yonggang Luo 3 месяцев назад
Родитель
Сommit
66b2bcc080

+ 1 - 1
bsp/at91/at91sam9260/drivers/at91_mci.c

@@ -430,7 +430,7 @@ static void at91_mci_process_next(struct at91_mci *mci)
  */
  */
 static void at91_mci_request(struct rt_mmcsd_host *host, struct rt_mmcsd_req *req)
 static void at91_mci_request(struct rt_mmcsd_host *host, struct rt_mmcsd_req *req)
 {
 {
-    rt_uint32_t timeout = RT_TICK_PER_SECOND;
+    rt_tick_t timeout = RT_TICK_PER_SECOND;
     struct at91_mci *mci = host->private_data;
     struct at91_mci *mci = host->private_data;
     mci->req = req;
     mci->req = req;
     mci->current_status = REQ_ST_INIT;
     mci->current_status = REQ_ST_INIT;

+ 1 - 1
bsp/at91/at91sam9g45/drivers/at91_mci.c

@@ -430,7 +430,7 @@ static void at91_mci_process_next(struct at91_mci *mci)
  */
  */
 static void at91_mci_request(struct rt_mmcsd_host *host, struct rt_mmcsd_req *req)
 static void at91_mci_request(struct rt_mmcsd_host *host, struct rt_mmcsd_req *req)
 {
 {
-    rt_uint32_t timeout = RT_TICK_PER_SECOND;
+    rt_tick_t timeout = RT_TICK_PER_SECOND;
     struct at91_mci *mci = host->private_data;
     struct at91_mci *mci = host->private_data;
     mci->req = req;
     mci->req = req;
     mci->current_status = REQ_ST_INIT;
     mci->current_status = REQ_ST_INIT;

+ 2 - 1
components/drivers/ipc/completion_mp.c

@@ -242,10 +242,11 @@ static rt_err_t _comp_susp_thread(struct rt_completion *completion,
         /* start timer */
         /* start timer */
         if (timeout > 0)
         if (timeout > 0)
         {
         {
+            rt_tick_t timeout_tick = timeout;
             /* reset the timeout of thread timer and start it */
             /* reset the timeout of thread timer and start it */
             rt_timer_control(&(thread->thread_timer),
             rt_timer_control(&(thread->thread_timer),
                              RT_TIMER_CTRL_SET_TIME,
                              RT_TIMER_CTRL_SET_TIME,
-                             &timeout);
+                             &timeout_tick);
             rt_timer_start(&(thread->thread_timer));
             rt_timer_start(&(thread->thread_timer));
         }
         }
 
 

+ 2 - 1
components/drivers/ipc/completion_up.c

@@ -108,10 +108,11 @@ __try_again:
                 /* start timer */
                 /* start timer */
                 if (timeout > 0)
                 if (timeout > 0)
                 {
                 {
+                    rt_tick_t timeout_tick = timeout;
                     /* reset the timeout of thread timer and start it */
                     /* reset the timeout of thread timer and start it */
                     rt_timer_control(&(thread->thread_timer),
                     rt_timer_control(&(thread->thread_timer),
                                      RT_TIMER_CTRL_SET_TIME,
                                      RT_TIMER_CTRL_SET_TIME,
-                                     &timeout);
+                                     &timeout_tick);
                     rt_timer_start(&(thread->thread_timer));
                     rt_timer_start(&(thread->thread_timer));
                 }
                 }
                 /* enable interrupt */
                 /* enable interrupt */

+ 4 - 2
components/drivers/ipc/dataqueue.c

@@ -129,10 +129,11 @@ rt_err_t rt_data_queue_push(struct rt_data_queue *queue,
             /* start timer */
             /* start timer */
             if (timeout > 0)
             if (timeout > 0)
             {
             {
+                rt_tick_t timeout_tick = timeout;
                 /* reset the timeout of thread timer and start it */
                 /* reset the timeout of thread timer and start it */
                 rt_timer_control(&(thread->thread_timer),
                 rt_timer_control(&(thread->thread_timer),
                                 RT_TIMER_CTRL_SET_TIME,
                                 RT_TIMER_CTRL_SET_TIME,
-                                &timeout);
+                                &timeout_tick);
                 rt_timer_start(&(thread->thread_timer));
                 rt_timer_start(&(thread->thread_timer));
             }
             }
 
 
@@ -247,10 +248,11 @@ rt_err_t rt_data_queue_pop(struct rt_data_queue *queue,
             /* start timer */
             /* start timer */
             if (timeout > 0)
             if (timeout > 0)
             {
             {
+                rt_tick_t timeout_tick = timeout;
                 /* reset the timeout of thread timer and start it */
                 /* reset the timeout of thread timer and start it */
                 rt_timer_control(&(thread->thread_timer),
                 rt_timer_control(&(thread->thread_timer),
                                 RT_TIMER_CTRL_SET_TIME,
                                 RT_TIMER_CTRL_SET_TIME,
-                                &timeout);
+                                &timeout_tick);
                 rt_timer_start(&(thread->thread_timer));
                 rt_timer_start(&(thread->thread_timer));
             }
             }
 
 

+ 2 - 1
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)
             if (timeout > 0)
             {
             {
+                rt_tick_t timeout_tick = timeout;
                 rt_timer_control(&(thread->thread_timer),
                 rt_timer_control(&(thread->thread_timer),
                         RT_TIMER_CTRL_SET_TIME,
                         RT_TIMER_CTRL_SET_TIME,
-                        &timeout);
+                        &timeout_tick);
                 rt_timer_start(&(thread->thread_timer));
                 rt_timer_start(&(thread->thread_timer));
             }
             }
 
 

+ 2 - 1
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)
             if (timeout > 0)
             {
             {
+                rt_tick_t timeout_tick = timeout;
                 rt_timer_control(&(thread->thread_timer),
                 rt_timer_control(&(thread->thread_timer),
                         RT_TIMER_CTRL_SET_TIME,
                         RT_TIMER_CTRL_SET_TIME,
-                        &timeout);
+                        &timeout_tick);
                 rt_timer_start(&(thread->thread_timer));
                 rt_timer_start(&(thread->thread_timer));
                 rt_set_errno(RT_ETIMEOUT);
                 rt_set_errno(RT_ETIMEOUT);
             }
             }

+ 2 - 1
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 */
                 /* has waiting time, start thread timer */
                 if (time > 0)
                 if (time > 0)
                 {
                 {
+                    rt_tick_t time_tick = time;
                     /* reset the timeout of thread timer and start it */
                     /* reset the timeout of thread timer and start it */
                     rt_timer_control(&(thread->thread_timer),
                     rt_timer_control(&(thread->thread_timer),
                                      RT_TIMER_CTRL_SET_TIME,
                                      RT_TIMER_CTRL_SET_TIME,
-                                     &time);
+                                     &time_tick);
                     rt_timer_start(&(thread->thread_timer));
                     rt_timer_start(&(thread->thread_timer));
                 }
                 }
 
 

+ 6 - 3
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);
                 rt_thread_wakeup_set(thread_send, wakeup_sender_wait_recv, (void *)ch);
                 if (time > 0)
                 if (time > 0)
                 {
                 {
+                    rt_tick_t time_tick = time;
                     rt_timer_control(&(thread_send->thread_timer),
                     rt_timer_control(&(thread_send->thread_timer),
                                      RT_TIMER_CTRL_GET_FUNC,
                                      RT_TIMER_CTRL_GET_FUNC,
                                      &old_timeout_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 */
                     /* reset the timeout of thread timer and start it */
                     rt_timer_control(&(thread_send->thread_timer),
                     rt_timer_control(&(thread_send->thread_timer),
                                      RT_TIMER_CTRL_SET_TIME,
                                      RT_TIMER_CTRL_SET_TIME,
-                                     &time);
+                                     &time_tick);
                     rt_timer_start(&(thread_send->thread_timer));
                     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);
                 rt_thread_wakeup_set(thread_send, wakeup_sender_wait_reply, (void *)ch);
                 if (time > 0)
                 if (time > 0)
                 {
                 {
+                    rt_tick_t time_tick = time;
                     rt_timer_control(&(thread_send->thread_timer),
                     rt_timer_control(&(thread_send->thread_timer),
                                      RT_TIMER_CTRL_GET_FUNC,
                                      RT_TIMER_CTRL_GET_FUNC,
                                      &old_timeout_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 */
                     /* reset the timeout of thread timer and start it */
                     rt_timer_control(&(thread_send->thread_timer),
                     rt_timer_control(&(thread_send->thread_timer),
                                      RT_TIMER_CTRL_SET_TIME,
                                      RT_TIMER_CTRL_SET_TIME,
-                                     &time);
+                                     &time_tick);
                     rt_timer_start(&(thread_send->thread_timer));
                     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;
                 thread->error = RT_EOK;
                 if (time > 0)
                 if (time > 0)
                 {
                 {
+                    rt_tick_t time_tick = time;
                     rt_timer_control(&(thread->thread_timer),
                     rt_timer_control(&(thread->thread_timer),
                                      RT_TIMER_CTRL_GET_FUNC,
                                      RT_TIMER_CTRL_GET_FUNC,
                                      &old_timeout_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 */
                     /* reset the timeout of thread timer and start it */
                     rt_timer_control(&(thread->thread_timer),
                     rt_timer_control(&(thread->thread_timer),
                                      RT_TIMER_CTRL_SET_TIME,
                                      RT_TIMER_CTRL_SET_TIME,
-                                     &time);
+                                     &time_tick);
                     rt_timer_start(&(thread->thread_timer));
                     rt_timer_start(&(thread->thread_timer));
                 }
                 }
                 rt_spin_unlock_irqrestore(&ch->slock, level);
                 rt_spin_unlock_irqrestore(&ch->slock, level);

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

@@ -302,7 +302,7 @@ static rt_err_t rt_link_frame_send(rt_slist_t *slist)
     }
     }
     else
     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_control(&rt_link_scb->sendtimer, RT_TIMER_CTRL_SET_TIME, &timeout);
         rt_timer_start(&rt_link_scb->sendtimer);
         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))
         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_control(&rt_link_scb->longframetimer, RT_TIMER_CTRL_SET_TIME, &timeout);
             rt_timer_start(&rt_link_scb->longframetimer);
             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_command_frame_send(RT_LINK_SERVICE_RTLINK, seq,
                                    RT_LINK_HANDSHAKE_FRAME, rt_link_scb->rx_record.rx_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_control(&rt_link_scb->sendtimer, RT_TIMER_CTRL_SET_TIME, &timeout);
         rt_timer_start(&rt_link_scb->sendtimer);
         rt_timer_start(&rt_link_scb->sendtimer);
     }
     }

+ 2 - 1
components/vbus/prio_queue.c

@@ -209,9 +209,10 @@ rt_err_t rt_prio_queue_pop(struct rt_prio_queue *que,
 
 
         if (timeout > 0)
         if (timeout > 0)
         {
         {
+            rt_tick_t timeout_tick = timeout;
             rt_timer_control(&(thread->thread_timer),
             rt_timer_control(&(thread->thread_timer),
                              RT_TIMER_CTRL_SET_TIME,
                              RT_TIMER_CTRL_SET_TIME,
-                             &timeout);
+                             &timeout_tick);
             rt_timer_start(&(thread->thread_timer));
             rt_timer_start(&(thread->thread_timer));
         }
         }
 
 

+ 2 - 1
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));
         rt_list_insert_after(&_chn_suspended_threads[id], &RT_THREAD_LIST_NODE(thread));
         if (timeout > 0)
         if (timeout > 0)
         {
         {
+            rt_tick_t timeout_tick = timeout;
             rt_timer_control(&(thread->thread_timer),
             rt_timer_control(&(thread->thread_timer),
                              RT_TIMER_CTRL_SET_TIME,
                              RT_TIMER_CTRL_SET_TIME,
-                             &timeout);
+                             &timeout_tick);
             rt_timer_start(&(thread->thread_timer));
             rt_timer_start(&(thread->thread_timer));
         }
         }
         /* rt_exit_critical will do schedule on need. */
         /* rt_exit_critical will do schedule on need. */

+ 2 - 1
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));
         rt_list_insert_after(&wg->suspended_threads, &RT_THREAD_LIST_NODE(thread));
         if (timeout > 0)
         if (timeout > 0)
         {
         {
+            rt_tick_t timeout_tick = timeout;
             rt_timer_control(&(thread->thread_timer),
             rt_timer_control(&(thread->thread_timer),
                              RT_TIMER_CTRL_SET_TIME,
                              RT_TIMER_CTRL_SET_TIME,
-                             &timeout);
+                             &timeout_tick);
             rt_timer_start(&(thread->thread_timer));
             rt_timer_start(&(thread->thread_timer));
         }
         }
         rt_hw_interrupt_enable(level);
         rt_hw_interrupt_enable(level);

+ 14 - 7
src/ipc.c

@@ -614,12 +614,13 @@ static rt_err_t _rt_sem_take(rt_sem_t sem, rt_int32_t timeout, int suspend_flag)
             /* has waiting time, start thread timer */
             /* has waiting time, start thread timer */
             if (timeout > 0)
             if (timeout > 0)
             {
             {
+                rt_tick_t timeout_tick = timeout;
                 LOG_D("set thread:%s to timer list", thread->parent.name);
                 LOG_D("set thread:%s to timer list", thread->parent.name);
 
 
                 /* reset the timeout of thread timer and start it */
                 /* reset the timeout of thread timer and start it */
                 rt_timer_control(&(thread->thread_timer),
                 rt_timer_control(&(thread->thread_timer),
                                  RT_TIMER_CTRL_SET_TIME,
                                  RT_TIMER_CTRL_SET_TIME,
-                                 &timeout);
+                                 &timeout_tick);
                 rt_timer_start(&(thread->thread_timer));
                 rt_timer_start(&(thread->thread_timer));
             }
             }
 
 
@@ -1433,13 +1434,14 @@ static rt_err_t _rt_mutex_take(rt_mutex_t mutex, rt_int32_t timeout, int suspend
                 /* has waiting time, start thread timer */
                 /* has waiting time, start thread timer */
                 if (timeout > 0)
                 if (timeout > 0)
                 {
                 {
+                    rt_tick_t timeout_tick = timeout;
                     LOG_D("mutex_take: start the timer of thread:%s",
                     LOG_D("mutex_take: start the timer of thread:%s",
                           thread->parent.name);
                           thread->parent.name);
 
 
                     /* reset the timeout of thread timer and start it */
                     /* reset the timeout of thread timer and start it */
                     rt_timer_control(&(thread->thread_timer),
                     rt_timer_control(&(thread->thread_timer),
                                      RT_TIMER_CTRL_SET_TIME,
                                      RT_TIMER_CTRL_SET_TIME,
-                                     &timeout);
+                                     &timeout_tick);
                     rt_timer_start(&(thread->thread_timer));
                     rt_timer_start(&(thread->thread_timer));
                 }
                 }
 
 
@@ -2186,10 +2188,11 @@ static rt_err_t _rt_event_recv(rt_event_t   event,
         /* if there is a waiting timeout, active thread timer */
         /* if there is a waiting timeout, active thread timer */
         if (timeout > 0)
         if (timeout > 0)
         {
         {
+            rt_tick_t timeout_tick = timeout;
             /* reset the timeout of thread timer and start it */
             /* reset the timeout of thread timer and start it */
             rt_timer_control(&(thread->thread_timer),
             rt_timer_control(&(thread->thread_timer),
                              RT_TIMER_CTRL_SET_TIME,
                              RT_TIMER_CTRL_SET_TIME,
-                             &timeout);
+                             &timeout_tick);
             rt_timer_start(&(thread->thread_timer));
             rt_timer_start(&(thread->thread_timer));
         }
         }
 
 
@@ -2621,6 +2624,7 @@ static rt_err_t _rt_mb_send_wait(rt_mailbox_t mb,
         /* has waiting time, start thread timer */
         /* has waiting time, start thread timer */
         if (timeout > 0)
         if (timeout > 0)
         {
         {
+            rt_tick_t timeout_tick = timeout;
             /* get the start tick of timer */
             /* get the start tick of timer */
             tick_delta = rt_tick_get();
             tick_delta = rt_tick_get();
 
 
@@ -2630,7 +2634,7 @@ static rt_err_t _rt_mb_send_wait(rt_mailbox_t mb,
             /* reset the timeout of thread timer and start it */
             /* reset the timeout of thread timer and start it */
             rt_timer_control(&(thread->thread_timer),
             rt_timer_control(&(thread->thread_timer),
                              RT_TIMER_CTRL_SET_TIME,
                              RT_TIMER_CTRL_SET_TIME,
-                             &timeout);
+                             &timeout_tick);
             rt_timer_start(&(thread->thread_timer));
             rt_timer_start(&(thread->thread_timer));
         }
         }
         rt_spin_unlock_irqrestore(&(mb->spinlock), level);
         rt_spin_unlock_irqrestore(&(mb->spinlock), level);
@@ -2901,6 +2905,7 @@ static rt_err_t _rt_mb_recv(rt_mailbox_t mb, rt_ubase_t *value, rt_int32_t timeo
         /* has waiting time, start thread timer */
         /* has waiting time, start thread timer */
         if (timeout > 0)
         if (timeout > 0)
         {
         {
+            rt_tick_t timeout_tick = timeout;
             /* get the start tick of timer */
             /* get the start tick of timer */
             tick_delta = rt_tick_get();
             tick_delta = rt_tick_get();
 
 
@@ -2910,7 +2915,7 @@ static rt_err_t _rt_mb_recv(rt_mailbox_t mb, rt_ubase_t *value, rt_int32_t timeo
             /* reset the timeout of thread timer and start it */
             /* reset the timeout of thread timer and start it */
             rt_timer_control(&(thread->thread_timer),
             rt_timer_control(&(thread->thread_timer),
                              RT_TIMER_CTRL_SET_TIME,
                              RT_TIMER_CTRL_SET_TIME,
-                             &timeout);
+                             &timeout_tick);
             rt_timer_start(&(thread->thread_timer));
             rt_timer_start(&(thread->thread_timer));
         }
         }
 
 
@@ -3446,6 +3451,7 @@ static rt_err_t _rt_mq_send_wait(rt_mq_t mq,
         /* has waiting time, start thread timer */
         /* has waiting time, start thread timer */
         if (timeout > 0)
         if (timeout > 0)
         {
         {
+            rt_tick_t timeout_tick = timeout;
             /* get the start tick of timer */
             /* get the start tick of timer */
             tick_delta = rt_tick_get();
             tick_delta = rt_tick_get();
 
 
@@ -3455,7 +3461,7 @@ static rt_err_t _rt_mq_send_wait(rt_mq_t mq,
             /* reset the timeout of thread timer and start it */
             /* reset the timeout of thread timer and start it */
             rt_timer_control(&(thread->thread_timer),
             rt_timer_control(&(thread->thread_timer),
                              RT_TIMER_CTRL_SET_TIME,
                              RT_TIMER_CTRL_SET_TIME,
-                             &timeout);
+                             &timeout_tick);
             rt_timer_start(&(thread->thread_timer));
             rt_timer_start(&(thread->thread_timer));
         }
         }
 
 
@@ -3825,6 +3831,7 @@ static rt_ssize_t _rt_mq_recv(rt_mq_t mq,
         /* has waiting time, start thread timer */
         /* has waiting time, start thread timer */
         if (timeout > 0)
         if (timeout > 0)
         {
         {
+            rt_tick_t timeout_tick = timeout;
             /* get the start tick of timer */
             /* get the start tick of timer */
             tick_delta = rt_tick_get();
             tick_delta = rt_tick_get();
 
 
@@ -3834,7 +3841,7 @@ static rt_ssize_t _rt_mq_recv(rt_mq_t mq,
             /* reset the timeout of thread timer and start it */
             /* reset the timeout of thread timer and start it */
             rt_timer_control(&(thread->thread_timer),
             rt_timer_control(&(thread->thread_timer),
                              RT_TIMER_CTRL_SET_TIME,
                              RT_TIMER_CTRL_SET_TIME,
-                             &timeout);
+                             &timeout_tick);
             rt_timer_start(&(thread->thread_timer));
             rt_timer_start(&(thread->thread_timer));
         }
         }
 
 

+ 2 - 1
src/mempool.c

@@ -314,13 +314,14 @@ void *rt_mp_alloc(rt_mp_t mp, rt_int32_t time)
 
 
         if (time > 0)
         if (time > 0)
         {
         {
+            rt_tick_t time_tick = time;
             /* get the start tick of timer */
             /* get the start tick of timer */
             before_sleep = rt_tick_get();
             before_sleep = rt_tick_get();
 
 
             /* init thread timer and start it */
             /* init thread timer and start it */
             rt_timer_control(&(thread->thread_timer),
             rt_timer_control(&(thread->thread_timer),
                              RT_TIMER_CTRL_SET_TIME,
                              RT_TIMER_CTRL_SET_TIME,
-                             &time);
+                             &time_tick);
             rt_timer_start(&(thread->thread_timer));
             rt_timer_start(&(thread->thread_timer));
         }
         }
 
 

+ 2 - 1
src/signal.c

@@ -369,10 +369,11 @@ int rt_signal_wait(const rt_sigset_t *set, rt_siginfo_t *si, rt_int32_t timeout)
     /* start timeout timer */
     /* start timeout timer */
     if (timeout != RT_WAITING_FOREVER)
     if (timeout != RT_WAITING_FOREVER)
     {
     {
+        rt_tick_t timeout_tick = timeout;
         /* reset the timeout of thread timer and start it */
         /* reset the timeout of thread timer and start it */
         rt_timer_control(&(tid->thread_timer),
         rt_timer_control(&(tid->thread_timer),
                          RT_TIMER_CTRL_SET_TIME,
                          RT_TIMER_CTRL_SET_TIME,
-                         &timeout);
+                         &timeout_tick);
         rt_timer_start(&(tid->thread_timer));
         rt_timer_start(&(tid->thread_timer));
     }
     }
     rt_spin_unlock_irqrestore(&_thread_signal_lock, level);
     rt_spin_unlock_irqrestore(&_thread_signal_lock, level);