richardghirst/PiBits — pull request #1 by rmallins (2012-11-11 21:40:30+00:00)
Title: Dev read

Hi Rich, this change adds a read capability to /dev/servoblaster, which I thought might be pretty useful for diagnostic purposes. I've updated the readme to suit.
Example of use:

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 $ echo 3=120 > /dev/servoblaster
pi@raspberrypi ~/src/PiBits/ServoBlaster $ echo 6=180 > /dev/servoblaster
pi@raspberrypi ~/src/PiBits/ServoBlaster $ cat /dev/servoblaster
0 1
1 1
2 1
3 120
4 1
5 1
6 180
7 1
pi@raspberrypi ~/src/PiBits/ServoBlaster $

Interesting that the code reads 1 before anything's done, while the default is supposed to be zero. It reads directly from the registers that the dev_write code writes to. Is there an off by 1 error in the existing code or have I just missed something?
regards,
Robin