Skip to content

Commit

Permalink
Update ClassControllCamera.cpp (#3313)
Browse files Browse the repository at this point in the history
  • Loading branch information
SybexX authored Oct 6, 2024
1 parent f034232 commit 6ee83b8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions code/components/jomjol_controlcamera/ClassControllCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,18 @@ esp_err_t CCamera::InitCam(void)
{
ESP_LOGD(TAG, "Init Camera");

TickType_t cam_xDelay = 100 / portTICK_PERIOD_MS;

CCstatus.ImageQuality = camera_config.jpeg_quality;
CCstatus.ImageFrameSize = camera_config.frame_size;

// De-init in case it was already initialized
esp_camera_deinit();
vTaskDelay(cam_xDelay);

// initialize the camera
esp_camera_deinit(); // De-init in case it was already initialized
esp_err_t err = esp_camera_init(&camera_config);
vTaskDelay(cam_xDelay);

if (err != ESP_OK)
{
Expand Down Expand Up @@ -280,8 +286,8 @@ esp_err_t CCamera::setSensorDatenFromCCstatus(void)

s->set_dcw(s, CCstatus.ImageDcw); // 0 = disable , 1 = enable

TickType_t xDelay2 = 100 / portTICK_PERIOD_MS;
vTaskDelay(xDelay2);
TickType_t cam_xDelay = 100 / portTICK_PERIOD_MS;
vTaskDelay(cam_xDelay);

return ESP_OK;
}
Expand Down

0 comments on commit 6ee83b8

Please sign in to comment.