meh
Fork of mbed by
Diff: TARGET_NUCLEO_L152RE/TARGET_STM/TARGET_NUCLEO_L152RE/gpio_object.h
- Revision:
- 86:04dd9b1680ae
- Parent:
- 84:0b3ab51c8877
- Child:
- 90:cb3d968589d8
--- a/TARGET_NUCLEO_L152RE/TARGET_STM/TARGET_NUCLEO_L152RE/gpio_object.h Wed Jun 11 15:14:05 2014 +0100 +++ b/TARGET_NUCLEO_L152RE/TARGET_STM/TARGET_NUCLEO_L152RE/gpio_object.h Wed Jul 02 13:22:23 2014 +0100 @@ -30,6 +30,7 @@ #ifndef MBED_GPIO_OBJECT_H #define MBED_GPIO_OBJECT_H +#include "mbed_assert.h" #include "cmsis.h" #include "PortNames.h" #include "PeripheralNames.h" @@ -48,6 +49,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 { @@ -56,6 +58,7 @@ } static inline int gpio_read(gpio_t *obj) { + MBED_ASSERT(obj->pin != (PinName)NC); return ((*obj->reg_in & obj->mask) ? 1 : 0); }