?? initial.bak.c
字號:
//////////////////////////////////////////////////////////
// ****** Big modification History Area ******
// LLY.172q, fix "non-give argument type of function prototype" for "ARM" warnning message
// LLY.274, some big modification
// [1] rename all MP3 relative info. because module name has changed !!
// - "mp3.h" --> "fmanager.h"
// - MP3_CheckMP3Disc() --> MP3_CheckPlayableCDROM()
// LLY2.80, Remove some un-necessary code
// [1] COMBO_SYSTEM
// [2] _QChannelTorelence(), because the action will be done with UTL_ReadSector()
// Micky2.80a
// - remove MULTI_DISC_SYSTEM codes
// LLY2.80a,
// - remove ADD_BACKGND_FOR_CDDA codes
// - remove the code while define "SUPPORT_SW_REROUTE" by H/W
// because it's only necessary for BA5580E chip
// - remove the code "SW_VERSION < 39"
//////////////////////////////////////////////////////////
//LJY1.10,
// - Remove the reference of CHIP_W9928
//LJY1.21,
// - Remove __btVideoFreeze, __btFreeze, __btEnableBookMarkPlay.
//////////////////////////////////////////////////////////////
// ***** Include header file Area *****
// The file "winav.h" must be included in first line
#include "winav.h"
#include "w99av.h"
#include "initial.h"
#include "utl.h"
#include "hal.h"
#include "servo.h"
#include "input.h"
#include "cdinfo.h"
#include "avsys.h" // LLY.277a-2
#ifdef _WINDVD
#include "navigate.h"
#endif // #ifdef _WINDVD
#include "digest.h"
#include "chips.h"
#include "cc.h"
#include "isr.h"
#include "osd.h"
#include "setup.h" // DVD_028 Micky added
#include "linear.h" // wyc.pro added
#include "ucode.h" // ** TCH1.55;
#include "dvdinfo.h" // LLY.171
#include "sysdebug.h"
#include "thumb.h" // LLY2.80
#include "amp.h"
#include "gdi.h"
#ifndef NO_MP3
#include "fmanager.h"
#endif // #ifndef NO_MP3
#include <string.h>
// Micky2.31, reduce codes, don't use C string API
#include "ctstring.h"
#ifdef TFT_CONTROL
#include "tft.h"
#endif
/////////////////////////////////////////////////////////////
// Extern other module's global variable Area
extern BYTE __bDigestStyle; // in cc.c
extern BYTE __bInvalidRegion; // in cc.c
extern BYTE _bLastSession; // in ser_ata.c
#ifdef PRESTOP_BEFORE_SETUP_AND_PROGRAM //XuLi.230
extern BYTE __bProgramStop;
extern BYTE __bPreCountStop;
#endif
////////////////////////////////////////////////////////////
// ***** Define some global variable Area *****//
// [1] Tolerance time for reading sector
// In CDIF path: must give the tolerance value for servo seeking, ex 5 sector
// In ATAPI path: it's unnecessary, the value alwasy "zero"
// LLY2.80, it's necessary to give the default value, because it will be set
// within ReadTOC() & UTL_ReadSector()
// [G-4bytes]
DWORD __dwTimeTorelence; //= 0;
// [2] The real sectors that will jump for each SCAN action
// LLY2.80, remove to CC module, becasue it only be updated within it.
// it's unnecessary to give the default value, becasue it will be set
// before issue SCAN command !!
// [G-2bytes]
//WORD __wScanGap;//=750;
// LLY2.78b-2, add a variable to keep initial status
// [3] Initial status info.
// Using bit addressing, ie. one bit means one mode status.
// Notice: Must merge all similiar status into this variables
// [G-1bytes]
BYTE __bInitialStatus;
// [5] Internal temp usage variables
// [G-5bytes]
BYTE _bINITIALTemp;
DWORD _dwINITIALTemp; // LLY.161
////////////////////////////////////////////////////////////
// ***** Extern other module's global variable Area ***** //
extern BYTE __bDigestStyle; // in cc.c
// Brian.170, for SW detect MIC & auto vocal
#ifdef ENABLE_AUTOVOCAL
extern DWORD __dwMICDectectInterval;
extern bit _btPreMICDetect;
extern BYTE _bMICOffCount;
#ifdef SW_MIC_DETECT
extern bit __sbMICDetect;
#endif // #ifdef SW_MIC_DETECT
#endif // #ifdef ENABLE_AUTOVOCAL
///////////////////////////////////////////////////////////////////////
// ***** Constant Code Define Area ***** //
// LLY.273, give pseudo code for constant code usage
// Otherwise, it will be linker error if F/W specify constant code location
// Example, if F/W enable AUTO_UPGRADE feature, F/W will use constant string "BIN"
// and, no constant code exist while disable AUTO_UPGRADE feature
BYTE code PseudoCode[]={0};
#ifdef SUPPORT_PORTABLE_PROJECT
BYTE __bKeyInputEnable; //added for portable
BYTE __bTopOpen;
BYTE __bTopInitial=1;
#endif
// CZ1.10-3
#ifdef SHOW_6_DISPLAY_MODE
//wendy1.07 record HDCD disctype,
//Because __bCDDA_DTS will be updated to CDDA title after 1st time checking as HDCD,
//we must use another variable to record the disc type at running time.
BYTE __bDiscHDCDType;//=FALSE; //LJY2.31, no need to initialize it
#endif
// Micky1.24, make sure that servo send correct dvdinfo data
// used for DVDINFO reference
// bit 4=0, ISO_9660 must be correct
// bit 0=0, DVDINFO must be correct
BYTE __bDataRequest;
// wyc1.24a, one function to display first time LOGO.
void INITIAL_ShowFirstLOGO();
extern BYTE _OSD_ShowLogo();
// LLY.102p, re-arrange the sequence of INITIAL_System
// *********************************************************************
// Function : INITIAL_System
// Description : Some steps for Player wake-up
// [1] uP [2] Variables [3] PANEL/OSD [4] Servo
// [5] MPEG Decoder [6] TV Encoder [7] Audio DAC
// Arguments : NONE
// Return :
// Side Effect :
// *********************************************************************
// LLY.171-2, re-arrange the procedure for INITIAL_System()
// Give the parameter, merge some procedure into HAL_PowerDown()
void INITIAL_System(BYTE bMode)
{
// Micky1.23, support DVD_T
// seems W99AV_Initial will do the initial????? confirm w/ D700
#ifdef SUPPORT_DVD_T
//GPCR1[15:0]: output value GPCR1[31:16]: I/O direction: 0: input mode 1: output mode
//Kevin1.25, fix CTMan DVD IR power off -> power on => PM jumps to STB in flash (GPA7 is set to be high due to input mode)
// W99AV_Initial has done the initialization
//__wW99AVGPCRLow = __wW99AVGPCRHigh= 0 ;
#endif //#ifdef SUPPORT_DVD_T
// uP and global variables initial action only need to do once time
// while 1st H/W power on
if(bMode & HARDWARE_SHUTDOWN)
{
// Step 1: Initialize uP
//DVD_051Micky, initial uP should be done first
INITIAL_uProcessor ();
// Step 2: Initialize all global variables
// LLY2.80, Don't put this procedure too late !!
// Otherwise, something maybe wrong if following API
// must refer those variable within it !!
// wyc.172r, move this function to below part.
// ** TCH1.60-1; Move global initial into here for saving code.
_INITIAL_Variables_PowerON ();
// LLY2.81, remove AUX channel initial procedure into HAL_PowerDown()
// Because, it must be done while enter/ exit power down mode
//LJY0.95, only H/W power-on needs to disable service 420. Ex. servo still needs to be served while IR power-down, otherwise
// the pick-up's behavior would be abnormal.
// LJY1.00, remove the define of "ONE_CPU"
{
extern BIT INIT_420_1(void);
// suspend 420's main flow. Only can be released after 420 initial OK.
INIT_420_1();
}
}
// Something need to do for 1st H/W power and total shutdown
if( !(bMode & PSEUDO_SHUTDOWN) )
{
// Step 3: Initialize some necessary pio pin
#ifdef SYSTEM_8051
#ifdef _WINDVD
#ifdef SUPPORT_POWERDOWN_CONTROL
__sbPowerDown= NULL; // active HIGH, means power-down enable
#endif // SUPPORT_POWERDOWN_CONTROL
#ifdef SUPPORT_AUTOUPGRADE_CONTROL
__sbAutoUpgrade= 1; // active HIGH, means SRAM enable
#endif // SUPPORT_AUTOUPGRADE_CONTROL
#endif // _WINDVD
#endif //#ifdef SYSTEM_8051
// Step 4: Initialize Panel
// *** ; let PANEL clear immediately
// Micky0.91, panel is controlled by GPIO
// must wait till detect base port OK.
// PANEL_Initial();
#ifndef POWERON_STANDBY // ** TCH0.411;
{
extern STATUS gcShowStatus;
gcShowStatus.bPowerDown= FALSE; // let PANEL can show information
}
// Micky0.91, panel is controlled by GPIO
// must wait till detect base port OK.
// PANEL_Output ( MSG_WAITING, NULL ); // ** S-TCH;
#endif // POWERON_STANDBY // ** TCH0.411;
// Step 5: Initial/ Wake-up MPEG chip
// All thing need to do or re-do while total shutdown case -- only uP and SRAM active
// Ex. Base port detecting, set PLLCR, load return code, initial PWRCR
// load ucode, initial VCR
// Detect Base Port for our Decoder IC
// Add protection method for detecting base port fail
for ( _bINITIALTemp=0; _bINITIALTemp< 10; _bINITIALTemp++ )
{
__btTemp= W99AV_DetectBasePort ();
if(__btTemp) // latch base port successfully
{
break;
}
else // latch base port fail
{
#ifdef _DEBUG_INFO
PANEL_Output(MSG_VERSION, (WORD)(64000+ _bINITIALTemp) );
#ifdef SUPPORT_PRINTF
printf("#### Detect base port fail -- %d !!\n", _bINITIALTemp);
#endif // #ifdef SUPPORT_PRINTF
#endif // #ifdef _DEBUG_INFO
UTL_DelayTime ( COUNT_200_MSEC, FALSE );
}
} // for ( _bHALTemp )
//Kevin2.26, integrate chip version & part no.
W99AV_DetectChipVersion();
#ifdef SUPPORT_AVIN
TFT_MUTE_ON(TRUE);
#endif
//Kevin1.00, H/W mute to avoid the H/W power-on bo noise when outputing PCMCLK/PCMWS to ADAC for the first time
HAL_HardwareMute(TRUE); //H/W mute
// Micky0.91, panel is controlled by GPIO
// must wait till detect base port OK.
PANEL_Initial(); // KCHong 0.90
// LLY2.80, remove this procedure into W99AV_DetectBasePort()'s last stage !!
// Otherwise, nobody knows when to un-reset the pin
// Un-reset the TVE_RST pin after VCR setting is ok !!
// Step 7: Turn-off TV encoder to avoid "un-stable TV screen" appear
// Must add after MPEG chip waking-up,
// Otherwise, the action maybe fail if it use "GPIO" to control TV encoder
_TVEncoderOff();
}
// Micky1.23-2 support resume info from EEPROM
// Ming2.36, support multi-disc resume from EEPROM.
// Use the new RESUME mechanism, so mark it.
//#ifdef SUPPORT_RESUME_EEPROM
// _Detect_Resume_Information();
//#endif //#ifdef SUPPORT_RESUME_EEPROM
// Step 8: Read-back some necessary setup info. while 1st H/W power on
if(bMode & HARDWARE_SHUTDOWN)
{
SETUP_Initial(SETUP_POWERON_INITIAL);
//Kevin1.24aDVD_T
#ifdef SUPPORT_DVD_T
//Kevin1.25, use xdata instead of EEPROM to decide the __bReduceSTBtoDVDtime flag
//__bReduceSTBtoDVDtime = HAL_EEPROM_Read(SETUP_ADDR_SEEK_FLAG);
//HAL_EEPROM_Write(SETUP_ADDR_SEEK_FLAG, FALSE); //clear flag
{
extern DWORD xdata __dwReservedDWORD;
if ( __dwReservedDWORD == 0x12345678 ) //magic key
__bReduceSTBtoDVDtime = TRUE;
else
__bReduceSTBtoDVDtime = FALSE;
__dwReservedDWORD = 0; //clear
}
#endif
}
// Step 9: Merge the necessary thing to HAL_PowerDown()
// Ex. MPEG chip, TV encoder, Audio DAC, Servo, SCART ...
HAL_PowerDown(bMode);
//LJY2.39, show logo after ucode unzip.
#ifndef SUPPORT_SHOWLOGO_AFTER_UNZIP
// wyc1.24a, when define SUPPORT_GZIP_COMPRESSION, move the code of display LOGO earily.
#ifdef SUPPORT_GZIP_COMPRESSION
//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
#ifndef POWERON_STANDBY //xuli2.36, PowerOnStandby
INITIAL_ShowFirstLOGO();
#else
if(!(bMode & HARDWARE_SHUTDOWN )) //xuliPowerOnStandby
{
INITIAL_ShowFirstLOGO();
}
else
{
W99AV_Reset(W99AV_RESET_TOTAL);//xuliPowerOnStandby
}
#endif
#endif //
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -