1. Pierre Pagnoux
  2. StarDSP

Commits

Pierre Surply  committed d0b5e1f

Fix termios BSD

  • Participants
  • Parent commits f9e55f2
  • Branches master

Comments (0)

Files changed (2)

File src/surface/master/surface.ml

View file
           in
             begin
               let ret = Term.send_int com packet in
-              (*Printf.printf "%X  \r%!" ret;*)
+		(*Printf.printf "%X  \r%!" ret;*)
               let opcode = ret land 0b11 in
               let arg = ret lsr 2 in
               match opcode with
       minisleep 0.05
     done;
     if len < 16 then
-      let _ = Term.send_int com 0 in ()
+      let _ = Term.send_int com 0 in ();
   | None -> ()
 
 let reset surface =

File src/surface/master/term_stubs.c

View file
 
   memset(t->cur, 0, sizeof(struct termios)); 
 
-  t->cur->c_cflag = CLOCAL | CS8;
+  t->cur->c_cflag = CLOCAL | CS8 | CREAD;
   t->cur->c_iflag = 0;
   t->cur->c_oflag = 0;
   t->cur->c_lflag = 0;
   unsigned char i = (unsigned char) Int_val(_i);
 
   write(t->fd, &i, 1);
-  i = 0;
+  tcdrain(t->fd);
+  i = 0xFF;
   read(t->fd, &i, 1);
-
   return Val_int((int) i);
 }