]> git.webhop.me Git - lcd4linux.git/commitdiff
[lcd4linux @ 2004-01-21 06:39:27 by reinelt]
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Wed, 21 Jan 2004 06:39:27 +0000 (06:39 +0000)
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Wed, 21 Jan 2004 06:39:27 +0000 (06:39 +0000)
HD44780 missed the "clear display' sequence
asc255bug handling added
HD44780 tested, works here!

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

drv_HD44780.c
lcd4linux.conf.sample

index d841a7b65269254900e092dceaef609345aad9d4..8432057049aab5faf8fdeba30a9f0380f4deef44 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: drv_HD44780.c,v 1.1 2004/01/20 15:32:49 reinelt Exp $
+/* $Id: drv_HD44780.c,v 1.2 2004/01/21 06:39:27 reinelt Exp $
  *
  * new style driver for HD44780-based displays
  *
  *
  *
  * $Log: drv_HD44780.c,v $
+ * Revision 1.2  2004/01/21 06:39:27  reinelt
+ * HD44780 missed the "clear display' sequence
+ * asc255bug handling added
+ * HD44780 tested, works here!
+ *
  * Revision 1.1  2004/01/20 15:32:49  reinelt
  * first version of Next Generation HD44780 (untested! but it compiles...)
  * some cleanup in the other drivers
@@ -347,7 +352,9 @@ static int drv_HD_start (char *section)
   drv_HD_command (0x03, 0x08, T_EXEC);  // Display off, cursor off, blink off
   drv_HD_command (0x03, 0x0c, T_CLEAR); // Display on, cursor off, blink off, wait 1.64 ms
   drv_HD_command (0x03, 0x06, T_EXEC);  // curser moves to right, no shift
-  
+  drv_HD_command (0x03, 0x01, T_CLEAR); // clear *both* displays
+  drv_HD_command (0x03, 0x03, T_CLEAR); // return home
   return 0;
 }
 
@@ -424,6 +431,7 @@ int drv_HD_list (void)
 int drv_HD_init (char *section)
 {
   WIDGET_CLASS wc;
+  int asc255bug;
   int ret;  
   
   XRES=5;
@@ -443,8 +451,13 @@ int drv_HD_init (char *section)
     return ret;
   
   // add fixed chars to the bar driver
+  // most displays have a full block on ascii 255, but some have kind of 
+  // an 'inverted P'. If you specify 'asc255bug 1 in the config, this
+  // char will not be used, but rendered by the bar driver
+  cfg_number(section, "asc255bug", 0, 0, 1, &asc255bug);
   drv_generic_text_bar_add_segment (  0,  0,255, 32); // ASCII  32 = blank
-  drv_generic_text_bar_add_segment (255,255,255,255); // ASCII 255 = block
+  if (!asc255bug) 
+    drv_generic_text_bar_add_segment (255,255,255,255); // ASCII 255 = block
   
   // register text widget
   wc=Widget_Text;
index 37beb543d7dc9edfbd29feaadcda4b8bc9704d97..5e085572f2b1b178814c0b2cedecfcd173be03a8 100644 (file)
@@ -14,6 +14,7 @@ Display myHD44780 {
 #   Port '0x378'
     Bits '8'
     Size '20x4'
+    asc255bug 1
     Wire {
        RW     'GND'
        RS     'AUTOFD'