Browse Source

Align the frame buffers to the structure alignment (#623)

* Align the frame buffers to the structure alignment 

cc: https://github.com/esp-rs/esp-idf-sys/issues/278
cc: https://github.com/esp-rs/rust/pull/195

* Include stdalign.h
pull/625/head
Me No Dev 1 year ago committed by GitHub
parent
commit
8df17f7286
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      driver/cam_hal.c

3
driver/cam_hal.c

@ -14,6 +14,7 @@ @@ -14,6 +14,7 @@
#include <stdio.h>
#include <string.h>
#include <stdalign.h>
#include "esp_heap_caps.h"
#include "ll_cam.h"
#include "cam_hal.h"
@ -265,7 +266,7 @@ static esp_err_t cam_dma_config(const camera_config_t *config) @@ -265,7 +266,7 @@ static esp_err_t cam_dma_config(const camera_config_t *config)
cam_obj->dma_buffer = NULL;
cam_obj->dma = NULL;
cam_obj->frames = (cam_frame_t *)heap_caps_calloc(1, cam_obj->frame_cnt * sizeof(cam_frame_t), MALLOC_CAP_DEFAULT);
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);
CAM_CHECK(cam_obj->frames != NULL, "frames malloc failed", ESP_FAIL);
uint8_t dma_align = 0;

Loading…
Cancel
Save