Skip to content

Commit

Permalink
Set PIN as output when blink_state is created
Browse files Browse the repository at this point in the history
  • Loading branch information
Enophi committed Oct 20, 2021
1 parent d288451 commit f121b4e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion include/mgos_pcf857x.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions src/mgos_pcf857x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit f121b4e

Please sign in to comment.