There was an error while loading. Please reload this page.
1 parent 3ad3365 commit 440cc16Copy full SHA for 440cc16
1 file changed
src/BluetoothA2DPSource.cpp
@@ -154,6 +154,20 @@ void BluetoothA2DPSource::end(bool release_memory) {
154
xTimerDelete(s_tmr, portMAX_DELAY);
155
s_tmr = nullptr;
156
}
157
+
158
+ // Properly deinitialize AVRC to allow reinitialization on next start()
159
+#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 0, 0)
160
+ if (is_passthru_active) {
161
+ ESP_LOGD(BT_APP_TAG, "Deinitializing AVRC TG");
162
+ esp_avrc_tg_deinit();
163
+ }
164
+#endif
165
+ ESP_LOGD(BT_APP_TAG, "Deinitializing AVRC CT");
166
+ esp_avrc_ct_deinit();
167
168
+ // Reset the bluedroid initialization flag so it can be reinitialized
169
+ is_bluedroid_initialized = false;
170
171
// standard end
172
BluetoothA2DPCommon::end(release_memory);
173
0 commit comments