Przeglądaj źródła

The IAR compilier does not resolve references to fields in the anonymous structs defined within the usbh_dev0_t and usbh_device_t structs as they are defined. The problem seems to relate to the placement of the 'volatile' keyword at the struct level. I fixed the problem by removing the 'volatile' from the struct level, and instead placing it on each of the field declarations within the structs.

Tom Peterson 4 lat temu
rodzic
commit
c06ecbef0c
1 zmienionych plików z 10 dodań i 10 usunięć
  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 hub_port;
   uint8_t speed;
   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;
 } usbh_dev0_t;
 
 
@@ -78,12 +78,12 @@ typedef struct {
   uint8_t hub_port;
   uint8_t hub_port;
   uint8_t speed;
   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 -------------//
   //------------- device descriptor -------------//