The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Dependents: hello SerialTestv11 SerialTestv12 Sierpinski ... more
mbed 2
This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.
Diff: TARGET_LPC1768/TARGET_NXP/TARGET_LPC176X/gpio_object.h
- Revision:
- 86:04dd9b1680ae
- Parent:
- 82:6473597d706e
- Child:
- 93:e188a91d3eaa
--- a/TARGET_LPC1768/TARGET_NXP/TARGET_LPC176X/gpio_object.h Wed Jun 11 15:14:05 2014 +0100 +++ b/TARGET_LPC1768/TARGET_NXP/TARGET_LPC176X/gpio_object.h Wed Jul 02 13:22:23 2014 +0100 @@ -16,6 +16,8 @@ #ifndef MBED_GPIO_OBJECT_H #define MBED_GPIO_OBJECT_H +#include "mbed_assert.h" + #ifdef __cplusplus extern "C" { #endif @@ -31,6 +33,7 @@ } gpio_t; static inline void gpio_write(gpio_t *obj, int value) { + MBED_ASSERT(obj->pin != (PinName)NC); if (value) *obj->reg_set = obj->mask; else @@ -38,6 +41,7 @@ } static inline int gpio_read(gpio_t *obj) { + MBED_ASSERT(obj->pin != (PinName)NC); return ((*obj->reg_in & obj->mask) ? 1 : 0); }