diff --git a/include/mgos_pcf857x.h b/include/mgos_pcf857x.h index bceae50..b2cb5e2 100644 --- a/include/mgos_pcf857x.h +++ b/include/mgos_pcf857x.h @@ -66,7 +66,6 @@ bool mgos_pcf857x_gpio_set_button_handler(struct mgos_pcf857x *dev, int pin, enu /* * A utility function that takes care of blinking an LED. - * The pin must be configured as output first. * Set to (0, 0) to disable. */ bool mgos_pcf857x_gpio_blink(struct mgos_pcf857x *dev, int pin, int on_ms, int off_ms); diff --git a/src/mgos_pcf857x.c b/src/mgos_pcf857x.c index 5f5cc67..040b51f 100644 --- a/src/mgos_pcf857x.c +++ b/src/mgos_pcf857x.c @@ -31,6 +31,8 @@ static struct mgos_pcf857x_gpio_blink_state *mgos_pcf857x_get_or_create_blink_st blink_states[pin]->dev = dev; blink_states[pin]->pin = pin; blink_states[pin]->timer_id = MGOS_INVALID_TIMER_ID; + + mgos_pcf857x_gpio_setup_output(dev, pin, false); } return blink_states[pin];