在close中增加延时
authorzwj <645281962@qq.com>
Wed, 24 May 2023 03:50:20 +0000 (11:50 +0800)
committerzwj <645281962@qq.com>
Wed, 24 May 2023 03:50:20 +0000 (11:50 +0800)
tof/src/tof.c

index c1b661bf5354b9ffcfd150c22f16f4d1c82841ad..cdd7a5d0e2eaa324031ba9cb53103051a6a48015 100644 (file)
@@ -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);