]> git.webhop.me Git - lcd4linux.git/commitdiff
[lcd4linux @ 2004-06-05 14:56:48 by reinelt]
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Sat, 5 Jun 2004 14:56:48 +0000 (14:56 +0000)
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Sat, 5 Jun 2004 14:56:48 +0000 (14:56 +0000)
Cwlinux splash screen fixed
USBLCD splash screen fixed
plugin_i2c qprintf("%f") replaced with snprintf()

git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@465 3ae390bd-cb1e-0410-b409-cd5a39f66f1f

drv_Cwlinux.c
drv_USBLCD.c
plugin_i2c_sensors.c

index 20b11751f53d188fafd433e45083932cc9642a1b..8b6987ded17d37a60821919a9de2577ae2f4114b 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: drv_Cwlinux.c,v 1.14 2004/06/05 06:41:39 reinelt Exp $
+/* $Id: drv_Cwlinux.c,v 1.15 2004/06/05 14:56:48 reinelt Exp $
  *
  * new style driver for Cwlinux display modules
  *
  *
  *
  * $Log: drv_Cwlinux.c,v $
+ * Revision 1.15  2004/06/05 14:56:48  reinelt
+ *
+ * Cwlinux splash screen fixed
+ * USBLCD splash screen fixed
+ * plugin_i2c qprintf("%f") replaced with snprintf()
+ *
  * Revision 1.14  2004/06/05 06:41:39  reinelt
  *
  * chancged splash screen again
@@ -140,7 +146,7 @@ typedef struct {
 
 static MODEL Models[] = {
   { 0x01, "CW1602",   2, 16,  5,  0,  1 },
-  { 0x02, "CW12232",  4, 40,  6,  0,  2 },
+  { 0x02, "CW12232",  4, 20,  6,  0,  2 },
   { 0xff, "Unknown", -1, -1, -1, -1, -1 }
 };
 
@@ -246,7 +252,7 @@ static int drv_CW_brightness (int brightness)
 }
 
 
-static int drv_CW_start (char *section, int quiet)
+static int drv_CW_start (char *section)
 {
   int i;  
   char *model;
@@ -304,15 +310,6 @@ static int drv_CW_start (char *section, int quiet)
     drv_CW_brightness(i);
   }
 
-  if (!quiet) {
-    char buffer[40];
-    qprintf(buffer, sizeof(buffer), "%s %s", Name, Models[Model].name);
-    if (drv_generic_text_greet (buffer, "www.cwlinux.com")) {
-      sleep (3);
-      drv_CW_clear();
-    }
-  }
-
   return 0;
 }
 
@@ -382,7 +379,7 @@ int drv_CW_init (char *section, int quiet)
   GOTO_COST = 3;  // number of bytes a goto command requires
 
   // start display
-  if ((ret=drv_CW_start (section, quiet))!=0)
+  if ((ret=drv_CW_start (section))!=0)
     return ret;
   
   // real worker functions
@@ -397,6 +394,15 @@ int drv_CW_init (char *section, int quiet)
       break;
   }
   
+  if (!quiet) {
+    char buffer[40];
+    qprintf(buffer, sizeof(buffer), "%s %s", Name, Models[Model].name);
+    if (drv_generic_text_greet (buffer, "www.cwlinux.com")) {
+      sleep (3);
+      drv_CW_clear();
+    }
+  }
+
   // initialize generic text driver
   if ((ret=drv_generic_text_init(section, Name))!=0)
     return ret;
index 28d7d004bd0b9f6950c9da657e980c6424895b91..d7d05c5474efd75db835003704e4b21d7d49c239 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: drv_USBLCD.c,v 1.8 2004/06/05 06:41:40 reinelt Exp $
+/* $Id: drv_USBLCD.c,v 1.9 2004/06/05 14:56:48 reinelt Exp $
  *
  * new style driver for USBLCD displays
  *
  *
  *
  * $Log: drv_USBLCD.c,v $
+ * Revision 1.9  2004/06/05 14:56:48  reinelt
+ *
+ * Cwlinux splash screen fixed
+ * USBLCD splash screen fixed
+ * plugin_i2c qprintf("%f") replaced with snprintf()
+ *
  * Revision 1.8  2004/06/05 06:41:40  reinelt
  *
  * chancged splash screen again
@@ -143,6 +149,8 @@ static void drv_UL_command (unsigned char cmd)
 static void drv_UL_clear (void)
 {
   drv_UL_command (0x01); // clear display
+  drv_UL_command (0x03); // return home
+  drv_UL_send();         // flush buffer
 }
 
 
@@ -267,11 +275,8 @@ static int drv_UL_start (char *section, int quiet)
   drv_UL_command (0x08); // Display off, cursor off, blink off
   drv_UL_command (0x0c); // Display on, cursor off, blink off
   drv_UL_command (0x06); // curser moves to right, no shift
-  drv_UL_clear();        // clear display
-  drv_UL_command (0x03); // return home
 
-  // flush buffer
-  drv_UL_send();
+  drv_UL_clear();        // clear display
   
   if (!quiet) {
     char buffer[40];
@@ -279,7 +284,6 @@ static int drv_UL_start (char *section, int quiet)
     if (drv_generic_text_greet (buffer, "http://www.usblcd.de")) {
       sleep (3);
       drv_UL_clear();
-      drv_UL_send();
     }
   }
     
@@ -400,9 +404,6 @@ int drv_UL_quit (void)
   
   // say goodbye...
   drv_generic_text_greet ("goodbye!", NULL);
-
-  // flush buffer
-  drv_UL_send();
   
   debug ("closing port %s", Port);
   close(usblcd_file);
index 2dcea77e2127a46b85dc6ee453dd827fe93ea180..4f1e569a385b79e34ea44f9a9ab337bb26b9f773 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: plugin_i2c_sensors.c,v 1.16 2004/06/01 06:45:30 reinelt Exp $
+/* $Id: plugin_i2c_sensors.c,v 1.17 2004/06/05 14:56:48 reinelt Exp $
  *
  * I2C sensors plugin
  *
  *
  *
  * $Log: plugin_i2c_sensors.c,v $
+ * Revision 1.17  2004/06/05 14:56:48  reinelt
+ *
+ * Cwlinux splash screen fixed
+ * USBLCD splash screen fixed
+ * plugin_i2c qprintf("%f") replaced with snprintf()
+ *
  * Revision 1.16  2004/06/01 06:45:30  reinelt
  *
  * some Fixme's processed
@@ -194,7 +200,7 @@ static int parse_i2c_sensors_sysfs(char *key)
       !strncmp(key, "curr", 4)  ||
       !strncmp(key, "in", 2)    ||
       !strncmp(key, "vid", 3)) {
-    qprintf(val, sizeof(val), "%f", strtod(buffer, NULL) / 1000.0);   
+    snprintf(val, sizeof(val), "%f", strtod(buffer, NULL) / 1000.0);   
   } else {
     qprintf(val, sizeof(val), "%s", buffer); 
     // we supress this nasty \n at the end