feat: remove background cam every time
This commit is contained in:
@ -344,21 +344,23 @@ private:
|
||||
vTaskDelay(pdMS_TO_TICKS(BACKGROUND_VISION_INITIAL_DELAY_MS));
|
||||
|
||||
while (true) {
|
||||
if (!Application::GetInstance().IsVisionTextModeEnabled()) {
|
||||
vTaskDelay(pdMS_TO_TICKS(BACKGROUND_VISION_SAMPLE_INTERVAL_MS));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (board->camera_ == nullptr) {
|
||||
vTaskDelay(pdMS_TO_TICKS(BACKGROUND_VISION_SAMPLE_INTERVAL_MS));
|
||||
continue;
|
||||
}
|
||||
|
||||
bool capture_ok = Application::GetInstance().IsVisionTextModeEnabled()
|
||||
? board->camera_->Capture()
|
||||
: board->camera_->CaptureBackground();
|
||||
if (capture_ok) {
|
||||
if (board->camera_->Capture()) {
|
||||
if (!has_logged_success) {
|
||||
ESP_LOGI(TAG, "Background vision sampler started");
|
||||
ESP_LOGI(TAG, "Vision preview sampler started");
|
||||
has_logged_success = true;
|
||||
}
|
||||
} else if (!has_logged_failure) {
|
||||
ESP_LOGW(TAG, "Background vision sampler is waiting for camera");
|
||||
ESP_LOGW(TAG, "Vision preview sampler is waiting for camera");
|
||||
has_logged_failure = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user