⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 initial.c

📁 车载电子影音系统dvd播放系统原程序代码
💻 C
📖 第 1 页 / 共 5 页
字号:
    if( bMode & HARDWARE_SHUTDOWN )
    {
        //Kevin2.26, comment
        /*
        // ** TCH1.55; begin... Below will check the valid u-code or not.
        // If invalid, PANEL will flash ON/ OFF.
        if ( ! UCODE_VerifyCODE (UCODE_IRAM ) )
        {   // U_CODE is imcompatible w/ CHIPS
            while ( 1 )
            {
            __bTemp++;

            if ( __bTemp > COUNT_1_SEC )
                __bTemp= NULL;
            OSD_OUTPUT_MACRO ( MSG_POWER, __bTemp%2, NULL );
            UTL_DelayTime ( COUNT_100_MSEC+ __bTemp, TRUE );
            
            if ( __bISRKey != KEY_NO_KEY )
                break;
#if IO == IO_PCI
            printf("###### IC and ucode version mis-match !!\n");
            getch();
            break;
#endif  // #ifdef IO == IO_PCI
            }
        }   
        // ** TCH1.55; end...
        */

#ifndef SUPPORT_SHOWLOGO_AFTER_UNZIP
    // wyc1.24a, need to set mode to GZIP compression mode to load DSP & parser code.
#ifdef    SUPPORT_GZIP_COMPRESSION  
        W99AV_PrepareGZIP1();
        W99AV_PrepareGZIP2();
#endif
#endif

        // Chuan1.21, Load OSD Font Table/ DSP Code/ Servo Code.
        // Must after __bVersionMPEG is determinde
        _PrepareLoadCode2();
	_ChangeDSPCode(HAL_AUDIO_PCM);


    }

}


