Skip to content

Commit 1eff7ec

Browse files
committed
Wiznet: Cope correctly with NC GPIO
1 parent e6e3614 commit 1eff7ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

targets/TARGET_WIZNET/TARGET_W7500x/gpio_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ uint32_t gpio_set(PinName pin)
4545

4646
void gpio_init(gpio_t *obj, PinName pin)
4747
{
48+
obj->pin = pin;
4849
if (pin == (PinName)NC) {
4950
return;
5051
}
5152

5253
obj->port_num = WIZ_PORT(pin);
5354
obj->pin_index = WIZ_PIN_INDEX(pin);
54-
obj->pin = pin;
5555
GPIO_TypeDef *gpio = (GPIO_TypeDef *)Get_GPIO_BaseAddress(obj->port_num);
5656
obj->reg_data_in = &gpio->DATA;
5757
}

0 commit comments

Comments
 (0)