📄 common.lst
字号:
C51 COMPILER V7.50 COMMON 08/18/2008 14:07:08 PAGE 1
C51 COMPILER V7.50, COMPILATION OF MODULE COMMON
OBJECT MODULE PLACED IN ..\output\output_bin\output_movie\common.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE ..\..\code\ap_movie\src\common.c LARGE OPTIMIZE(9,SIZE) BROWSE INCDIR(..\..
-\..\bsp\include;..\..\code\ap_movie\src\include;..\..\code\global;..\..\code\include) DEFINE(CONFIG_ASIC,dynamic_load) D
-EBUG OBJECTEXTEND PRINT(..\output\output_bin\output_movie\common.lst) OBJECT(..\output\output_bin\output_movie\common.ob
-j)
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 #include "movie_utile.h"
15
16 UINT32 u16TimerCount=0;
17
18 MUSIC_INFORMATION curr_music;
19 UINT16 curr_lyric_time;
20
21 INT8U _buf[256];
22 INT8U vol_flag=0;
23 FILE_INFORMATION curr_finfo, curr_dir, play_dir;
24 SCREENLEVEL screen_level;
25
26 UINT16 select;
27
28 UINT16 totdir, totfile, totitem;
29 UINT8 *search_extstr;
30
31
32 BOOLEAN bHotKeyHandle(UINT8 ekey)
33 {
34 1
35 1 //api_bStop();
36 1 switch(ekey)
37 1 {
38 2 case KEY_LONG_MENU:
39 2 key_menu_long = 1;
40 2 api_bStop();
41 2 lcd_set_disply_mode(0x00,0x22);
42 2 api_bSavePreferenceData(&tUserPreference,sizeof(USER_PREFERENCE_T));
43 2 //close_volume();
44 2 #ifdef dynamic_load
45 2 api_vLoad(Code_USER1,1);
46 2 #else
Print("Load Function\n");
#endif
49 2 break;
50 2 case KEY_LONG_PLAY:
51 2 api_bStop();
52 2 lcd_set_disply_mode(0x00,0x22);
C51 COMPILER V7.50 COMMON 08/18/2008 14:07:08 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 if(bLCD_PIN_BACKLIGHT && key!=KEY_EOS)
67 1 return;
68 1 //if()
69 1
70 1 //now handle hot key
71 1 bHotKeyHandle(key);
72 1
73 1 //deal other key now.
74 1 if(curr_screen->main)
75 1 curr_screen->main(key);
76 1 }
77
78 void get_short_name(FILE_INFORMATION *pfinfo, UINT8 xdata *buf)
79 {
80 1 UINT8 xdata *name = pfinfo->pu8FileName;
81 1 UINT8 xdata *ext = pfinfo->pu8FileExt;
82 1 BOOLEAN flags = false;
83 1
84 1 while(1)
85 1 {
86 2 if(*name == '\0' || *name == ' ')
87 2 break;
88 2 *buf++ = *name++;
89 2 }
90 1
91 1 *buf++ = '.';
92 1
93 1 while(1) {
94 2 if(*ext == '\0' || *ext == ' ')
95 2 break;
96 2 *buf++ = *ext++;
97 2 flags = true;
98 2 }
99 1
100 1 if(!flags)
101 1 buf--;
102 1
103 1 *buf = '\0';
104 1 }
105
106 void get_long_name(FILE_INFORMATION *pfinfo, UINT8 xdata *buf)
107 {
108 1 UINT16 xdata *name = (UINT16 xdata *)pfinfo->pu8LongFileName;
109 1
110 1 while(*name != 0) {
111 2 buf[0] = ((UNION16 *)name)->v8[1];
112 2 buf[1] = ((UNION16 *)name)->v8[0];
113 2
114 2 if(*(UINT16 *)buf >= 'a' && *(UINT16 *)buf <= 'z')
C51 COMPILER V7.50 COMMON 08/18/2008 14:07:08 PAGE 3
115 2 *(UINT16 *)buf = *(UINT16 *)buf - 'a' + 'A';
116 2
117 2 name++;
118 2 buf += 2;
119 2 }
120 1
121 1 *(UINT16 *)buf = 0;
122 1 }
123
124
125 BOOLEAN change_dir(FILE_INFORMATION *pDir)
126 {
127 1 if(pDir)
128 1 memcpy(&curr_dir, pDir, sizeof(FILE_INFORMATION));
129 1 else
130 1 curr_dir.u32startclus = 0; // ROOT dir
131 1
132 1 return api_bChangeDir(pDir);
133 1 }
134
135 void scan_dir_file(UINT8 search_mode, UINT8 *extstr, BOOLEAN select_dir)
136 {
137 1 select = totitem = totdir = totfile = 0;
138 1
139 1 if(api_bSearchDirInDir(search_mode))
140 1 totdir = api_u16GetTotalFile();
141 1
142 1 if(api_bSearchFileInDir(search_mode, extstr))
143 1 totfile = api_u16GetTotalFile();
144 1
145 1 if(select_dir && totdir)
146 1 if(!api_bSearchDirInDir(SEARCH_MODE_CURRDIR))
147 1 return;
148 1
149 1 totitem = totdir + totfile;
150 1 search_extstr = extstr;
151 1 }
152
153 BOOLEAN playdir_valid()
154 {
155 1 if(curr_dir.u32startclus != play_dir.u32startclus)
156 1 return false;
157 1 else
158 1 return true;
159 1 }
160
161 BOOLEAN init_volume(void)
162 {
163 1 //*(INT8U xdata*)(0xF96E) = 0x00;
164 1 api_bSetVolume(tUserPreference.u8Volume);
165 1 return 1;
166 1 }
167
168 BOOLEAN close_volume(void)
169 {
170 1 api_bSetVolume(0-api_s8GetVolume());
171 1 //*(INT8U xdata*)(0xF96E) = 0x03;
172 1 return 1;
173 1 }
174
175
176 //--------------------------------------------------------------------------
C51 COMPILER V7.50 COMMON 08/18/2008 14:07:08 PAGE 4
177 void vKeyTimeOut(void)
178 {
179 1 if (u16TimerCount == 0)
180 1 {
181 2 if (tUserPreference.u8BackLightTime!=0)
182 2 vOpenBackLight();
183 2 }
184 1 u16TimerCount++;
185 1 if((u16TimerCount>=tUserPreference.u8BackLightTime*4) && (tUserPreference.u8BackLightTime>0))
186 1 vCloseBackLight();
187 1
188 1 if((u16TimerCount>=tUserPreference.u8ShutDownTime*240) && (tUserPreference.u8ShutDownTime>0))
189 1 vShutDown();
190 1
191 1 }
192
193 void vShutDown()
194 {
195 1 INT16U i;
196 1
197 1 api_bSetVolume(0-api_s8GetVolume());
198 1 for(i=0;i<9;i++)
199 1 {
200 2 delay(20);
201 2 bResShowPic(GJI01+i,0,0);
202 2 }
203 1
204 1 delay(20);
205 1 vCloseBackLight();
206 1 lcd_clear();
207 1 delay(20);
208 1
209 1 api_bSetPowerDownMode(POWER_DOWN_ADDA_OFF);
210 1 delay(200);
211 1 b_PIN_POWEROFF = 0;
212 1 while(1){;}
213 1 }
214
215 void vOpenBackLight(void)
216 {
217 1 bLCD_PIN_BACKLIGHT = 0;
218 1 }
219
220 void vCloseBackLight(void)
221 {
222 1 bLCD_PIN_BACKLIGHT = 1;
223 1 }
224
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 921 ----
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 + -