intel_edison_fab_c.c: don't undo muxing if we don't own the pin
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
@@ -208,11 +208,14 @@ mraa_intel_edison_gpio_init_post(mraa_gpio_context dev)
|
|||||||
mraa_result_t
|
mraa_result_t
|
||||||
mraa_intel_edison_gpio_close_pre(mraa_gpio_context dev)
|
mraa_intel_edison_gpio_close_pre(mraa_gpio_context dev)
|
||||||
{
|
{
|
||||||
if (dev->phy_pin >= 0) {
|
// check if we own it
|
||||||
int pin = dev->phy_pin;
|
if (dev->owner != 0) {
|
||||||
if (agpioOutputen[pin]) {
|
if (dev->phy_pin >= 0) {
|
||||||
mraa_gpio_close(agpioOutputen[pin]);
|
int pin = dev->phy_pin;
|
||||||
agpioOutputen[pin] = NULL;
|
if (agpioOutputen[pin]) {
|
||||||
|
mraa_gpio_close(agpioOutputen[pin]);
|
||||||
|
agpioOutputen[pin] = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return MRAA_SUCCESS;
|
return MRAA_SUCCESS;
|
||||||
|
|||||||
Reference in New Issue
Block a user