diff --git a/src/utility/Camera_Class.cpp b/src/utility/Camera_Class.cpp index 8be6f84..162963c 100644 --- a/src/utility/Camera_Class.cpp +++ b/src/utility/Camera_Class.cpp @@ -29,10 +29,11 @@ static camera_config_t camera_config = { .fb_count = 2, .fb_location = CAMERA_FB_IN_PSRAM, .grab_mode = CAMERA_GRAB_WHEN_EMPTY, - .sccb_i2c_port = 0, + .sccb_i2c_port = 1, }; bool Camera_Class::begin() { + config = &camera_config; esp_err_t err = esp_camera_init(&camera_config); if (err != ESP_OK) { return false; @@ -41,6 +42,14 @@ bool Camera_Class::begin() { return true; } +bool Camera_Class::deinit() { + esp_err_t err = esp_camera_deinit(); + if (err != ESP_OK) { + return false; + } + return true; +} + bool Camera_Class::get() { fb = esp_camera_fb_get(); if (!fb) { diff --git a/src/utility/Camera_Class.h b/src/utility/Camera_Class.h index b9ecf59..56594ae 100644 --- a/src/utility/Camera_Class.h +++ b/src/utility/Camera_Class.h @@ -38,6 +38,7 @@ class Camera_Class { bool begin(); bool get(); bool free(); + bool deinit(); }; #endif \ No newline at end of file diff --git a/src/utility/RTC8563_Class.cpp b/src/utility/RTC8563_Class.cpp index 3ea55b8..6986592 100644 --- a/src/utility/RTC8563_Class.cpp +++ b/src/utility/RTC8563_Class.cpp @@ -29,7 +29,7 @@ static std::uint8_t byteToBcd2(std::uint8_t value) { } bool RTC8563_Class::begin() { - _i2c.begin(&Wire1, 12, 14); + _i2c.begin(&Wire, 12, 14); _i2c.writeByte(BM8563_I2C_ADDR, 0x00, 0x00); return _i2c.writeByte(BM8563_I2C_ADDR, 0x0E, 0x03); ;