Private
Public Access
2
0

gpio: mraa_gpio_dir allow output to set val

There is an issue that when you take an IO pin that has an external PU
resistor and switch it from INPUT to OUTPUT the state of the pin will go
down before you can set it back high.

Signed-off-by: Kurt Eckhardt <kurte@rockisland.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Kurt Eckhardt
2015-01-05 15:03:17 -08:00
committed by Brendan Le Foll
parent 66eb476620
commit 20d229168b
3 changed files with 13 additions and 3 deletions

View File

@@ -426,6 +426,12 @@ mraa_gpio_dir(mraa_gpio_context dev, gpio_dir_t dir)
case MRAA_GPIO_IN:
length = snprintf(bu, sizeof(bu), "in");
break;
case MRAA_GPIO_OUT_HIGH:
length = snprintf(bu, sizeof(bu), "high");
break;
case MRAA_GPIO_OUT_LOW:
length = snprintf(bu, sizeof(bu), "low");
break;
default:
close(direction);
return MRAA_ERROR_FEATURE_NOT_IMPLEMENTED;