Skip to content

Commit

Permalink
mraa-gpio.c: Fix raw gpio setting
Browse files Browse the repository at this point in the history
setraw was not using mraa_gpio_init_raw so did not work

Signed-off-by: Brendan Le Foll <[email protected]>
  • Loading branch information
arfoll committed Jun 20, 2016
1 parent 8af6843 commit 3d2163e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion examples/mraa-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,13 @@ list_pins()
mraa_result_t
gpio_set(int pin, int level, mraa_boolean_t raw)
{
mraa_gpio_context gpio = mraa_gpio_init(pin);
mraa_gpio_context gpio;
if (raw) {
gpio = mraa_gpio_init_raw(pin);
}
else {
gpio = mraa_gpio_init(pin);
}
if (gpio != NULL) {
mraa_gpio_dir(gpio, MRAA_GPIO_OUT);
if (raw != 0) {
Expand Down

0 comments on commit 3d2163e

Please sign in to comment.