📄 main.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"
/*******************************************************************
* main()
********************************************************************/
void main()
{
DI();
Init_CPU();
EI();
while(1)
{
Sys.module = 0;
WDTE=0xAC;
NOP();
CheckSystemSub();
if(PowerCk()== 1) SysReset(); //
if(Flag.run & bitR_Adj) ECAdj();
if(Flag.run & bitR_Pulse) AddEnergy();
DisplayKey_Check();
IC_ESAM_Opera();
PrepayCTL();
RelayCheck();
if(Flag.even &bitHfSec) Tou_pro();
if(Flag.even &bitDisT) LCDDisplay(); //
Comm_Process() ;
}
}
/*******************************************************************
* Interrupt_init() :
********************************************************************/
void Interrupt_init(void)
{
//INTM0 = 0B01100110; // INTP2 AND INTP0 rising edge interrupt, INTP1 setting prohibited.
//INTM1 = 0B00000001; // INTP3 rising edge interrupt.
IF0 = 0;
IF1 = 0;
MK0 = 0b11011011; // TM000, INTP0 interrupt enable.
MK1 = 0b10011001; // URT RX, URT TX, INTP2,INTP3 interrupt enable
}
/*******************************************************************
* H1PWM38K_init() : H1 TIMER 38K PWM set
********************************************************************/
void H1PWM38K_init(void)
{
TMHE1 = 0;
TMHMD1= 0B00000001; // enable output
CMP01=105; //38k PWM, (2000/38)-1
pin_PWM = 0; //
TMHE1=1;
}
/*******************************************************************
* display key in effect
********************************************************************/
void DisplayKey_Check(void)
{
if((Flag.even & bitDKen) == 0 ) return;
Flag.even &= ~bitDKen;
BLED_Open();
LCDStatus_Trig(DISTG_KEY);
}
//*****************************************************************
// intlize BEIGUANG LED
//***************************************************************/
void BLED_Open(void)
{
PM7.1 = 0;
pin_BLED = 1;
Sram.tmrBLED=60;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -