File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed
Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change 3232#define MUSB_DEBUG 2
3333#define MUSB_REGS (rhport ) ((musb_regs_t*) MUSB_BASES[rhport])
3434
35- #if __GNUC__ > 8 && defined(__ARM_FEATURE_UNALIGNED )
36- /* GCC warns that an address may be unaligned, even though
37- * the target CPU has the capability for unaligned memory access. */
38- _Pragma ("GCC diagnostic ignored \"-Waddress-of-packed-member\"" );
39- #endif
40-
4135#include "musb_type.h"
4236#include "device/dcd.h"
4337
@@ -73,7 +67,10 @@ typedef struct TU_ATTR_PACKED
7367
7468typedef struct
7569{
76- tusb_control_request_t setup_packet ;
70+ union {
71+ tusb_control_request_t setup_packet ;
72+ uint32_t setup_buffer [2 ];
73+ };
7774 uint16_t remaining_ctrl ; /* The number of bytes remaining in data stage of control transfer. */
7875 int8_t status_out ;
7976 pipe_state_t pipe0 ;
@@ -174,9 +171,8 @@ static void process_setup_packet(uint8_t rhport) {
174171 musb_regs_t * musb_regs = MUSB_REGS (rhport );
175172
176173 // Read setup packet
177- uint32_t * p = (void * )& _dcd .setup_packet ;
178- p [0 ] = musb_regs -> fifo [0 ];
179- p [1 ] = musb_regs -> fifo [0 ];
174+ _dcd .setup_buffer [0 ] = musb_regs -> fifo [0 ];
175+ _dcd .setup_buffer [1 ] = musb_regs -> fifo [0 ];
180176
181177 _dcd .pipe0 .buf = NULL ;
182178 _dcd .pipe0 .length = 0 ;
You can’t perform that action at this time.
0 commit comments