Private
Public Access
2
0

pwm.c: properly close duty file when disabling PWM

Fixes #669.

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Alex Tereschenko
2017-03-14 19:20:43 +01:00
committed by Brendan Le Foll
parent b24e90db0c
commit 21e0ff7c02

View File

@@ -493,6 +493,9 @@ mraa_pwm_close(mraa_pwm_context dev)
}
mraa_pwm_unexport(dev);
if (dev->duty_fp != -1) {
close(dev->duty_fp);
}
free(dev);
return MRAA_SUCCESS;
}