//  *********************************************************************
//  Function    :   INITIAL_PowerONStatus
//  Description :
//  Arguments   :   NONE
//  Return      :
//  Side Effect :
//  *********************************************************************
// DVD_100Micky, merge I/R power on sequence with h/w power on.
void INITIAL_PowerONStatus(BYTE bPower)
{
    // wyc1.25, add one variable to record flow when detected as wrong disc for debug usage, initial to 0 first.
    __bTestFlow = 0;
	if (bPower==INITIAL_POWER_HARDWARE)
    	{
		TFT_HW_Switch_ON_OFF(FALSE);
		__sbAvIn=0;		
//#ifdef SUPPORT_AVIN
		TFT_MUTE_ON(TRUE);
//#endif
		 #ifdef YHTANG_DEBUG
	              _printf("\n initial. c h/w turn off TFT switch");
		 #endif
		_TFT_PowerOn_Initial_Variable();
		_TFT_PowerOn_Initial();
/*#ifdef SUPPORT_AVIN
		TFT_MUTE_ON(FALSE);
#endif*/
    	}
//yhtang_0809 end	

    // wyc1.24a, when not define SUPPORT_GZIP_COMPRESSION, make flow of display LOGO go original path.
#ifdef SUPPORT_SHOWLOGO_AFTER_UNZIP //LJY2.39, show logo after ucode unzip.
    // wyc1.24a, set __bLOGO=LOGO_NONE only when not GZIP mode. Because GZIP mode have displayed LOGO in INITIAL_System.
    // LLY.276p, expand the _bLOGO meaning, and rename it to __bLOGO
    __bLOGO=LOGO_NONE; //FALSE;
    // wyc1.24a, add parameter for W99AV_PowerOnInitial to check if need to issue W99AV_RESET_TOTAL.   
    W99AV_PowerOnInitial(TRUE);
    //CoCo1.21, Load palette before clearing region.
    GDI_LoadPalette(3);

//Brian0.87, move from GDI.C
#ifdef CT908_UI
    // Brian1.10, initialize color mode for the case of one OSD region only
    __bColorMode = COLOR_MODE_4_BIT;
    GDI_ClearRegion_By_RISC(0);

#ifndef USE_ONE_OSD_REGION
    __bColorMode = COLOR_MODE_8_BIT;
    GDI_ClearRegion_By_RISC(1);
#endif

    __bColorMode = COLOR_MODE_8_BIT;
    // Brian1.24-3, it will clear the icon bmp uzipped in _PrepareLoadCode2, and we don't want this happen.
    // In fact, there is no need to clear the bmp region at all. 
    //GDI_ClearRegion_By_RISC(2);
#endif
#ifdef  POWERON_STANDBY //LJY2.39, not show logo for H/W power-on under power-on standby mode.
    if (bPower==INITIAL_POWER_SOFTWARE)
#endif
    INITIAL_ShowFirstLOGO();
	if (bPower==INITIAL_POWER_HARDWARE)
    	{
		TFT_HW_Switch_ON_OFF(TRUE);
		 #ifdef YHTANG_DEBUG
	              _printf("\n initial.c h/w  , TURN on TFT SWITCH");
		 #endif
    	}
#else
    // wyc1.24a, when define SUPPORT_GZIP_COMPRESSION, the LOGO have displayed in INITIAL_System. So needn't to H/W reset RISC to avoid
    // video become black. Also set __bLOGO=LOGO_DEFAULT because of LOGO have displayed in INITIAL_System.
//LJY2.37, removed.    __bLOGO=LOGO_DEFAULT;
    W99AV_PowerOnInitial(FALSE);
#endif // 



    // DVD_100Micky, only hardware power on need check power on standby mode
    if (bPower==INITIAL_POWER_HARDWARE)
    {

        
        // Brian1.22-2, Set DM pause_threshold once 
        // Tell DSP to maintain audio buffer to a certain level (to threshold 0x1000) when skipping audio data for PAUSE/STEP command.
        W99AV_WriteDM(W99AV_DM_PAUSE_THRESHOLD, 0x1000);



#ifdef  POWERON_STANDBY
        // Let F/W enter POWER-DOWN mode immediately
        // LLY2.37p, assign KEY_POWER from F/W
        // To avoid IR and F/W key conflict issue
        //__bISRKey= KEY_POWER;
        __bFWKey=KEY_POWER;

//LJY1.10, only need to initial OSD and load font
// Chuan1.20, Load font table early if support GZIP
#ifndef SUPPORT_GZIP_COMPRESSION
        //OSD_LoadFontTableHDW();
        //OSD_LoadFontTableLDW();
        OSD_LoadFontTable();    // Brian1.25, always call this to load font table
#endif
        OSD_Initial();

        return;
#endif  // #ifdef POWERON_STANDBY




//Kevin1.26, move from below to fix CTMan STB->DVD => shows OSD_Output(MSG_WAITING) before loading font table
#ifdef  SUPPORT_DVD_T
        //Kevin1.24aDVD_T, reduce the switch time from STB->DVD
        if (__bReduceSTBtoDVDtime)
        {
            extern void UDE_ReloadVariable(void);
            //extern void SRVIF_UpInitial(void);
            extern BIT start_service_420;
            
            //restore SERVO state var. 
            UDE_ReloadVariable();
            
            //restore font table & bimap
            W99AV_RestoreFontBitmap(); 

            //Kevin1.25, comment, UDE_ReloadVariable() does
            //initialize up Timer/INT for Servo (SERVO_Reset()-> INIT_420_2()-> SRVIF_UpInitial())
            //SRVIF_UpInitial();
        }
#endif



    }

// Chuan1.20, Load font table and initial OSD early if support GZIP
#if 0//def SUPPORT_GZIP_COMPRESSION
    OSD_Initial();
//LJY2.37, port KCHong's code
#ifdef SUPPORT_PORTABLE_DVD_TOP_LOADING
    if(SERVO_CheckTrayStatus()==TRAY_CLOSED)
#endif // #ifdef SUPPORT_PORTABLE_DVD_TOP_LOADING
    OSD_Output ( MSG_WAITING, NULL, 0xFF );   // KCHong 0.90
#endif

//LJY1.23, per KWD's request
#ifdef SET_VIDEO_OUTPUT_WHEN_POWER_ON 
    SETUP_AdjustSetting(SETUP_SCREEN_VIDEO_OUTPUT); //KWD-1.21c for Norcent to fix video output blue background color
#endif    

// Alex1.24a, Scan Dram ok at power on, assign __bISRKey=KEY_OPEN_CLOSE
// To skip disc reading action.
#ifdef SUPPORT_DRAM_SCAN_POWERON
    // LLY2.37p, assign KEY_OPEN_CLOSE from F/W 
    // To avoid IR and FW key conflict issue
    //__bISRKey = KEY_OPEN_CLOSE;
    __bFWKey = KEY_OPEN_CLOSE;
#endif 

#ifdef SUPPORT_PORTABLE_PROJECT

	SERVO_CheckTrayClosed();    // Added for portable, KCHong, 20031117
#endif

#ifdef SHOW_POWERON_BAR //Xuli1.07
	OSD_Initial(); //OSD initial to draw bar
	if (bPower==INITIAL_POWER_HARDWARE)
	{
		OSD_Output (MSG_PWRON_BAR, 0, 0xff);
	}
#endif
// ** S-TCH; remove it as INITIAL_System will call PANEL_Initial it
//    OSD_INITIAL_MACRO ();               // OSD/PANEL Initial call
//LJY1.00, to reset servo after LOGO dislplayed.
//LJY1.00-4, move SERVO_Reset() here for both H/W and IR power-on.
//LJY1.07, let SERVO_Reset() to pass parameter for status bar display
#ifdef SHOW_POWERON_BAR
  	if (bPower==INITIAL_POWER_HARDWARE)
  	{
   	    SERVO_Reset (TRUE) ; //show loading status bar
  	}
    else
#endif       
    {
#ifndef  SUPPORT_DVD_T
        SERVO_Reset(FALSE); //not show loading status bar
#else
        //Kevin1.24aDVD_T, reduce the switch time from STB->DVD
        if (__bReduceSTBtoDVDtime)
        {
            //Kevin1.26, move above
            /*
            extern void UDE_ReloadVariable(void);
            //extern void SRVIF_UpInitial(void);
            extern BIT start_service_420;
            
            //restore SERVO state var. 
            UDE_ReloadVariable();
            
            //restore font table & bimap
            W99AV_RestoreFontBitmap(); 

            //Kevin1.25, comment, UDE_ReloadVariable() does
            //initialize up Timer/INT for Servo (SERVO_Reset()-> INIT_420_2()-> SRVIF_UpInitial())
            //SRVIF_UpInitial();
            */
            
            printf("SERVO_Seek\n");
            start_service_420 = TRUE; //otherwise, SERVO_Seek will not work
            __dwTimeNow= 0x16;
            SERVO_Seek(__dwTimeNow, TRUE);
        }
        else
        {
            printf("SERVO_Reset\n");
            SERVO_Reset(FALSE);
        }
#endif

    }
#ifdef SUPPORT_PORTABLE_PROJECT
// Added for portable, begin, KCHong, 20031117
__bTopInitial=0;
            SERVO_CheckTrayClosed();  // detect top loader
    if(__bTopOpen)
    {
        __bISRKey=KEY_OPEN_CLOSE;//yhtang_0601
        __bKeyInputEnable=FALSE;      // Added for portable, KCHong, 20031118
    }
    else
        __bISRKey=KEY_NO_KEY;
// Added for portable, end, KCHong, 20031117
#endif
#ifdef SUPPORT_AVIN
	__bTftKeyAvInEnable=TRUE;
#endif

// LJY1.00-4, only need to do once after H/W power-on, removed from GDI_Initial().
// Chuan1.20, Load font table and initial OSD early if support GZIP
#ifndef SUPPORT_GZIP_COMPRESSION
    if (bPower==INITIAL_POWER_HARDWARE)
    {
#ifdef  SUPPORT_DVD_T
        if (!__bReduceSTBtoDVDtime)  //Kevin1.24aDVD_T, no load font table when switching from STB->DVD  
#endif
        {
            //OSD_LoadFontTableHDW();
            //OSD_LoadFontTableLDW();
            OSD_LoadFontTable();    // Brian1.25, always call this to load font table
        }             
    }
#endif
#if !defined(SHOW_POWERON_BAR) && !defined(SUPPORT_GZIP_COMPRESSION) //Xuli1.07 has moved in advance
    OSD_Initial();
    OSD_Output ( MSG_WAITING, NULL, 0xFF );   // KCHong 0.90
#endif
#ifdef SHOW_POWERON_BAR //Xuli1.07
	if (bPower==INITIAL_POWER_HARDWARE)
	{
		OSD_Output (MSG_PWRON_BAR, 1, 0xff);//turn off power-on bar
	}
#endif
//LJY2.37, port KCHong's code
    // The PANEL_Output will reference global variable
    // but this variable is not initialized(program???)
    // Need check this issue.!!!!!!
    // so don't call PANEL(MSG_WAITING now)
    // It will be called till _WaitStable is called.
//    OSD_OUTPUT_MACRO ( MSG_WAITING, NULL, 0xFF );


#ifdef SUPPORT_TOPLOADING //xuli0309 for fuss 0419

            SERVO_CheckTrayClosed();  // detect top loader

    if(__bTopOpen) //Do not show "loading" when tray cover open

        {

        //   __bPowerOnTopOpen=TRUE; 

        OSD_OUTPUT_MACRO(MSG_OPEN, TRUE, 0XFF);

        }

        else

#endif   //for fuss 0419
    OSD_Output ( MSG_WAITING, NULL, 0xFF );   // KCHong 0.90

    SETUP_Initial(SETUP_OTHERS_INITIAL); //CoCo.051

    INITIAL_Variables ();   // ** S-TCH; move from INITIAL_System

    CHIPS_Initial(CHIPS_INIT_ALL);

#ifdef  INPUT_PATH_ATAPIIF
    // DVD_100Micky, only hardware power need do SERVO identify
    // TCC102b, force to do identify device in case that atapi-reset is needed.
    //if (bPower==INITIAL_POWER_HARDWARE)
    {
        // wyc.171-3, reference ESS method to do start up when IR power on to fix FUSS detection long problem.
        SERVO_PowerMode(SERVO_POWER_START);
    }
#endif  // #ifdef INPUT_PATH_ATAPIIF

    INITIAL_InitialState();

    CHIPS_Initial(CHIPS_INIT_VOL); //jyliu.yhi

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -