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

📄 initial.~c

📁 ct952 source code use for Digital Frame Photo
💻 ~C
📖 第 1 页 / 共 5 页
字号:
#endif  // #ifndef NO_DIGEST    // DVD_101bMicky, the initial CountStop shall be real stop    __bCountStop=2;// DVD_103Micky, turn on __bAutoVocal when defined is on#ifdef  ENABLE_AUTOVOCAL    __bAutoVocal=1;    // Brian.170, SW MIC Detect#ifdef  SUPPORT_MIC_DETECT_INV    __sbMICDetect=0;    _btPreMICDetect=0;#else   // #ifdef SUPPORT_MIC_DETECT_INV    __sbMICDetect = 1;    _btPreMICDetect= 1;#endif  // #ifdef SUPPORT_MIC_DETECT_INV    __dwMICDectectInterval = 0;    _bMICOffCount=0;#endif  // #ifdef ENABLE_AUTOVOCAL    __bEXTAttr = 0;    // wyc1.10-DVDR, default set to FALSE.    __bDVDROM = FALSE;    // Micky2.79-2, support FullScreen function    // init. value 0 will be assigned within INITIAL_Variables.    // 1: means full screen video on, 0: means full screen video off.    __bFullScreen=0;    __bScanLevel = 0;    HAL_WriteAM(HAL_AM_FF_SPEED, __bScanLevel);#ifndef SIMP_INITIAL    // wyc1.07, rename some variables and initial their value in initial.c    {    extern void MONITOR_InitialValue(void);    MONITOR_InitialValue();    }#endif  // #ifndef SIMP_INITIAL    // LLY0.65, initial the source filter relative variables    SrcFilter_Init();    // LLY0.60, it's un-necessary to set audio threshold for pause/ skip command    // or video master mode    // Because, it will be removed to HAL_InitAudio() for CT909    // ** TCH1.00-908; begin...     It's a default value for disable Video Master Mode.    HAL_ControlAVSync (HAL_AVSYNC_VIDEOMASTER, 0);    //kevin1.07, really disable MV when IR power off and Open    /*    {        extern  BYTE    _bAPSType;        _bAPSType=0; //Kevin1.07a, clear when open    }    */    HAL_TVSetAPS(0);//Alex1.21,20031210 support bookmark//Clear _wBookMark Time and Title value#ifdef SUPPORT_BOOKMARK    __wBookMark[0]=1;    for(__bTemp=0;__bTemp<BOOKMARK_NO;__bTemp++)    {        __wBookMark[__bTemp+1]=0;        __bBookMark_Title[__bTemp+1]=0;//        __wBookMark_Chapter[__bTemp+1]=0;    }#endif//#ifdef SUPPORT_BOOKMARK    // Ming0.80, support multi-disc resume.    // LLY2.14, porting Aron's code to support STB system#if defined( SUPPORT_MULTI_DISC_RESUME) //||defined(SUPPORT_STB)    {        extern BYTE __fSaveResumeInfo;        __fSaveResumeInfo = TRUE;    }#endif // #ifdef SUPPORT_MULTI_RESUME    // LLY1.02, reset the previous play item as unknown    __wPrevPlayItem=0xFFFF;    __wPrevPlayDir=0xFFFF;    // LLY1.02, clear the SPU control to fix HLI don't disappear    // while playback DVD title "Nero" Menu --> Open/Close tray    // Notice: must remove to do this initial during 1st H/W power on    //         after F/W will do CC_KeyCommand(KEY_STOP) while open/close    __SPUCtrl.bEnable = 0;//Alan1.10, support char-based subpicture#ifdef SUPPORT_CHAR_SUBPICTURE    CHAR_SP_Initial();#endif    // wyc2.36a-909s,#ifdef SUPPORT_FUSS_MPEG_CD    INFOFILTER_FUSSMPEGCD(IF_MODE_CLEAR_MODE, 0);#endif //    // wyc2.55-909P-AP, init it to notify infofilter to parse playable files.    INFOFILTER_SetParseMode(IF_PARSE_FILE_MODE);#ifdef  NO_DISC_MODE    __SF_SourceGBL[__dwSFStreamID].bSourceIndex = SOURCE_USB0_0;#ifdef SUPPORT_JPEG_AUDIO_PLAYING    __SF_SourceGBL[BG_ITEM_STREAM_ID].bSourceIndex = SOURCE_USB0_0;#endif //#else   // #ifdef NO_DISC_MODE    //Aron2.17-909S, set bSourceIndex = SOURCE_DISC as default    //Otherwise, it will not config servo dump-in buffer when switching from USB    __SF_SourceGBL[__dwSFStreamID].bSourceIndex = SOURCE_DISC;#ifdef SUPPORT_JPEG_AUDIO_PLAYING    __SF_SourceGBL[BG_ITEM_STREAM_ID].bSourceIndex = SOURCE_DISC;#endif //#endif  // #ifdef NO_DISC_MODE    // LLY2.01, set servo/ parser dump in buffer as normal while open/close    // LLY2.20, rename it as UTL_Config_BufferMode()    // LLY2.51, porting CoCo's code to config buffer mode as video only for CT95x solution#ifdef CT950_STYLE    UTL_Config_BufferMode(DUMP_BUFF_MM_VIDEO_ONLY_MODE);#else    UTL_Config_BufferMode(DUMP_BUFF_NORMAL_MODE);#endif //CT950_STYLE    // LLY2.51, porting YC's code to config MM Init Menu    MM_ConfigMMInitMenu(MM_INITIAL_MENU_NORMAL);#ifdef SUPPORT_ENCODE_JPG_PICTURE    // LLY2.51, porting YC's code to initial Encoder File    MM_EncodeFile_Init();#endif //    // LLY2.36, config video display error rate    // It will skip the picture while this picture is destroyed > 1/DEC_ERROR_RATIO    HAL_PlayCommand(COMMAND_V_ERROR_RATIO, DEC_ERROR_RATIO);    return ;}//  *********************************************************************//  Function    :   _INITIAL_PowerON_Variables//  Description :   ....//  Arguments   :   NULL//  Return      ://  Side Effect :   Only H/W Power-ON once time//  *********************************************************************void _INITIAL_Variables_PowerON(void)   // ** TCH1.60-1;{    // LLY2.79-2, assign __bISRKey as KEY_NO_KEY again after INITIAL_uProcessor()    // to avoid unknown 132 H/W IR interrupt    // Fix "MSG_INVALID" appear while H/W power on by 132 H/W IR    // Notice: Can be removed if find the reason of abnormal H/R IR interrupt    __bISRKey=KEY_NO_KEY;    __bFWKey=KEY_NO_KEY;    // wyc1.25, add one variable to record flow when detected as wrong disc for debug usage,    // And, initial to 0 first.    __bTestFlow = 0;    ///////////////////////////////////////////////////////////////    // [CC] Module    //LJY1.22, Per Micky's request    _CC_Variables_PowerON();    ///////////////////////////////////////////////////////////////    {   // [UTL] Module        extern  DWORD       _dwTimePrev;        extern  BYTE        __bCDDAAutoChTrk;        extern  DWORD   _dwUTLNextTriggerCount;  // ** TCH1.70-2; record SysTimer for next Trigger.        _dwTimePrev= 0;        // wyc.172-CDDA, add a flag to represent CDDA is play across tracks automatically.        __bCDDAAutoChTrk = FALSE;#ifndef SIMP_INITIAL        __bAttrPlay=ATTR_NONE;        __bAttrPlayNew=ATTR_NONE;#endif  // #ifndef SIMP_INITIAL        // LLY.274p-3, initialize this value, otherwise, the OSD_Trigger() can't be called        // within UTL_OutputShowTime() because UTL_GetSysTimer() can't larger than this value (8051 system)        // And, OSD message always can't time-out        _dwUTLNextTriggerCount=0;        // Micky2.80, review global variables init.        __bCheckAudioType=CHECK_NONE;        __btCheckVideoType=FALSE;        __bModePlayPreCDROM= MODE_PLAYUNKNOW;        _dwTriggerShowTime= 0;        _dwGap_TriggerShowTime= (COUNT_500_MSEC+ COUNT_200_MSEC);    }    // LLY0.60, integrate W99AV and HAL variable initial action together    HAL_InitVariables();    MainVideoInfo.bEnable = TRUE;    MainVideoInfo.sHStart = 117;    MainVideoInfo.sVStart = 46;    MainVideoInfo.wHWidth = 720;    MainVideoInfo.wVWidth = 480;    MainBGColor.Color.bWeight = 0x0;    MainBGColor.Color.bY = 0x0;    MainBGColor.Color.bU = 0x80;    MainBGColor.Color.bV = 0x80;    // LLY0.76-1, give the default value for PIP frame size (independent of digest mode)    // Just for un-expect usaga.    PIPVideoInfo.bEnable = FALSE;    PIPVideoInfo.sHStart = 0;    PIPVideoInfo.sVStart = 0;    PIPVideoInfo.wHWidth = 360;    PIPVideoInfo.wVWidth = 240;    // LLY1.02, give the default value for PIP background and border color    PIPBGColor.Color.bWeight = 0x0;    PIPBGColor.Color.bY = 0x0;    PIPBGColor.Color.bU = 0x80;    PIPBGColor.Color.bV = 0x80;    PIPBorderColor.Color.bWeight = 0x0;    PIPBorderColor.Color.bY = 0x0;    PIPBorderColor.Color.bU = 0x80;    PIPBorderColor.Color.bV = 0x80;    __dwCoded_Picture_Width = 720;    __dwCoded_Picture_Height = 480;    // LLY0.65, initial the flag as NONE for all thread initial done status    // LLY1.01, can't put the thread initial flag initial here since it's too late.    // Because, Servo thread initial flag are put before INITIAL_Variables_PowerON() now.    //cyg_flag_init (&__fThreadInit);    // LLY0.95, initial the DISP flag base on Chuan suggestion.    // OS_InitFlag (&__fDISPInfo);    // Initialize parser module and global variables -- LLY0.61    PARSER_ThreadInit( );    // LLY1.00, initialize JPEG decoder thread global variable    JPEG_ThreadInit();#ifdef  SIMP_INITIAL    // Initial default source index as ATAPI or SERVO for SIMP_INITIAL    // Notice: must base on supported source type -- LLY0.67    // For read DVD system, it will be done by source filter#ifdef  SUPPORT_ATAPI_SOURCE    __SF_SourceGBL[0].bSourceIndex = SOURCE_ATAPI;#endif  // #ifdef  SUPPORT_ATAPI_SOURCE#ifdef  SUPPORT_SERVO_SOURCE    __SF_SourceGBL[0].bSourceIndex = SOURCE_SERVO;#endif  // #ifdef  SUPPORT_SERVO_SOURCE    // Assign the pre-define disc type    __wDiscType = DISC_TYPE;    // Assign playing mode attribute    // Notice: must be put together with UTL_SetPlayMode()    __bAttrPlayNew = ATTR_PLAY;#endif  // #ifdef SIMP_INITIAL    /////////////////////////////////////////////////////////////    // wyc.171, moves global variables initial here to reduce the code size in common bank#ifndef NO_DIGEST //LJY1.20, support 4M flash, remove digest    //LJY1.10, reduce extern global vars for INITIAL module.    {        DIGEST_VarInit();    }#endif#ifndef NO_DISC_MODE    ///////////////////////////////////////////////////////////////    // Chuan2.80 VCD20 Module    {        extern WORD __wListType;        extern BIT __btJumpTiming;        __wListType = ID_ENDLIST;        __btJumpTiming = 0;    }    // LLY2.17, configure NV buffer start address    // since the value maybe different base on different DRAM configuration    __dwNVStart = DS_NV_BUF_ADDR_ST;#endif  // #ifndef NO_DISC_MODE    //////////////////////////////////////////////////////////////    // [SETUP] Module    {        // Initial __bSetupMode as FALSE        // Because, the initial action is removed from SETUP module        // Fix "can't playing title while 1st H/W power on"        // No bitstream can be sent into buffer within new CC procedure.        __bSetupMode=FALSE;    }    /////////////////////////////////////////////////////////////    // [THUMB] Module    {        // Give default value as FALSE        // Otherwise, user will see "unknown char" first        // while 1st H/W power --> 1st call OSD_Output(MSG_XXX, XXX)        __bThumbnailMode= FALSE;    }    //[CHIPS], LJY1.10    {        CHIPS_Initial(CHIPS_INIT_ALL);    }    // Brian0.69    SrcFilter_InitVariables();#ifdef SUPPORT_WATCHDOG_BURNIN    // elmer2.78, support burn-in testing    {        extern DWORD __dwWatchdogTime;        __dwWatchdogTime = OS_GetSysTimer();    }#endif}//  **********************************************************************************//  Function    :   INITIAL_CheckServo//  Description :   Check the SERVO. Decide which kind of title that puts in Drive//  Arguments   :   NONE//  Return      :   ERR_NOERR//  Side Effect ://  **********************************************************************************WORD INITIAL_CheckServo(void){    // For SIMP_INITIAL, do servo related action and assign a pre-define disc type    // For real DVD system, all things will be handled by media.c#ifdef  SIMP_INITIAL    extern   BOOL    INFOFILTER_GetDiscTypeFromSource(VOID);    // ** S-TCH; first suppose no disc in SERVO    __wDiscType= NO_DISC_IN_DRIVE;    // Micky1.05-2, Fix Loading-> Setup-> exit setup-> will detect as wrong disc    // must clear __bDiscInfo for each title detection.    __bDiscInfo= DISCINFO_NONE;    // check if Drive is OPEN ot CLOSE    if ( __btDriveOpen )    {        // wyc.172r, remove this code for not doing close command twice to avoid the result of mode select command to make        // DVD title detection fail.        // wyc.273-1, make __bCloseCommand =1 when close by extra force.        extern BYTE __bCloseCommand ;        __bCloseCommand = TRUE;        __btDriveOpen= FALSE;    }    OSD_OUTPUT_MACRO ( MSG_WAITING, 0, 0xFF );    // Check the exist of CD-Drive    if (SRCFilter_GetMediaStatus() != SRCFILTER_HAVEDISC)    {        // stop loader for wrong disc or no disc        // wyc1.25, add one variable to record flow when detected as wrong disc for debug usage,        SrcFilter_PowerMode (SERVO_POWER_STOP) ;        __bTestFlow |= 0x1;    }    else    {        // Servo Initialization: Identify -> Init -> Check Disc and Wait Stable -> ReadTOC        // Reset CDROM and Read TOC        if ( ! INFOFILTER_GetDiscTypeFromSource () )        {            __wDiscType=NO_DISC_IN_DRIVE;            // wyc2.53-909P,            SrcFilter_Stop(__dwSFStreamID);            return ERR_ERROR;

⌨️ 快捷键说明

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