void mkc_null(void);
void mkc_autowater(void);
void mkc_timerwater(void);
void mkc_handwater(void);
void mkc_autoheat(void);
void mkc_timerheat(void);
void mkc_handheat(void);
void mkc_set(void);
void mkc_up(void);
void mkc_dn(void);
void mkc_err(void);
void mkv_null(void);
void mkv_autowater(void);
void mkv_timerwater(void);
void mkv_handwater(void);
void mkv_autoheat(void);
void mkv_timerheat(void);
void mkv_handheat(void);
void mkv_set(void);
void mkv_up(void);
void mkv_dn(void);
void mkv_err(void);
void mdisp_up(void);
void mdisp_dn(void);
/******************************************************************************/
void mdisp_key(void)
{
if(fkey_scan_ok)
{
if(fdis_key)
{
if(gkey[0]==ck_null) {gkey[1]=gkey[0];fdis_key=0;}
}
else //允许按键接收
{
if(gkey[1]==gkey[0]) //新旧按键比较
{
switch(gkey[0]) //连续键
{
case ck_null: mkc_null(); break; //空键连续键
case ck_timer_water: mkc_timerwater();break; //定时上水连续键
case ck_hand_water: mkc_handwater(); break; //手动上水连续键
case ck_auto_heat: mkc_autoheat(); break; //自动加热连续键
case ck_timer_heat: mkc_timerheat(); break; //定时加热连续键
case ck_hand_heat: mkc_handheat(); break; //手动加热连续键
case ck_set: mkc_set(); break; //设置键连续键
case ck_up: mkc_up(); break; //增键连续键
case ck_dn: mkc_dn(); break; //减键连续键
case ck_auto_water: mkc_autowater(); break; //自动上水连续键
case ck_err: mkc_err(); break; //错键连续键
default: break;
}
}
else
{
gkey[1]=gkey[0]; //非连续键
str_music.fkey=1; //采样到一合理按键时蜂鸣器响
switch(gkey[0])
{
case ck_null: mkv_null(); break; //空键
case ck_timer_water: mkv_timerwater();break; //定时上水键
case ck_hand_water: mkv_handwater(); break; //手动上水键
case ck_auto_heat: mkv_autoheat(); break; //自动加热键
case ck_timer_heat: mkv_timerheat(); break; //定时加热键
case ck_hand_heat: mkv_handheat(); break; //手动加热键
case ck_set: mkv_set(); break; //设置键
case ck_up: mkv_up(); break; //增键
case ck_dn: mkv_dn(); break; //减键
case ck_auto_water: mkv_autowater(); break; //自动上水键
case ck_err: mkv_err(); break; //错键
default: break;
}
}
}
fkey_scan_ok=0; //按键处理完毕将此标志清0
}
}
/*---------------------------------------------------------------------------*/
//
/****************************************************************************/
/***********************非连续键*************************/
/****************************************************************************/
/*---------空键-----------*/
void mkv_null(void)
{
str_music.fkey=0;
}
//
/*---------设置键处理-----------*/
void mkv_set(void)
{
if(fkey_lock) //处于键盘锁定状态
{
fdis_key=1;
str_music.fkey=0;
}
else
{
if(fdir_set) //处于设定状态下
{
TIMSEC(60,cUPDATE); //启动页面刷新的起始时间60S
fdis_key=1; //禁止按键接收
switch(gpage)
{
case cpage_tim_hou: gpage=cpage_tim_min; break;
case cpage_tim_min: gpage=cpage_tim0_water_hou; break;
case cpage_tim0_water_hou: gpage=cpage_tim0_water_min; break;
case cpage_tim0_water_min: gpage=cpage_tim1_water_hou; break;
case cpage_tim1_water_hou: gpage=cpage_tim1_water_min; break;
case cpage_tim1_water_min: gpage=cpage_tim2_water_hou; break;
case cpage_tim2_water_hou: gpage=cpage_tim2_water_min; break;
case cpage_tim2_water_min: gpage=cpage_tim3_water_hou; break;
case cpage_tim3_water_hou: gpage=cpage_tim3_water_min; break;
case cpage_tim3_water_min: gpage=cpage_tim0_heat_hou; break;
case cpage_tim0_heat_hou: gpage=cpage_tim0_heat_min; break;
case cpage_tim0_heat_min: gpage=cpage_tim1_heat_hou; break;
case cpage_tim1_heat_hou: gpage=cpage_tim1_heat_min; break;
case cpage_tim1_heat_min: gpage=cpage_tim2_heat_hou; break;
case cpage_tim2_heat_hou: gpage=cpage_tim2_heat_min; break;
case cpage_tim2_heat_min: gpage=cpage_tim3_heat_hou; break;
case cpage_tim3_heat_hou: gpage=cpage_tim3_heat_min; break;
case cpage_tim3_heat_min: gpage=cpage_tim0_chacy_strhou; break;
case cpage_tim0_chacy_strhou: gpage=cpage_tim0_chacy_strmin; break;
case cpage_tim0_chacy_strmin: gpage=cpage_tim0_chacy_endhou; break;
case cpage_tim0_chacy_endhou: gpage=cpage_tim0_chacy_endmin; break;
case cpage_tim0_chacy_endmin: gpage=cpage_tim1_chacy_strhou; break;
case cpage_tim1_chacy_strhou: gpage=cpage_tim1_chacy_strmin; break;
case cpage_tim1_chacy_strmin: gpage=cpage_tim1_chacy_endhou; break;
case cpage_tim1_chacy_endhou: gpage=cpage_tim1_chacy_endmin; break;
case cpage_tim1_chacy_endmin: gpage=cpage_tim2_chacy_strhou; break;
case cpage_tim2_chacy_strhou: gpage=cpage_tim2_chacy_strmin; break;
case cpage_tim2_chacy_strmin: gpage=cpage_tim2_chacy_endhou; break;
case cpage_tim2_chacy_endhou: gpage=cpage_tim2_chacy_endmin; break;
case cpage_tim2_chacy_endmin: gpage=cpage_tgapcyc_start; break;
case cpage_tgapcyc_start: gpage=cpage_tgapcyc_end; break;
case cpage_tgapcyc_end: gpage=cpage_tmp_outwater; break;
case cpage_tmp_outwater: gpage=cpage_tmp_box; break;
case cpage_tmp_box: gpage=cpage_tmp_prfrecyc; break;
case cpage_tmp_prfrecyc: gpage=cpage_tmp_chacy; break;
case cpage_tmp_chacy: gpage=cpage_watlev_dn_limit; break;
case cpage_watlev_dn_limit: gpage=cpage_watlev_up_limit; break;
case cpage_watlev_up_limit: fdir_set=0;gpage=0; break;
default: break;
}
}
else //处于主显示状态
{
if(gpage==0)
{
str_music.fkey=0;
TIMMS(3000,cDIR_SET); //设置3S延时的起始时间
}
else
{
fdis_key=1;
str_music.fkey=0;
}
}
}
}
/****************************************************************************/
/*---------增键处理-----------*/
void mkv_up(void)
{
if(fkey_lock) //处于键盘锁定状态
{
str_music.fkey=0;
TIMSEC(8,cUP_8S); //设置8S延时的起始时间
}
else //键盘解锁状态
{
if(fdir_set) //处于设定状态
{
TIMSEC(60,cUPDATE); //设置页面刷新时间60S
TIMMS(600,cKC); //设置连续键600MS的起始时间
mdisp_up();
}
else
{
if(gpage==0) //主显状态PAGE0状态
{
str_music.fkey=0;
TIMSEC(8,cUP_8S); //设置8S延时的起始时间
}
else
{
str_music.fkey=0;
fdis_key=1;
}
}
}
}
//
/*****
评论0