📄 timer.lst
字号:
C51 COMPILER V7.50 TIMER 01/14/2006 15:30:04 PAGE 1
C51 COMPILER V7.50, COMPILATION OF MODULE TIMER
OBJECT MODULE PLACED IN .\HEX\Timer.obj
COMPILER INVOKED BY: F:\Keil\C51\BIN\C51.EXE Timer.c LARGE BROWSE DEBUG OBJECTEXTEND PRINT(.\lst\Timer.lst) OBJECT(.\HEX
-\Timer.obj)
line level source
1
2 #include "osd_vx1828.h"
3 #include "ext_globl.h"
4 #include "ext_osd.h"
5 #include "ir.h"
6 #include "func_shi.h"
7 #include "menu.h"
8 #include "config.h"
9 #include "pindef.h"
10 #if _debug
11 #include <stdio.h> // printf() in the file .
12 #endif
13 #define EEPROM 0xA0
14
15 #define title 0x01
16 #define content 0x02
17 #define bottom 0x03
18 #define highlight 0x01
19 #define normal 0x00
20 #define foreground 0x01
21 #define background 0x00
22 #define bl 0x01
23 #define hl 0x00
24 #define britc 0x00
25 #define contc 0x01
26 #define satr 0x02
27 #define hue 0x03
28 #define sharp 0x04
29 // Define Color .
30 #define Black 0x00
31 #define Blue 0x01
32 #define Green 0x02
33 #define Cyan 0x03
34 #define Red 0x04
35 #define Fuchsia 0x05
36 #define Yellow 0x06
37 #define White 0x07
38 #define Transparent 0x08
39 #define RoyalBlue 0x09
40 #define MediumAquamarine 0x0a
41 #define LightGreen 0x0b
42 #define Orange 0x0c
43 #define HotPink 0x0d
44 #define Silver 0x0e
45 #define Gray 0x0f
46
47
48
49
50 sbit ptime_int2 = P1^7;//zl.d
51 sbit ptime_int1 = P3^6;
52
53
54 extern unsigned int idata osd_timer;
C51 COMPILER V7.50 TIMER 01/14/2006 15:30:04 PAGE 2
55
56 extern bit XIE_Power;
57
58 struct TIME{
59 //nsigned char year;
60 //nsigned char month;
61 //nsigned char day;
62 unsigned char hour;
63 unsigned char minute;
64 unsigned char second;
65 };
66
67 void read_timer(char,struct TIME *);
68 void write_timer(char,struct TIME *);
69 void timer_on_off(void);
70
71 static struct TIME curr_time={0,0,0},on_time={0,0,0},off_time={0,0,0};
72 unsigned char timer_able_flag=0;
73
74
75 unsigned char time_sel=1;
76 bit timeshow_flag=0;
77 extern unsigned int idata osd_timer;
78
79 char code Timer[0x06]={0x6d,0x13,0x22,0x26,0x1e,0x2b};
80 char code enable[0x07]={0x6d,0x1e,0x27,0x1a,0x1b,0x25,0x1e};
81 char code disable[0x07]={0x1d,0x22,0x2c,0x1a,0x1b,0x25,0x1e};
82 char code TIME_SET_UP[14]={0x13,0x08,0x0c,0x04,0x6d,0x12,0x04,0x13,0x6d,0x14,0x0f};
83 char code current_time[14]={0x1c,0x2e,0x2b,0x2b,0x1e,0x27,0x2d,0x6d,0x6d,0x2d,0x22,0x26,0x1e,0x6d};
84 char code power_on_time[14]={0x29,0x28,0x30,0x1e,0x2b,0x6d,0x28,0x27,0x6d,0x6d,0x2d,0x22,0x26,0x1e};
85 char code power_off_time[14]={0x29,0x28,0x30,0x1e,0x2b,0x6d,0x28,0x1f,0x1f,0x6d,0x2d,0x22,0x26,0x1e};
86 char code time_exit[4]={0x1e,0x31,0x22,0x2d};
87
88 //=========================================================
89 void init_timer_menu()
90 {
91 1 // Set initial address of OSD block
92 1 osd_clearall();
93 1 osd_madr(content,0x30); // Set the initial address of Content Block
94 1 osd_switch(4);// Turn the OSD T/C/B block off
95 1 // Disable blink or highlight zone
96 1 osd_hbsection(content,bl,0x00,0x00,0x00,0x00);
97 1 osd_hbsection(content,hl,0x00,0x00,0x00,0x00);
98 1 // Set size of block
99 1 osd_size(content,0x20,0x05); // Set Content block size adjust by cswu.
100 1 // Set position of block
101 1 osd_pos(content,0x40,19); // Set Content block position
102 1 // Select Block Color
103 1
104 1 osd_color(title,foreground,normal,LightGreen); // Content
105 1 osd_color(title,background,normal,Transparent); // Content
106 1
107 1
108 1 osd_color(content,foreground,normal,LightGreen); // Content
109 1 osd_color(content,background,normal,Transparent); // Content
110 1 osd_color(content,foreground,highlight,HotPink); // Content
111 1 osd_color(content,background,highlight,Transparent); // Content
112 1
113 1 osd_clear(0x30);osd_clear(0x40);
114 1 osd_clear(0x50);osd_clear(0x60);
115 1 osd_clear(0x70);osd_clear(0x80);
116 1 osd_clear(0x90);osd_clear(0xa0);
C51 COMPILER V7.50 TIMER 01/14/2006 15:30:04 PAGE 3
117 1 osd_clear(0xb0);osd_clear(0xc0);
118 1 //osd_clear(0xa0);osd_clear(0xb0);
119 1 osd_show(0x3A,10,&TIME_SET_UP);
120 1 osd_show(0x50,13,¤t_time);
121 1 osd_show(0x70,13,&power_on_time);
122 1 osd_show(0x90,13,&power_off_time);
123 1 //osd_show(0xb0,4,&Timer);
124 1 osd_show(0xb0,0x03,&time_exit);
125 1
126 1 osd_switch(6); // Turn Title/Content/Bottom Block on
127 1 }
128
129 //===============================================================
130 void current_time_menu(unsigned char temphour,unsigned char tempminute,unsigned char tempsecond)//zl.d
131 {
132 1 unsigned char idata temp[8];
133 1 unsigned char idata i;
134 1
135 1 // Show Number of hour --------------------------------------
136 1 temp[0] = temphour/10 + 0x62; // 1
137 1 i = temphour%10;
138 1 temp[1] = i + 0x62; // 2
139 1 temp[2]=0x47;
140 1 // Show Number of minute -----------------------------------
141 1 temp[3] = tempminute/10 + 0x62; // 1
142 1 i = tempminute%10;
143 1 temp[4] = i + 0x62; // 2
144 1 temp[5] = 0x47;
145 1 // Show Number of second -----------------------------------
146 1 temp[6] =tempsecond/10 + 0x62;
147 1 i = tempsecond%10;
148 1 temp[7] = i + 0x62; // 3
149 1
150 1
151 1 osd_show(0x62,7,&temp);
152 1
153 1 }
154 void on_time_menu(unsigned char temphour,unsigned char tempminute)
155 {
156 1 unsigned char idata temp[5];
157 1 unsigned char idata i;
158 1
159 1 // Show Number of hour --------------------------------------
160 1 temp[0] = temphour/10 + 0x62; // 1
161 1 i = temphour%10;
162 1 temp[1] = i + 0x62; // 2
163 1 temp[2]=0x47;
164 1 // Show Number of minute -----------------------------------
165 1 temp[3] = tempminute/10 + 0x62; // 1
166 1 i = tempminute%10;
167 1 temp[4] = i + 0x62; // 2
168 1 osd_show(0x82,4,&temp);
169 1 }
170 void off_time_menu(unsigned char temphour,unsigned char tempminute)
171 {
172 1 unsigned char idata temp[5];
173 1 unsigned char idata i;
174 1
175 1 // Show Number of hour --------------------------------------
176 1 temp[0] = temphour/10 + 0x62; // 1
177 1 i = temphour%10;
178 1 temp[1] = i + 0x62; // 2
C51 COMPILER V7.50 TIMER 01/14/2006 15:30:04 PAGE 4
179 1 temp[2]=0x47;
180 1 // Show Number of minute -----------------------------------
181 1 temp[3] = tempminute/10 + 0x62; // 1
182 1 i = tempminute%10;
183 1 temp[4] = i + 0x62; // 2
184 1 osd_show(0xa2,4,&temp);
185 1 }
186 void able_time_menu(unsigned char able)
187 {
188 1 if(able){
189 2 osd_show(0x89,6,&enable);
190 2 osd_show(0xa9,6,&enable);
191 2 }
192 1 else{
193 2 osd_show(0x89,6,&disable);
194 2 osd_show(0xa9,6,&disable);
195 2 }
196 1 }
197 //==================================================
198 #if 1
199 void time_setup_process()
200 {
201 1 unsigned char idata temp[5]=0,temp1[3]=0 ,tmp3[7]=0;
202 1 if(timemenu_flag){
203 2 if(!timeshow_flag){
204 3
205 3
206 3 /* tmp3[0]=1;tmp3[1]=2;tmp3[2]=3;
207 3 shi_sub_write1(0x66, 0x02, &tmp3);
208 3 shi_sub_read1( 0x66, 0x02, &tmp3);
209 3 printf("state4==%bx%bx%bx\n",tmp3[0],tmp3[1],tmp3[2]);
210 3 tmp3[0]=4;tmp3[1]=5;tmp3[2]=6;
211 3 shi_sub_write1(0x66, 0x02, &tmp3);
212 3 shi_sub_read1( 0x66, 0x02, &tmp3);
213 3 printf("state4==%bx%bx%bx\n",tmp3[0],tmp3[1],tmp3[2]);
214 3 tmp3[0]=17;tmp3[1]=18;tmp3[2]=9;
215 3 shi_sub_write1(0x66, 0x02, &tmp3);
216 3 shi_sub_read1( 0x66, 0x02, &tmp3);
217 3 printf("state4==%bx%bx%bx\n",tmp3[0],tmp3[1],tmp3[2]);
218 3
219 3
220 3 curr_time.hour=0, curr_time.minute=0;
221 3 read_timer(&curr_time);//zl.d
222 3 printf("curr_time.hour, curr_time.minute==%bx%bx\n",curr_time.hour, curr_time.minute);
223 3 write_timer(&curr_time);
224 3 curr_time.hour=0, curr_time.minute=0;
225 3 read_timer(&curr_time);//zl.d
226 3 printf("curr_time.hour, curr_time.minute==%bx%bx\n",curr_time.hour, curr_time.minute);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -