-
Notifications
You must be signed in to change notification settings - Fork 1
/
test5.c
55 lines (49 loc) · 1.22 KB
/
test5.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include <stdio.h>
#include <stdlib.h>
#include <threads.h>
#include <terminals.h>
void writer1(void *arg);
int
main(int argc, char **argv)
{
int len1, len2;
char buf1[2];
char buf2[10];
InitTerminalDriver();
InitTerminal(0);
len1 = ReadTerminal(0, buf1, 2);
// status = WriteTerminal(1, string1, length1);
len2 = ReadTerminal(0, buf2, 10);
//
// if (argc > 1) HardwareOutputSpeed(1, atoi(argv[1]));
// if (argc > 2) HardwareInputSpeed(1, atoi(argv[2]));
// ThreadCreate(writer1, NULL);
// ThreadCreate(writer2, NULL);
printf("len1 %d, %c %c, len2 %d, %c %c %c\n", len1, buf1[0],buf1[1],len2, buf2[0],buf2[1],buf2[9]);
ThreadWaitAll();
exit(0);
}
/*
void
writer1(void *arg)
{
// int status;
int len1, len2;
char buf1[2];
char buf2[10];
len1 = ReadTerminal(0, buf1, 2);
// status = WriteTerminal(1, string1, length1);
len2 = ReadTerminal(0, buf2, 10);
printf("len1 %d, %c %c, len2 %d, %c %c %c\n", len1, buf1[0],buf2[0],len2, buf2[0],buf2[1],buf2[9]);
}*/
/*
void
writer2(void *arg)
{
int status;
status = WriteTerminal(1, string2, length2);
if (status != length2)
fprintf(stderr, "Error: writer2 status = %d, length2 = %d\n",
status, length2);
}
*/