1
0
mirror of https://github.com/richardghirst/PiBits.git synced 2024-11-29 13:24:10 +01:00
Commit Graph

22 Commits

Author SHA1 Message Date
Richard Hirst
fe63b9899e Rework to process commands as they are issued, rather than on close() 2012-11-23 22:31:42 +00:00
Robin Mallinson
e59ad99d57 Change dev_read() to output data suitable for direct write back through the dev file. 2012-11-21 22:46:23 +00:00
Robin Mallinson
e712bd86ba All works as intended now. Commands can be written partially, and a single
write to the device file may contain multiple commands.
To achieve both of these the driver now only parses the commands on
dev_close().
2012-11-21 03:15:12 +00:00
Robin Mallinson
0439809e27 Use max_idx rather than hardcoded data. 2012-11-21 01:48:14 +00:00
Robin Mallinson
1b8dbeed21 Increase space available for cmd_str ready for taking multiple commands in one go. 2012-11-21 01:07:17 +00:00
Robin Mallinson
ce367d489a Factor out process_command_string() 2012-11-21 01:00:36 +00:00
Robin Mallinson
983e36f7c1 Following test and bug fix code now works as intended on partial writes. 2012-11-21 00:48:27 +00:00
Robin Mallinson
b1bb608d4c Allow dev_write to work per-process. 2012-11-18 23:35:32 +00:00
Robin Mallinson
ef87ef88a7 Add code to allow dev_write to cope with partial writes (as will sometimes
occur when using languages such as python to write to the dev file).
Currently static data so same for all processes.
2012-11-18 23:15:35 +00:00
Robin Mallinson
b14044eba1 Refactor dev_write prior to allowing it to take partial strings. 2012-11-18 21:52:28 +00:00
Robin Mallinson
e993a088eb Change dev_read to use per-process data. 2012-11-18 21:12:36 +00:00
Robin Mallinson
38101f8a62 fix dumb typo 2012-11-18 14:57:55 +00:00
Robin Mallinson
90dfe77fd5 Sketch out temporary data 2012-11-18 14:55:27 +00:00
Robin Mallinson
d6e1b2efe5 Add skeleton of allocation code for kmalloc and kfree. Currently allocates a dummy storage area. 2012-11-18 14:36:05 +00:00
Robin Mallinson
4b87d814df Add crude 'written_data' array so dev_read simply echos verbatim what was written to dev_write without probing the actual DMA control block data. This gives no clue as to whether the DMA control bloack has been programmed but does mean that Richard's control code - which has a special case for delay=0 - does not require changing. Next steps are to have an array per-process. 2012-11-18 14:09:45 +00:00
Robin Mallinson
94c2aab61b Revert to original code re: setting delay, so we again have a delay of 1
for a pulse of zero.  Will frig the display issues by using an array that
stores written cnt rather than deriving it from actual register data.
2012-11-18 13:47:30 +00:00
Robin Mallinson
62f326001c Refactor to amke the only difference between the code paths a little more obvious. 2012-11-13 00:02:11 +00:00
Robin Mallinson
e3230cb8d2 Make servoblaster write pulse high length even when cnt=0. Also change default tick high from 1 to zero. 2012-11-12 23:49:39 +00:00
Robin Mallinson
8002904e4e Enable dev_read code, plus fix a couple of syntax errors (the code hadn't been compiled).
It appears to work at a cursory level:

pi@raspberrypi ~/src/PiBits/ServoBlaster $ sudo insmod ./servoblaster.ko
pi@raspberrypi ~/src/PiBits/ServoBlaster $ ls -l /dev/servoblaster
crw-rw-rw- 1 root root 251, 0 Nov 11 19:22 /dev/servoblaster
pi@raspberrypi ~/src/PiBits/ServoBlaster $ cat /dev/servoblaster
0 1
1 1
2 1
3 1
4 1
5 1
6 1
7 1
pi@raspberrypi ~/src/PiBits/ServoBlaster $
2012-11-11 19:23:41 +00:00
Robin Mallinson
fd2d771d1e Add dev_read() function to driver to allow it to report current settings
for each of the 8 PWMs via /dev/servoblaster.
2012-11-05 22:23:45 +00:00
Richard Hirst
2b9f76dd88 Updates to allow tweaking timing via module parameters 2012-08-30 21:58:53 +01:00
Richard Hirst
d8df9b7625 Added ServoBlaster 2012-08-19 17:11:33 +01:00