File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -29,10 +29,11 @@ static camera_config_t camera_config = {
29
29
.fb_count = 2 ,
30
30
.fb_location = CAMERA_FB_IN_PSRAM,
31
31
.grab_mode = CAMERA_GRAB_WHEN_EMPTY,
32
- .sccb_i2c_port = 0 ,
32
+ .sccb_i2c_port = 1 ,
33
33
};
34
34
35
35
bool Camera_Class::begin () {
36
+ config = &camera_config;
36
37
esp_err_t err = esp_camera_init (&camera_config);
37
38
if (err != ESP_OK) {
38
39
return false ;
@@ -41,6 +42,14 @@ bool Camera_Class::begin() {
41
42
return true ;
42
43
}
43
44
45
+ bool Camera_Class::deinit () {
46
+ esp_err_t err = esp_camera_deinit ();
47
+ if (err != ESP_OK) {
48
+ return false ;
49
+ }
50
+ return true ;
51
+ }
52
+
44
53
bool Camera_Class::get () {
45
54
fb = esp_camera_fb_get ();
46
55
if (!fb) {
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ class Camera_Class {
38
38
bool begin ();
39
39
bool get ();
40
40
bool free ();
41
+ bool deinit ();
41
42
};
42
43
43
44
#endif
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ static std::uint8_t byteToBcd2(std::uint8_t value) {
29
29
}
30
30
31
31
bool RTC8563_Class::begin () {
32
- _i2c.begin (&Wire1 , 12 , 14 );
32
+ _i2c.begin (&Wire , 12 , 14 );
33
33
_i2c.writeByte (BM8563_I2C_ADDR, 0x00 , 0x00 );
34
34
return _i2c.writeByte (BM8563_I2C_ADDR, 0x0E , 0x03 );
35
35
;
You can’t perform that action at this time.
0 commit comments