Commit Graph

2 Commits (19d131973c50213daf355148c27dc8c265d0ae84)

Author SHA1 Message Date
Adam Green 8a6d5ebc34 USBHost: Updates to allow compilation with GCC_ARM
I updated a few things in the USBHost source code to get it to compile
with GCC:
* In USBHALHost.cpp, the usb_buf global variable was defined with two
  different aligmnent specifiers:
    static volatile __align(256) uint8_t usb_buf[TOTAL_SIZE] __attribute((section("AHBSRAM1"),aligned));  //256 bytes aligned!
  The first one was not accepted by GCC.  I removed the duplicate
  alignment specifier and updated the one in the existing __attribute
  property to force the desired 256 byte alignment.
* Removed the explicit use of the __packed property from structures
  and instead used the PACKED macro defined in the mbed SDK's
  toolchain.h header file.  This macro does the right thing for the
  various compilers supported by the mbed team.
* Updated USB_* message macros in dbg.h to place spaces around
  references to the 'x' macro parameter.  Without this, C++ 11
  compilation thought the x character was a string literal operator but
  it wasn't one it recognized.  Adding the spaces makes it easier to
  see the use of the parameter, fixes this compile time error, and
  doesn't add any extra space to the final output string since the
  compiler only concatenates the contents within the double quotes of
  the strings.

By the way, I build with the gnu++11 standard since I have had requests
for its support from gcc4mbed.  Some of the items fixed here might not
be errors when using older standards with GCC.

I built and tested a USBHostMSD sample with these updates using both
GCC and the online compiler.  I will test more of the host interfaces
before issuing a pull request containing this commit.
2013-08-29 12:48:20 -07:00
unknown 1c981f929a add USBHost library 2013-03-14 16:36:35 +00:00