From 9bf72836b1ac78dd9c74e1341d5013994d586105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9E=BF=E7=AB=A5?= <884299658@qq.com> Date: Thu, 11 May 2023 11:09:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- smarttimer/smarttimer.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/smarttimer/smarttimer.c b/smarttimer/smarttimer.c index f357c64..a907b51 100644 --- a/smarttimer/smarttimer.c +++ b/smarttimer/smarttimer.c @@ -251,9 +251,8 @@ static struct stim_event* find_event ( int8_t id, struct stim_event_list *list ) * Description: insert an event which stat is STIM_EVENT_RECYCLE into recycle linked * ===================================================================================== */ -static void recyle_event ( struct stim_event *event ) +static void recyle_event ( struct stim_event *event ,struct stim_event_list *list) { - struct stim_event_list *list = &list_manager.list[list_manager.cur_index]; remove_node(event,list); insert_to_tail(event,&recycle_list); @@ -391,7 +390,7 @@ void stim_remove_event(int8_t id) event = find_event(id,list); if(event != NULL){ event->stat = STIM_EVENT_RECYCLE; - recyle_event(event); + recyle_event(event,list); break; } } @@ -428,7 +427,7 @@ void stim_tick (void) if((event->looptimes != STIM_LOOP_FOREVER) && (--event->looptimes == 0)){ event->stat = STIM_EVENT_RECYCLE; - recyle_event(event); + recyle_event(event,list); }else{ event->tick_punch = current_tick + event->interval; remove_node(event,list);