Keil RTX51 Manual page 58

Table of Contents

Advertisement

58
#define
*/
unsigned char
*/
unsigned char
*/
idata
*/
unsigned char
*/
#define
*/
#define
*/
bit
*/
bit
*/
bit
*/
/*****************************************************************************
*/
/*
*/
/*****************************************************************************
*/
putbuf (char c)
if (!sendfull)
*/
if
*/
*/
*/
}
else
6
*/
*/
}
*/
}
}
/*****************************************************************************
*/
/*
*/
/*****************************************************************************
*/
char putchar (char c)
if (c == '\n')
*/
while (sendfull)
*/
ILEN
8
istart;
iend;
char
inbuf[ILEN];
itask = 0xff;
CTRL_Q
0x11
CTRL_S
0x13
sendfull;
sendactive;
sendstop;
putbuf:
write
{
{
(!sendactive
&&
!sendstop)
sendactive = 1;
SBUF = c;
{
outbuf[oend++ & (OLEN-1)] = c;
if (((oend ^ ostart) & (OLEN-1)) == 0)
putchar:
{
{
{
/* size of serial receiving buffer
/* receiving buffer start index
/* receiving buffer end index
/* storage for receiving buffer
/* task number of output task
/* Control+Q character code
/* Control+S character code
/* flag: marks transmit buffer full
/* flag: marks transmitter active
/* flag: marks XOFF character
a
character
to
SBUF
/* transmit only if buffer not full
{
/*
if
transmitter
/* transfer the first character direct
/* to SBUF to start transmission
/* transfer char to transmission buffer
sendfull = 1;
/* set flag if buffer is full
interrupt
controlled
/* expand new line character:
/* wait for transmission buffer empty
Application Examples
or
transmission
buffer
not
active:
/*
otherwize:
putchar
function

Advertisement

Table of Contents
loading

Table of Contents