File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -193,7 +193,6 @@ static void cam_task(void *arg)
193
193
if (cam_obj -> fb_size < (frame_buffer_event -> len + pixels_per_dma )) {
194
194
ESP_LOGW (TAG , "FB-OVF" );
195
195
ll_cam_stop (cam_obj );
196
- DBG_PIN_SET (0 );
197
196
continue ;
198
197
}
199
198
frame_buffer_event -> len += ll_cam_memcpy (cam_obj ,
@@ -207,6 +206,14 @@ static void cam_task(void *arg)
207
206
cam_obj -> state = CAM_STATE_IDLE ;
208
207
}
209
208
cnt ++ ;
209
+ // stop when too many DMA copies occur so the PSRAM
210
+ // framebuffer slot doesn't overflow from runaway transfers
211
+ if (cnt >= cam_obj -> frame_copy_cnt ) {
212
+ ESP_LOGE (TAG , "DMA overflow" );
213
+ ll_cam_stop (cam_obj );
214
+ cam_obj -> state = CAM_STATE_IDLE ;
215
+ continue ;
216
+ }
210
217
211
218
} else if (cam_event == CAM_VSYNC_EVENT ) {
212
219
//DBG_PIN_SET(1);
You can’t perform that action at this time.
0 commit comments