📷 Adds support for esp32-wroom-camera

This commit is contained in:
Rune Harlyk
2024-06-17 22:19:32 +02:00
committed by Rune Harlyk
parent 0880f569b7
commit efb45218af
5 changed files with 1299 additions and 1273 deletions
+5 -2
View File
@@ -78,7 +78,9 @@ esp_err_t CameraService::InitializeCamera() {
if (psramFound()) {
camera_config.frame_size = FRAMESIZE_SVGA;
camera_config.jpeg_quality = 10;
camera_config.fb_location = CAMERA_FB_IN_PSRAM;
camera_config.fb_count = 2;
camera_config.grab_mode = CAMERA_GRAB_LATEST;
} else {
camera_config.frame_size = FRAMESIZE_SVGA;
camera_config.jpeg_quality = 12;
@@ -87,7 +89,8 @@ esp_err_t CameraService::InitializeCamera() {
log_i("Initializing camera");
esp_err_t err = esp_camera_init(&camera_config);
if (err != ESP_OK) log_e("Camera probe failed with error 0x%x", err);
if (err == ESP_OK) ESP_LOGI("CameraService", "Camera probe successful");
else ESP_LOGE("CameraService", "Camera probe failed with error 0x%x", err);
return err;
}
@@ -95,7 +98,7 @@ esp_err_t CameraService::InitializeCamera() {
esp_err_t CameraService::cameraStill(PsychicRequest *request) {
camera_fb_t *fb = safe_camera_fb_get();
if (!fb) {
Serial.println("Camera capture failed");
ESP_LOGE("CameraService", "Camera capture failed");
request->reply(500, "text/plain", "Camera capture failed");
return ESP_FAIL;
}