Commit graph

63 commits

Author SHA1 Message Date
Justin Cooper
25e654a982 fix for SPI not loading spidevX.X correctly based on load order 2014-05-23 03:22:48 +00:00
Justin Cooper
a0902d971f further pwm cleanup 2013-08-19 21:52:16 +00:00
bit-hacker
fc4df3fdf1 Update c_pwm.c
In definition of struct pwm_exp, extended length of key by 1 to ensure room for a terminating byte.  Currently, the code doesn't check this, expecting strncpy in pwm_start to trim and NUL-terminate the string. 

In lookup_exported_pwm, return "not-found" condition as NULL, not 0, per general pointer usage recommendations.

In pwm_start, added code to ensure NUL-termination of the key.

In pwm_disable, there's a path that doesn't set prev_pwm and can leave it NULL.  It being NULL seems to indicate a "first-time" flag, for when the first item in the list is matched. If the search should be terminated after finding device "key", should break be used?  Reasonably, a device named "key" should only be found once in the tree, but as coded, it seems that this search loop might find it more than once.  

In pwm_set_polarity, the original length of the buffer as 5 will cover positive 16-bit integers, but not room for a trailing NUL byte.  If accidently negative, a size of 7 will include room for the sign without breaking.
2013-08-16 09:54:26 -07:00
Justin Cooper
a322ddc2c0 fix for polarity not getting set properly, add polarity as optional parameter in start 2013-08-15 03:55:08 +00:00
Justin Cooper
5f865a1b6c remove unused variables 2013-08-12 21:28:46 +00:00
Justin Cooper
b9c2b3d6d7 Fix PWM duty cycle so 0 is off and 100 is on. Set polarity to 0 by default. 2013-08-12 21:25:51 +00:00
Justin Cooper
670bfcbf1c better error handling of load_device_tree through adc, pwm, and uart 2013-07-30 19:34:24 +00:00
Justin Cooper
ab6dab6519 fix tests, initial non-working spi, refactor loading device tree 2000-01-01 00:06:09 +00:00
Justin Cooper
465ce81caa remove unused code 2000-01-03 02:00:27 +00:00
Justin Cooper
5343ed160a add copyright and license notices 2000-01-01 00:04:25 +00:00
Justin Cooper
844a19570e pwm working per the tests 2013-06-11 20:45:46 +00:00
Justin Cooper
1a31f1714e initial duty and frequency settings for pwm 2013-06-11 05:55:46 +00:00
Justin Cooper
1258c651cb Initial Commit 2013-06-10 20:16:39 +00:00