feat: add icon beaver

This commit is contained in:
0Xiao0
2026-05-29 11:22:31 +08:00
parent 37343ac0fe
commit 33ee598c21
3 changed files with 10 additions and 2 deletions

View File

@ -682,6 +682,10 @@ void Application::ToggleChatStateWithVision() {
xEventGroupSetBits(event_group_, MAIN_EVENT_TOGGLE_CHAT); xEventGroupSetBits(event_group_, MAIN_EVENT_TOGGLE_CHAT);
} }
bool Application::IsVisionTextModeEnabled() const {
return vision_text_mode_enabled_.load();
}
void Application::StartListening() { void Application::StartListening() {
vision_text_mode_enabled_.store(false); vision_text_mode_enabled_.store(false);
xEventGroupSetBits(event_group_, MAIN_EVENT_START_LISTENING); xEventGroupSetBits(event_group_, MAIN_EVENT_START_LISTENING);
@ -968,7 +972,7 @@ void Application::SendCurrentVisionFrame() {
} }
std::string jpeg_data; std::string jpeg_data;
if (!camera->CaptureToJpeg(jpeg_data, false)) { if (!camera->CaptureToJpeg(jpeg_data, true)) {
ESP_LOGW(TAG, "Failed to capture vision frame"); ESP_LOGW(TAG, "Failed to capture vision frame");
return; return;
} }

View File

@ -93,6 +93,7 @@ public:
*/ */
void ToggleChatState(); void ToggleChatState();
void ToggleChatStateWithVision(); void ToggleChatStateWithVision();
bool IsVisionTextModeEnabled() const;
/** /**
* Start listening (event-based, thread-safe) * Start listening (event-based, thread-safe)

View File

@ -349,7 +349,10 @@ private:
continue; continue;
} }
if (board->camera_->CaptureBackground()) { bool capture_ok = Application::GetInstance().IsVisionTextModeEnabled()
? board->camera_->Capture()
: board->camera_->CaptureBackground();
if (capture_ok) {
if (!has_logged_success) { if (!has_logged_success) {
ESP_LOGI(TAG, "Background vision sampler started"); ESP_LOGI(TAG, "Background vision sampler started");
has_logged_success = true; has_logged_success = true;