summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2025-08-05 23:24:07 +0700
committerGitHub <[email protected]>2025-08-05 23:24:07 +0700
commitf6bec1073ea56ae4ab8a6cb3b313a92a5c37f745 (patch)
tree8ad11494269c20ce570ab159c0c141ad56c5382b
parenta014df995d863ee5f4345a7f2254807dbf565d4f (diff)
parent4bfba6b09a90d5321b3dbd2d986760438417c430 (diff)
Merge pull request #3203 from hathach/fix-rp2-audio-iso-transfer
fix rp2 iso transfer with new audio driver
-rw-r--r--examples/device/uac2_headset/src/main.c6
-rw-r--r--src/portable/raspberrypi/rp2040/dcd_rp2040.c3
2 files changed, 6 insertions, 3 deletions
diff --git a/examples/device/uac2_headset/src/main.c b/examples/device/uac2_headset/src/main.c
index 06a673f91..d4c2b41d9 100644
--- a/examples/device/uac2_headset/src/main.c
+++ b/examples/device/uac2_headset/src/main.c
@@ -297,8 +297,9 @@ bool tud_audio_set_itf_close_ep_cb(uint8_t rhport, tusb_control_request_t const
uint8_t const itf = tu_u16_low(tu_le16toh(p_request->wIndex));
uint8_t const alt = tu_u16_low(tu_le16toh(p_request->wValue));
- if (ITF_NUM_AUDIO_STREAMING_SPK == itf && alt == 0)
+ if (ITF_NUM_AUDIO_STREAMING_SPK == itf && alt == 0) {
blink_interval_ms = BLINK_MOUNTED;
+ }
return true;
}
@@ -309,8 +310,9 @@ bool tud_audio_set_itf_cb(uint8_t rhport, tusb_control_request_t const *p_reques
uint8_t const alt = tu_u16_low(tu_le16toh(p_request->wValue));
TU_LOG2("Set interface %d alt %d\r\n", itf, alt);
- if (ITF_NUM_AUDIO_STREAMING_SPK == itf && alt != 0)
+ if (ITF_NUM_AUDIO_STREAMING_SPK == itf && alt != 0) {
blink_interval_ms = BLINK_STREAMING;
+ }
// Clear buffer when streaming format is changed
spk_data_size = 0;
diff --git a/src/portable/raspberrypi/rp2040/dcd_rp2040.c b/src/portable/raspberrypi/rp2040/dcd_rp2040.c
index 358ce84bc..a89c2f42b 100644
--- a/src/portable/raspberrypi/rp2040/dcd_rp2040.c
+++ b/src/portable/raspberrypi/rp2040/dcd_rp2040.c
@@ -190,8 +190,9 @@ static void __tusb_irq_path_func(hw_handle_buff_status)(void) {
bool done = hw_endpoint_xfer_continue(ep);
if (done) {
// Notify
- dcd_event_xfer_complete(0, ep->ep_addr, ep->xferred_len, XFER_RESULT_SUCCESS, true);
+ const uint16_t xferred_len = ep->xferred_len;
hw_endpoint_reset_transfer(ep);
+ dcd_event_xfer_complete(0, ep->ep_addr, xferred_len, XFER_RESULT_SUCCESS, true);
}
remaining_buffers &= ~bit;
}