Update main.cpp

If the camera could only be initialized on the second attempt, "Camera Framebuffer Check" and "Print camera infos" was skipped.
This commit is contained in:
SybexX
2025-02-16 12:01:30 +01:00
committed by GitHub
parent e60c12b25d
commit 26770d877e

View File

@@ -122,7 +122,7 @@ bool Init_NVS_SDCard()
if (ret != ESP_OK)
{
ESP_LOGE(TAG, "Failed to create a new on-chip LDO power control driver");
return ret;
return false;
}
host.pwr_ctrl_handle = pwr_ctrl_handle;
#endif
@@ -174,7 +174,7 @@ bool Init_NVS_SDCard()
.format_if_mount_failed = false,
.max_files = 12, // previously -> 2022-09-21: 5, 2023-01-02: 7
.allocation_unit_size = 0, // 0 = auto
.disk_status_check_enable = 0
.disk_status_check_enable = 0,
};
sdmmc_card_t* card;
@@ -291,7 +291,7 @@ extern "C" void app_main(void)
setSystemStatusFlag(SYSTEM_STATUS_HEAP_TOO_SMALL);
StatusLED(PSRAM_INIT, 3, true);
}
else { // OK
else { // PSRAM OK
// Init camera
// ********************************************
PowerResetCamera();
@@ -322,10 +322,12 @@ extern "C" void app_main(void)
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Camera init failed (" + std::string(camStatusHex) +
")! Check camera module and/or proper electrical connection");
setSystemStatusFlag(SYSTEM_STATUS_CAM_BAD);
Camera.LightOnOff(false); // make sure flashlight is off
StatusLED(CAM_INIT, 1, true);
}
}
else { // ESP_OK -> Camera init OK --> continue to perform camera framebuffer check
if (camStatus == ESP_OK) { // ESP_OK -> Camera init OK --> continue to perform camera framebuffer check
// Camera framebuffer check
// ********************************************
if (!Camera.testCamera()) {