X-Git-Url: http://gitweb.hachti.de/?a=blobdiff_plain;f=pc-tools%2Fldc%2Ftape.c;fp=pc-tools%2Fldc%2Ftape.c;h=6225ca1ccd70708b1677481d7f02c2e40753810e;hb=437b3ba835f66625031f4711cd0a963be67ccf5a;hp=0000000000000000000000000000000000000000;hpb=008a15c07914ebf7f69e6243c4d2754c8f959a7f;p=h316.git diff --git a/pc-tools/ldc/tape.c b/pc-tools/ldc/tape.c new file mode 100644 index 0000000..6225ca1 --- /dev/null +++ b/pc-tools/ldc/tape.c @@ -0,0 +1,46 @@ +#include +#include +#include +#include +#include +#include + +#include "tape.h" + +static struct termios orgstate; +static struct termios workstate; + +static int fd; + +void tapeclose () +{ + tcsetattr (fd, TCSANOW, &orgstate); + close (fd); +} + +void tapestart () +{ + char a = 0x11; //xon; + write (fd, &a, 1); +} + +void tapestop () +{ + char a = 0x13; //xoff; + write (fd, &a, 1); +} + +void tapeinit (int tapefd) +{ + fd = tapefd; + tcgetattr (tapefd, &orgstate); + tcgetattr (tapefd, &workstate); + workstate.c_iflag = 0; + workstate.c_oflag = 0; + workstate.c_cflag = CS8 | CREAD | CLOCAL | CRTSCTS | CSTOPB; + workstate.c_lflag = 0; + cfsetspeed (&workstate, B4800); + tcsetattr (tapefd, TCSANOW, &workstate); +} + +// Ende.