/* 1. Compiler: TC 2.0 2. Mode: Large 3. Project: Stdcom.prj Stdcom.c ..\lib\8000l.lib ..\lib\tcpipl.lib 4. Explain: To read the data from com1 input buffer. ** press 'q' or 'Q' to quit. 5. Hordware: 8831 It's compiled by Tony ----------------------------------------------------------------------------------- */ #include #include #include #include #include #include"..\lib\8000.h" #include"..\lib\vxcomm.h" /*----------------------------------------------------------------------------------*/ void main(void) { int quit=0; int data; int type; int ver; type=Is8000(); /*detect the current operation system*/ if(type) { ver=GetLibVersion(); Print("Hello 8831! (Flash memory is %d K)\n\r",type); Print("Library version is %d.%02d",ver>>8,ver&0xff); } else { Print("Hello PC!, this program is not run under 8831."); return; } InstallCom1(115200L,8,0); while(!quit){ if(IsCom1()){ data=ReadCom1(); ToCom1(data); if(data=='q') quit=1; else if(data=='\r') ToCom1('\n'); } } RestoreCom1(); }