Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/utility/GC0308.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,19 @@ static camera_config_t camera_config = {
.sccb_i2c_port = -1,
};

bool GC0308::begin()
GC0308::GC0308() {
fb = nullptr;
sensor = nullptr;
config = &camera_config;
}

bool GC0308::begin(camera_config_t* _config)
{
M5.In_I2C.release();
esp_err_t err = esp_camera_init(&camera_config);
if (_config) {
config = _config;
}
esp_err_t err = esp_camera_init(config);
if (err != ESP_OK) {
return false;
}
Expand Down
4 changes: 3 additions & 1 deletion src/utility/GC0308.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ class GC0308 {
camera_fb_t* fb;
sensor_t* sensor;
camera_config_t* config;
bool begin();

GC0308();
bool begin(camera_config_t* _config = nullptr);
bool get();
bool free();
};
Expand Down