Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bd61723

Browse files
committed
Fix OV2640 not being reset when OV3660 is enabled
1 parent 67cf240 commit bd61723

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

driver/camera.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,17 @@ esp_err_t camera_probe(const camera_config_t* config, camera_model_t* out_camera
992992
ESP_LOGD(TAG, "Detected camera at address=0x%02x", s_state->sensor.slv_addr);
993993
sensor_id_t* id = &s_state->sensor.id;
994994

995+
#if (CONFIG_OV2640_SUPPORT && CONFIG_OV3660_SUPPORT)
996+
if (slv_addr == 0x30) {
997+
ESP_LOGD(TAG, "Resetting OV2640");
998+
//camera might be OV2640. try to reset it
999+
SCCB_Write(0x30, 0xFF, 0x01);//bank sensor
1000+
SCCB_Write(0x30, 0x12, 0x80);//reset
1001+
vTaskDelay(10 / portTICK_PERIOD_MS);
1002+
slv_addr = SCCB_Probe();
1003+
}
1004+
#endif
1005+
9951006
#if CONFIG_OV3660_SUPPORT
9961007
if(s_state->sensor.slv_addr == 0x3c){
9971008
id->PID = SCCB_Read16(s_state->sensor.slv_addr, REG16_CHIDH);

0 commit comments

Comments
 (0)