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

📄 timer.c

📁 一整套电梯控制器源程序
💻 C
字号:
#include "public.h"

void timer0() interrupt 1 using 3       //50ms
{
    EA=0;
    TH0=-50000/256;
    TL0=-50000%256;
    
    if(P1_7==0)                         //功能切换
    if((m_cSettingFuncFlg==1) && (m_cSettingSubFuncFlg==0))
    if(m_cNewFuncFlg==0)
    if((m_cFuncTimer--)==0){
          m_cNewFuncFlg=1;
		  m_cFuncTimer=TIMER_FUNC_NUM;
    }  

    if(P1_7==0)                         //子功能切换
    if((m_cSettingFuncFlg==0) && (m_cSettingSubFuncFlg==1))
    if(m_cNewSubFuncFlg==0){
        if(P1_6==0){                    //功能选择按钮被按下(对应上呼按钮按下,累加)
            if((m_cSubFuncTimer--)==0){
                m_cNewSubFuncFlg=1;
                m_cSubFuncTimer=TIMER_SUBFUNC_NUM;
                m_cSubToParTimer=TIMER_SUBTOPAR_NUM;    //2004.09.24 确保子功能计数(注意:OutCallPanel是否需要修改)
            }
        }/*else if(P1_2==0){              //下呼按钮按下
            if((m_cSubFuncTimer--)==0){
                m_cNewSubFuncFlg=1;
                m_cSubFuncTimer=TIMER_SUBFUNC_NUM;
            }
        }*/ 
    }


    if(P1_7==0)                         //恢复子功能是否超过3s(超过后,父功能进一)
    if(P1_6==1)
    if(m_cSubToParLess2sFlg==1){
        if((m_cSubToParTimer--)==0){
            m_cSubToParLess2sFlg=0;
    		m_cSubToParTimer=TIMER_SUBTOPAR_NUM;
            //父功能进一
            m_cNewFuncFlg=1;
            m_cFuncTimer=TIMER_FUNC_NUM;
        }        
    }


    if(P1_7==1)                         //整行滚动是否超过150ms
//    if((data5045.cF2==1) || (data5045.cF2==2) || (data5045.cF2==3))
    if(data5045.cF2!=0)
	if(m_cWholeMoveOKFlg==0)
    if(m_cNewLineFlg==0){
        if((m_cMoveTimer--)==0){
            m_cNewLineFlg=1;
    		m_cMoveTimer=TIMER_ONELINE_NUM;
        }
    }
    
    if((time_nocan_flg==1)&&(time_nocan200ms_flg==0)){
        if((time_nocan_count--)==0){
            time_nocan200ms_flg=1;
    		time_nocan_count=TIMER_NOCANDATA_NUM;
        }   
    }

    if((time_report_flg==1)&&(time_report2s_flg==0)){
        if((time_report_count--)==0){
            time_report2s_flg=1;
    		   time_report_count=TIMER_REPORT_NUM;
        }   
    }
/*
    if(P1_7==1){

        if(P1_0==0){                                //上呼
            if(((time1_count--)==0)&&(time1_flg==0)){
                time1_flg=1;
                time1_count=TIMER_FILTER_NUM;
            }
        }

        if(P1_2==0){                                //下呼
            if(((time2_count--)==0)&&(time2_flg==0)){
                time2_flg=1;
                time2_count=TIMER_FILTER_NUM;
            }
        }

        if((P1_4==0)&&(data5045.cF3==1)){           //锁梯
            if(((time3_count--)==0)&&(time3_flg==0)){
                time3_flg=1;
                time3_count=TIMER_FILTER_NUM;
            }
        }

        if((P1_5==0)&&(data5045.cF4==1)){           //消防
            if(((time4_count--)==0)&&(time4_flg==0)){
                time4_flg=1;
                time4_count=TIMER_FILTER_NUM;
            }
        }

        if((P1_6==0)&&(data5045.cF4==1)){           //消防返回
            if(((time5_count--)==0)&&(time5_flg==0)){
                time5_flg=1;
                time5_count=TIMER_FILTER_NUM;
            }
        }
    }
*/
    EA=1;
}

⌨️ 快捷键说明

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