1
0
mirror of https://github.com/aap/pdp6.git synced 2026-03-10 12:48:43 +00:00

little fix in apr; added delay to mkpty

This commit is contained in:
aap
2016-11-04 14:50:02 +01:00
parent 136ae33449
commit 0cdb02a439
2 changed files with 10 additions and 2 deletions

View File

@@ -12,6 +12,7 @@
#include <unistd.h>
#include <poll.h>
#include <errno.h>
#include <time.h>
struct termios tiosaved;
@@ -33,6 +34,10 @@ reset(int fd)
return 0;
}
#define BAUD 30
struct timespec slp = { 0, 1000*1000*1000 / BAUD };
void
readwrite(int ttyin, int ttyout, int ptyin, int ptyout)
{
@@ -56,8 +61,10 @@ readwrite(int ttyin, int ttyout, int ptyin, int ptyout)
if(pfd[0].revents & POLLIN){
if(n = read(ptyin, &c, 1), n <= 0)
return;
else
else{
write(ttyout, &c, 1);
nanosleep(&slp, NULL);
}
}
/* read from tty, write to pty */
if(pfd[1].revents & POLLIN){
@@ -67,6 +74,7 @@ readwrite(int ttyin, int ttyout, int ptyin, int ptyout)
if(c == 035)
return;
write(ptyout, &c, 1);
nanosleep(&slp, NULL);
}
}
}

View File

@@ -2410,7 +2410,7 @@ pulse(et1){
apr->mb &= RT; // 6-3
}
if(apr->ir_jrst && apr->ir & H12)
apr->ex_mode_sync = 1; // 5-13
set_ex_mode_sync(apr, 1); // 5-13
if(apr->ir_jrst && apr->ir & H11)
ar_flag_set(apr); // 6-10
if(PI_RST)