基本按键功能测试完成

This commit is contained in:
CSBOOK\44744
2026-06-25 13:37:12 +08:00
parent 84ecf892b5
commit ec2ad4dfc9
6 changed files with 207 additions and 232 deletions
@@ -16,6 +16,14 @@
#define CONFIG_MULTIMODAL_CONNECT_TIMEOUT_MS 10000
#endif
#ifndef CONFIG_TQ_BOOT_SOUND_TIMEOUT_MS
#define CONFIG_TQ_BOOT_SOUND_TIMEOUT_MS 3000
#endif
#ifndef CONFIG_TQ_BOOT_SOUND_FILE
#define CONFIG_TQ_BOOT_SOUND_FILE ""
#endif
#define CONTROL_PLANE_STA_CONNECT_MAX_ATTEMPTS 3
#define CONTROL_PLANE_STA_RETRY_BASE_DELAY_MS 300
@@ -208,6 +216,33 @@ bool control_plane_is_sta_connected(void)
return domain_runtime_wifi_portal_sta_is_connected();
}
esp_err_t control_plane_play_boot_sound(int timeout_ms)
{
int effective_timeout_ms = timeout_ms > 0 ? timeout_ms : CONFIG_TQ_BOOT_SOUND_TIMEOUT_MS;
ESP_LOGI(TAG, "Boot sound policy start timeout=%dms", effective_timeout_ms);
if (CONFIG_TQ_BOOT_SOUND_FILE[0] == '\0') {
ESP_LOGW(TAG, "Boot sound file is not configured");
return ESP_ERR_NOT_SUPPORTED;
}
esp_err_t audio_err = domain_runtime_multimodal_audio_init();
if (audio_err != ESP_OK) {
ESP_LOGW(TAG, "Boot sound audio init failed: %s", esp_err_to_name(audio_err));
return audio_err;
}
esp_err_t play_err = domain_runtime_behavior_play_prompt_file(CONFIG_TQ_BOOT_SOUND_FILE);
if (play_err != ESP_OK) {
ESP_LOGW(TAG, "Boot sound playback failed: %s", esp_err_to_name(play_err));
}
domain_runtime_multimodal_audio_deinit();
ESP_LOGI(TAG, "Boot sound audio resources released");
return play_err;
}
esp_err_t control_plane_init_lcd_device(void)
{
return domain_runtime_init_lcd_device();
@@ -218,6 +253,16 @@ void control_plane_start_lcd_render_loop(void)
domain_runtime_start_lcd_render_loop();
}
esp_err_t control_plane_request_boot_expression(void)
{
domain_expression_request_t request = {
.id = DOMAIN_EXPRESSION_IDLE,
.trigger = DOMAIN_EXPRESSION_TRIGGER_UNSPECIFIED,
.direction_index = 0,
};
return domain_runtime_request_expression(&request);
}
esp_err_t control_plane_stop_lcd_render_loop(int timeout_ms)
{
return domain_runtime_stop_lcd_render_loop(timeout_ms);