feat(control_plane): apply light standby hardware policy
This commit is contained in:
@@ -1369,6 +1369,37 @@ bool multimodal_audio_is_initialized(void)
|
||||
return s_audio.initialized;
|
||||
}
|
||||
|
||||
esp_err_t multimodal_audio_set_speaker_output_enabled(bool enabled)
|
||||
{
|
||||
multimodal_audio_ctx_t *ctx = &s_audio;
|
||||
if (!ctx->initialized || ctx->codec_dev == NULL || ctx->gpio_if == NULL ||
|
||||
ctx->gpio_if->set == NULL) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
if (!enabled) {
|
||||
esp_err_t mute_err = set_downstream_output_mute_if_needed(
|
||||
ctx,
|
||||
true,
|
||||
"Light standby");
|
||||
if (mute_err != ESP_OK) {
|
||||
return mute_err;
|
||||
}
|
||||
}
|
||||
|
||||
int ret = ctx->gpio_if->set(CONFIG_MULTIMODAL_AUDIO_PA_GPIO, enabled);
|
||||
if (ret != ESP_CODEC_DEV_OK) {
|
||||
ESP_LOGW(TAG,
|
||||
"Speaker PA power %s failed: 0x%x",
|
||||
enabled ? "on" : "off",
|
||||
ret);
|
||||
return (esp_err_t)ret;
|
||||
}
|
||||
|
||||
ESP_LOGI(TAG, "Speaker PA power %s", enabled ? "on" : "off");
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t multimodal_audio_register_downstream_playback_callback(
|
||||
multimodal_audio_downstream_playback_callback_t cb,
|
||||
void *cb_ctx)
|
||||
|
||||
Reference in New Issue
Block a user