From c6799ea9980082412daddf7167000e9ecc0d0577 Mon Sep 17 00:00:00 2001 From: Gordon Henderson Date: Fri, 24 Aug 2012 19:07:54 +0100 Subject: [PATCH] Updating softPwm to fix some typos. --- wiringPi/softPwm.c | 14 ++++++++++++++ wiringPi/softPwm.h | 5 ++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/wiringPi/softPwm.c b/wiringPi/softPwm.c index 56bf4d8..b568dfb 100644 --- a/wiringPi/softPwm.c +++ b/wiringPi/softPwm.c @@ -84,8 +84,22 @@ static PI_THREAD (softPwmThread) return NULL ; } + +/* + * softPwmWrite: + * Write a PWM value to the given pin + ********************************************************************************* + */ + void softPwmWrite (int pin, int value) { + pin &= 63 ; + + /**/ if (value < 0) + value = 0 ; + else if (value > range [pin]) + value = range [pin] ; + marks [pin] = value ; } diff --git a/wiringPi/softPwm.h b/wiringPi/softPwm.h index a6d8cd4..4a17cb0 100644 --- a/wiringPi/softPwm.h +++ b/wiringPi/softPwm.h @@ -22,6 +22,5 @@ *********************************************************************** */ -extern int setupSoftPwm (int pin) ; -extern int softPwmCreate (int pin, int value, int range) ; -extern void softPwmWrite (int pin, int value) ; +extern int softPwmCreate (int pin, int value, int range) ; +extern void softPwmWrite (int pin, int value) ;