parport: ECR = 0x00
[lptgpib.git] / terminal.c
index c0ceafd..8ca8cdd 100644 (file)
@@ -25,14 +25,14 @@ int main(int argc,char **argv) {
   for (;;) {
 
     // GPIB -> obrazovka
-    if (init)
+    if (init) {
       fprintf(stderr,"Inicializuji port... ");
-    lptgpib_command(UNL);
-    lptgpib_command(MLA+0);
-    lptgpib_command(MTA+zdroj_adresa);
-    if (init)
+      lptgpib_command(UNL);
+      lptgpib_command(MLA+0);
+      lptgpib_command(MTA+zdroj_adresa);
       fprintf(stderr,"hotovo.\n");
-    init=0;
+      init=0;
+    }
     put_control(TRI | NDAC);   /* clear NRFD */
     usleep(1000000/10);
     if (get_control()&DAV) {   /* wait for DAV */
@@ -44,6 +44,7 @@ int main(int argc,char **argv) {
        fprintf(stderr,"precten znak: %02x (%c)\n",val,val);
     }
     put_control(TRI | NDAC | NRFD );  /* back to default state */
+    usleep(1000000/10); /* chvili pockat, asi zbytecne, jen aby to bylo videt na portu */
 
     // klavesnice -> GPIB
     struct pollfd pollfd;