Commit graph

13 commits

Author SHA1 Message Date
Drew Fustini
6d78f9db06 Fix gcc warnings about comparing signed and unsigned values
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
2017-01-11 09:14:38 +00:00
Drew Fustini
b1ad088164 Fix unused parameter warning [-Werror=unused-parameter] 2017-01-10 10:52:01 +00:00
Drew Fustini
4371949776 Adjust ADC scaling based on kernel version
The older Linux 3.8.13 kernel produced raw ADC value
of 0 to 1800.  Newer Linux 4.1+ kernels produce ADC
value of 0 to 4095.
2016-10-28 08:49:53 +00:00
Deng Bo
9220c13f90 BBB has 12‐bit ADCs (2^12 = 4,096), meaning a value between 0 and 2^12 − 1 (0 to 4,095), read() should return the raw value devide by 4095. 2016-10-26 11:23:07 +08:00
Matthew West
8fe1336b0a Bug fixes almost to stability 2016-08-08 10:51:15 -07:00
Matthew West
6b2aa7aabc Change return value convention for errors
Replace 1 for success and 0/-1 for failure with an enum type.
2016-08-05 13:19:54 -07:00
Tony DiCola
5c8db6b80d Fix #67 and fix compiler warnings. 2014-10-03 23:24:10 +00:00
Zach Thorson
fa1b4a3e7e Added a retry to reading for the analog inputs to avoid a bug where reading back and forth between two analog inputs would cause the resource to be unavailable every 16 scans
Corrected the readback of the success bit to correctly check for a read and raise an exception on failure
2013-11-20 14:52:04 -06:00
Zach Thorson
34d7e30e1a Updated the build_path to be more selective over what paths it chooses (This should prevent chosing the wrong helper leading to seg faults)
Improved error messages when ADC fails to setup
Check for null file handle when opening AIN to prevent seg fault
2013-11-14 11:10:09 -06: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
bdafa9a6c5 working adc, remove cleanup, add read_raw 2000-01-01 03:57:40 +00:00
Justin Cooper
78610e35a2 clean up adc, and add test 2000-01-01 00:03:14 +00:00
Justin Cooper
651395582a initial adc commit 2000-01-03 02:00:52 +00:00