📄 videodetect.lst
字号:
C51 COMPILER V8.08 VIDEODETECT 11/23/2007 00:57:20 PAGE 1
C51 COMPILER V8.08, COMPILATION OF MODULE VIDEODETECT
OBJECT MODULE PLACED IN .\Object\VideoDetect.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE SourceFile\VideoDetect.c LARGE BROWSE INCDIR(.\IncludeFile;.\IncludeFile\Pa
-nel;.\IncludeFile\Font_Icon) DEFINE(T108) DEBUG OBJECTEXTEND PRINT(.\List\VideoDetect.lst) OBJECT(.\Object\VideoDetect.o
-bj)
line level source
1 #include "Common.h"
2 #include "Global.h"
3 #include "ICControl.h"
4 #include "VideoSourceSwitch.h"
5 #include "System.h"
6 #include "TWICreg.h"
7 #include "VideoDetect.h"
8 #include "SRC_ctrl.h"
9 //#define _Myson8957_
10 #include "Myson8957.h"
11 /* D E T E C T S I G N A L S T D */
12 /*-------------------------------------------------------------------------
13 if h/v locked
14 setOPTiming
15 if color detected and chroma locked
16 SetSignalStd
17 -------------------------------------------------------------------------*/
18 void DetectSignalStd(void)
19 {
20 1 uCHAR temp;
21 1
22 1 temp=SignalDefine; //sm061011
23 1
24 1 m_cBuff[0]=m_cStandard;
25 1 m_cBuff[1]=IC_ReadByte(TWIC_P2, 0x3A); //read video status registers
26 1 if(IC_ReadByte(TWIC_P2, 0x3A)&0x06) // Judge vlock and hlock
27 1 {
28 2 //if(IC_ReadByte(SlaveAddr, 0x7B+RegAddrShift)>0x10){// For no chroma case
29 2 //twdDelay(100);
30 2 //~~~~~~~ set OPTiming ~~~~~~~~~~~~~~~~~~~//
31 2 if(IC_ReadByte(TWIC_P0,0x59) <= 0xd6) //read hsync period MSB Register 20060809
32 2 m_cBuff[0]=S_NTSC;
33 2 else
34 2 m_cBuff[0]=S_PAL;
35 2 if((m_cStandard!=m_cBuff[0])){ // signal std was changed,and output timing must be set again
36 3 m_cStandard=m_cBuff[0];
37 3 SetOPTiming();
38 3 }
39 2 //~~~~~~~ End of set OPTiming ~~~~~~~~~~~~~~~~~~~//
40 2
41 2 //~~~~~~~ set Chroma ~~~~~~~~~~~~~~~~~~~//
42 2 m_cBuff[4]=m_cChroma;
43 2 twdDelay(100);
44 2 // Set Chroma lock configration
45 2 // if(IC_ReadByte(TWIC_P0,0x59) <= 0xd6)
46 2 // IC_WritByte(SlaveAddr, 0x83+RegAddrShift, 0x39);//6f); // NTSC // change by Sherman 06'02'07
47 2 // else
48 2 IC_WritByte(TWIC_P2, 0x83, 0x39); // PAL write to Vsync Time Constant Register 20060809
49 2 twdDelay(500);
50 2
51 2 if(IC_ReadByte(TWIC_P0,0x59) <= 0xd6)
52 2 { // NTSC-M,NTSC-4,PAL-M
53 3 m_wBuff[2]=0;
C51 COMPILER V8.08 VIDEODETECT 11/23/2007 00:57:20 PAGE 2
54 3 m_cBuff[1]=m_cChroma; // Preserve previous status for signal std
55 3 twdDelay(300); // add by Sherman 06'01'16
56 3 while (1){ // NTSC-M=1,NTSC-4=4,PAL-M=5
57 4 if (m_cChroma == S_NTSC_4)
58 4 {
59 5 if ((IC_ReadByte(TWIC_P2, 0x3a)&0x08)&&(IC_ReadByte(TWIC_P2, 0x7a)<0x80))
60 5 break; //T103 has no register 0x7a at Page 2?
61 5 }
62 4 if ((m_cChroma == S_NTSC)||(m_cChroma == S_PAL_M)){
63 5 if ((IC_ReadByte(TWIC_P2, 0x3a)&0x08))
64 5 break; //reg0x3a at page 2 locked chroma pll burst
65 5 }
66 4
67 4 do{
68 5 m_cChroma++;
69 5 if(m_cChroma>=S_PAL_M)
70 5 m_cChroma=S_NTSC;
71 5 }while(((1<<m_cChroma)&temp)==0x00);
72 4
73 4
74 4 SetSignalStd(); // Set Signal flag and DTO
75 4 twdDelay(100);
76 4
77 4 if ((++m_wBuff[2]) >4) break; // Avoid while setting, input switch to NTSC
78 4 }
79 3 }
80 2 else
81 2 { // PAL-BD,PAL-CN,SECAM
82 3
83 3 #if (defined YPbPr)
if(EepPublic.cSource == isrYPbPr)
m_cBuff[4]=S_PAL;
else
{
#endif
89 3 m_wBuff[2]=0;
90 3 m_cBuff[1]=m_cChroma; // Preserve previous status for signal std
91 3 twdDelay(300); // add by Sherman 06'01'16
92 3 while (1) // PAL-BD=2,PAL-CN=6,SECAM=3
93 3 {
94 4 if ((m_cChroma == S_PAL)||(m_cChroma == S_PAL_CN)){
95 5 if ((IC_ReadByte(TWIC_P2, 0x3a)&0x08) && (IC_ReadByte(TWIC_P2, 0x3c)&0x01==1))//&& (IC_ReadByte(Slav
-eAddr, 0x7d+RegAddrShift)>0xf0))
96 5 break; //chroma PLL locked to color burst and PAL color Mode detected
97 5 }
98 4 if (m_cChroma == S_SECAM){
99 5 if ((IC_ReadByte(TWIC_P2, 0x3a)&0x08) && (IC_ReadByte(TWIC_P2, 0x7d)>0xf0))
100 5 break; //T103 seems have no reg 0x7d at page 2?
101 5 }
102 4
103 4 do{
104 5 m_cChroma++;
105 5 if(m_cChroma>=S_END)
106 5 m_cChroma=S_PAL;
107 5 }while(((1<<m_cChroma)&temp)==0x00);
108 4
109 4 SetSignalStd(); // Set Signal flag and DTO
110 4 twdDelay(100);
111 4 if ((++m_wBuff[2]) >4) break; // Avoid while setting, input switch to NTSC
112 4 }
113 3 #if (defined YPbPr)
}
C51 COMPILER V8.08 VIDEODETECT 11/23/2007 00:57:20 PAGE 3
#endif
116 3 }
117 2 if (m_cBuff[1] != m_cChroma){
118 3 if ((IC_ReadByte(TWIC_P2, 0x3a)&0x08))
119 3 m_cBuff[4] = m_cChroma;
120 3 m_cChroma=m_cBuff[1] ;
121 3 }
122 2 if((m_cChroma!=m_cBuff[4])){
123 3 m_cChroma=m_cBuff[4];
124 3 }
125 2 }// 癹伴い
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -