2525#include "USB/samd21_device.h"
2626#include "sam.h"
2727
28- #ifdef __cplusplus
29- extern "C" {
30- #endif // __cplusplus
31-
32- #ifdef SAMD_SERIES
33-
3428//#define TRACE_DEVICE(x) x
3529#define TRACE_DEVICE (x )
3630
37- __attribute__((__aligned__ (4 ))) /* __attribute__((__section__(".bss_hram0")))*/ uint8_t udd_ep_out_cache_buffer [4 ][64 ];
38- __attribute__((__aligned__ (4 ))) /* __attribute__((__section__(".bss_hram0")))*/ uint8_t udd_ep_in_cache_buffer [4 ][128 ];
31+ __attribute__((__aligned__ (4 ))) __attribute__((__section__ (".bss_hram0" ))) uint8_t udd_ep_out_cache_buffer [4 ][64 ];
32+ __attribute__((__aligned__ (4 ))) __attribute__((__section__ (".bss_hram0" ))) uint8_t udd_ep_in_cache_buffer [4 ][128 ];
3933
4034/**
4135 * USB SRAM data containing pipe descriptor table
@@ -270,7 +264,6 @@ uint8_t UDD_Recv_data(uint32_t ep, uint32_t len)
270264{
271265 TRACE_DEVICE (printf ("=> UDD_Recvdata : ep=%d\r\n" , (char )ep );)
272266
273- if (len > 64 ) len = 64 ;
274267 usb_endpoint_table [ep ].DeviceDescBank [0 ].ADDR .reg = (uint32_t )& udd_ep_out_cache_buffer [ep ];
275268 usb_endpoint_table [ep ].DeviceDescBank [0 ].PCKSIZE .bit .MULTI_PACKET_SIZE = len ;
276269 usb_endpoint_table [ep ].DeviceDescBank [0 ].PCKSIZE .bit .BYTE_COUNT = 0 ;
@@ -280,7 +273,7 @@ uint8_t UDD_Recv_data(uint32_t ep, uint32_t len)
280273 /* Wait for transfer to complete */
281274 while (!udd_is_OUT_transf_cplt (ep ));
282275 /* Clear Transfer complete 0 flag */
283- udd_clear_OUT_transf_cplt (ep );
276+ // udd_clear_OUT_transf_cplt(ep);
284277
285278 return udd_ep_out_cache_buffer [ep ][0 ];
286279}
@@ -309,7 +302,7 @@ void UDD_ReleaseRX(uint32_t ep)
309302 // The RAM Buffer is empty: we can receive data
310303 udd_OUT_transfer_allowed (ep );
311304 /* Clear Transfer complete 0 flag */
312- udd_clear_OUT_transf_cplt (ep );
305+ // udd_clear_OUT_transf_cplt(ep);
313306}
314307
315308void UDD_ReleaseTX (uint32_t ep )
@@ -318,7 +311,7 @@ void UDD_ReleaseTX(uint32_t ep)
318311 // The RAM Buffer is full: we can send data
319312 udd_IN_transfer_allowed (ep );
320313 /* Clear the transfer complete flag */
321- udd_clear_IN_transf_cplt (ep );
314+ // udd_clear_IN_transf_cplt(ep);
322315}
323316
324317void UDD_SetAddress (uint32_t addr )
@@ -342,10 +335,3 @@ uint32_t UDD_GetFrameNumber(void)
342335{
343336 return udd_frame_number ();
344337}
345-
346- #ifdef __cplusplus
347- }
348- #endif
349-
350- #endif /* SAMD_SERIES */
351-
0 commit comments