📄 test.c
字号:
/* TEST.C - test for XSIO
|===================================================================|
| My changes can be considered public domain. Geof's statement |
| will cover everything. |
| - Rick Rodman 09/02/97 |
|===================================================================|
940925 rr initial file
*/
#include "stdio.h"
#include "options.h"
#include "casyncms.h"
int main( argc, argv ) int argc; char *argv[]; {
int l, n;
char c;
printf( "Put loopback plug on serial port, press enter\n" );
getchar();
init_comm();
printf( "Comm initialized\n" );
for( l = 0; l < 50; ++l ) {
outp_char( '1' );
outp_char( '2' );
outp_char( '3' );
outp_char( '4' );
outp_char( '5' );
outp_char( '6' );
outp_char( '7' );
outp_char( '\r' );
outp_char( '\n' );
printf( "Outputted 9 chars\n" );
n = 0;
while( inp_status() ) {
c = ( char ) inp_char();
putchar( c );
++n;
}
printf( "Received %d chars\n", n );
}
uninit_comm();
return 0;
}
/* end of test.c */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -