C51 COMPILER V9.00 PRINTF 07/01/2013 12:13:30 PAGE 1
C51 COMPILER V9.00, COMPILATION OF MODULE PRINTF
OBJECT MODULE PLACED IN ..\output\printf.obj
COMPILER INVOKED BY: D:\Keil\C51\BIN\C51.EXE ..\c_file\printf.c BROWSE INCDIR(..\c_file;..\h_file;..\output;..\project)
-DEBUG OBJECTEXTEND PRINT(.\printf.lst) OBJECT(..\output\printf.obj)
line level source
1 /**************************************************************************************
2 * 子程序:底层程序
3 * 功能:显示数据处理,标志位,光标,星期;
4 * 调用子程序;
5 * *
6 ***************************************************************************************/
7 # include "ds1302.h"
8 # include "nokia5110.h"
9 # include "key.h"
10 # include "delay.h"
11 # include "main.h"
12 # include "power.h"
13
14 /*日期、时间、星期数据的调整标志位以及光标显示*/
15 void tiaozheng_flag()
16 {
17 1 switch(set)
18 1 {
19 2 case 0: LCD_write_6x8shu(10,4,96);LCD_write_6x8shu(11,4,96);LCD_write_6x8shu(12,4,96);LCD_write_6x8shu(13
-,4,96);break;
20 2
21 2 case 1: LCD_write_6x8shu(10,4,96);LCD_write_6x8shu(11,4,96);LCD_write_6x8shu(12,4,96);LCD_write_6x8shu(13
-,4,96);break;
22 2
23 2
24 2 case 2: Delay100ms();LCD_write_6x8shu(9,3,98);LCD_write_6x8shu(10,3,98);Delay100ms(); LCD_write_6x8shu(1
-0,4,96);LCD_write_6x8shu(11,4,29);LCD_write_6x8shu(12,4,41);LCD_write_6x8shu(13,4,39);break;
25 2
26 2 case 3: Delay100ms();LCD_write_shu(4,2,76);LCD_write_shu(5,2,76);Delay100ms(); LCD_write_6x8shu(10,4,9
-6);LCD_write_6x8shu(11,4,23);LCD_write_6x8shu(12,4,45);LCD_write_6x8shu(13,4,50);break;
27 2
28 2 case 4: Delay100ms();LCD_write_shu(1,2,76);LCD_write_shu(2,2,76);Delay100ms(); LCD_write_6x8shu(10,4,18
-);LCD_write_6x8shu(11,4,51);LCD_write_6x8shu(12,4,57);LCD_write_6x8shu(13,4,54);break;
29 2
30 2 case 5: Delay100ms();LCD_write_6x8shu(8,5,98);LCD_write_6x8shu(9,5,98);Delay100ms(); LCD_write_6x8shu(1
-0,4,96);LCD_write_6x8shu(11,4,14);LCD_write_6x8shu(12,4,37);LCD_write_6x8shu(13,4,61);break;
31 2
32 2 case 6: Delay100ms();LCD_write_6x8shu(5,5,98);LCD_write_6x8shu(6,5,98);Delay100ms(); LCD_write_6x8shu(1
-0,4,96);LCD_write_6x8shu(11,4,23);LCD_write_6x8shu(12,4,51);LCD_write_6x8shu(13,4,50);break;
33 2
34 2 case 7: Delay100ms();LCD_write_6x8shu(11,5,98);LCD_write_6x8shu(12,5,98);LCD_write_6x8shu(13,5,98);Delay1
-00ms(); LCD_write_6x8shu(10,4,33);LCD_write_6x8shu(11,4,41);LCD_write_6x8shu(12,4,41);LCD_write_6x8shu(13,4,47);break;
35 2
36 2 case 8: Delay100ms();LCD_write_6x8shu(2,5,98);LCD_write_6x8shu(3,5,98);Delay100ms(); LCD_write_6x8shu(1
-0,4,35);LCD_write_6x8shu(11,4,41);LCD_write_6x8shu(12,4,37);LCD_write_6x8shu(13,4,54);break;
37 2
38 2 default:LCD_write_6x8shu(10,4,96);LCD_write_6x8shu(11,4,96);LCD_write_6x8shu(12,4,96);LCD_write_6x8shu(13
-,4,96);break;
39 2 }
40 1
41 1
42 1
43 1 }
44 /*日期、时间、星期数据的转化*/
C51 COMPILER V9.00 PRINTF 07/01/2013 12:13:30 PAGE 2
45 void data_change()
46 {
47 1
48 1 l_tmpdisplay[0]=l_tmpDate[6]/16;
49 1 l_tmpdisplay[1]=l_tmpDate[6]%16;//年;
50 1
51 1 l_tmpdisplay[2]=l_tmpDate[4]/16;
52 1 l_tmpdisplay[3]=l_tmpDate[4]%16;//月;
53 1
54 1 l_tmpdisplay[4]=l_tmpDate[3]/16;
55 1 l_tmpdisplay[5]=l_tmpDate[3]%16;//日;
56 1
57 1 l_tmpdisplay[6]=l_tmpDate[2]/16;
58 1 l_tmpdisplay[7]=l_tmpDate[2]%16;//小时;
59 1
60 1 l_tmpdisplay[8]=l_tmpDate[1]/16;
61 1 l_tmpdisplay[9]=l_tmpDate[1]%16;//分钟;
62 1
63 1 l_tmpdisplay[10]=l_tmpDate[0]/16;
64 1 l_tmpdisplay[11]=l_tmpDate[0]%16;//秒钟;
65 1
66 1
67 1 l_tmpdisplay[12]=l_tmpDate[5]%16;//显示当前星期;
68 1 }
69 /*日期、时间数据的显示*/
70 void date_time()
71 {
72 1
73 1
74 1 LCD_write_6x8shu(0,0,97);
75 1
76 1
77 1
78 1 LCD_write_6x8shu(0,5,2);
79 1 LCD_write_6x8shu(1,5,0);
80 1
81 1 LCD_write_6x8shu(2,5,l_tmpdisplay[0]);
82 1 LCD_write_6x8shu(3,5,l_tmpdisplay[1]);//年;
83 1 LCD_write_6x8shu(4,5,78);
84 1 LCD_write_6x8shu(5,5,l_tmpdisplay[2]);
85 1 LCD_write_6x8shu(6,5,l_tmpdisplay[3]);//月;
86 1 LCD_write_6x8shu(7,5,78);
87 1 LCD_write_6x8shu(8,5,l_tmpdisplay[4]);
88 1 LCD_write_6x8shu(9,5,l_tmpdisplay[5]);//日;
89 1 LCD_write_6x8shu(10,5,76);
90 1
91 1
92 1
93 1
94 1 LCD_write_shu(1,2,l_tmpdisplay[6]);
95 1 LCD_write_shu(2,2,l_tmpdisplay[7]);//时;
96 1 LCD_write_shu(3,2,64);
97 1 LCD_write_shu(4,2,l_tmpdisplay[8]);
98 1 LCD_write_shu(5,2,l_tmpdisplay[9]);//分;
99 1
100 1 LCD_write_6x8shu(8,3,69);
101 1
102 1 LCD_write_6x8shu(9,3,l_tmpdisplay[10]);
103 1 LCD_write_6x8shu(10,3,l_tmpdisplay[11]);//秒;
104 1
105 1
106 1
C51 COMPILER V9.00 PRINTF 07/01/2013 12:13:30 PAGE 3
107 1 }
108 /*星期转换以及显示控制*/
109 void week()
110 {
111 1 if(l_tmpdisplay[12]==1)
112 1 {
113 2
114 2 LCD_write_6x8shu(11,5,23);
115 2 LCD_write_6x8shu(12,5,25);
116 2 LCD_write_6x8shu(13,5,24);
117 2 }
118 1 if(l_tmpdisplay[12]==2)
119 1 {
120 2 LCD_write_6x8shu(11,5,30);
121 2 LCD_write_6x8shu(12,5,31);
122 2 LCD_write_6x8shu(13,5,15);
123 2 }
124 1
125 1 if(l_tmpdisplay[12]==3)
126 1 {
127 2
128 2 LCD_write_6x8shu(11,5,33);
129 2 LCD_write_6x8shu(12,5,15);
130 2 LCD_write_6x8shu(13,5,14);
131 2 }
132 1
133 1 if(l_tmpdisplay[12]==4)
134 1 {
135 2
136 2 LCD_write_6x8shu(11,5,30);
137 2 LCD_write_6x8shu(12,5,18);
138 2 LCD_write_6x8shu(13,5,31);
139 2 }
140 1
141 1 if(l_tmpdisplay[12]==5)
142 1 {
143 2
144 2 LCD_write_6x8shu(11,5,16);
145 2 LCD_write_6x8shu(12,5,28);
146 2 LCD_write_6x8shu(13,5,19);
147 2 }
148 1
149 1 if(l_tmpdisplay[12]==6)
150 1 {
151 2
152 2 LCD_write_6x8shu(11,5,29);
153 2 LCD_write_6x8shu(12,5,11);
154 2 LCD_write_6x8shu(13,5,30);
155 2 }
156 1
157 1 if(l_tmpdisplay[12]==7)
158 1 {
159 2 LCD_write_6x8shu(11,5,29);
160 2 LCD_write_6x8shu(12,5,31);
161 2 LCD_write_6x8shu(13,5,24);
162 2 }
163 1 }
164
165
166 void logo()
167 {
168 1 LCD_write_6x8shu(3,0,'S'-54);
C51 COMPILER V9.00 PRINTF 07/01/2013 12:13:30 PAGE 4
169 1 LCD_write_6x8shu(4,0,'t'-60);
170 1 LCD_write_6x8shu(5,0,'y'-60);
171 1 LCD_write_6x8shu(6,0,'l'-60);
172 1 LCD_write_6x8shu(7,0,'e'-60);
173 1 LCD_write_6x8shu(8,0,76);
174 1 LCD_write_6x8shu(9,0,'y'-60);
175 1 LCD_write_6x8shu(10,0,'z'-60);
176 1
177 1 }
178
179
180
181
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 1044 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)