summaryrefslogtreecommitdiff
path: root/src/portable/nuvoton
diff options
context:
space:
mode:
authorhathach <[email protected]>2025-11-20 18:35:28 +0700
committerhathach <[email protected]>2025-11-20 18:35:28 +0700
commit30198b2ab9e69c120e5b49c063dad3d2d3889d79 (patch)
treeb63aceb41a91b5ada7464a1311db959440a4c091 /src/portable/nuvoton
parent409c19364b3be723b26b013efa5ab3ec1d17435a (diff)
refactor tu_fifo, add tu_fifo_write/read/peek_n_access()
Diffstat (limited to 'src/portable/nuvoton')
-rw-r--r--src/portable/nuvoton/nuc505/dcd_nuc505.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/portable/nuvoton/nuc505/dcd_nuc505.c b/src/portable/nuvoton/nuc505/dcd_nuc505.c
index 7c80f06d9..12f8cbd09 100644
--- a/src/portable/nuvoton/nuc505/dcd_nuc505.c
+++ b/src/portable/nuvoton/nuc505/dcd_nuc505.c
@@ -193,9 +193,8 @@ static void dcd_userEP_in_xfer(struct xfer_ctl_t *xfer, USBD_EP_T *ep)
/* provided buffers are thankfully 32-bit aligned, allowing most data to be transferred as 32-bit */
#if 0 // TODO support dcd_edpt_xfer_fifo API
- if (xfer->ff)
- {
- tu_fifo_read_n_const_addr_full_words(xfer->ff, (void *) (&ep->EPDAT_BYTE), bytes_now);
+ if (xfer->ff) {
+ tu_fifo_read_n_access(xfer->ff, (void *) (&ep->EPDAT_BYTE), bytes_now, TU_FIFO_FIXED_ADDR_RW32);
}
else
#endif
@@ -696,15 +695,14 @@ void dcd_int_handler(uint8_t rhport)
uint16_t const available_bytes = ep->EPDATCNT & USBD_EPDATCNT_DATCNT_Msk;
/* copy the data from the PC to the previously provided buffer */
#if 0 // TODO support dcd_edpt_xfer_fifo API
- if (xfer->ff)
- {
- tu_fifo_write_n_const_addr_full_words(xfer->ff, (const void *) &ep->EPDAT_BYTE, tu_min16(available_bytes, xfer->total_bytes - xfer->out_bytes_so_far));
+ if (xfer->ff) {
+ tu_fifo_write_n_access(xfer->ff, (const void *) &ep->EPDAT_BYTE, tu_min16(available_bytes, xfer->total_bytes - xfer->out_bytes_so_far), TU_FIFO_FIXED_ADDR_RW32);
}
else
#endif
{
- for (int count = 0; (count < available_bytes) && (xfer->out_bytes_so_far < xfer->total_bytes); count++, xfer->out_bytes_so_far++)
- {
+ for (int count = 0; (count < available_bytes) && (xfer->out_bytes_so_far < xfer->total_bytes);
+ count++, xfer->out_bytes_so_far++) {
*xfer->data_ptr++ = ep->EPDAT_BYTE;
}
}