mbed library sources
Dependents: frdm_kl05z_gpio_test
Fork of mbed-src by
Diff: targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/pinmap.c
- Revision:
- 227:7bd0639b8911
- Parent:
- 30:91c1d09ada54
- Child:
- 250:a49055e7a707
--- a/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/pinmap.c Wed Jun 11 09:45:09 2014 +0100 +++ b/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/pinmap.c Wed Jun 11 16:00:09 2014 +0100 @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include "mbed_assert.h" #include "pinmap.h" #include "error.h" void pin_function(PinName pin, int function) { - if (pin == (uint32_t)NC) return; - + MBED_ASSERT(pin != (PinName)NC); uint32_t offset = (uint32_t)pin & 0xff; __IO uint32_t *reg = (__IO uint32_t*)(LPC_IOCON_BASE + offset); @@ -27,10 +27,9 @@ } void pin_mode(PinName pin, PinMode mode) { - if (pin == (uint32_t)NC) { return; } - + MBED_ASSERT(pin != (PinName)NC); uint32_t offset = (uint32_t)pin & 0xff; - uint32_t drain = ((uint32_t) mode & (uint32_t) OpenDrain) >> 2; + uint32_t drain = ((uint32_t)mode & (uint32_t)OpenDrain) >> 2; __IO uint32_t *reg = (__IO uint32_t*)(LPC_IOCON_BASE + offset); uint32_t tmp = *reg;