File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -435,7 +435,7 @@ esp_err_t cam_deinit(void)
435435 }
436436
437437 ll_cam_deinit (cam_obj );
438-
438+
439439 if (cam_obj -> dma ) {
440440 free (cam_obj -> dma );
441441 }
@@ -484,7 +484,11 @@ camera_fb_t *cam_take(TickType_t timeout)
484484 } else {
485485 ESP_LOGW (TAG , "NO-EOI" );
486486 cam_give (dma_buffer );
487- return cam_take (timeout - (xTaskGetTickCount () - start ));//recurse!!!!
487+ TickType_t ticks_spent = xTaskGetTickCount () - start ;
488+ if (ticks_spent >= timeout ) {
489+ return NULL ; /* We are out of time */
490+ }
491+ return cam_take (timeout - ticks_spent );//recurse!!!!
488492 }
489493 } else if (cam_obj -> psram_mode && cam_obj -> in_bytes_per_pixel != cam_obj -> fb_bytes_per_pixel ){
490494 //currently this is used only for YUV to GRAYSCALE
You can’t perform that action at this time.
0 commit comments