📄 isr.c
字号:
if(flag1>2)
{
flag1=0;
flag2=1; //transfered
flag3=0;
flag4=0;
flag5=0;
}
_bKeyGet=KEY_NO_KEY;
}
}
}
else
{
flag3=1;
flag1=0;
flag2=0; //transfered
flag4=0;
flag5=0;
bKEY_KEEP=_bKeyGet;
_bKeyGet=KEY_NO_KEY;
}
}
else
#endif
{
#if defined( KEY_RIGHT_LEFT_CHANGETO_SCF_SCB )||defined(KEY_NEXT_PREV_SCB_SCF_AS_KEY_DOWN_UP_LEFT_RIGHT) //yhtang_0809
bKEY_KEEP=0;
flag5=0;
flag4=0;
flag3=0;
flag2=0;
flag1=0;
#endif
if ( _bKeyGet == __bISRKeyPrev )
{
// wyc1.07a, update some code from HKC
if ( (__dwCountSystem - __dwTimeISRKeyPrev) < COUNT_250_MSEC ) // 1.07 KCHong
{
// wyc1.07, make only follow keys to accept continue keys and other keys don't support continue keys to avoid error action.
// Suppose that the time gap between key and key need 200 msec at least
if ( (_bKeyGet!=KEY_VOL_UP) &&
(_bKeyGet!=KEY_VOL_DOWN)&&(_bKeyGet!=KEY_POWER))
{
_bKeyGet = KEY_NO_KEY;
}
// wyc2.81, make PANEL key scan and IR use the same continue time control (both use 250ms).
// Also remove panel key scan sensitive control code. Because this code is inly for some special panel.
// if ( (__dwCountSystem- __dwTimeISRKeyPrev) < COUNT_250_MSEC ) // 1.07 KCHong
// _bKeyGet= KEY_NO_KEY; // give-up the key , suppose it push so long
}
}
}
__dwTimeISRKeyPrev= __dwCountSystem; // 1.07 KCHong, always reset timer include KEY_NO_KEY
if ( _bKeyGet != KEY_NO_KEY )
{
#ifndef SUPPORT_PORTABLE_PROJECT
// LLY2.37p, remove __bISRKeyRead, because we will split IR and F/W key to __bISRKey and __bFWKey
// So, it's un-necessary to reference it to decide input key source
//__bISRKeyRead=TRUE;
__bISRKey= _bKeyGet;
__bISRKeyPrev= _bKeyGet;
#else
// Added for portable, begin, KCHong, 20031117
if(__bKeyInputEnable)
{
// Added for portable, end, KCHong, 20031117
__bISRKeyPrev= _bKeyGet;
//#ifdef KEY_NEXT_PREV_AS_KEY_UPDOWN_IN_SETUPMODE
#ifdef KEY_NEXT_PREV_SCB_SCF_AS_KEY_DOWN_UP_LEFT_RIGHT
{
extern BYTE __bSetupMode;
if(__bSetupMode)
{
if(_bKeyGet==KEY_NEXT)
_bKeyGet=KEY_DOWN;
else if(_bKeyGet==KEY_PREV)
_bKeyGet=KEY_UP;
else if(_bKeyGet==KEY_SCB)
_bKeyGet=KEY_LEFT;
else if(_bKeyGet==KEY_SCF)
_bKeyGet=KEY_RIGHT;
}
}
#endif
#ifdef SUPPORT_AVIN
if(_bKeyGet==KEY_TFT_AV_IN)
{
if(__bTftKeyAvInEnable)
{
_bKeyGet=KEY_POWER;
__bTftKeyAvInEnable=FALSE;
__bTtfKeyPowerFlag=0;
if(__bAvInStatus==DVD_OUTPUT_STATUS)
{
__bAvInStatus=AV_IN_STATUS;
}
else
{
__bAvInStatus=DVD_OUTPUT_STATUS;
}
TFT_HW_Switch_ON_OFF(FALSE);
__bTftAvSwitchFlag=0;
}
else
{
_bKeyGet=KEY_NO_KEY;
}
}
#endif
__bISRKey= _bKeyGet;
} // Added for portable, KCHong, 20031117
#endif
// DVD_101Micky, don't need extra double stop action sice provide __bKeySource
}
} // if ( _bKeyGet != KEY_NO_KEY )
#if defined( KEY_RIGHT_LEFT_CHANGETO_SCF_SCB )||defined(KEY_NEXT_PREV_SCB_SCF_AS_KEY_DOWN_UP_LEFT_RIGHT) //yhtang_0809
else
{
if(flag4)
{
flag5++;
if(flag5>10)
{
flag1=0;
flag2=0;
flag3=0;
flag4=0;
flag5=0;
bKEY_KEEP=0;
}
}
else
{
if(flag3)
{
_bKeyGet=bKEY_KEEP;
// Added for portable, begin, KCHong, 20031117
if(__bKeyInputEnable)
{
// Added for portable, end, KCHong, 20031117
__bISRKey= _bKeyGet;
__bISRKeyPrev= _bKeyGet;
} // Added for portable, KCHong, 20031117
}
flag3=0;
flag2=0;
flag1=0;
bKEY_KEEP=0;
}
}
#endif
} // if ( ! (__bISRCount % COUNT_100_MSEC ) )
#endif
// add for skywood request ,yfxiao02.23
// if DVD @ Menu || VCD @Menu)
{
extern BYTE __bSELBTN_Ns; // number of selectable buttons
if(((__bSELBTN_Ns)||(__wPlayItem >99))&&(!__btDriveOpen))
{
if ((_bKeyGet == KEY_SCB)||(_bKeyGet == KEY_SCF)||(_bKeyGet == KEY_NEXT) ||(_bKeyGet == KEY_PREV))
__btMultKey = TRUE;
}
if((__wDiscType&BOOK_DVD)&&(!__bSELBTN_Ns))
{
if ((_bKeyGet == KEY_LEFT)||(_bKeyGet == KEY_RIGHT)||(_bKeyGet == KEY_UP) ||(_bKeyGet == KEY_DOWN))
__btMultKey = TRUE;
}
}
// end skywood.
#ifdef ERROR_CONCEAL
if ( ! (__bISRCount % COUNT_100_MSEC ) )
{
if (__btPlaying)
_ISR_ErrorConcealment (); // Don't do error concealment
} // if ( ! (__bISRCount % COUNT_100_MSEC ) )
#endif
#ifdef SYSTEM_8051
// Set the base value for up counting.
TH0 = TIMER_TH; // reload counter
TL0 = TIMER_TL;
#endif
__dwW99AVCmdArg = __dwW99AVCmdBuffer;
return;
}
// *********************************************************************
// Function : ISR_Timer2;
// Timer0, mode 1, 16 bits counter
// Description : 1.
// 2.
// 3.
// Arguments : NONE
// Return : NONE
// Side Effect :
// *********************************************************************
// wyc.278-3, for 28C_MSDAV panel 臂п.
#ifdef ENABLE_PANEL_VOLUME_ADJUSTMENT_BUTTON
#ifndef SERIAL_DEBUG
#ifdef SYSTEM_8051
void ISR_Timer2(void) interrupt 5 using 1
#else
void ISR_Timer2(void)
#endif
{
#ifdef SYSTEM_8051
void Delay100us(void);
if(TF2)
{
TF2=0;
TH2=0;
TL2=0;
_bKeyGetCount+=0x10;
if((_bKeyGetCount & 0xf0)==0xf0)
{
TR2=0;
if(_bVolumeEncoder==129)
{
__bISRKey=KEY_VOL_UP;
// LLY2.37p, remove __bISRKeyRead, because we will split IR and F/W key to __bISRKey and __bFWKey
// So, it's un-necessary to reference it to decide input key source
//__bISRKeyRead=TRUE;
}
else if(_bVolumeEncoder==127)
{
__bISRKey=KEY_VOL_DOWN;
// LLY2.37p, remove __bISRKeyRead, because we will split IR and F/W key to __bISRKey and __bFWKey
// So, it's un-necessary to reference it to decide input key source
//__bISRKeyRead=TRUE;
}
}
return;
}
if(T2IP)
{
if(TR2==0)
{
T2IP=0;
TH2=0;
TL2=0;
_bKeyGetCount &= 0x0f;
Delay100us();
_bVolumeEncoder=(HAL1_ExtIOStatus() & 0x02)?127:129;
TR2=1;
}
else
{
T2IP=0;
if(_bVolumeEncoder>=127)
_bVolumeEncoder-=64;
_bVolumeEncoder=(HAL1_ExtIOStatus() & 0x02)?(_bVolumeEncoder-1):(_bVolumeEncoder+1);
if(_bVolumeEncoder>65)
{
TH2=0;
TL2=0;
_bVolumeEncoder=64;
__bISRKey=KEY_VOL_UP;
// LLY2.37p, remove __bISRKeyRead, because we will split IR and F/W key to __bISRKey and __bFWKey
// So, it's un-necessary to reference it to decide input key source
//__bISRKeyRead=TRUE;
}
else if(_bVolumeEncoder<63)
{
TH2=0;
TL2=0;
_bVolumeEncoder=64;
__bISRKey=KEY_VOL_DOWN;
// LLY2.37p, remove __bISRKeyRead, because we will split IR and F/W key to __bISRKey and __bFWKey
// So, it's un-necessary to reference it to decide input key source
//__bISRKeyRead=TRUE;
}
}
return;
}
#endif
}
#endif // #ifdef SERIAL_DEBUG
#endif // #ifdef ENABLE_PANEL_VOLUME_ADJUSTMENT_BUTTON
// *********************************************************************
// Function : ISR_INT1; EX1(SFR, bit 2 of IE)
// : External H/W interrupt INT1(through P3.3)
// Description : MPEG-Decoder W99XX usage
// : 1. Check bitstream format(do resize if necessary)
// : 2. Do SCAN command when in DIGEST mode
// : 3. Control Auto pause of VCD 2.0
// Arguments :
// Return :
// Side Effect :
// *********************************************************************
//DVD_037RECOVER
#ifdef SYSTEM_8051
void ISR_INT1 (void) interrupt 2 using 1
#else
void ISR_INT1 (void)
#endif
{
//BYTE bINTEvent;
// ** TCH0.50; DWORD dwTemp; // Use __dwDRAMValue
DWORD dwVRemainder;
// wyc2.80, add fish's updated code.
// LLY2.80, swap the argument buffer of W99AV_CommandN() to ISR usage
// To avoid content be destroyed while ISR will call any W99AV_CommandN()
// Notice: Must put this in 1st statement within this API
__dwW99AVCmdArg = __dwW99AVCmdBuffer_ISR;
W99AV_EnableInterrupt(NULL);
__wTempPSR=W99AV_GetPSR();
//LJY2.30a, close CDIF when ARem > __dwAOBuffer.
#ifdef CHECK_OVERFLOW_IN_ISR
{
if (!__bServoAutoCtrl )
{
if(!__bAudioOverflow)
{
if ( __wTempPSR & INT_AO )
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -