feat: remove background cam every time

This commit is contained in:
0Xiao0
2026-05-29 14:53:58 +08:00
parent 33ee598c21
commit b92e6e1b07
3 changed files with 32 additions and 17 deletions

View File

@ -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;
}