system_util.c
资源名称:8202s.rar [点击查看]
上传用户:poi891205
上传日期:2013-07-15
资源大小:9745k
文件大小:5k
源码类别:
DVD
开发平台:
C/C++
- void
- sysmain_boot_message(void)
- {
- printf("Sunplus DVD driver " __DATE__ "n");
- printf("FSJPEGDATA:%x DataSaved:%xn",sizeof(FSJPEGDATA),sizeof(DataSaved));
- }
- void
- sysmain_load_setup(void)
- {
- //
- // Initialize user setup with default value
- set_default_value();
- //
- // Load user_setup from i2c eeprom
- #ifdef FORCE_REWRITE_WHEN_UPGRADE//terry,2004/1/8 05:32PM
- load_user_setup(0);
- #else
- load_user_setup();
- #endif
- #ifdef FORCE_RETURN_TO_DEFAULT_TV_FORMAT
- //
- // restore default TV
- setup_SetTV_default_format();
- #endif//FORCE_RETURN_TO_DEFAULT_TV_FORMAT
- }
- void
- sysmain_setup_hardware(void)
- {
- //
- // setup TV-encoder output current
- #ifdef IC_8202E
- sp8200tv_setup_dac_current(TV_DAC_A_HALF|TV_DAC_B_QUART|TV_DAC_C_QUART|TV_DAC_D_QUART|TV_DAC_E_QUART|TV_DAC_F_QUART); // dac f/e/d/c/b quarter-swing
- #else
- #ifdef TV_USE_HALF_SWING
- tv_dachalf(TV_DAC_F|TV_DAC_E|TV_DAC_D|TV_DAC_C|TV_DAC_B); // dac f/e/d/c/b half-swing
- #else
- tv_dachalf(0);
- #endif
- #endif // IC_8202E
- //
- // setup TV-encoder DAC output
- #ifndef TVOUT6_4DAC_ON
- #ifdef TV_USE_4_DAC
- #ifdef SPHE1000
- tv_dacoff(TV_DAC_F|TV_DAC_E); // dac d/c/b/a on ,e,f off
- #else
- #ifdef GBM_PORTABLE_DVD
- tv_dacoff(TV_DAC_F|TV_DAC_E); // dac d/c/b/a on ,e,f off
- #else
- //gerry add for gbm,when we set to S-VIDEO,tv dac3 will be off,2004-5-13 15:44
- #if defined(S_VIDEO_OUT)&&defined(S_VIDEO_SET_TV_DAC3_OFF)
- extern UINT8 setup_GetVideoMode(void);
- if(setup_GetVideoMode()==2) //default S_VIDEO out
- tv_dacoff(TV_DAC_C|TV_DAC_B|TV_DAC_D); // dac f/e/d//a on ,b,c off
- else
- #endif
- tv_dacoff(TV_DAC_C|TV_DAC_B); // dac f/e/d//a on ,b,c off
- #endif
- #endif
- #else
- #ifndef SLEEP_WHEN_POWER_ON //hq,3-11-25 22:39
- #ifndef USE_SUNPLUS_EMU_BOARD
- #ifdef SUPPORT_FUNCTION_MENU //Jack added for argus portable dvd
- #ifdef SUPPORT_SPI
- if(pdvd_mode == PDVD_MODE)
- {
- sp8200tv_setup_custom_output(TV_OUT_CScRGB);
- tv_dacoff(TV_DAC_C|TV_DAC_B|TV_DAC_A);
- }
- else
- #endif
- #endif
- #endif
- #ifdef GBM_ONLY_CVBS_S_VIDEO_SHOW_COMPOSITE//gerry,2004-7-30 17:11
- tv_dacoff(TV_DAC_F|TV_DAC_E|TV_DAC_D|TV_DAC_C|TV_DAC_B);//turn off dac f/e/d/c/b,gerry,2004-7-30 17:11
- #else//GBM_ONLY_CVBS_S_VIDEO_SHOW_COMPOSITE
- tv_dacoff(0); // dac f/e/d/c/b/a on
- #endif//GBM_ONLY_CVBS_S_VIDEO_SHOW_COMPOSITE
- #endif
- #endif
- #endif
- }
- //terry,2003/8/9 03:48PM
- //wanghaoying 2003-8-12 19:38 modified the type of the function
- BYTE wait_dsp_port0_5(int port0,int port5,int val,UINT32 risc_waiting_dsp_tm)
- {
- UINT32 i;
- if(srv_on == 0) risc_waiting_dsp_tm = 0x1;//terry,2003/8/11 11:41AM
- for (i=0; i< risc_waiting_dsp_tm; i++)
- {
- if ( (port0==0)||((regs0->dsp24_port[0] & 0x8000) == 0x8000) )
- {
- if( (port5==0)||(regs0->dsp24_port[5]==(UINT32)val) )//wanghaoying 2003-8-12 19:36 modified, please terry confirm
- {
- return 1;
- }
- }
- #if 0//def DVD_SERVO//servo-test 2004-5-3 16:47
- if(srv_on == 1)
- ServoDecMainLoop();// barry add for polling servo status
- #endif
- }
- return 0;
- }
- void delay_srv_10ms(int tms)
- {
- #if defined(SUPPORT_CARD_STORAGE)||defined(SUPPORT_USB)||defined(SPHE8202_CARD_STORAGE)
- if (media_type==MEDIA_CARD)
- {
- delay_1ms(10*tms);
- return;
- }
- #endif
- #ifndef DVD_SERVO
- delay_1ms(10*tms);
- #else
- if (srv_on==0)
- {
- int i;
- for(i=0;i<tms;i++)
- {
- delay_1ms(10);
- //#ifdef HANYANG_SCAN_KEY
- //check_hanyang_keylight_status();
- //#endif
- #if defined(USE_VFDPORT_TO_KEYLIGHT_MINTON)
- check_minton_keylight_status();
- #endif
- }
- }
- else
- {
- int now,old = GET_RTC_15_0();
- int cnt = 0;
- do {
- now = GET_RTC_15_0();
- if(old!=now)
- {
- cnt++;
- old=now;
- #if defined(USE_VFDPORT_TO_KEYLIGHT_MINTON)
- check_minton_keylight_status();
- #endif
- //#ifdef HANYANG_SCAN_KEY
- //check_hanyang_keylight_status();
- //#endif
- }
- #ifdef DVD_SERVO
- ServoDecMainLoop();// barry add for polling servo status
- #endif
- #ifdef HDMI
- HDCP_polling();//Modifed for avoid unknow recursion.chenzhao on 2004-12-14 16:21
- #endif
- }while(cnt<=tms);
- }
- #endif
- }