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

📄 tou.c

📁 本公司的单相CPU卡表的源程序代码
💻 C
字号:
/*******************************************************************
* Tou.c    :
********************************************************************/
#include "include\macro.h"  
#include "include\HardConfig.h"
#include "include\SysConfig.h"
#include "include\SubConfig.h"
#include "include\data.h"
#include "include\bitdef.h"

#include "include\FunAnnounce.h"


//*****************************************************************
//
//***************************************************************/
void Tou_pro(void)
{ 
 uchar data;
 	
    Flag.even &= ~bitHfSec;	
    Sram.halfSec++;
    if(Sram.halfSec >= 120)
    {
        Sram.halfSec = 0;
        Sram.minute++;   
        MDstatus_judge(); 

        // prokey status check
        if(Flag.even & bitPGKen)
        {
            Sram.tmr1ProKEY--;
            if(Sram.tmr1ProKEY ==0)
            {
                 ProgStatu_off();   
            }
        }

        // relay time judge
        if(Relay.status & bitRstu_arm2off)
        {
            if(Relay.tmr_status == 0)
            {
                 Relay.status &= ~bitRstu_arm2off;  
            }
            else
            {
                 Relay.tmr_status--;   
            }
        }

        if(Relay.status & bitRstu_cardoff)
        {
            if(Relay.tmr_status == 0)
            {
                 Relay.status &= ~bitRstu_cardoff;  
            }
            else
            {
                 Relay.tmr_status--;   
            }
        }

        if(Relay.status & bitRstu_cardon)
        {
            if(Relay.tmr_status == 0)
            {
                 Relay.status &= ~bitRstu_cardon;  
            }
            else
            {
                 Relay.tmr_status--;   
            }
        }


        //
    }

    LcdTmr_autodec();                 //LCD_display time dec

    // program key check
    if(pin_PRGM == 0)
    {
        
        if(Sram.tmr0ProKEY>=2)
        {
            Sram.tmr0ProKEY = 0; 
            if(Flag.even & bitPGKen)
            {
                ProgStatu_off();
            }
            else
            {
                ProgStatu_on();
            }
        }
        else
        {
            Sram.tmr0ProKEY++;
        }
    }
    else
    {
         Sram.tmr0ProKEY = 0;   
    } 
    
    // REV energy status check.	
    Flag.run &= ~bitR_REV;
    if(pin_REVP1)   
    {
        Flag.run |= bitR_REV;
        PM0.0 = 0;
        pin_LEDREV = 0;	
    }

    // bright led time dec check
    if(Sram.tmrBLED != 0)
    {
         Sram.tmrBLED--;
         if(Sram.tmrBLED == 0)
         {
               PM7.1 = 0;
               pin_BLED = 0;
         }
    }

}


/*************************************************************
**
*************************************************************/
 void ProgStatu_off(void)
{
     Flag.even &=  ~bitPGKen;
     Sram.tmr1ProKEY = 0;
}

/*************************************************************
**
*************************************************************/
 void  ProgStatu_on(void)
{
     Flag.even |=  bitPGKen;
     Sram.tmr1ProKEY = 10;
     BLED_Open();
}

⌨️ 快捷键说明

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