aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drv_MatrixOrbital.c86
1 files changed, 49 insertions, 37 deletions
diff --git a/drv_MatrixOrbital.c b/drv_MatrixOrbital.c
index ec1f949..5ee11c9 100644
--- a/drv_MatrixOrbital.c
+++ b/drv_MatrixOrbital.c
@@ -1,4 +1,4 @@
-/* $Id: drv_MatrixOrbital.c,v 1.26 2004/05/31 16:39:06 reinelt Exp $
+/* $Id: drv_MatrixOrbital.c,v 1.27 2004/05/31 21:23:16 reinelt Exp $
*
* new style driver for Matrix Orbital serial display modules
*
@@ -23,6 +23,10 @@
*
*
* $Log: drv_MatrixOrbital.c,v $
+ * Revision 1.27 2004/05/31 21:23:16 reinelt
+ *
+ * some cleanups in the MatrixOrbital driver
+ *
* Revision 1.26 2004/05/31 16:39:06 reinelt
*
* added NULL display driver (for debugging/profiling purposes)
@@ -407,54 +411,62 @@ static int drv_MO_start (char *section)
if (drv_generic_serial_open(section, Name, 0)<0) return -1;
- // read module type
- drv_generic_serial_write ("\3767", 2);
- usleep(1000);
- if (drv_generic_serial_read (buffer, 1)==1) {
- for (i=0; Models[i].type!=0xff; i++) {
- if (Models[i].type == (int)*buffer) break;
- }
- info ("%s: display reports model '%s' (type 0x%02x)",
- Name, Models[i].name, Models[i].type);
+ if (Model == -1 || Models[Model].protocol > 1) {
+ // read module type
+ drv_generic_serial_write ("\3767", 2);
+ usleep(1000);
+ if (drv_generic_serial_read (buffer, 1)==1) {
+ for (i=0; Models[i].type!=0xff; i++) {
+ if (Models[i].type == (int)*buffer) break;
+ }
+ info ("%s: display reports model '%s' (type 0x%02x)",
+ Name, Models[i].name, Models[i].type);
- // auto-dedection
- if (Model==-1) Model=i;
+ // auto-dedection
+ if (Model==-1) Model=i;
- // auto-dedection matches specified model?
- if (Models[i].type!=0xff && Model!=i) {
- error ("%s: %s.Model '%s' from %s does not match dedected Model '%s'",
- Name, section, model, cfg_source(), Models[i].name);
- return -1;
- }
+ // auto-dedection matches specified model?
+ if (Models[i].type!=0xff && Model!=i) {
+ error ("%s: %s.Model '%s' from %s does not match dedected Model '%s'",
+ Name, section, model, cfg_source(), Models[i].name);
+ return -1;
+ }
- } else {
- info ("%s: display detection failed.", Name);
- }
-
- // read serial number
- drv_generic_serial_write ("\3765", 2);
- usleep(100000);
- if (drv_generic_serial_read (buffer, 2)==2) {
- info ("%s: display reports serial number 0x%x", Name, *(short*)buffer);
+ } else {
+ info ("%s: display detection failed.", Name);
+ }
}
- // read version number
- drv_generic_serial_write ("\3766", 2);
- usleep(100000);
- if (drv_generic_serial_read (buffer, 1)==1) {
- info ("%s: display reports firmware version 0x%x", Name, *buffer);
- }
-
// initialize global variables
DROWS = Models[Model].rows;
DCOLS = Models[Model].cols;
GPOS = Models[Model].gpos;
Protocol = Models[Model].protocol;
- if (Protocol==2)
- drv_generic_serial_write ("\376\130", 2); // Clear Screen
- else
+ if (Protocol > 1) {
+ // read serial number
+ drv_generic_serial_write ("\3765", 2);
+ usleep(100000);
+ if (drv_generic_serial_read (buffer, 2)==2) {
+ info ("%s: display reports serial number 0x%x", Name, *(short*)buffer);
+ }
+
+ // read version number
+ drv_generic_serial_write ("\3766", 2);
+ usleep(100000);
+ if (drv_generic_serial_read (buffer, 1)==1) {
+ info ("%s: display reports firmware version 0x%x", Name, *buffer);
+ }
+ }
+
+ switch (Protocol) {
+ case 1:
drv_generic_serial_write ("\014", 1); // Clear Screen
+ break;
+ case 2:
+ drv_generic_serial_write ("\376\130", 2); // Clear Screen
+ break;
+ }
drv_generic_serial_write ("\376B", 3); // backlight on
drv_generic_serial_write ("\376K", 2); // cursor off
amp;follow=1'>Release 0+git20141218.b46a22c-1debian/0+git20141218.b46a22c-1Jonathan McCrohan1-2/+2 2014-12-28Updated AU DVB-T files; Thanks Brian Burch! (Closes LP: #1393280)Jonathan McCrohan1-0/+1 2014-12-28New Upstream Snapshot (commit b46a22c)Jonathan McCrohan1-0/+6 2014-12-28Imported Upstream version 0+git20141218.b46a22cupstream/0+git20141218.b46a22cJonathan McCrohan535-639/+317 2014-10-20Release 0+git20141009.d26b627-1debian/0+git20141009.d26b627-1Jonathan McCrohan1-2/+2 2014-10-20Fix up packaging to account for move to DVBv5Jonathan McCrohan2-2/+6 2014-10-20delete d/dtv-scan-files.install; Upstream now supplies a MakefileJonathan McCrohan2-4/+1 2014-10-15d/control: update Standards Version to 3.9.6Jonathan McCrohan2-1/+3 2014-10-15d/control: add Build-Depends on dvb-toolsJonathan McCrohan2-1/+2 2014-10-15New Upstream Snapshot (commit d26b627)Jonathan McCrohan1-0/+10 2014-10-15Imported Upstream version 0+git20141009.d26b627upstream/0+git20141009.d26b627Jonathan McCrohan2010-11120/+159271 2014-07-23Release 0+git20140611.14bd6c7-1debian/0+git20140611.14bd6c7-1Jonathan McCrohan1-2/+2 2014-07-23New Upstream Snapshot (commit 14bd6c7)Jonathan McCrohan1-2/+3 2014-07-23Imported Upstream version 0+git20140611.14bd6c7upstream/0+git20140611.14bd6c7Jonathan McCrohan7-11/+60 2014-05-13New Upstream Snapshot (commit 1246b27)Jonathan McCrohan1-0/+6 2014-05-13Imported Upstream version 0+git20140512.1246b27upstream/0+git20140512.1246b27Jonathan McCrohan391-301/+3983 2014-04-05Release 0+git20140326.cfc2975-1debian/0+git20140326.cfc2975-1Jonathan McCrohan1-2/+2 2014-04-05d/control: update Homepage (upstream has moved from Gitweb to cgit)Jonathan McCrohan2-1/+2 2014-04-05New Upstream Snapshot (commit cfc2975)Jonathan McCrohan1-0/+6 2014-04-05Imported Upstream version 0+git20140326.cfc2975upstream/0+git20140326.cfc2975Jonathan McCrohan118-656/+877 2014-01-16Release 0+git20140107.1850cf8-1debian/0+git20140107.1850cf8-1Jonathan McCrohan1-2/+2 2014-01-16Update Standards Version to 3.9.5Jonathan McCrohan2-1/+9