📄 main_h.h
字号:
////2006-02-20
//###############################################################
static volatile unsigned char flag0 @ 0x7d;
static volatile unsigned char GN_flag @ 0x7e;
static volatile unsigned char flag3 @ 0x7f;
//static volatile unsigned int REAL_RC @ 0x1c;
/* FLAG1 bits */
static volatile bit power_fg @(unsigned)&flag0*8+0; //电源开关标志
static volatile bit beep_fg @(unsigned)&flag0*8+1; //
static volatile bit have_key_fg @(unsigned)&flag0*8+2; //
static volatile bit CHONLANG_FG @(unsigned)&flag0*8+3; //冲浪标志
static volatile bit JIRE_FG @(unsigned)&flag0*8+4; //加热标志
static volatile bit ZHENDON_FG @(unsigned)&flag0*8+5; //振动标志
static volatile bit QP_FG @(unsigned)&flag0*8+6; //气泡 标志
static volatile bit CY_FG @(unsigned)&flag0*8+7; //臭氧标志
//
static volatile bit CHAOWEN_FG @(unsigned)&GN_flag*8+0; //超温标志
static volatile bit FALSH_FG @(unsigned)&GN_flag*8+1; //闪动标志(每0.5S闪一次)
static volatile bit FALSH_FG_0 @(unsigned)&GN_flag*8+2; //是否闪动标志(共3S)
static volatile bit TIME_DISP_FG @(unsigned)&GN_flag*8+3; //时间显示标志
static volatile bit TEMP_DISP_FG @(unsigned)&GN_flag*8+4; //时间显示标志
static volatile bit FUN_ERROR_FG @(unsigned)&GN_flag*8+5; //测有水标志
static volatile bit WENDU_0_FG @(unsigned)&GN_flag*8+6; //温度为0标志
static volatile bit CHAOWEN_FG_LED @(unsigned)&GN_flag*8+7; //超温时超指示灯标志为0标志
static volatile bit JIRE_FG_0 @(unsigned)&flag3*8+7;//为保证在第一次按下温度加或减键不会马上加热,要等到数码管闪烁完后再开始加热
//IO DEFINE
#define beep RC7 //蜂鸣器
//开关端口定义,高电平有效
#define POWER_KG RB6 //电源开关
#define ADD_TKEY RB5 //加温开关
#define DEC_TKEY RB4 //减温开关
#define TIME_KEY RB3 //定时选择开关
#define zhong_key RB1 //振动开关
#define ZHENDON_KEY RB2 //气泡-臭氧选择开关
//RC1----RC7为数码管数据口
//发光二极管端口定义
#define LED1 RB6 //电源指示
#define LED2 RB4 //加热指示
#define LED3 RB5 //温度指示
#define LED4 RB3 //超温指示(1秒闪烁一次)
#define LED5 RB2 //振动指示
#define LED6 RB0 //气泡指示(绿).0
#define LED7 RB1 //气泡+加臭氧指示(红),1
//
//功能输出IO口定义
#define GN1_OUT RC6 //加热
#define GN2_OUT RC5//水汞
#define GN3_OUT RC4 //振动
#define GN4_OUT RC3 //气汞
#define GN5_OUT RC2 //臭氧
//
//数码管选择位
#define LEDGW_SLE RB7 //数码管个位选择
#define LEDSW_SLE RC0 //数码管十位选择
//LED选项择位
#define LED_SLE RC1 //LED选项择位
//测温IO口定义
#define SENSOR_PIN RA2 //测温;100
//#define JIAOZHEN RA1 //校正;10K
//#define KAISHICHE RA3 //开始测温的引脚5V,RT=50K
//--------------------------------------------------------------
//测试是否有水IO口分布
#define FGS_IO RA0 //测试是否有水
#define QP_CY_KEY RB0
#define fun_out RA3
//
#define beep RC7 //蜂鸣器
#define TIME_DEFINE 60
//#define REAL_RC 10000
//================================================================================================================
volatile unsigned long int real_rm ;
volatile unsigned int temp_tm,temp_tc;
volatile unsigned int div_xx,div_yy;
volatile unsigned char TEMP;
bank1 volatile unsigned char t1,t2,t3;
bank1 volatile unsigned char key_delay_count,tem_data1,real_temp,led_data,led_pub_sel,SEC_0,SEC_1;
bank1 volatile unsigned char led_temp1,beep_delay=0,gw_zc,i,real_temp_old,count;
bank2 volatile unsigned int temp_tc_bank2,temp_tm_bank2;
//==================================================================================================================
const unsigned char led_table[]={0x3f,0x30,0x5b,0x4f,0x65,0x6e,0x7e,0x07,0x7f,0x6f}; //共阴极0---9
//10K+-3%,B25C/50C=3950K;MF5A,2006-01-13
const unsigned int temp_table[]=
{ 32660,31132,29687,28314,27003,25750,24549,23396,22290,21228, //0---9
20210,19233,18296,17423,16600,15823,15088,14392,13734,13109, //10---19
12518,11958,11427,10925,10449,10000,9576, 9175, 8798, 8443, //20---29
8110, 7779, 7460, 7151, 6853, 6565, 6287, 6021, 5767, 5523, //30---39
5292, 5074, 4870, 4679, 4502, 4340, 4178, 4022, 3872, 3727, //40---49
3588, 3454, 3325, 3202, 3083, 2969, 2860, 2755, 2655, 2559, //50---59
2468 //60
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -