Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add delay in InitCam #3313

Merged
merged 3 commits into from
Oct 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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