mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-10-22 11:46:03 +00:00
(Phil) It works! So, I'll commit it. Here's the skinny:
There is only one file 'disp'. To send bytes (like chars to be displayed)
you send a series of unsigned base-10 values separated by spaces.
For example:
echo "hi there" | perl -e \
'$_=<STDIN>; while (/(.)/gc) { print ord($1)," "; }' \
> /proc/sys/dev/sensors/matorb*/disp
This is equivelent to doing:
echo "104 105 32 116 104 101 114 101" > /proc/sys/dev/sensors/matorb*/disp
I was going to create more files for doing things like clearing the screen,
but it is easier and probably better to do this in user-space. For example,
to clean the screen, you can do:
echo "254 88" > /proc/sys/dev/sensors/matorb*/disp
(As documented in the manual from Matrix-Orbital)
If the folks at Matrix-Orbital added device ID on a read (we talked about
this), then I will add an ID file to indicate that info.
TODO: finish detection. Right now it looks for a device at a particular
address and assumes it is a display.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@482 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
1ff91e0555
commit
63a083da8e
1 file changed
+4
-2
@@ -303,6 +303,8 @@ void matorb_update_client(struct i2c_client *client)
|
||||
void matorb_disp(struct i2c_client *client, int operation, int ctl_name,
|
||||
int *nrels_mag, long *results)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (operation == SENSORS_PROC_REAL_INFO)
|
||||
*nrels_mag = 0;
|
||||
else if (operation == SENSORS_PROC_REAL_READ) {
|
||||
@@ -310,8 +312,8 @@ void matorb_disp(struct i2c_client *client, int operation, int ctl_name,
|
||||
results[0] = 0;
|
||||
*nrels_mag = 3;
|
||||
} else if (operation == SENSORS_PROC_REAL_WRITE) {
|
||||
if (*nrels_mag >= 1) {
|
||||
matorb_write_value(client,0,results[0]);
|
||||
for (i=1; i<=*nrels_mag;i++) {
|
||||
matorb_write_value(client,0,results[i-1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user