📄 user_main.lst
字号:
174 1 }
175
176 void event_quarter_sec(void)
C51 COMPILER V7.50 USER_MAIN 08/20/2008 17:11:01 PAGE 4
177 {
178 1 UINT16 data ptime;
179 1 if(curr_screen->id == SCREEN_VOICE)
180 1 play_time_update(1);
181 1
182 1 if(vol_flag && curr_screen->id == SCREEN_VOICE)
183 1 {
184 2 if(_flash)
185 2 {
186 3 _flash = 0;
187 3 bResShowPic(MVOL_CLR,66,144);
188 3
189 3 }
190 2 else
191 2 {
192 3 _flash = 1;
193 3 ui_show_vol();
194 3 }
195 2 }
196 1
197 1 //ui_show_charge();
198 1 if(screen_level!=SCREEN_LEVEL_USB_ON)
199 1 {
200 2 if(usb_plug)
201 2 {
202 3 ui_show_charge1();
203 3 }
204 2 }
205 1 else
206 1 {
207 2 ui_show_charge();
208 2 }
209 1
210 1 if(batt_count++ > 6 )
211 1 {
212 2 batt_count = 0;
213 2 if(!usb_plug)
214 2 ui_show_batt();
215 2 }
216 1 if(api_u8GetBatteryRemain() <= BATTERY_LEVEL_20)
217 1 {
218 2 low_batt_count++;
219 2 }
220 1 else
221 1 {
222 2 low_batt_count = 0;
223 2 }
224 1 if(low_batt_count==6) //shut down
225 1 {
226 2 close_volume();
227 2 bResShowPic(LOWPOWER,0,0);
228 2 delay(10000);
229 2 delay(10000);
230 2 vShutDown();
231 2 }
232 1
233 1 if(curr_screen->id == SCREEN_VOICE && screen_level == SCREEN_LEVEL_MUSIC_PLAY)
234 1 {
235 2 bResShowPic(RPLAY1+cartoon_count++,2,51);
236 2 if(cartoon_count>=12)
237 2 cartoon_count = 0;
238 2 }
C51 COMPILER V7.50 USER_MAIN 08/20/2008 17:11:01 PAGE 5
239 1 vKeyTimeOut();
240 1 }
*** WARNING C280 IN LINE 178 OF ..\..\CODE\AP_VOICE\SRC\USER_MAIN.C: 'ptime': unreferenced local variable
241
242 void event_dsp_exception(void)
243 {
244 1 #if 0
if((curr_screen->id == SCREEN_MOVIE && screen_level == SCREEN_LEVEL_MOVIE_PLAY) ||
(curr_screen->id == SCREEN_PICTURE && screen_level == SCREEN_LEVEL_JPEG_DISP)) {
Print("Fmt err\n");
lcd_set_rw_area(SCREEN_START_X, SCREEN_START_Y, SCREEN_WIDTH, SCREEN_HEIGHT);
key_process(KEY(NEXT));
}
#endif
252 1 }
253
254 void event_loop_epilog(void)
255 {
256 1 #if 1
257 1 if(/*curr_screen->id == SCREEN_VOICE &&*/ music_on) {
258 2 if(eSysState == STATE_IDLE) {
259 3 key_process(KEY(EOS));
260 3 //music_on = 0;
261 3 }
262 2 }
263 1 #if 0
else if(music_on) {
if(curr_screen->id == SCREEN_MAINMENU || curr_screen->id == SCREEN_FILEBROWSER)
if(eSysState == STATE_IDLE)
key_process(KEY(EOS));
}
#endif
270 1
271 1 #endif
272 1 }
273
274 void event_init_startup(void)
275 {
276 1 #ifndef CONFIG_NAND_LARGEPAGE
/* Nothing, just for demo "api_vGetFreeXdataInfo()" in small page flash. */
INT16U free_size, free_start;
api_vGetFreeXdataInfo(&free_size, &free_start);
free_mem_ptr = free_start;
free_mem_end_ptr = free_mem_ptr + free_size;
file_entry = (INT32U *)my_malloc(FILE_ENTRY_MAX * sizeof(UINT32));
#endif
286 1 api_vKeyMapRegister(key_map);
287 1 api_vSetPassCount(20);
288 1 api_vBatteryLevelRegister(battery_map);
289 1 api_bLoadPreferenceData((void*)(&tUserPreference),sizeof(USER_PREFERENCE_T));
290 1
291 1
292 1 if(tUserPreference.u8LanguageId>4)
293 1 api_bSetLanguage(0);
294 1 else
295 1 api_bSetLanguage(tUserPreference.u8LanguageId);
296 1 if(api_bChangeDisk(DISK_SD))
297 1 have_sd = 1;
298 1 else
299 1 have_sd = 0;
C51 COMPILER V7.50 USER_MAIN 08/20/2008 17:11:01 PAGE 6
300 1
301 1 api_bChangeDisk(DISK_NAND);
302 1
303 1 u16TimerCount = 0;
304 1 cartoon_count = 0;
305 1 music_on = 0;
306 1 //lcd_init();
307 1 gui_init();
308 1 screen_level = SCREEN_LEVEL_MUSIC_STOP;
309 1 screen_map(SCREEN_VOICE);
310 1 }
311
312
313 typedef void event_handler(void);
314
315 static code event_handler *handlers[] = {
316 event_init_startup, // EVENT_INIT_STARTUP
317 NULL, // EVENT_WATCHDOG_UP
318 NULL, // EVENT_LOOP_PROLOG
319 event_loop_epilog, // EVENT_LOOP_EPILOG
320 NULL, // EVENT_OCTANT_SEC
321 event_quarter_sec, // EVENT_QUARTER_SEC
322 event_usb_cable_in, // EVENT_USB_CABLE_IN
323 event_usb_cable_out, // EVENT_USB_CABLE_OUT
324 NULL, // EVENT_USB_CABLE_OUT
325 event_card_change, // EVENT_CARD_CHANGE
326 event_long_button, // EVENT_LONG_BUTTON
327 event_short_button, // EVENT_SHORT_BUTTON
328 event_button_release, // EVENT_BUTTON_RELEASE
329 event_dsp_exception, // EVENT_DSP_EXCEPTION
330 };
331
332 void user_main(UINT8 event, UINT8 argv)
333 {
334 1 event_argv = argv;
335 1 event -= 0x80;
336 1
337 1 if(handlers[event])
338 1 (*handlers[event])();
339 1 }
340
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 575 ----
CONSTANT SIZE = 92 ----
XDATA SIZE = 5 ----
PDATA SIZE = ---- ----
DATA SIZE = ---- 2
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 1 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -