📄 user_main.lst
字号:
162 1 }
163
164 void event_usb_status_change(void)
165 {
166 1 }
167
168 void event_init_startup(void);
169 void event_usb_cable_out(void)
170 {
171 1 }
172 void event_usb_cable_in(void)
173 {
174 1 //usb_online();
175 1 //screen_map(SCREEN_USB);
176 1 api_vLoad(Code_USER13,1);
C51 COMPILER V7.50 USER_MAIN 08/18/2008 14:07:07 PAGE 4
177 1 }
178
179 void event_quarter_sec(void)
180 {
181 1 if((usb_plug) && (screen_level == SCREEN_LEVEL_MOVIE_STOP))
182 1 ui_show_charge();
183 1 if(batt_count++ > 6 )
184 1 {
185 2 batt_count = 0;
186 2 if(screen_level != SCREEN_LEVEL_MOVIE_PLAY)
187 2 ui_show_batt();
188 2 }
189 1
190 1 if(api_u8GetBatteryRemain() <= BATTERY_LEVEL_20)
191 1 {
192 2 low_batt_count++;
193 2 }
194 1 else
195 1 {
196 2 low_batt_count = 0;
197 2 }
198 1 if(low_batt_count==6) //shut down
199 1 {
200 2 close_volume();
201 2 bResShowPic(LOWPOWER,0,0);
202 2 delay(10000);
203 2 delay(10000);
204 2 vShutDown();
205 2 }
206 1
207 1
208 1 if(vol_flag && screen_level != SCREEN_LEVEL_MOVIE_PLAY && curr_screen->id == SCREEN_MOVIE)
209 1 {
210 2 if(_flash)
211 2 {
212 3 _flash = 0;
213 3 bResShowPic(MVOL_CLR,66,144);
214 3
215 3 }
216 2 else
217 2 {
218 3 _flash = 1;
219 3 ui_show_vol();
220 3 }
221 2 }
222 1 vKeyTimeOut();
223 1 }
224
225 void event_dsp_exception(void)
226 {
227 1 #if 1
228 1 if((curr_screen->id == SCREEN_MOVIE && screen_level == SCREEN_LEVEL_MOVIE_PLAY))
229 1 {
230 2 key_process(KEY(EOS));
231 2 }
232 1 #endif
233 1 }
234
235 void event_loop_epilog(void)
236 {
237 1 #if 1
238 1 if(curr_screen->id == SCREEN_MOVIE && screen_level == SCREEN_LEVEL_MOVIE_PLAY) {
C51 COMPILER V7.50 USER_MAIN 08/18/2008 14:07:07 PAGE 5
239 2 if(eSysState == STATE_IDLE){
240 3 key_process(KEY(EOS));
241 3 }
242 2 }
243 1 #if 0
#endif
245 1
246 1 #endif
247 1 }
248
249 void event_init_startup(void)
250 {
251 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
261 1 api_vKeyMapRegister(key_map);
262 1
263 1 api_vSetPassCount(30);
264 1
265 1 api_vBatteryLevelRegister(battery_map);
266 1 api_bLoadPreferenceData((void*)(&tUserPreference),sizeof(USER_PREFERENCE_T));
267 1
268 1 if(tUserPreference.u8LanguageId>4)
269 1 api_bSetLanguage(0);
270 1 else
271 1 api_bSetLanguage(tUserPreference.u8LanguageId);
272 1
273 1 if(api_bChangeDisk(DISK_SD))
274 1 have_sd = 1;
275 1 else
276 1 have_sd = 0;
277 1
278 1 api_bChangeDisk(DISK_NAND);
279 1 u16TimerCount = 0;
280 1 movie_init = 1;
281 1
282 1 gui_init();
283 1
284 1 api_vSetAVMFwRwdSpeed(1);
285 1 screen_level = SCREEN_LEVEL_MUSIC_STOP;
286 1 screen_map(SCREEN_MOVIE);
287 1 }
288
289
290 typedef void event_handler(void);
291
292 static code event_handler *handlers[] = {
293 event_init_startup, // EVENT_INIT_STARTUP
294 NULL, // EVENT_WATCHDOG_UP
295 NULL, // EVENT_LOOP_PROLOG
296 event_loop_epilog, // EVENT_LOOP_EPILOG
297 NULL, // EVENT_OCTANT_SEC
298 event_quarter_sec, // EVENT_QUARTER_SEC
299 event_usb_cable_in, // EVENT_USB_CABLE_IN
300 event_usb_cable_out, // EVENT_USB_CABLE_OUT
C51 COMPILER V7.50 USER_MAIN 08/18/2008 14:07:07 PAGE 6
301 event_usb_status_change, // EVENT_USB_STATUS_CHANGE
302 event_card_change, // EVENT_CARD_CHANGE
303 event_long_button, // EVENT_LONG_BUTTON
304 event_short_button, // EVENT_SHORT_BUTTON
305 event_button_release, // EVENT_BUTTON_RELEASE
306 event_dsp_exception, // EVENT_DSP_EXCEPTION
307 };
308
309 void user_main(UINT8 event, UINT8 argv)
310 {
311 1 event_argv = argv;
312 1 event -= 0x80;
313 1
314 1 if(handlers[event])
315 1 (*handlers[event])();
316 1 }
317
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 563 ----
CONSTANT SIZE = 92 ----
XDATA SIZE = 5 ----
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -