mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Revision:
64:7b352733b00a
Parent:
19:398f4c622e1b
Child:
221:8276e3a4886f
--- a/common/pinmap_common.c	Thu Dec 19 09:00:06 2013 +0000
+++ b/common/pinmap_common.c	Thu Dec 19 13:15:07 2013 +0000
@@ -44,17 +44,22 @@
     return (uint32_t)NC;
 }
 
-uint32_t pinmap_peripheral(PinName pin, const PinMap* map) {
-    if (pin == (PinName)NC)
-        return (uint32_t)NC;
-
+uint32_t pinmap_find_peripheral(PinName pin, const PinMap* map) {
     while (map->pin != NC) {
         if (map->pin == pin)
             return map->peripheral;
         map++;
     }
-
-    // no mapping available
-    error("pinmap not found for peripheral");
     return (uint32_t)NC;
 }
+
+uint32_t pinmap_peripheral(PinName pin, const PinMap* map) {
+    uint32_t peripheral = (uint32_t)NC;
+
+    if (pin == (PinName)NC)
+        return (uint32_t)NC;
+    peripheral = pinmap_find_peripheral(pin, map);
+    if ((uint32_t)NC == peripheral) // no mapping available
+        error("pinmap not found for peripheral");
+    return peripheral;
+}