Commit 579396ac authored by limm's avatar limm

V1.5

parent a5affd19
......@@ -50,7 +50,7 @@ static void (*non_permeable_opcode_analysis)(PROTOCOL_DEAL protocol_data);
static void (*transparent_opcode_analysis)(PROTOCOL_DEAL protocol_data);
static TP_ErrorStatus transparent_protocol_analysis(TP_uc8 *data,TP_uc8 len);
static u8 Record_Last_Seq = 0xFF;
/**************************************************************************************************************
全局变量,用于 transparent_protocol_send
***************************************************************************************************************/
......@@ -464,22 +464,17 @@ static TP_ErrorStatus transparent_protocol_analysis(TP_uc8 *data, TP_uc8 len)
}
Usart_protocol_deal.SEQ = *(data + 4); //记录 seq 的值
if(Usart_protocol_deal.SEQ == Record_Last_Seq)
return TP_ERROR;
if(BYTE_MOVE(*(data + len -2),*(data + len -1)) != CreateCrc16(data+ 3,len - 5)) //CRC校验
{ //校验不对
send_crc_error(Usart_protocol_deal.SEQ);
return TP_ERROR;
}
Record_Last_Seq = Usart_protocol_deal.SEQ;
Usart_protocol_deal.Opcode = BYTE_MOVE(*(data + 7),*(data + 8)); //赋值功能码
Usart_protocol_deal.Channel_ID = *(data + 6);
Usart_protocol_deal.ControlField = *(data + 3);
Usart_protocol_deal.ARG = (data + 9);
Usart_protocol_deal.ARG_len = (*(data + 2) - 6); //根据协议,此处应该 data + 2
//DEBUG_USATR1("[cc->stm]RECIVE OPCODE: %16x \r\n",Usart_protocol_deal.Opcode);
if((Usart_protocol_deal.ControlField & 0x80) == 0x80)//非透传的数据
......
......@@ -1898,7 +1898,7 @@ void Tap_Init(void)
{
Fan_Speed_Control(Oled_Display_Info.FAN_Device.wind_speed); //默认打开
if((Oled_Display_Info.FAN_Device.on_off ==1)&&(Oled_Display_Info.aging_test_flag != 1)) //开机状态且没处于15min-4h老化期间
if((Oled_Display_Info.FAN_Device.on_off ==1)&&(Oled_Display_Info.aging_test_flag != 1)&&(First_Exit_Factory_Mode == 0)) //开机状态且没处于15min-4h老化期间
{
Fan_PassbyONOFF_By_Mode_Trans(Oled_Display_Info.FAN_Device.system_type,1);
Fan_Speed_Control(Oled_Display_Info.FAN_Device.wind_speed);
......@@ -1965,7 +1965,7 @@ void Fan_Speed_Control(u8 wind_speed)
void Tap_Status_Scan(void)
{
#if DEVICE_TYPE_FLOOR_HEATING
if((Oled_Display_Info.FLOOR_Device.on_off ==1)&&(Oled_Display_Info.aging_test_flag != 1)) //开机状态且没处于15min-4h老化期间
if((Oled_Display_Info.FLOOR_Device.on_off ==1)&&(Oled_Display_Info.aging_test_flag != 1)&&(First_Exit_Factory_Mode ==0)) //开机状态且没处于15min-4h老化期间
{
if(Oled_Display_Info.FLOOR_Device.system_type == SYSTEM_MODE_MANUAL)
{
......@@ -1993,7 +1993,7 @@ void Tap_Status_Scan(void)
}
}
#elif DEVICE_TYPE_FAN
if((Oled_Display_Info.FAN_Device.on_off ==1)&&(Oled_Display_Info.aging_test_flag != 1)) //开机状态且没处于15min-4h老化期间
if((Oled_Display_Info.FAN_Device.on_off ==1)&&(Oled_Display_Info.aging_test_flag != 1)&&(First_Exit_Factory_Mode ==0)) //开机状态且没处于15min-4h老化期间
{
if(Oled_Display_Info.FAN_Device.system_type != SYSTEM_MODE_ROLL)
return;
......
......@@ -365,7 +365,8 @@ static u8 Save_Data(u8 device_type,u8 index,u32 *write_data)
if(index == 0)
{
*write_data = 0;
*write_data = (*write_data | Oled_Display_Info.aging_test_flag) << 8; //保存老化标志位
if(Oled_Display_Info.aging_test_flag != 1)
*write_data = (*write_data | Oled_Display_Info.aging_test_flag) << 8; //保存老化标志位
*write_data = (*write_data | Oled_Display_Info.binding_device) << 8; //保存绑定信息
......@@ -422,7 +423,8 @@ static u8 Save_Data(u8 device_type,u8 index,u32 *write_data)
if(index == 0)
{
*write_data = 0;
*write_data = (*write_data | Oled_Display_Info.aging_test_flag) << 8; //保存老化标志位
if(Oled_Display_Info.aging_test_flag != 1)
*write_data = (*write_data | Oled_Display_Info.aging_test_flag) << 8; //保存老化标志位
*write_data = (*write_data | Oled_Display_Info.binding_device) << 8; //保存绑定信息
......@@ -465,7 +467,8 @@ static u8 Save_Data(u8 device_type,u8 index,u32 *write_data)
if(index == 0)
{
*write_data = 0;
*write_data = (*write_data | Oled_Display_Info.aging_test_flag) << 8; //保存老化标志位
if(Oled_Display_Info.aging_test_flag != 1)
*write_data = (*write_data | Oled_Display_Info.aging_test_flag) << 8; //保存老化标志位
*write_data = (*write_data | Oled_Display_Info.binding_device) << 8; //保存绑定信息
......@@ -1072,6 +1075,8 @@ static void aging_test(void)
if(Board_test_time>= FAST_AGING_STEP2_TIME) //8小时
{
aging_step = 2;
aging_test_stop();
Board_test_time = 0;
First_Exit_Factory_Mode = 1;
Oled_Display_Info.aging_test_flag = 2; //
save_data(); //老化完成,写入标志位
......@@ -1906,6 +1911,31 @@ void transparent_data_analyze(PROTOCOL_DEAL recv_data)
}
state_change_report(OPCODE_GENERAL_REPORT_STATUS,1);
}
else if((Oled_Display_Info.screen_page == 2)&&(Oled_Display_Info.FLOOR_Device.error == 2)) //通讯故障
{
Oled_Display_Info.FLOOR_Device.error = 0;
if( Get_Display_Status())
{
LCDShowTemp_state_t.LCD_place = DELAY_OFF_TIME_DISPLAY;
LCDShowTemp_state_t.LCD_display_count = 0;
LCDShowTemp_state_t.LCD_state = OFF;
LcdShowCTR(LCDShowTemp_state_t);
}
state_change_report(OPCODE_GENERAL_REPORT_STATUS,2);
}
else if((Oled_Display_Info.screen_page == 3)&&(Oled_Display_Info.FAN_Device.error == 2)) //通讯故障
{
Oled_Display_Info.FAN_Device.error = 0;
if( Get_Display_Status())
{
LCDShowTemp_state_t.LCD_place = DELAY_OFF_TIME_DISPLAY;
LCDShowTemp_state_t.LCD_display_count = 0;
LCDShowTemp_state_t.LCD_state = OFF;
LcdShowCTR(LCDShowTemp_state_t);
}
state_change_report(OPCODE_GENERAL_REPORT_STATUS,3);
}
break;
}
case OPCODE_GENERAL_BING_DEVICE: //绑定设备
......
......@@ -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,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}};
OLED_ALL_DSD Oled_Display_Info = { 3,0,3,0,0,0x15,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
......
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