Go to file
Adam Green ddb3fbe826 USBHost: Silence GCC warnings in USBHost.cpp
There are a few warnings thrown by GCC for this source file that I have
attempted to correct.  I would definitely appreciate feedback from
others on these changes:
* USBHost::usb_process() would attempt to write past the end of the
  deviceInited[] array in the following code snippet:
    if (i == MAX_DEVICE_CONNECTED) {
        USB_ERR("Too many device connected!!\r\n");
        deviceInited[i] = false;
  The i variable is guaranteed to index 1 item past then end of this
  array since it only contains MAX_DEVICE_CONNECTED elements.  I have
  removed the line which sets deviceInited[i] to false.  Two questions
  result though:
    1) What was the intent of this line of code and is it Ok that I
       just removed it or should it be replaced with something else?
    2) I see no where else that elements in the deviceInited array are
       set to false except when all are set to false in the usbThread()
       method.  Should there be code in DEVICE_DISCONNECTED_EVENT to
       do this as well?
* USBHost::transferCompleted(volatile uint32_t addr) was comparing addr
  to NULL, which is of pointer type.  GCC issues a warning on this
  since the types are different (void* being compared to uint32_t).  I
  switched it to just compare with 0 instead.
* There is a switch statement in USBHost::unqueueEndpoint() which
  is conditional on a ENDPOINT_TYPE enumeration but doesn't contain
  cases for all values in the enumeration.  I just added a default
  case to simply break on other values to silence this GCC warning and
  allow the code to continue working as it did before.  Is it Ok that
  this particular piece of code only handles these two particular
  cases?
* USBHost::fillControlBuf() was generating a warning about possible
  alignment issues when accessing the setupPacket byte array as 16-bit
  half words instead.  I changed the casting to silence the warnings
  and modified the declaration of the setupPacket field to make sure
  that it is at least 2-byte aligned for these 16-bit accesses.
2013-08-29 19:22:36 -07:00
libraries USBHost: Silence GCC warnings in USBHost.cpp 2013-08-29 19:22:36 -07:00
workspace_tools Added support for LPC11U35_401 in ARM and GCC_ARM 2013-08-27 15:19:01 +03:00
.gitattributes Added .gitattributes for automatic LF line ending conversion 2013-08-08 13:19:34 +03:00
.gitignore Tidy up default settings 2013-08-15 16:09:12 +01:00
LICENSE Add Apache v2 LICENSE file 2013-08-06 12:05:04 +01:00
README.md Added LPC11C24 to README.md 2013-08-05 17:25:12 +01:00

README.md

mbed SDK

The mbed Software Development Kit (SDK) is a C/C++ microcontroller software platform relied upon by tens of thousands of developers to build projects fast.

The SDK is licensed under the permissive Apache 2.0 licence, so you can use it in both commercial and personal projects with confidence.

The mbed SDK has been designed to provide enough hardware abstraction to be intuitive and concise, yet powerful enough to build complex projects. It is built on the low-level ARM CMSIS APIs, allowing you to code down to the metal if needed. In addition to RTOS, USB and Networking libraries, a cookbook of hundreds of reusable peripheral and module libraries have been built on top of the SDK by the mbed Developer Community.

Documentation

Supported Microcontrollers

NXP:

  • LPC1768 (Cortex-M3)
  • LPC11U24 (Cortex-M0)
  • LPC2368 (ARM7TDMI-S)
  • LPC812 (Cortex-M0+)
  • LPC4088 (Cortex-M4)
  • LPC4330 (Cortex-M4 + Cortex-M0)
  • LPC1347 (Cortex-M3)
  • LPC1114 (Cortex-M0)
  • LPC11C24 (Cortex-M0)

Freescale:

  • KL25Z (Cortex-M0+)
  • KL05Z (Cortex-M0+)

STMicroelectronics:

  • STM32F407 (Cortex-M4)

Supported Toolchains and IDEs

API Documentation

Community

For discussing the development of the mbed SDK itself (Addition/support of microcontrollers/toolchains, build and test system, Hardware Abstraction Layer API, etc) please join our mbed-devel mailing list.

For every topic regarding the use of the mbed SDK, rather than its development, please post on the mbed.org forum, or the mbed.org Q&A.

For reporting issues in the mbed libraries please open a ticket on the issue tracker of the relevant mbed official library.