From: zwj <645281962@qq.com> Date: Wed, 24 May 2023 03:50:20 +0000 (+0800) Subject: 在close中增加延时 X-Git-Url: http://kyz.pub/gitweb/?a=commitdiff_plain;h=23c702faffb9166a5fb23019ea545f731a7be8bb;p=yn%2Falarmmonitor.git 在close中增加延时 --- diff --git a/tof/src/tof.c b/tof/src/tof.c index c1b661b..cdd7a5d 100644 --- a/tof/src/tof.c +++ b/tof/src/tof.c @@ -2134,6 +2134,7 @@ void* tof_task(void* data) if(my_info->status != TOF_ANYBODY){ my_info->distance = range; my_info->status = TOF_ANYBODY; + printf("you ren\n"); if(tof_event != NULL){ tof_event(my_info); } @@ -2143,6 +2144,7 @@ void* tof_task(void* data) if(my_info->status != TOF_NOBODY){ my_info->distance = range; my_info->status = TOF_NOBODY; + printf("wu ren\n"); if(tof_event != NULL){ tof_event(my_info); } @@ -2159,6 +2161,7 @@ void* tof_task(void* data) my_info->distance = range1; my_info->status = TOF_FIXED_BARRIER; distanceThreshold = range1; + printf("zhang ai wu\n"); if(tof_event != NULL){ tof_event(my_info); } @@ -2238,6 +2241,7 @@ error: void mg_tof_close( mg_tof_t * tof_ctrl ) { stop = 0; + usleep(30); mg_tof_disable(NULL); free(my_tof); free(my_info);