Skip to content

Commit

Permalink
Update esp32_camera.c
Browse files Browse the repository at this point in the history
Fix compilation failed if log enabled
  • Loading branch information
luc-github committed May 1, 2024
1 parent 8a8d4a1 commit 74fc2f0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions hardware/drivers_common/camera/esp32_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@
*********************/

#include "esp32_camera.h"

#include <string.h>

#include "esp3d_log.h"



/**********************
* STATIC VARIABLES
**********************/
Expand Down Expand Up @@ -73,16 +72,16 @@ esp_err_t esp32_camera_init(const esp32_camera_config_t *config) {
_camera_pin_led = config->pin_led;
}
// Save camera name
_camera_name = (char *)calloc(strlen(config->name) + 1, sizeof(char));
_camera_name = (char *)calloc(strlen(config->name) + 1, sizeof(char));
if (_camera_name == NULL) {
esp3d_log_e("Camera name allocation failed");
return ESP_ERR_NO_MEM;
}
_camera_name = strcpy(_camera_name, config->name);

// Initilize camera
esp3d_log("Camera init") esp_err_t err =
esp_camera_init(&(config->hw_config));
esp3d_log("Camera init");
esp_err_t err = esp_camera_init(&(config->hw_config));
if (err != ESP_OK) {
esp3d_log_e("Camera init failed with error 0x%x", err);
return err;
Expand Down

0 comments on commit 74fc2f0

Please sign in to comment.