Skip to content

Commit d1b1a93

Browse files
committed
Merge pull request #978 from 0xc0170/fix_nucleo103_gpio_connected
Nucleo F103RB - gpio_is_connected method readdition
2 parents bad3d04 + b75b7a4 commit d1b1a93

File tree

1 file changed

+4
-0
lines changed
  • libraries/mbed/targets/hal/TARGET_STM/TARGET_NUCLEO_F103RB

1 file changed

+4
-0
lines changed

libraries/mbed/targets/hal/TARGET_STM/TARGET_NUCLEO_F103RB/gpio_object.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ static inline int gpio_read(gpio_t *obj)
6464
return ((*obj->reg_in & obj->mask) ? 1 : 0);
6565
}
6666

67+
static inline int gpio_is_connected(const gpio_t *obj) {
68+
return obj->pin != (PinName)NC;
69+
}
70+
6771
#ifdef __cplusplus
6872
}
6973
#endif

0 commit comments

Comments
 (0)