Commit a5affd19 authored by limm's avatar limm

V1.4

parent deb06860
......@@ -182,6 +182,7 @@ A = 0 B = 1 C = 1
#define ButtonLongEvent 0x90
#define ButtonLongUpEvent 0xa0
#define Button10sLongEvent 0xb0
#define Button10sLongUpEvent 0xc0
#define AIR_CMD_ONOFF 1
#define AIR_CMD_SYSTEM_MODE 2
......
......@@ -297,8 +297,8 @@ u8 KeyScanState( KeyScan_t* Buttion_T, u8 ButtonState )
&&( Low == Buttion_T->PreState )
&&( AntiShakeTime < Buttion_T->KeyTime )
&&( PressLongTime > Buttion_T->KeyTime)
&&( ButtonLongEvent != (Buttion_T->PreKeyEvent) )
)
&&( ButtonLongEvent != (Buttion_T->PreKeyEvent))
&&(Button10sLongEvent != (Buttion_T->PreKeyEvent)) )
{
Buttion_T->KeyTime = NULL;
Buttion_T->PreKeyEvent = ButtonShortEvent;
......@@ -318,7 +318,6 @@ u8 KeyScanState( KeyScan_t* Buttion_T, u8 ButtonState )
count++;
if(count == 5) //10s
{
count = 0;
Buttion_T->PreKeyEvent = Button10sLongEvent;
EventReturn = Button10sLongEvent;//InputKeyEvent( Key_Button, ModeButtonLongEvent );
}
......@@ -337,6 +336,7 @@ u8 KeyScanState( KeyScan_t* Buttion_T, u8 ButtonState )
}
else
{
Buttion_T->KeyTime = NULL;
if( ButtonLongEvent == (Buttion_T->PreKeyEvent) )
......@@ -345,6 +345,12 @@ u8 KeyScanState( KeyScan_t* Buttion_T, u8 ButtonState )
Buttion_T->PreKeyEvent = ButtonLongUpEvent;
EventReturn = ButtonLongUpEvent;
}
else if(Button10sLongEvent == (Buttion_T->PreKeyEvent))
{
count = 0;
Buttion_T->PreKeyEvent = Button10sLongUpEvent;
EventReturn = Button10sLongUpEvent;
}
}
///**** 状态更新 *****/
......@@ -395,7 +401,7 @@ static void LED_BEEP_Feedback(u8 key_id)
void KeyProcess_Handler_Callbacks(u8 key_id,u8 KeyPressEvent)
{
//printf("####KeyProcess_Handler_Callbacks,keyid = %d,Key_Event = %x\r\n",key_id,KeyPressEvent);
if(Key_Operate_Config_Operation(key_id,KeyPressEvent))
if(Key_Operate_Config_Operation(key_id,KeyPressEvent)||(KeyPressEvent == Button10sLongUpEvent))
{
LED_BEEP_Feedback(key_id);
return;
......
......@@ -700,11 +700,9 @@ void recover_current_state(void)
}
void ReDefine_AIR_Condition_Syetem_Mode(void)
{
s16 temp ;
SHTC3_GetTemp(&temp);
if(temp > 280)
if(Oled_Display_Info.Air_Device.real_temperature > 280)
Oled_Display_Info.Air_Device.system_type = SYSTEM_MODE_COOLING;
else if(temp <200)
else if(Oled_Display_Info.Air_Device.real_temperature <200)
Oled_Display_Info.Air_Device.system_type = SYSTEM_MODE_HEATING;
else
Oled_Display_Info.Air_Device.system_type = SYSTEM_MODE_AIR;
......@@ -852,6 +850,10 @@ void delay_confirm_fan_speed_control(u8 start)
task_comps[5].task_switch = SWITCH_OFF;
}
u8 Is_Fan_Speed_Display(void)
{
return (task_comps[5].task_switch == SWITCH_ON);
}
/**************************************************************************************************/
/*上电延时回调处理
**************************************************************************************************/
......@@ -871,12 +873,6 @@ void setup_handler(void)
{
count = 1;
//空调设备判断当前温度,初始化当前模式
if(Oled_Display_Info.device_type == AIR_CONDITION)
{
ReDefine_AIR_Condition_Syetem_Mode();
}
//未老化完成,则进入老化阶段
if(Oled_Display_Info.aging_test_flag == 0)
aging_test_start();
......
......@@ -11,7 +11,7 @@ extern Lcd_Status_Info_t LCDShowTemp_state_t;
#elif DEVICE_TYPE_FLOOR_HEATING
OLED_ALL_DSD Oled_Display_Info = { 2,0,2,0,0,0x11,0,0,0,0,{0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff},{1,0,0,0,260,0,3,0,5,0,2,1,0,0,3000,0,0xff,0xff,0},{1,0,0,0,260,0,2,0,DEV_TYPE,0,0,0},{1,0,0,0,0,2,1,0,0,0,3000,0}};
#elif DEVICE_TYPE_FAN
OLED_ALL_DSD Oled_Display_Info = { 3,0,3,0,0,0x13,0,0,0,0,{0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff},{1,0,0,0,260,0,3,0,5,0,2,1,0,0,3000,0,0xff,0xff,0},{1,0,0,0,260,0,2,0,0,0,0,0},{1,0,0,0,0,2,1,0,0,0,3000,0}};
OLED_ALL_DSD Oled_Display_Info = { 3,0,3,0,0,0x14,0,0,0,0,{0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff},{1,0,0,0,260,0,3,0,5,0,2,1,0,0,3000,0,0xff,0xff,0},{1,0,0,0,260,0,2,0,0,0,0,0},{1,0,0,0,0,2,1,0,0,0,3000,0}};
#endif
Key_Operation_Status gKey_Press_Info = {0};
// .device_type = 1, //AIR_CONDITION
......@@ -550,6 +550,10 @@ void Display_Up_Contend(u8 device_type)
}
void Fan_Oled_Display()
{
if((Oled_Display_Info.FAN_Device.no_disturb_mode == 1)&&(IsLcdEnterScreenSave()))
return;
LCD_CONTROL(1);
/********************************************
显示“新风”字样
*********************************************/
......@@ -578,9 +582,22 @@ void Fan_Oled_Display()
*********************************************/
if(!IsLcdEnterScreenSave())
Display_Up_Contend(FAN);
/********************************************
ZigBee信号图标
*********************************************/
if (Oled_Display_Info.net_work_flage != OUT_LINE)
{
LCDShowTemp_state_t.LCD_place = ZIGBEE_NET_CAHR_DISPLAY;
LCDShowTemp_state_t.LCD_state = ON;
LcdShowCTR(LCDShowTemp_state_t);
}
}
void Floor_Heating_Oled_Display()
{
if((Oled_Display_Info.FLOOR_Device.no_disturb_mode == 1)&&(IsLcdEnterScreenSave()))
return;
LCD_CONTROL(1);
/********************************************
显示“地暖”字样
*********************************************/
......@@ -607,9 +624,23 @@ void Floor_Heating_Oled_Display()
*********************************************/
if(!IsLcdEnterScreenSave())
Display_Up_Contend(FLOOR_HEATING);
/********************************************
ZigBee信号图标
*********************************************/
if (Oled_Display_Info.net_work_flage != OUT_LINE)
{
LCDShowTemp_state_t.LCD_place = ZIGBEE_NET_CAHR_DISPLAY;
LCDShowTemp_state_t.LCD_state = ON;
LcdShowCTR(LCDShowTemp_state_t);
}
}
void Air_Oled_Display(void)
{
if((Oled_Display_Info.Air_Device.no_disturb_mode == 1)&&(IsLcdEnterScreenSave()))
return;
LCD_CONTROL(1); //开机
/********************************************
显示“空调”字样
*********************************************/
......@@ -638,10 +669,19 @@ void Air_Oled_Display(void)
Display_Up_Contend(AIR_CONDITION);
/********************************************
ZigBee信号图标
*********************************************/
if (Oled_Display_Info.net_work_flage != OUT_LINE)
{
LCDShowTemp_state_t.LCD_place = ZIGBEE_NET_CAHR_DISPLAY;
LCDShowTemp_state_t.LCD_state = ON;
LcdShowCTR(LCDShowTemp_state_t);
}
/********************************************
显示主从模式
*********************************************/
#if (DEV_TYPE == 0) &&(DEVICE_TYPE_AIR_CONDITION ==1)
if( (Oled_Display_Info.Air_Device.power_off_time == 0) &&(Oled_Display_Info.Air_Device.air_master_slavery_mode))
if( Oled_Display_Info.Air_Device.air_master_slavery_mode)
{
//显示H图标
if(!IsLcdEnterScreenSave())
......@@ -660,24 +700,13 @@ void Oled_Display_whole(void)
{
if(IsLocalConfigMode())
return;
LCD_CONTROL(1); //开机
if(Oled_Display_Info.screen_page == AIR_CONDITION)
Air_Oled_Display();
else if(Oled_Display_Info.screen_page == FLOOR_HEATING)
Floor_Heating_Oled_Display();
else if(Oled_Display_Info.screen_page == FAN)
Fan_Oled_Display();
/********************************************
ZigBee信号图标
*********************************************/
if (Oled_Display_Info.net_work_flage != OUT_LINE)
{
LCDShowTemp_state_t.LCD_place = ZIGBEE_NET_CAHR_DISPLAY;
LCDShowTemp_state_t.LCD_state = ON;
LcdShowCTR(LCDShowTemp_state_t);
}
Fan_Oled_Display();
}
......@@ -1265,6 +1294,7 @@ void delay_confirm_fan_speed(void)
LCDShowTemp_state_t.LCD_state = OFF;
LcdShowCTR(LCDShowTemp_state_t);
}
extern u8 Is_Fan_Speed_Display(void);
void Set_CMD_Handler(u8 device_type,u16 opcode,u8 *arg,u8 arg_len)
{
if(arg == NULL)
......@@ -1307,6 +1337,11 @@ void Set_CMD_Handler(u8 device_type,u16 opcode,u8 *arg,u8 arg_len)
#else
state_change_report(OPCODE_GENERAL_REPORT_STATUS,1); //状态改变通知
#endif
//如果此时正在调节风速,提前结束
if(Is_Fan_Speed_Display())
{
delay_confirm_fan_speed();
}
}
}
......@@ -1385,6 +1420,10 @@ void Set_CMD_Handler(u8 device_type,u16 opcode,u8 *arg,u8 arg_len)
return;
Oled_Display_Info.Air_Device.wind_speed = wind_speed;
#if (DEV_TYPE == 0) &&(DEVICE_TYPE_AIR_CONDITION ==1)
if(Is_Fan_Speed_Display()&&(!IsLcdEnterScreenSave()))
{
display_wind_speed(Oled_Display_Info.Air_Device.wind_speed,0); //显示当前风速
}
delay_control_fan_speed_start();
#else
state_change_report(OPCODE_GENERAL_REPORT_STATUS,1); //状态改变通知
......@@ -1589,7 +1628,11 @@ void Set_CMD_Handler(u8 device_type,u16 opcode,u8 *arg,u8 arg_len)
{
Displayt_System_Mode(system_mode);
Oled_Display_Info.FLOOR_Device.system_type = system_mode;
if(Oled_Display_Info.FLOOR_Device.system_type == SYSTEM_MODE_AUTO)
{
Oled_Display_Info.FLOOR_Device.set_temperature = 260;
display_set_temp(0,Oled_Display_Info.FLOOR_Device.set_temperature,0);
}
state_change_report(OPCODE_GENERAL_REPORT_STATUS,2);
arg[0] = 0;
}
......
......@@ -293,6 +293,7 @@ static void FMC_init(void)
SYS_LockReg();
}
extern void ReDefine_AIR_Condition_Syetem_Mode(void);
void hardware_init(void)
{
SYS_Init();
......@@ -323,6 +324,12 @@ void hardware_init(void)
GPIO_init();
temp_init();
//空调设备判断当前温度,初始化当前模式
if(Oled_Display_Info.device_type == AIR_CONDITION)
{
ReDefine_AIR_Condition_Syetem_Mode();
}
#if (DEVICE_TYPE_FLOOR_HEATING || DEVICE_TYPE_FAN)
Tap_Init();
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment