Browse Source

Updating softPwm to fix some typos.

pull/22/head
Gordon Henderson 12 years ago
parent
commit
c6799ea998
2 changed files with 16 additions and 3 deletions
  1. +14
    -0
      wiringPi/softPwm.c
  2. +2
    -3
      wiringPi/softPwm.h

+ 14
- 0
wiringPi/softPwm.c View File

@@ -84,8 +84,22 @@ static PI_THREAD (softPwmThread)
return NULL ; return NULL ;
} }



/*
* softPwmWrite:
* Write a PWM value to the given pin
*********************************************************************************
*/

void softPwmWrite (int pin, int value) void softPwmWrite (int pin, int value)
{ {
pin &= 63 ;

/**/ if (value < 0)
value = 0 ;
else if (value > range [pin])
value = range [pin] ;

marks [pin] = value ; marks [pin] = value ;
} }




+ 2
- 3
wiringPi/softPwm.h View File

@@ -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) ;

Loading…
Cancel
Save