fix(screen): streamline runtime display states

This commit is contained in:
admin
2026-04-30 10:07:25 +08:00
parent 7e77c6809a
commit d83180975d
9 changed files with 841 additions and 154 deletions

View File

@@ -77,7 +77,7 @@ static void voice_mic_key_handle_press_down(void) {
if (voice.tap_active) {
ESP_LOGI(TAG, "MIC_KEY press ignored: tap already active");
voice_mic_key_show_status("语音已在录制中");
(void)screen_preview_show_event(SCREEN_PREVIEW_EVENT_VOICE_LISTENING, NULL);
return;
}
@@ -90,12 +90,12 @@ static void voice_mic_key_handle_press_down(void) {
voice.marker_image_gen_running,
printer.busy,
printer.queue_depth);
voice_mic_key_show_status("设备忙碌中\n请等待当前任务完成");
(void)screen_preview_show_event(SCREEN_PREVIEW_EVENT_DEVICE_BUSY, NULL);
return;
}
if (!voice_mic_key_session_ready(&voice)) {
voice_mic_key_show_status("语音连接中...\n请稍候");
(void)screen_preview_show_event(SCREEN_PREVIEW_EVENT_VOICE_CONNECTING, NULL);
char start_err[128] = {0};
esp_err_t start_rc = voice_interaction_start_with_timeout(0, start_err, sizeof(start_err));
if (start_rc != ESP_OK) {
@@ -103,7 +103,7 @@ static void voice_mic_key_handle_press_down(void) {
"MIC_KEY auto session start failed: %s (%s)",
esp_err_to_name(start_rc),
start_err[0] != '\0' ? start_err : "-");
voice_mic_key_show_status("语音连接失败\n请稍后重试");
(void)screen_preview_show_event(SCREEN_PREVIEW_EVENT_VOICE_ERROR, NULL);
return;
}
}
@@ -115,7 +115,7 @@ static void voice_mic_key_handle_press_down(void) {
voice.session_active,
voice.ws_connected,
voice.started);
voice_mic_key_show_status("语音服务暂不可用\n请稍后重试");
(void)screen_preview_show_event(SCREEN_PREVIEW_EVENT_VOICE_ERROR, NULL);
return;
}
@@ -130,7 +130,7 @@ static void voice_mic_key_handle_press_down(void) {
return;
}
voice_mic_key_show_status("请开始说话");
(void)screen_preview_show_event(SCREEN_PREVIEW_EVENT_VOICE_LISTENING, NULL);
ESP_LOGI(TAG, "MIC_KEY tap started");
}
@@ -152,7 +152,7 @@ static void voice_mic_key_handle_press_up(void) {
return;
}
voice_mic_key_show_status("已结束录音\n正在处理...");
(void)screen_preview_show_event(SCREEN_PREVIEW_EVENT_VOICE_PROCESSING, NULL);
ESP_LOGI(TAG, "MIC_KEY tap stopped");
}