标题: 这段单片机红外解码的代码怎么理解? [打印本页]

作者: kfwxfl    时间: 2019-4-23 18:54
标题: 这段单片机红外解码的代码怎么理解?
void Timer0 interrupt 1()                                                            
{      
        irTime++;   
        if(irTime==240)   
       {
             irTime--;  
             codeCnt=0x3f;
       }      
       if(IR_IO)   Irprot_LastState=1;   
       else if(Irprot_LastState)      
       {      
              Irprot_LastState = 0;            
              if(irTime<24)                     
             {         
                    codeCnt++;  
                    codeCnt &= 0x1f;         
                    IR_data[codeCnt>>3] <<= 1;      
                    if( irTime>15)   
                    IR_data[codeCnt>>3]++;      
             }   
             irTime = 0;                  
        }
}






欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1