pwm: fix writing of period
authorThomas Ingleby <thomas.c.ingleby@intel.com>
Wed, 21 May 2014 13:49:32 +0000 (14:49 +0100)
committerThomas Ingleby <thomas.c.ingleby@intel.com>
Wed, 21 May 2014 13:49:32 +0000 (14:49 +0100)
Incorrect value attempted to be written

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
src/pwm/pwm.c

index 50786e8..5e80d29 100644 (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;