?? uart.c
字號:
#include "xmodem.h"
#include "vxworks.h"
#include "tylib.h"
int consoleFd;
void sio_init( )
{
consoleFd=open("/tyCo/0",O_RDWR,0666);
ioctl(consoleFd,FIOSETOPTIONS,OPT_RAW);
ioctl(consoleFd,FIOFLUSH,0);
}
void sio_putc(unsigned char c)
{
unsigned char keyout;
keyout = c;
write(consoleFd, &keyout, 1);
}
void sio_puts(char *s)
{
while(*s != 0) {
sio_putc(*s);
s++;
}
}
unsigned char sio_getc( )
{
unsigned char keyout;
while( !sio_ischar() );
read(consoleFd,&keyout,1);
return keyout;
}
/* 如果串口有數據,返回1 */
int sio_ischar()
{
int cnt;
ioctl (consoleFd, FIONREAD, (int) &cnt);
return cnt;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -