📄 monitor.c
字号:
}
return FALSE;
}
} // if(__bModeCmd == KEY_SCF)
else if ( __bModeCmd == KEY_SCB )
{
// change > into >=
if (__dwTimeNow <= __dwTimeBegin) //SCB reach track begin
{
if ( __btPBC )
{
// when scan back to play item begin
// will normal play this play item
// using KEY_PAUSE to keep the current PBC state
// if use KEY_STOP, will reset the PBC state
// the KEY pause is probinit in SCF mode.
//CC_DoKeyAction ( KEY_PAUSE );
__btPlaying=FALSE;
__btPause=TRUE;
// force to reset
__bModePlay= MODE_PLAYUNKNOW;
__dwTimeNow= 0;
// Remove it as it play same PlayItem
// __btCheckBitStream= TRUE;
// Will normal play this play item
CC_DoKeyAction ( KEY_PLAY );
}
else
{
// wyc2.30, fix MP3 SCF to file begin then pause is invalid problem.
if (__bAttrPlay & TYPE_CDROM_AUDIO)
__bScanLevel = 0;
// LLY.101-2, must same as PBC on mode's flow while enable following define
// otherwise, it will issue KEY_PREV action
// ** TCH1.55-1; begin... FORCE_CHANGE_TRACK_NORMAL_PLAY can do it simpler.
#ifdef FORCE_CHANGE_TRACK_NORMAL_PLAY
_dwMONITORTemp= __wPlayItem;
// reset the play state
//Kevin1.07, fix "In program playing, SCB to track begin will clear program mode"
// CC_DoKeyAction (KEY_STOP) will clear program mode
// SCF to track end also calls CC_KeyCommand(KEY_STOP)
//CC_DoKeyAction ( KEY_STOP );
CC_KeyCommand ( KEY_STOP );
__wPlayItem= (WORD)_dwMONITORTemp;
// next will normal play from the frist track
CC_DoKeyAction ( KEY_PLAY );
#else // #ifdef FORCE_CHANGE_TRACK_NORMAL_PLAY
// SCANBACK to first track, system will become normal play
if ( __wPlayItem == __wTrackBegin )
{
// reset the play state
//Kevin1.07, fix "In program playing, SCB to track begin will clear program mode"
// CC_DoKeyAction (KEY_STOP) will clear program mode
// SCF to track end also calls CC_KeyCommand(KEY_STOP)
//CC_DoKeyAction ( KEY_STOP );
CC_KeyCommand ( KEY_STOP );
// next will normal play from the frist track
CC_DoKeyAction ( KEY_PLAY );
}
else // will Scan back previous track
{
// must check repeat mode then decide to play next
// modify for use by LINEAR_ChangeTrack call
LINEAR_ChangeTrack(KEY_PREV, (BYTE)NULL);
} // NOT BeginTrack
#endif // #ifdef FORCE_CHANGE_TRACK_NORMAL_PLAY
// ** TCH1.55-1; end...
} // __btPBC
return TRUE;
} // SCB reach to the Begin of the range
} // KEY_SCB
// TCC2.78b-2, fix CDDA scan will show 5500 problem. Should use __bAttrPlay to check instead of __wDiscType.
//if (__wDiscType & BOOK_CDDA) // Cindy for CDDA SCF/SCB
if ( __bAttrPlay==ATTR_CDDA
#if (FM_KEY_SCF_KEY_SCB_MODE == MODE_SCAN_ONLY) || (FM_KEY_SCF_KEY_SCB_MODE == MODE_SCAN_PAGE) //Kevin1.26-2
|| __bAttrPlay==ATTR_MP3 || __bAttrPlay==ATTR_MP2 //Kevin1.24a, support MP3/MP2 SCB
#endif //
)
{
__bScan=SCAN_NONE;
// wyc.160
//SERVO_ReadSectors(__dwTimeNow, __dwTimeEnd);
}
else
{
// Step2:
// Jump to new time, and open CD-IF
UTL_PlayFromTime ( __dwTimeNow );
// open CD-IF anyway, even finding MSF fail
HAL_ControlCDIF(HAL_CDIF_OPEN);
// Start scaning a new I picture
__bScan= SCAN_GO; // in MC [SCAN] mode
// reset the starting time
__dwTimeRef= __dwCountSystem;
// send a scan command
W99AV_Command1(COMMAND_SCAN, 0);
}
} // if ( IFSC )
//else //IFSC interrupt not found
else if (! (__bAttrPlay&TYPE_CDROM_AUDIO) ) //Kevin1.25, exclude CDROM audio only
{
// Chuan 278 2002/10/23: CDIF Close -> KEY_SCAN may not find I-Picture. So need re-open CDIF
if (HAL_CheckCDIF(HAL_CDIF_STOP, NULL))
{
UTL_GetCurrentTime(); //get current CD-IF time
__dwTimeNow++; //next start time for data input
if ( ! UTL_PlayFromTime ( __dwTimeNow ) )
HAL_ControlCDIF(HAL_CDIF_OPEN);
//__btFreeze= FALSE;
}
// After issuing Scan command, the IFSC is not set within 3 sec.
// LLY.103, avoid "22QF078.DOC: __dwCountSystem accessing trap" problem
// Using UTL_GetSysTimer() instead of __dwCountSystem
//if ( (__dwCountSystem - __dwTimeRef) > COUNT_3_SEC )
if( (UTL_GetSysTimer() - __dwTimeRef) > COUNT_3_SEC )
{
// force SCAN Command again, ???
W99AV_Command1(COMMAND_SCAN, 0);
__dwTimeRef= __dwCountSystem;
}
}
}
break;
default:
break;
} // switch ( __bModeCmd )
return TRUE;
}
// *************************************************************************
// Function : MONITOR_SystemHang
// Description : [1] Monitor the hang state and do recover action.
// It inclues DIGEST hang, normal/scan play hang.
// And it also check SERVO command fail state.
// [2] Support two feature: Auto Power Down mode, Screen
// Saver mode
// Arguments : None
// Return : None
// Side Effect :
// *************************************************************************
void MONITOR_SystemHang(void)
{
MONITOR_Debug (); // ** TCH2.37;
// wyc2.37, update micky code
// Micky2.37, move auto power down control into function
#ifdef AUTO_POWERDOWN
MONITOR_AutoPowerDown(MONITOR_POWERDOWN_ENTER);
#endif // #ifdef AUTO_POWERDOWN
// Begin system hang checking ....
// LLY.274p, checking playing mode method has updated
//if (__bModePlay & MODE_PLAYCDDA)
if(__bAttrPlay == ATTR_CDDA)
{
if ( (__bModeCmd==KEY_SCF)||(__bModeCmd==KEY_SCB) )
return; // do not check
}
// wyc1.25, reset DSP when DSP code report abnormal status by AINT. It is to fix DSP error write OSD or other DRAM space to make OSD display error.
// wyc2.31, follow code is useless and need to remove them.
/*if ((__wDiscType & BOOK_DVD) && (__bAudioType == HAL_AUDIO_AC3) && (__bNeedResetAudio))
{
HAL_Reset(HAL_RESET_AUDIO);
__bNeedResetAudio = FALSE;
__wAudioResetCount++;
}*/
// DVD_047-1
// for LPCM pause will show 65000(as video buffr empty, issue SERVO_ReadData)
// DVD_048-1
// should process at lower level
// if (__btPlaying || __btDIGEST)
SERVO_Monitor (); // ** SVCD-TCH;
#ifndef NO_DIGEST //LJY1.20, support 4M flash, remove digest
// auto recover DIGEST mode
if (__btDIGEST && (__bModePlay==MODE_PLAYMOTION))
{
DIGEST_CheckHang();
return;
}
#endif
// DVD_040-1, new checking statement for system hang
// if ( __btPlaying && (!__bStillTime) && (!__bVOBUWait) && !__bVOBUStill)
if ( __btPlaying && (!__bStillTime) && !__bVOBUStill)
{
// wyc1.11-2, disable this code because IFD maybe detect onc time but RISC still can't decode. If happen this status then video still can't update
// but recover stage will set to 0 and re-start the recover mechanism from 0 -> 1 ->2. When recover stage reached to 2 it will get time from CELL
// and the time is still same with last time that can't play. So it play and detect one IFD then still hang in infinite loop. So remov this code to avoid
// IFD detected one time to affect the recover stage status and let FRAME_ID / FRAME_COUNT to decide the recover stage setting. Then we can
// enhance the infinite loop problem.
/*if ( __wMonitorLackIFD < 5 )
__bRecoverStage = 0;*/
//KWD1.05-2003/9/25 Begin error concealment while MODE_PLAYAUDIO
// wyc1.23, re-layout the code in MODE_PLAYAUDIO part and add debug OSD & message in audio part.
if (__bModePlay & MODE_PLAYAUDIO)
{
switch (__bRecoverStage)
{
case 0:
if (__wMonitorLackIFD > MONITOR_ENTERRECOVER)
{
__bRecoverStage = 1;
__bSoftResetCount = 0;
__bDoActionInStage = TRUE;
//Kevin1.22, jump to stage 3 directly. WMA must play from the beginning, 'cause no sync bitstream within WMA file except file header
if (__bAttrPlay == ATTR_WMA)
{
__bRecoverStage = 3;
__bNEXTPREVCount = 0;
}
}
break;
// Purose of stage 1, reset RISC or DSP by software
// if still recover system , then goto next stage
case 1:
if (__bDoActionInStage)
{
#ifdef _KWD_TRACE
_printf("\n __bAttrPlay = %hu", __bAttrPlay);
#endif
#ifdef _DEBUG_INFO
OSD_Output(MSG_VERSION, 9001, 1);
#endif // #ifdef _DEBUG_INFO
#if defined (SERIAL_DEBUG) || defined(SUPPORT_PRINTF)
if (__btDumpFlag)
if (__bDumpType & INFO_ERR_CONCEAL)
MONITOR_ShowDebug();
#endif
//KWD-1.05-2003/9/27
//Note: __bAttrPlay is attribute of playing object, for MP3 title
// if system hang, sometimes __bAttrPlay = 0, for CDDA, if system hang
// __bAttrPlay keep original value
if (__bAttrPlay == ATTR_CDDA)
{
//if ATTR_CDDA, then reset audio only
HAL_Reset(HAL_RESET_AUDIO);
#ifdef _KWD_TRACE
_printf("\n Reset DSP only");
#endif
}
//if ATTR_CDDA, then reset audio only
else //KWD1.05-2003/9/27 if (__bAttrPlay == ATTR_MP3)
{
// System will reset RISC by software if playing MP3
__bModePlay = MODE_PLAYUNKNOW;
UTL_SetPlayMode(MODE_PLAYAUDIO);
HAL_ControlCDIF(HAL_CDIF_OPEN);
// Recover play original mode
UTL_TransferCommandID(__bModeCmd);
#ifdef _KWD_TRACE
_printf("\n Reset RISC and DSP");
#endif
}
// Restore audio output
if (!__btMute)
{
if (__bModeCmd == KEY_PLAY)
CHIPS_OpenAudio(TRUE);
}
__dwTimeHalt = UTL_GetSysTimer();
_dwTimeRecoverUsed = W99AV_ReadRegDW(ABRR);
__bSoftResetCount++;
__bDoActionInStage = FALSE;
}
else
{
if ((UTL_GetSysTimer()-__dwTimeHalt) > COUNT_1_SEC)
{
if (W99AV_ReadRegDW(ABRR) == _dwTimeRecoverUsed)
{
if (__bSoftResetCount > 3)
{
__bRecoverStage = 2;
}
}
else
{
__bRecoverStage = 0;
__wMonitorLackIFD = 0;
}
// Prepare next times or NEXT stage to real motion
__bDoActionInStage = TRUE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -