diff options
author | RJ Ryan <rryan@mit.edu> | 2011-09-18 15:39:28 -0400 |
---|---|---|
committer | RJ Ryan <rryan@mit.edu> | 2011-09-18 15:39:28 -0400 |
commit | 7cb0bf6923fe613016cd83c511187539e0709af1 (patch) | |
tree | 82ab48f7f6160f508ad4d84447bf05fb3bbdb525 /libmaple/libmaple_types.h | |
parent | a9f14657020161fe8798e23489ce7b9489bbe815 (diff) | |
download | librambutan-7cb0bf6923fe613016cd83c511187539e0709af1.tar.gz librambutan-7cb0bf6923fe613016cd83c511187539e0709af1.zip |
Fix memory alignment of USB descriptor structures.
A variety of USB descriptor structures have been manually
"unpacked". Instead of using the struct, their members were unpacked
into the struct they were nested in. Additionally sizeof()'s were
commented in favor of manual calculation of structure sizes.
After uncommenting these changes, the USB CDC peripheral stopped
correctly configuring with the host. The root problem with the
structures is that GCC is padding them. By applying
__attribute__((__packed__)), these problems are fixed. I removed all
the instances of the workaround I saw within the USB code.
Signed-off-by: RJ Ryan <rryan@mit.edu>
Diffstat (limited to 'libmaple/libmaple_types.h')
-rw-r--r-- | libmaple/libmaple_types.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libmaple/libmaple_types.h b/libmaple/libmaple_types.h index 17bcfb1..08adaff 100644 --- a/libmaple/libmaple_types.h +++ b/libmaple/libmaple_types.h @@ -47,6 +47,7 @@ typedef void (*voidFuncPtr)(void); #define __io volatile #define __attr_flash __attribute__((section (".USER_FLASH"))) +#define __packed __attribute__((__packed__)) #ifndef NULL #define NULL 0 |