📄 sio.lst
字号:
C51 COMPILER V7.50 SIO 12/14/2005 10:05:35 PAGE 1
C51 COMPILER V7.50, COMPILATION OF MODULE SIO
OBJECT MODULE PLACED IN .\OBJ\sio.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE sio.c LARGE OPTIMIZE(9,SIZE) BROWSE PRINT(.\LST\sio.lst) OBJECT(.\OBJ\sio.o
-bj)
line level source
1 /*
2 ********************************************************************************
3 *
4 * (c) Copyright 2002, Vineyard Technologies, Inc.
5 *
6 * Filename : sio.c
7 * Programmer(s): Steve KyeongHyeon Lee
8 * Created : 2003/02/05
9 * Modified :
10 *
11 * Description :
12 ********************************************************************************
13 */
14
15 //###############################################################################
16 //
17 //###############################################################################
18 #include "types.h"
19
20 #include "8052reg.h"
21 #include <stdio.h>
22 #include "sio.h"
23
24
25 //###############################################################################
26 //
27 //###############################################################################
28
29 xdata char tbuf[TBUF_SIZE];
30 xdata char rbuf[RBUF_SIZE];
31 xdata u16 t_in = 0;
32 xdata u16 t_out = 0;
33 xdata u16 r_in = 0;
34 xdata u16 r_out = 0;
35 //xdata u8 t_disable = 0;
36
37 #ifdef RS232_TO_PC_TRANSFER
//xdata u16 num00 =0;
//xdata u16 secnum01;
//xdata u16 secnum02;
#endif
42
43 #ifdef DISPLAY_IP_ADDRESS
xdata u16 r_timeout = 0;//for remote control IP recieve time out
xdata u16 t_timeout = 0;//for remote control IP transfer time out
#endif
47 #ifdef RE_CON
48 //====================================================================
49 // Check SIO input buffer length
50 //====================================================================
51
52 u8 sio_rbuflen(void)
53 {
54 1 return ( (r_in + RBUF_SIZE - r_out) % RBUF_SIZE );
C51 COMPILER V7.50 SIO 12/14/2005 10:05:35 PAGE 2
55 1 }
56
57 //====================================================================
58 // Get a character form input SIO buffer
59 //====================================================================
60
61 u8 sio_getchar(void)
62 {
63 1 u8 ch;
64 1
65 1 ch = rbuf[r_out];
66 1 if(++r_out==RBUF_SIZE) r_out = 0;
67 1 return(ch);
68 1 }
69
70
71
72 //====================================================================
73 //
74 //====================================================================
75 char sio_putchar(u8 c)
76 {
77 1 while(t_out!=t_in); // Wait until tx buffer is empty
78 1
79 1 tbuf[t_in] = c;
80 1
81 1 if((t_in+1)==TBUF_SIZE)
82 1 t_in = 0;
83 1 else
84 1 t_in++;
85 1 //if(t_disable)
86 1 //{
87 1 // t_disable = 0;
88 1
89 1 TI = 1;
90 1 //}
91 1 return (0);
92 1 }
93 #endif //RE_CON
94 #ifdef DEBUG_PRINT
//====================================================================
//
//====================================================================
char putchar(char c)
{
sio_putchar(c);
return (c);
}
#endif
104
105 //====================================================================
106 //
107 //====================================================================
108 void sio_init(void)
109 {
110 1 t_in = 0;
111 1 t_out = 0;
112 1 // t_disable = 1;
113 1 r_in = 0;
114 1 r_out = 0;
115 1 #ifdef DISPLAY_IP_ADDRESS
r_timeout = 0;
C51 COMPILER V7.50 SIO 12/14/2005 10:05:35 PAGE 3
t_timeout = 0;
#endif
119 1 }
120
121
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 172 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = 76 ----
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -