summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHiFiPHile <[email protected]>2026-08-25 09:27:36 +0200
committerHiFiPHile <[email protected]>2026-08-25 09:27:36 +0200
commitebec43ef01258e1abd37a08f603c940690257951 (patch)
treefb43728ed027d69c64ffb5e048b1d68fdc0aedb4 /src
parent350b4fe5ba4754fa606aabc447795d038c10a623 (diff)
fix(audio): clear stale Feature Unit associations
Reset Feature Unit state when parsing a new audio function. Devices without a matching unit must not inherit an ID collected from an earlier interface or device. Signed-off-by: HiFiPHile <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/class/audio/audio_host.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/class/audio/audio_host.c b/src/class/audio/audio_host.c
index 338b6d94a..4f4c1e0d0 100644
--- a/src/class/audio/audio_host.c
+++ b/src/class/audio/audio_host.c
@@ -551,9 +551,10 @@ void audioh_close(uint8_t daddr) {
_audioh_epbuf[idx].complete_cb = NULL; // drop a pending feature-unit request
_audioh_epbuf[idx].fu_busy = false;
- p_audio->stream_count = 0;
- p_audio->daddr = 0;
- p_audio->mounted = false;
+ p_audio->feature_unit_id = 0;
+ p_audio->stream_count = 0;
+ p_audio->daddr = 0;
+ p_audio->mounted = false;
}
}
@@ -878,6 +879,7 @@ uint16_t audioh_open(uint8_t rhport, uint8_t dev_addr, const tusb_desc_interface
audioh_interface_t *p_audio = &_audioh_itf[idx];
p_audio->daddr = dev_addr;
p_audio->ac_itf_num = desc_itf->bInterfaceNumber;
+ p_audio->feature_unit_id = 0;
audioh_stream_reset(&p_audio->in_stream);
audioh_stream_reset(&p_audio->out_stream);
p_audio->in_stream.daddr = dev_addr;