⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 int.c

📁 LCDTV的source code,含周邊ic的driver code ,scaler ,
💻 C
字号:
/*******************************************************************************
  INT.C
  Copyright (c) SmartASIC, Inc. All rights reserved.
*******************************************************************************/
#include <MTV230.H>
#include <DEFINE.H>
/*==============================================================================
  Function: INT0 interrupt operation
==============================================================================*/
void INT0(void) interrupt 0 {

  EX0=0;
  TH1=0xf7;//2.222ms for 1.25 cycles
  TH0=0x51;
  TR1=ET1=1;

  Remote_Code.ir_index=1;
  Remote_Code.ir_sys=0x80;
  Remote_Code.ir_cmd=0x00;

  }


/*==============================================================================
  Function: Timer0 interrupt operation
==============================================================================*/
void Timer0(void) interrupt 1 {

  TH0=0x3c;//Timer0 using 50ms interrupt
  TL0=0xb0;
  
  //---Sleep Timer---//
  if(SleepCountDown>0) {
    if((++MinuteCounter)==(20*60)) {
      if((--SleepCountDown)==0)
        bshutdown=1;
      MinuteCounter=0;
      }
    }

  //---For OSD Timer---//
  if(bosd_status) {
    if(!(bsmart||bfactory))
      Timer0Counter++;
    if(Timer0Counter==20) {
      Timer0Second++;
      Timer0Counter=0;
      //OSD OFF timer
      if(OSD_CountDown>0) {
        OSD_CountDown--;
        if(OSD_CountDown==0)
          if(!((Page==110)||(Page==120)||(Page==130)||(Page==200)||(Page==201)))
            bosdtimeout=1;
        }
      //Input OFF Timer
      if(Input_CountDown>0)
        if(--Input_CountDown==0)
          bsetchok=1;
      }
    }
  

  //---Keyboard Timer---//
  KeyPadTimer++;
  if(bkeyfast) {        //50ms delay for keyboard fast
    if(KeyPadTimer>0) {
      KeyPadTimer=0;
      if((bkey_code_pre==0x04)||(bkey_code_pre==0x08))
        bkey_code_pre=0;
      }
    }
  else {                //250ms delay for keyboard
    if(KeyPadTimer>5) {
      KeyPadTimer=0;
      if((bkey_code_pre==0x04)||(bkey_code_pre==0x08))
        bkey_code_pre=0;
      }
    }

  }


/*==============================================================================

==============================================================================*/
void INT1(void) interrupt 2 {

  
  }


/*==============================================================================
  Function: Timer1 interrupt operation
==============================================================================*/
extern code unsigned char BIT_OPOR[8];
void Timer1(void) interrupt 3 {

  TH1=0xf9;//1.778ms for 1 cycle
  TL1=0x2f;

  if(Remote_Code.ir_index<13) {
    Remote_Code.ir_index++;
    if(!RX_ON) {
      if(Remote_Code.ir_index<9)
        Remote_Code.ir_sys|=BIT_OPOR[8-Remote_Code.ir_index];
      else
        Remote_Code.ir_cmd|=BIT_OPOR[8-(Remote_Code.ir_index-8)];
      }
    }
  else {
    Remote_Code.ir_rdy=1;
    if(!RX_ON)
      Remote_Code.ir_cmd|=BIT_OPOR[2];
    ET1=TR1=0;
    }

  }


/*==============================================================================
  Function: Serial Port interrupt operation
==============================================================================*/
void Serial(void) interrupt 4 {


  }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -