Skip to content

Commit e06aa3d

Browse files
committed
bt_av: keep audio and led modes when BT_A2DP_IDLE_BIT is not set
1 parent 2c08b63 commit e06aa3d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

main/src/user/bt_av.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,15 @@ static void bt_av_hdl_a2d_evt(uint16_t event, void *p_param)
138138
esp_bt_gap_set_scan_mode(ESP_BT_CONNECTABLE, ESP_BT_GENERAL_DISCOVERABLE);
139139
}
140140

141+
if (!(uxBits & BT_A2DP_IDLE_BIT)) {
141142
#ifdef CONFIG_ENABLE_AUDIO_PROMPT
142-
audio_player_play_file(MP3_FILE_IDX_DISCONNECTED);
143+
audio_player_play_file(MP3_FILE_IDX_DISCONNECTED);
143144
#endif
144145
#ifdef CONFIG_ENABLE_LED
145-
led_set_mode(LED_MODE_IDX_BLINK_M0);
146+
led_set_mode(LED_MODE_IDX_BLINK_M0);
146147
#endif
147-
148-
xEventGroupSetBits(user_event_group, BT_A2DP_IDLE_BIT);
148+
xEventGroupSetBits(user_event_group, BT_A2DP_IDLE_BIT);
149+
}
149150
} else if (a2d->conn_stat.state == ESP_A2D_CONNECTION_STATE_CONNECTED) {
150151
xEventGroupClearBits(user_event_group, BT_A2DP_IDLE_BIT);
151152

0 commit comments

Comments
 (0)