Private
Public Access
2
0

pwm: fix writing of period

Incorrect value attempted to be written

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
This commit is contained in:
Thomas Ingleby
2014-05-21 14:49:32 +01:00
parent e5a893bfb8
commit 7cc5d6b2b8

View File

@@ -68,7 +68,7 @@ maa_pwm_write_period(maa_pwm_context dev, int period)
return MAA_ERROR_INVALID_RESOURCE;
}
char out[MAX_SIZE];
int length = snprintf(out, MAX_SIZE, "%d", dev->pin);
int length = snprintf(out, MAX_SIZE, "%d", period);
if (write(period_f, out, length*sizeof(char)) == -1) {
close(period_f);
return MAA_ERROR_INVALID_RESOURCE;