📄 isr.c
字号:
#include "types.h"
#include "board.h"
#include "global.h"
#include "power.h"
#include "debug.h"
#include "debugDef.h"
#include "UserPrefDef.h"
#include "ddc2bi.h"
#define ReSyncTick 255//54 // 0.2 Second for resynchorize dubug process
#if UseINT
#define EnableExt0Interrupt 1
#else
#define EnableExt0Interrupt 0
#endif
#define EnableExt1Interrupt 0
#define EnableTime0Interrupt 1
#define EnableTime1Interrupt 0
#define EnableTime2Interrupt 0
#define EnableSerialPortInterrupt 1
#if EnableExt0Interrupt
void EXT0Interrupt(void) interrupt 0
{
#if MSTMCU
if(ADC_INT_FLAG&(BIT3 | BIT4 ))
{
// DoDDCCI(0);
}
else if(DVI_INT_FLAG&(BIT3|BIT4))
{
// DoDDCCI(1);
}
else if (!SyncLossState())
#else
if (!SyncLossState())// && InputTimingStableFlag)// && SrcInputType!=Input_Digital)
#endif
{ hw_ClrBackLit();
Set_InputTimingChangeFlag();
SrcFlags|=SyncLoss;
}
IE0=0;
}
#endif
#if EnableTime0Interrupt
extern BYTE ReSyncCounter;
extern WORD ms_Counter;
extern BYTE Second;
extern BYTE OsdCounter;
extern BYTE PowerDownCounter;
void Time0Interrupt(void) interrupt 1
{ ms_Counter--;
if (ReSyncCounter)
ReSyncCounter--;
if (ModeDetectCounter)
ModeDetectCounter--;
if (ms_Counter==0) //
{ Second++;
if (!PowerSavingFlag)
{ if (BLTime<0xFFFFFFFFul)
BLTime+=1;
}
if (OsdCounter)
if (--OsdCounter==0)
Set_OsdTimeoutFlag();
#if DISPLAYLOGO
if(LogoTimeCounter)
LogoTimeCounter--;
#endif
if (PowerDownCounter)
if (--PowerDownCounter==0)
Set_ForcePowerSavingFlag();
#if NoSyncLedBlink
else if (SyncLossState())
{
hwGreenLed_Pin=~hwGreenLed_Pin;
hwAmberLed_Pin=0;
}
#endif
Set_ChangePatternFlag();
////////////////////////////////////////////////////
///////////Enter Factory OSD key delay counter
if (EnableFactoryKeyCount)
if (--EnableFactoryKeyCount==0)
Set_EnableEnterFactory();
//////////
///////////////////////////////////////////////////
ms_Counter=SystemTick;
}
if ((ms_Counter%250)==0)
{
Set_ms500Flag();
#if PanelOff1Sec
if(PanelOffTimeCounter)
if(--PanelOffTimeCounter==0)
Clr_DisablePanelOnFlag();
#endif
}
TH0=ClockPeriod>>8;
TL0=ClockPeriod&0xFF; // timer 1 counter
TF0=0; // timer 1 flag
}
#endif
#if EnableExt1Interrupt
void EXT1Interrupt(void) interrupt 2
{ IE1=0;
}
#endif
#if EnableTime1Interrupt
void Time1Interrupt(void) interrupt 3
{
}
#endif
#if EnableSerialPortInterrupt
void SerialPortInterrupt(void) interrupt 4
{ BYTE sioData;
if (RI)
{ RI=0;
sioData=SBUF;
if(EnableAutoColorTempFlag)
{
if(EnableReadColorSettingFlag)
{
if(sioData==']')
{
SIORxBuffer[0]='P';
sioData='1';
SIORxIndex=1;
}
}
else
{
if(sioData=='P')
SIORxIndex=0;
}
ReSyncCounter=ReSyncTick;
SIORxBuffer[SIORxIndex++]=sioData;
if((SIORxIndex>=16) && (sioData==0x0D))
Set_RxBusyFlag();
}
else if (SIORxIndex<4)
{ if (SIORxIndex==0)
{ ReSyncCounter=ReSyncTick;
}
SIORxBuffer[SIORxIndex++]=sioData;
if (SIORxIndex==CommandLength)
{ Set_RxBusyFlag();
ReSyncCounter=ReSyncTick;
}
}
}
if (TI)
TI=0;
}
#endif
#if EnableTime2Interrupt
void Time2Interrupt(void) interrupt 5
{ TF2=0;
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -