📄 common.lst
字号:
C51 COMPILER V7.50 COMMON 09/05/2008 14:57:48 PAGE 1
C51 COMPILER V7.50, COMPILATION OF MODULE COMMON
OBJECT MODULE PLACED IN ..\output\output_bin\output_picture\common.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE ..\..\code\ap_picture\src\common.c LARGE OPTIMIZE(9,SIZE) BROWSE INCDIR(..\
-..\..\bsp\include;..\..\code\ap_picture\src\include;..\..\code\global;..\..\code\include) DEFINE(CONFIG_ASIC,dynamic_loa
-d) DEBUG OBJECTEXTEND PRINT(..\output\output_bin\output_picture\common.lst) OBJECT(..\output\output_bin\output_picture\c
-ommon.obj)
line level source
1 /*******************
2 * common.c
3 *******************/
4 #include <string.h>
5 #include "api.h"
6 #include "lcd.h"
7 #include "common.h"
8 #include "display.h"
9 #include "ap_common.h"
10 #include "prefer.h"
11 #include "global_user.h"
12 #include "res.h"
13 #include "res_show.h"
14
15 UINT32 u16TimerCount=0;
16
17 MUSIC_INFORMATION curr_music;
18 UINT16 curr_lyric_time;
19
20 INT8U _buf[256];
21 INT8U vol_flag=0;
22
23 FILE_INFORMATION curr_finfo, curr_dir, play_dir;
24 SCREENLEVEL screen_level;
25
26 UINT16 select;
27 UINT16 totdir, totfile, totitem;
28 UINT8 *search_extstr;
29
30
31 BOOLEAN bHotKeyHandle(UINT8 ekey)
32 {
33 1
34 1 switch(ekey)
35 1 {
36 2 case KEY_LONG_MENU:
37 2 key_menu_long = 1;
38 2 api_vLcdPinSelect();
39 2 write2c(ENTRY_MODE_SET,0x00); // 0xE
40 2 api_vLcdPinRecover();
41 2 api_bSavePreferenceData(&tUserPreference,sizeof(USER_PREFERENCE_T));
42 2 //close_volume();
43 2 #ifdef dynamic_load
44 2 api_vLoad(Code_USER1,1);
45 2 #else
Print("Load Function\n");
#endif
48 2 break;
49 2 case KEY_LONG_PLAY:
50 2 api_vLcdPinSelect();
51 2 write2c(ENTRY_MODE_SET,0x00); // 0xE
52 2 api_vLcdPinRecover();
C51 COMPILER V7.50 COMMON 09/05/2008 14:57:48 PAGE 2
53 2 api_bSavePreferenceData(&tUserPreference,sizeof(USER_PREFERENCE_T));
54 2 vShutDown();
55 2 break;
56 2 default:
57 2 return FALSE;
58 2 }
59 1 }
60
61 void key_process(UINT8 key)
62 {
63 1 u16TimerCount=0;
64 1
65 1 vOpenBackLight();
66 1 //now handle hot key
67 1 bHotKeyHandle(key);
68 1
69 1 //deal other key now.
70 1 if(curr_screen->main)
71 1 curr_screen->main(key);
72 1 }
73
74 void get_short_name(FILE_INFORMATION *pfinfo, UINT8 xdata *buf)
75 {
76 1 UINT8 xdata *name = pfinfo->pu8FileName;
77 1 UINT8 xdata *ext = pfinfo->pu8FileExt;
78 1 BOOLEAN flags = false;
79 1
80 1 while(1) {
81 2 if(*name == '\0' || *name == ' ')
82 2 break;
83 2 *buf++ = *name++;
84 2 }
85 1
86 1 *buf++ = '.';
87 1
88 1 while(1) {
89 2 if(*ext == '\0' || *ext == ' ')
90 2 break;
91 2 *buf++ = *ext++;
92 2 flags = true;
93 2 }
94 1
95 1 if(!flags)
96 1 buf--;
97 1
98 1 *buf = '\0';
99 1 }
100
101 void get_long_name(FILE_INFORMATION *pfinfo, UINT8 xdata *buf)
102 {
103 1 UINT16 xdata *name = (UINT16 xdata *)pfinfo->pu8LongFileName;
104 1
105 1 while(*name != 0) {
106 2 buf[0] = ((UNION16 *)name)->v8[1];
107 2 buf[1] = ((UNION16 *)name)->v8[0];
108 2
109 2 if(*(UINT16 *)buf >= 'a' && *(UINT16 *)buf <= 'z')
110 2 *(UINT16 *)buf = *(UINT16 *)buf - 'a' + 'A';
111 2
112 2 name++;
113 2 buf += 2;
114 2 }
C51 COMPILER V7.50 COMMON 09/05/2008 14:57:48 PAGE 3
115 1
116 1 *(UINT16 *)buf = 0;
117 1 }
118
119
120 BOOLEAN change_dir(FILE_INFORMATION *pDir)
121 {
122 1 if(pDir)
123 1 memcpy(&curr_dir, pDir, sizeof(FILE_INFORMATION));
124 1 else
125 1 curr_dir.u32startclus = 0; // ROOT dir
126 1
127 1 return api_bChangeDir(pDir);
128 1 }
129
130 void scan_dir_file(UINT8 search_mode, UINT8 *extstr, BOOLEAN select_dir)
131 {
132 1 select = totitem = totdir = totfile = 0;
133 1
134 1 if(api_bSearchDirInDir(search_mode))
135 1 totdir = api_u16GetTotalFile();
136 1
137 1 if(api_bSearchFileInDir(search_mode, extstr))
138 1 totfile = api_u16GetTotalFile();
139 1
140 1 if(select_dir && totdir)
141 1 if(!api_bSearchDirInDir(SEARCH_MODE_CURRDIR))
142 1 return;
143 1
144 1 totitem = totdir + totfile;
145 1 search_extstr = extstr;
146 1 }
147
148 BOOLEAN playdir_valid()
149 {
150 1 if(curr_dir.u32startclus != play_dir.u32startclus)
151 1 return false;
152 1 else
153 1 return true;
154 1 }
155
156 BOOLEAN init_volume(void)
157 {
158 1 //*(INT8U xdata*)(0xF96E) = 0x00;
159 1 api_bSetVolume(tUserPreference.u8Volume);
160 1 return 1;
161 1 }
162
163 BOOLEAN close_volume(void)
164 {
165 1 api_bSetVolume(0-api_s8GetVolume());
166 1 //*(INT8U xdata*)(0xF96E) = 0x03;
167 1 return 1;
168 1 }
169
170
171 //--------------------------------------------------------------------------
172 void vKeyTimeOut(void)
173 {
174 1 if (u16TimerCount == 0)
175 1 {
176 2 if (tUserPreference.u8BackLightTime!=0)
C51 COMPILER V7.50 COMMON 09/05/2008 14:57:48 PAGE 4
177 2 vOpenBackLight();
178 2 }
179 1 u16TimerCount++;
180 1 if((u16TimerCount>=tUserPreference.u8BackLightTime*4) && (tUserPreference.u8BackLightTime>0))
181 1 vCloseBackLight();
182 1
183 1 if((u16TimerCount>=tUserPreference.u8ShutDownTime*240) && (tUserPreference.u8ShutDownTime>0))
184 1 vShutDown();
185 1
186 1 }
187
188 void vShutDown()
189 {
190 1 INT16U i;
191 1
192 1 api_bSetVolume(0-api_s8GetVolume());
193 1 for(i=0;i<9;i++)
194 1 {
195 2 delay(20);
196 2 bResShowPic(GJI01+i,0,0);
197 2 }
198 1
199 1 delay(20);
200 1 vCloseBackLight();
201 1 lcd_clear();
202 1 delay(20);
203 1
204 1 api_bSetPowerDownMode(POWER_DOWN_ADDA_OFF);
205 1 delay(200);
206 1 b_PIN_POWEROFF = 0;
207 1 while(1){;}
208 1 }
209
210 void vOpenBackLight(void)
211 {
212 1 bLCD_PIN_BACKLIGHT = 0;
213 1 }
214
215 void vCloseBackLight(void)
216 {
217 1 bLCD_PIN_BACKLIGHT = 1;
218 1 }
219
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 916 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = 344 19
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = ---- 2
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -