📄 main.lst
字号:
165
166 void OpenPanel(void)
167 {
168 1 if(m_bPanelClose){
169 2 m_bPanelClose = 0;
170 2 I2CWriteByte(TW101, 0xC2, I2CReadByte(TW101, 0xC2)&~(PSYNC_STR|IGNORE_VSYNC));
171 2 I2CWriteByte(TW101, PATTERN_CTRL, I2CReadByte(TW101, PATTERN_CTRL)&~0x80); //Enable Frame Background Col
-or
172 2
173 2 twdDelay(100);
174 2 }
175 1 }
176 void BKPower(void)
C51 COMPILER V7.50 MAIN 06/16/2006 15:29:44 PAGE 4
177 {
178 1 if(m_bBKPowerOn){
179 2 BKLIGHT_EN = 1; // BKLIGHT shut down
180 2 twdDelay(100);
181 2 m_bBKPowerOn = 0;
182 2 }
183 1 else{
184 2 twdDelay(100);
185 2 BKLIGHT_EN = 0; // BKLIGHT power on
186 2 m_bBKPowerOn = 1;
187 2 #ifdef LEDCONTROL
m_bLedOn=1;
#endif
190 2 }
191 1 }
192
193 void PowerManage(void)
194 {
195 1 if(m_bKyPowerOn) //Power on
196 1 {
197 2 LED_RED = 1; //Turn Off
198 2 LED_GREEN = 0; //Turn On
199 2 I2CWriteByte(TW101, 0xE0, I2CReadByte(TW101, 0xE0)|TPDB);
200 2 m_cOSDEvent=0;
201 2 m_cOSDFunc=0;
202 2 //When power on chip, force to reset chip
203 2 m_bChipPowerOn=1;
204 2 //m_cSource=0x0F;
205 2 twdDelay(100);
206 2 OpenPanel();
207 2 //AUDIO_STANBY=0; //Audio on
208 2 }
209 1 else //Forced Power Off
210 1 {
211 2 if(m_bChipPowerOn)
212 2 {
213 3 LED_RED =0; //Turn On
214 3 LED_GREEN = 1; //Turn Off
215 3 twdDelay(100);
216 3 OSDExit();
217 3 if(m_bBKPowerOn)
218 3 BKPower();
219 3 ClosePanel(0x00,0x40,0x8a);
220 3 twdDelay(200);
221 3 I2CWriteByte(TW101, 0xE0, I2CReadByte(TW101, 0xE0)&~TPDB|PDMD);
222 3 m_bChipPowerOn=0;
223 3 }
224 2 }
225 1 }
226
227 void Initial(void)
228 {
229 1 extern EEPVIDEO idata EepVideo;
230 1
231 1 SysInit();
232 1 #ifdef TCON
233 1 TconInit();
234 1 #endif
235 1 //Ruby modify 2005-06-07
236 1 ClosePanel(0x00,0x40,0x8a);
237 1 OSDDisable();
238 1 LoadGammaTable(0);
C51 COMPILER V7.50 MAIN 06/16/2006 15:29:44 PAGE 5
239 1
240 1 OSDLogo();
241 1 }
242
243 void SysInit(void)
244 {
245 1 P0=0xff;
246 1 P1=0xff;
247 1 P2=0xff;
248 1 P3=0xff;
249 1 //Chip Reset
250 1 CHIP_RESET = 0;
251 1 VIDEO_RESET=0;
252 1 twdDelay(100);
253 1 CHIP_RESET = 1;
254 1 VIDEO_RESET=1;
255 1 twdDelay(50);
256 1 //8051Register Set
257 1 IE = 0; // disable all interrupt
258 1 TMOD = 0x11; // Timer1 Mode 1, Timer0 Mode 1;
259 1 //TMOD = 0x01; // Timer0 Mode 1;
260 1 EX0 = 0; // disable external interrupt 0, IE[0]
261 1 EX1 = 0;
262 1 //ET0 = 1; // enable bTimer 0
263 1 //IT0 = 1; // falling endge generate interrupt, TCON[0]
264 1 INT0 = 1;
265 1 IT1 = 1; // falling endge generate interrupt, TCON[0]
266 1 INT1 = 1;
267 1
268 1 twdDelay(10);
269 1 //ClosePanel(0x00,0x40,0x60);
270 1 #if (defined T100)|(defined T101)
LoadFilter(3);//3
#endif
273 1 #ifdef T101A
LoadFilter(0);//2
#endif
276 1 #ifdef T102
//LoadFilter(6);
#endif
279 1 InitT10x();
280 1 #ifdef NVRAM
281 1 #ifdef RESET_EEPROM
InitEEPRom();
OSDResetVideoData();
#else
285 1 EEPLoadPubData();
286 1 #endif
287 1 #endif
288 1
289 1 kyKeypadInit();
290 1 m_bPanelClose = 0;
291 1 m_bBKPowerOn=0;
292 1 m_bKyPowerOn=1;
293 1 m_bChipPowerOn=1;
294 1 LED_GREEN=0;
295 1 }
296
297 void SysInterruptEnable(void)
298 {
299 1 #ifdef TIMER1
300 1 // Timer1Reset();
C51 COMPILER V7.50 MAIN 06/16/2006 15:29:44 PAGE 6
301 1 ET1 = 1; // Enable Timer1 interrupt
302 1 TR1=0;
303 1 #endif
304 1 #ifdef TIMER0
305 1 Timer0Reset();
306 1 ET0 = 1; // Enable Timer0 interrupt
307 1 TR0 = 0;
308 1 #endif
309 1 #ifdef INTERRUPT1
310 1 EX1 = 1; // Enable INT1 (IR)
311 1 #endif
312 1 EA = 1; // Enable Interrupt
313 1 }
314
315
316
317
318
319
320
321
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 479 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 17 3
IDATA SIZE = 20 ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -