diff options
| author | Tom Peterson <[email protected]> | 2022-02-25 16:49:55 -0600 |
|---|---|---|
| committer | Tom Peterson <[email protected]> | 2022-02-25 16:49:55 -0600 |
| commit | c06ecbef0ce7cb286dce85d2329a02c513e2c61b (patch) | |
| tree | 9d4dc9d91093d4875fa0041b70c9eed439a2ceba | |
| parent | b797d1aa50310a46d430ff0efd66d7e88028de3b (diff) | |
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.
| -rw-r--r-- | src/host/usbh.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/host/usbh.c b/src/host/usbh.c index b8439addc..e925a01fe 100644 --- a/src/host/usbh.c +++ b/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 -------------// |
