Эх сурвалжийг харах

Merge pull request #1353 from ETCLabs/iar-compiler-error-on-src-host-usbh.c

The IAR compilier does not resolve references to fields in the anonym…
Ha Thach 4 жил өмнө
parent
commit
f392054e70
1 өөрчлөгдсөн 10 нэмэгдсэн , 10 устгасан
  1. 10 10
      src/host/usbh.c

+ 10 - 10
src/host/usbh.c

@@ -62,12 +62,12 @@ typedef struct
   uint8_t hub_port;
   uint8_t speed;
 
-  volatile struct TU_ATTR_PACKED
+  struct TU_ATTR_PACKED
   {
-    uint8_t connected    : 1;
-    uint8_t addressed    : 1;
-    uint8_t configured   : 1;
-    uint8_t suspended    : 1;
+    volatile uint8_t connected    : 1;
+    volatile uint8_t addressed    : 1;
+    volatile uint8_t configured   : 1;
+    volatile uint8_t suspended    : 1;
   };
 } usbh_dev0_t;
 
@@ -78,12 +78,12 @@ typedef struct {
   uint8_t hub_port;
   uint8_t speed;
 
-  volatile struct TU_ATTR_PACKED
+  struct TU_ATTR_PACKED
   {
-    uint8_t connected    : 1;
-    uint8_t addressed    : 1;
-    uint8_t configured   : 1;
-    uint8_t suspended    : 1;
+    volatile uint8_t connected    : 1;
+    volatile uint8_t addressed    : 1;
+    volatile uint8_t configured   : 1;
+    volatile uint8_t suspended    : 1;
   };
 
   //------------- device descriptor -------------//