@@ -53,6 +53,7 @@ static void unaligned_memcpy(uint8_t *dst, const uint8_t *src, size_t n) {
5353 }
5454}
5555
56+ #if CFG_TUD_EDPT_DEDICATED_HWFIFO
5657void tu_hwfifo_write (volatile void * hwfifo , const uint8_t * src , uint16_t len , const tu_hwfifo_access_t * access_mode ) {
5758 (void )access_mode ;
5859 unaligned_memcpy ((uint8_t * )(uintptr_t )hwfifo , src , len );
@@ -62,6 +63,7 @@ void tu_hwfifo_read(const volatile void *hwfifo, uint8_t *dest, uint16_t len, co
6263 (void )access_mode ;
6364 unaligned_memcpy (dest , (const uint8_t * )(uintptr_t )hwfifo , len );
6465}
66+ #endif
6567
6668void rp2usb_init (void ) {
6769 // Reset usb controller
@@ -138,10 +140,13 @@ static uint32_t __tusb_irq_path_func(prepare_ep_buffer)(struct hw_endpoint *ep,
138140 if (buflen ) {
139141 // Copy data from user buffer/fifo to hw buffer
140142 uint8_t * hw_buf = ep -> hw_data_buf + buf_id * 64 ;
143+ #if CFG_TUD_EDPT_DEDICATED_HWFIFO
141144 if (ep -> is_xfer_fifo ) {
142145 // not in sram, may mess up timing with E15 workaround
143146 tu_hwfifo_write_from_fifo (hw_buf , ep -> user_fifo , buflen , NULL );
144- } else {
147+ } else
148+ #endif
149+ {
145150 unaligned_memcpy (hw_buf , ep -> user_buf , buflen );
146151 ep -> user_buf += buflen ;
147152 }
@@ -227,6 +232,7 @@ void __tusb_irq_path_func(hw_endpoint_start_next_buffer)(struct hw_endpoint* ep)
227232}
228233
229234void hw_endpoint_xfer_start (struct hw_endpoint * ep , uint8_t * buffer , tu_fifo_t * ff , uint16_t total_len ) {
235+ (void ) ff ;
230236 hw_endpoint_lock_update (ep , 1 );
231237
232238 if (ep -> active ) {
@@ -240,10 +246,13 @@ void hw_endpoint_xfer_start(struct hw_endpoint *ep, uint8_t *buffer, tu_fifo_t *
240246 ep -> xferred_len = 0 ;
241247 ep -> active = true;
242248
249+ #if CFG_TUD_EDPT_DEDICATED_HWFIFO
243250 if (ff != NULL ) {
244251 ep -> user_fifo = ff ;
245252 ep -> is_xfer_fifo = true;
246- } else {
253+ } else
254+ #endif
255+ {
247256 ep -> user_buf = buffer ;
248257 ep -> is_xfer_fifo = false;
249258 }
@@ -284,10 +293,13 @@ static uint16_t __tusb_irq_path_func(sync_ep_buffer)(hw_endpoint_t *ep, io_rw_32
284293 assert (buf_ctrl & USB_BUF_CTRL_FULL );
285294
286295 uint8_t * hw_buf = ep -> hw_data_buf + buf_id * 64 ;
296+ #if CFG_TUD_EDPT_DEDICATED_HWFIFO
287297 if (ep -> is_xfer_fifo ) {
288298 // not in sram, may mess up timing with E15 workaround
289299 tu_hwfifo_read_to_fifo (hw_buf , ep -> user_fifo , xferred_bytes , NULL );
290- } else {
300+ } else
301+ #endif
302+ {
291303 unaligned_memcpy (ep -> user_buf , hw_buf , xferred_bytes );
292304 ep -> user_buf += xferred_bytes ;
293305 }
0 commit comments