Skip to content

Commit f00ca7d

Browse files
authored
Align the frame buffers to the structure alignment
cc: esp-rs/esp-idf-sys#278 cc: esp-rs/rust#195
1 parent dba8da9 commit f00ca7d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

driver/cam_hal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ static esp_err_t cam_dma_config(const camera_config_t *config)
265265
cam_obj->dma_buffer = NULL;
266266
cam_obj->dma = NULL;
267267

268-
cam_obj->frames = (cam_frame_t *)heap_caps_calloc(1, cam_obj->frame_cnt * sizeof(cam_frame_t), MALLOC_CAP_DEFAULT);
268+
cam_obj->frames = (cam_frame_t *)heap_caps_aligned_calloc(alignof(cam_frame_t), 1, cam_obj->frame_cnt * sizeof(cam_frame_t), MALLOC_CAP_DEFAULT);
269269
CAM_CHECK(cam_obj->frames != NULL, "frames malloc failed", ESP_FAIL);
270270

271271
uint8_t dma_align = 0;

0 commit comments

Comments
 (0)