Skip to content

Commit 7bcb066

Browse files
authored
Merge pull request #7856 from fredlee12001/master
Realtek: fix gpio is connected
2 parents 3da606e + 84eda27 commit 7bcb066

File tree

1 file changed

+9
-0
lines changed
  • targets/TARGET_Realtek/TARGET_AMEBA/TARGET_RTL8195A

1 file changed

+9
-0
lines changed

targets/TARGET_Realtek/TARGET_AMEBA/TARGET_RTL8195A/gpio_api.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,4 +199,13 @@ void gpio_deinit(gpio_t *obj)
199199
HAL_GPIO_DeInit(&obj->hal_pin);
200200
}
201201

202+
int gpio_is_connected(const gpio_t *obj)
203+
{
204+
if(obj->pin != (PinName)NC){
205+
return 1;
206+
} else {
207+
return 0;
208+
}
209+
}
210+
202211
#endif

0 commit comments

Comments
 (0)