summaryrefslogtreecommitdiff
path: root/src/class/mtp
diff options
context:
space:
mode:
authorcopilot-swe-agent[bot] <[email protected]>2025-10-22 06:12:08 +0000
committercopilot-swe-agent[bot] <[email protected]>2025-10-22 06:12:08 +0000
commit27415e6114cb6e23ca085b21161eb79278f6b97b (patch)
tree43d1d403c57a40dccc0cb4b3b3cb134a100e7ac1 /src/class/mtp
parent16cfe6895a4ee6d6b196e99a033a7326908f8d8a (diff)
Add is_isr parameter to usbd_edpt_xfer and usbd_edpt_xfer_fifo
- Added bool is_isr parameter to usbd_edpt_xfer() and usbd_edpt_xfer_fifo() wrapper functions - These are called by class drivers to queue USB transfers - Updated all callers to pass false by default (non-ISR context) - Updated audiod_rx_xfer_isr() and audiod_tx_xfer_isr() to pass true (ISR context) - All 21 unit tests pass Co-authored-by: HiFiPhile <[email protected]>
Diffstat (limited to 'src/class/mtp')
-rw-r--r--src/class/mtp/mtp_device.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/class/mtp/mtp_device.c b/src/class/mtp/mtp_device.c
index 04bde9415..0499f2dda 100644
--- a/src/class/mtp/mtp_device.c
+++ b/src/class/mtp/mtp_device.c
@@ -191,7 +191,7 @@ TU_ATTR_UNUSED static const char* _mtp_phase_str[] = {
//--------------------------------------------------------------------+
static bool prepare_new_command(mtpd_interface_t* p_mtp) {
p_mtp->phase = MTP_PHASE_COMMAND;
- return usbd_edpt_xfer(p_mtp->rhport, p_mtp->ep_out, _mtpd_epbuf.buf, CFG_TUD_MTP_EP_BUFSIZE);
+ return usbd_edpt_xfer(p_mtp->rhport, p_mtp->ep_out, _mtpd_epbuf.buf, CFG_TUD_MTP_EP_BUFSIZE, false);
}
static bool mtpd_data_xfer(mtp_container_info_t* p_container, uint8_t ep_addr) {
@@ -219,7 +219,7 @@ static bool mtpd_data_xfer(mtp_container_info_t* p_container, uint8_t ep_addr) {
if (xact_len) {
// already transferred all bytes in header's length. Application make an unnecessary extra call
TU_VERIFY(usbd_edpt_claim(p_mtp->rhport, ep_addr));
- TU_ASSERT(usbd_edpt_xfer(p_mtp->rhport, ep_addr, _mtpd_epbuf.buf, xact_len));
+ TU_ASSERT(usbd_edpt_xfer(p_mtp->rhport, ep_addr, _mtpd_epbuf.buf, xact_len, false));
}
return true;
}
@@ -238,7 +238,7 @@ bool tud_mtp_response_send(mtp_container_info_t* p_container) {
p_container->header->type = MTP_CONTAINER_TYPE_RESPONSE_BLOCK;
p_container->header->transaction_id = p_mtp->command.header.transaction_id;
TU_VERIFY(usbd_edpt_claim(p_mtp->rhport, p_mtp->ep_in));
- return usbd_edpt_xfer(p_mtp->rhport, p_mtp->ep_in, _mtpd_epbuf.buf, (uint16_t)p_container->header->len);
+ return usbd_edpt_xfer(p_mtp->rhport, p_mtp->ep_in, _mtpd_epbuf.buf, (uint16_t) p_container->header->len, false);
}
bool tud_mtp_mounted(void) {
@@ -251,7 +251,7 @@ bool tud_mtp_event_send(mtp_event_t* event) {
TU_VERIFY(p_mtp->ep_event != 0);
_mtpd_epbuf.buf_event = *event;
TU_VERIFY(usbd_edpt_claim(p_mtp->rhport, p_mtp->ep_event)); // Claim the endpoint
- return usbd_edpt_xfer(p_mtp->rhport, p_mtp->ep_event, (uint8_t*) &_mtpd_epbuf.buf_event, sizeof(mtp_event_t));
+ return usbd_edpt_xfer(p_mtp->rhport, p_mtp->ep_event, (uint8_t*, false) &_mtpd_epbuf.buf_event, sizeof(mtp_event_t));
}
//--------------------------------------------------------------------+