[Lcdproc] MOU-AL202C-XR
Ray Molenkamp
rmolenkamp@matrixorbital.ca
Thu May 15 21:20:02 2008
This is a MIME-formatted message. If you see this text it means that your
E-mail software does not support MIME-formatted messages.
--=_mail.matrixorbital.ca-5357-1210886479-0001-2
Content-Type: text/plain; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Ethan,
Please review attached patch.
The K was not caused by the cursor command
but by the GPO output commands. On units with
only 1 GPO you send 254 'V' or 'W' to turn it
on or off. On units with more GPOs it takes a
parameter specifying which GPO to turn on/off.
What was happening is on a unit that had multiple
GPO's the codepath for a single GPO was chosen
254 'V/W' was send, with the unit waiting for the parameter
Next command in the pipeline was a cursor command
254 'K' , the GPO command ate the 254 and the K
was displayed on the display.
Since there is no way to tell how many
GPO's a unit has and even if we kept list
there's always custom units that deviate from
the standard I moved the setting to the config file.
Seemed like the most logic thing to do.
--Ray
Ethan Dicks wrote:
> On Wed, May 14, 2008 at 11:01 PM, Ray Molenkamp
> <rmolenkamp@matrixorbital.ca> wrote:
>
>> Couldn't find an lcd in the office so used a vfd and had the
>> display type set to vfd. I'll track down an lcd and try again
>> tomorrow for you.
>>
>
> Hi, Ray,
>
> I think I'm one of the few LCDproc driver maintainers who still has a
> Matrix Orbital display - a VKD204 bought in, IIRC, mid-2000. I did
> fix a bug with VFD/VKD displays between the released version of 0.5.2
> and the a later version in CVS. Unfortunately, I can't test
> LCD-specific code since I don't have an MO LCD. I can say that I've
> run into strange behavior when accidentally forgetting to set the MO
> display type - there's a bit of code that determines what specific
> control codes to send to handle the minor differences between the two
> command sets.
>
> Looking at MtxOrb_cursor() in a recent version of MtxOrb.c, it
> explicitly sends either a "K" or a "J" to rurn the cursor off or on.
> I don't have the manual for your model of LCD in front of me, but did
> the command change to control the cursor?
>
> -ethan
> _______________________________________________
> LCDproc mailing list
> LCDproc@lists.omnipotent.net
> http://lists.omnipotent.net/mailman/listinfo/lcdproc
>
--=_mail.matrixorbital.ca-5357-1210886479-0001-2
Content-Type: text/plain; name="patch.diff"; charset=iso-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="patch.diff"
diff -uprN lcdproc-cvs/LCDd.conf lcdproc-tst/LCDd.conf
--- lcdproc-cvs/LCDd.conf 2008-05-09 03:28:18.000000000 -0600
+++ lcdproc-tst/LCDd.conf 2008-05-15 19:01:27.000000000 -0600
@@ -737,6 +737,8 @@ Speed=19200
# keypad_set_mode to no again.
keypad_test_mode=no
+# Define how many GPOs the unit has
+GPOs=6
## mx5000 driver for LCD display on the Logitech MX5000 keyboard ##
diff -uprN lcdproc-cvs/server/drivers/MtxOrb.c lcdproc-tst/server/drivers/MtxOrb.c
--- lcdproc-cvs/server/drivers/MtxOrb.c 2007-11-04 07:49:51.000000000 -0700
+++ lcdproc-tst/server/drivers/MtxOrb.c 2008-05-15 19:01:15.000000000 -0600
@@ -117,6 +117,9 @@ typedef enum {
typedef struct {
int fd; /* The LCD file descriptor */
+ /* Number of GPOs on the module */
+ int GPOs;
+
/* dimensions */
int width, height;
int cellwidth, cellheight;
@@ -306,6 +309,9 @@ MtxOrb_init (Driver *drvthis)
drvthis->name, buf);
return -1;
}
+
+ /* Get GPO settings */
+ p->GPOs = drvthis->config_get_int(drvthis->name, "GPOs", 0, 0);
/* Get keypad settings */
@@ -778,32 +784,34 @@ MtxOrb_backlight (Driver *drvthis, int o
MODULE_EXPORT void
MtxOrb_output (Driver *drvthis, int state)
{
+ int i;
PrivateData *p = drvthis->private_data;
unsigned char out[5] = { '\xFE', 0, 0 };
- state &= 0x3F; /* strip to six bits */
+ state &= ( (1 << p->GPOs) -1 ); /* strip to nr of GPOs bits */
p->output_state = state;
debug(RPT_DEBUG, "MtxOrb: output pins set: %04X", state);
-
- if (IS_LCD_DISPLAY || IS_VFD_DISPLAY) {
- /* LCD and VFD displays only have one output port */
- out[1] = (state) ? 'W' : 'V';
+ switch (p->GPOs)
+ {
+ case 0:
+ break;
+ case 1:
+ out[1] = (state) ? 'W' : 'V';
write(p->fd, out, 2);
- }
- else {
- int i;
-
- /* Other displays have six output ports;
+ break;
+ default:
+ /* Other displays have multiple output ports;
* the value "on" is a binary value determining which
* ports are turned on (1) and off (0).
*/
- for (i = 0; i < 6; i++) {
+ for (i = 0; i < p->GPOs; i++) {
out[1] = (state & (1 << i)) ? 'W' : 'V';
out[2] = i+1;
write(p->fd, out, 3);
}
+ break;
}
}
--=_mail.matrixorbital.ca-5357-1210886479-0001-2--