]> git.webhop.me Git - lcd4linux.git/commitdiff
[lcd4linux @ 2001-03-15 15:49:22 by ltoetsch]
authorltoetsch <ltoetsch@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Thu, 15 Mar 2001 15:49:23 +0000 (15:49 +0000)
committerltoetsch <ltoetsch@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Thu, 15 Mar 2001 15:49:23 +0000 (15:49 +0000)
fixed compile HD44780.c, cosmetics

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

HD44780.c
mail.c
processor.c

index 0832d57cfd4305c1b70a3364575c0eb4407178e7..a92d0516a53f8c3103a9c5b296c22ee27cd6185c 100644 (file)
--- a/HD44780.c
+++ b/HD44780.c
@@ -1,4 +1,4 @@
-/* $Id: HD44780.c,v 1.18 2001/03/15 09:47:13 reinelt Exp $
+/* $Id: HD44780.c,v 1.19 2001/03/15 15:49:22 ltoetsch Exp $
  *
  * driver for display modules based on the HD44780 chip
  *
@@ -20,6 +20,9 @@
  *
  *
  * $Log: HD44780.c,v $
+ * Revision 1.19  2001/03/15 15:49:22  ltoetsch
+ * fixed compile HD44780.c, cosmetics
+ *
  * Revision 1.18  2001/03/15 09:47:13  reinelt
  *
  * some fixes to ppdef
@@ -182,7 +185,10 @@ static LCD Lcd;
 static unsigned short Port=0;
 
 static char *PPdev=NULL;
+
+#ifdef WITH_PPDEV
 static int   PPfd=-1;
+#endif
 
 static char Txt[4][40];
 static BAR  Bar[4][40];
@@ -754,6 +760,7 @@ int HD_flush (void)
 
 int HD_quit (void)
 {
+#ifdef WITH_PPDEV
   if (PPdev) {
     debug ("closing ppdev %s", PPdev);
     if (ioctl(PPfd, PPRELEASE)) {
@@ -763,7 +770,9 @@ int HD_quit (void)
       error ("close(%s) failed: %s", PPdev, strerror(errno));
       return -1;
     }
-  } else {
+  } else 
+#endif    
+   {
     debug ("closing raw port 0x%x", Port);
     if (ioperm(Port, 3, 0)!=0) {
       error ("HD44780: ioperm(0x%x) failed: %s", Port, strerror(errno));
diff --git a/mail.c b/mail.c
index 18158090e0a7b58e5712517f1d8510a9a9533cbf..7e0711858f3e319eba65f90e08543b75b90d09b8 100644 (file)
--- a/mail.c
+++ b/mail.c
@@ -1,4 +1,4 @@
-/* $Id: mail.c,v 1.7 2001/03/15 14:25:05 ltoetsch Exp $
+/* $Id: mail.c,v 1.8 2001/03/15 15:49:23 ltoetsch Exp $
  *
  * email specific functions
  *
@@ -20,6 +20,9 @@
  *
  *
  * $Log: mail.c,v $
+ * Revision 1.8  2001/03/15 15:49:23  ltoetsch
+ * fixed compile HD44780.c, cosmetics
+ *
  * Revision 1.7  2001/03/15 14:25:05  ltoetsch
  * added unread/total news
  *
@@ -95,14 +98,18 @@ int Mail (int index, int *num, int *unseen)
 
   if (index<0 || index>MAILBOXES) return -1;
 
-  if (now[index] == 0) { /* not first time, to give faster a chance */
-    now[index] = -1;
+  if (now[index] == 0) { /* first time, to give faster a chance */
+    now[index] = -1-index;
+    return 0;
+  }
+  if (now[index] < -1) { /* wait different time to avoid long startup */
+    now[index]++;
     return 0;
   }
-  if (now[index] > 0) {        /* first time, immediately, else wait  */
+  if (now[index] > 0) {        /* not first time, delay  */
     sprintf(txt1, "Delay_e%d", index); 
     if (time(NULL)<=now[index]+atoi(cfg_get(txt1)?:"5")) 
-      return 0;   // More then 5/Delay_eX seconds after last check?
+      return 0;   // no more then 5/Delay_eX seconds after last check?
   }
   time(&now[index]);                      // for Mailbox #index
   /*
index fdda6611df7a40913f293f3b5c9bd5bb8e63bd04..ad878686e10d2795f0397defb3cb2a93dcf2056b 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: processor.c,v 1.21 2001/03/15 09:47:13 reinelt Exp $
+/* $Id: processor.c,v 1.22 2001/03/15 15:49:23 ltoetsch Exp $
  *
  * main data processing
  *
@@ -20,6 +20,9 @@
  *
  *
  * $Log: processor.c,v $
+ * Revision 1.22  2001/03/15 15:49:23  ltoetsch
+ * fixed compile HD44780.c, cosmetics
+ *
  * Revision 1.21  2001/03/15 09:47:13  reinelt
  *
  * some fixes to ppdef
@@ -460,12 +463,6 @@ static void print_token (int token, char **p, char *start, int maxlen)
     }
     break;
 
-  case T_MAIL:
-  case T_MAIL_UNSEEN:
-    val=query(token);
-    *p+=sprintf (*p, "%3.0f", val);
-    break;
-
   case T_EXEC:
     i = (token>>8)-'0';
     *p+=sprintf (*p, "%.*s",cols-(*p-start), exec[i].s);