?? com_demo.c
字號(hào):
/************************************************************************/
/* com_demo
有線口字符發(fā)送和接收示例
可以與PC機(jī)在38400波特率下進(jìn)行通訊,掌上機(jī)可以發(fā)送和接收字符
(Take the communication of imput and output of the characters.)
Copyright (c) 2006 by Thinta Co.LTD
All rights reserved */
/************************************************************************/
#include "..\inc\Bio_Func.h"
#include "..\inc\key.h"
#include <STDIO.H>
#include <STRING.H>
#define TRUE 1
#define FALSE 0
#define BAND 38400 //波特率
#define CONTROL 0x01 //8位無(wú)校驗(yàn),1位停止位
#define PORT 1 //有線口
void com_sendread(void)
{
U8 cRead ;
S16 cKey_in;
U8 title[] = " --通訊測(cè)試-- " ;
U8 port[] = "電纜口:38400\n" ;
_setcomport(PORT) ;
_com_init(1, BAND, CONTROL);
_gotoxy(0, 0) ;
_putstr(title) ;
_putstr(port) ;
while(1)
{
if(_bioskey(1) != 0)
{
cKey_in = _bioskey(0) ;
if(cKey_in == ESC)
{//按退出鍵返回
break ;
}else
{//按其他鍵,發(fā)送字符
_com_send(cKey_in) ;
}
}
if(!_com_read(&cRead))
{//接收到字符
if(isalnum(cRead))
{
_putch(cRead) ;
}
}
if(19 == _getx() && 9 == _gety())
{//顯示到屏幕末尾
_clsn(2, 8) ;
_gotoxy(0, 2) ;
}
}
}
void main(void)
{
_sysinit() ;
com_sendread() ;
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -