Commit deb06860 authored by limm's avatar limm

v1.3

parent f4a8fe0b
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -262,7 +262,7 @@ void ikkUartRecvLoopCheck(UMsgNodeSt *pNode, int waitto_ms )
{
if( emberSerialReadAvailable(g_uManagerInsc.port)) {
while(emberSerialReadByte(g_uManagerInsc.port, &data) == EMBER_SUCCESS ) {
//iKonkeAfSelfPrint(">>>>>>1111Recv Data %x\r\n", data);
iKonkeAfSelfPrint(">>>>>>1111Recv Data %x\r\n", data);
currentTime = halCommonGetInt64uMillisecondTick();
//add by maozj 20200602
//When the data header is detected, fix the problem that the data is too long to verify successfully
......
......@@ -269,7 +269,7 @@ static kk_err_t kOptTunnelCommonReportSend(uint16_t attribute_id, uint8_t conten
emAfApsFrameEndpointSetup(1, 1);
EmberAfStatus status = emberAfSendUnicast(EMBER_OUTGOING_DIRECT, 0, &globalApsFrame, appZclBufferLen, appZclBuffer);
iKonkeAfSelfPrint("######OPT SEND Attr(0x%2x) Time(%d)\r\n",attribute_id, halCommonGetInt64uMillisecondTick());
iKonkeAfSelfPrint("######OPT SEND Attr(0x%2x) Time(%llu)\r\n",attribute_id, halCommonGetInt64uMillisecondTick());
cliBufferPrint();
return ((status == EMBER_ZCL_STATUS_SUCCESS)?KET_OK:KET_ERR_UNKNOW);
}
......@@ -356,9 +356,10 @@ kk_err_t kOptTunnelCommonReport(uint16_t attribute_id )
void kOptTunnelMtoRRDelayRspEventHandler(void )
{
emberEventControlSetInactive(kOptTunnelMtoRRDelayRspEventControl);
iKonkeAfSelfPrint("####### MtoO report time(%d)\r\n", halCommonGetInt64uMillisecondTick());
iKonkeAfSelfPrint("####### MtoO report time(%llu)\r\n", halCommonGetInt64uMillisecondTick());
//Prevent interference when reading CMEI Or ISN Or installation code, resulting in error report
kOptTunnelCommonReport(ECA_OPTDATA);
emberEventControlSetInactive(kOptTunnelMtoRRDelayRspEventControl);
}
/* DESP: private protocol command response process.
......@@ -840,7 +841,7 @@ static kk_err_t kOptTunnelCommonWriteAttributeSend(uint16_t attribute_id, uint8_
emAfApsFrameEndpointSetup(1, 1);
EmberAfStatus status = emberAfSendUnicast(EMBER_OUTGOING_DIRECT, 0, &globalApsFrame, appZclBufferLen, appZclBuffer);
iKonkeAfSelfPrint("######OPT SEND Attr(0x%2x) Time(%d)\r\n",attribute_id, halCommonGetInt64uMillisecondTick());
iKonkeAfSelfPrint("######OPT SEND Attr(0x%2x) Time(%d\llu)\r\n",attribute_id, halCommonGetInt64uMillisecondTick());
cliBufferPrint();
return ((status == EMBER_ZCL_STATUS_SUCCESS)?KET_OK:KET_ERR_UNKNOW);
}
......
......@@ -34,7 +34,7 @@ static uint8_t g_u8MessageSeqRecord = 0XFF;
#define HEART_RAND_MAX_NUM (300 * 1000)
#define MIN_JOINED_NWK_DELAY_TIME_MS (7 * 1000) //重新上电后最短时间,用于判断是否随机延时10~40S上报心跳和CMEI和ISN
#define BOOT_DONE_TIME_MS (2 * 1000)
#define BOOT_DONE_TIME_MS (10)
#if HEART_DEBUG
#define HEARTBEAT_TIME_MS (1 * 60 * 1000)
......@@ -135,7 +135,7 @@ SensorStatusSt g_stSensorStatusBuffer = {
};
extern uint8_t generatedDefaults[];
#define Software_Version 0x12
#define Software_Version 0x14
#define Hardware_Version 0x10
#define MODEID_AIR_MEIDI 0x03008611 //美的线控器
......@@ -143,7 +143,6 @@ extern uint8_t generatedDefaults[];
#define MODEID_ELECTRIC_FLOOR_HEATING 0x03008603 //电地暖
#define MODEID_FAN_CONTROL_PANNEL 0x03008601 //风机盘管
extern BIND_Info_Store Bind_Addr_Table;
void Rewrite_Modeid(uint8_t *modeid,uint8_t software,uint8_t hardware)
{
......@@ -746,6 +745,7 @@ bool kZclClusterReportChangeCallback(uint8_t endpoint, EmberAfClusterId clusterI
//属性延时上报事件,可根据不同的属性延时上报自定义修改
void kOnOffDelayReportAttrEventHandler(void)
{
iKonkeAfSelfPrint("##############kOnOffDelayReportAttrEventHandler\r\n");
emberEventControlSetInactive( kOnOffDelayReportAttrEventControl);
kZclClusterSetPermitReportInfo(g_sDevice_Info.Device_Type, ZCL_ON_OFF_CLUSTER_ID, true, false, true, false);
kOptTunnelReportingPlagiarizeOriginal(g_sDevice_Info.Device_Type, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, CLUSTER_MASK_SERVER);
......@@ -759,6 +759,7 @@ void kSystemModeDelayReportAttrEventHandler(void)
void kTargetTemperDelayReportAttrEventHandler(void)
{
iKonkeAfSelfPrint("##############kTargetTemperDelayReportAttrEventHandler\r\n");
emberEventControlSetInactive( kTargetTemperDelayReportAttrEventControl);
kZclClusterSetPermitReportInfo(g_sDevice_Info.Device_Type, ZCL_THERMOSTAT_CLUSTER_ID, true, false, true, false);
kOptTunnelReportingPlagiarizeOriginal(g_sDevice_Info.Device_Type, ZCL_THERMOSTAT_CLUSTER_ID, ZCL_OCCUPIED_HEATING_SETPOINT_ATTRIBUTE_ID, CLUSTER_MASK_SERVER);
......@@ -1107,7 +1108,7 @@ void kkSystemSetUpEventHandler(void )
{
emberEventControlSetInactive(kkSystemSetUpEventControl);
//static bool relayStatusBuffer[] = {false, false, false, false};
iKonkeAfSelfPrint("####### kkSystemSetUpEventHandler\r\n");
switch (g_u8SystemSetupStatus)
{
......@@ -1325,7 +1326,10 @@ void Process_Device_TypeCallback(uint8_t device_type,uint8_t device_subtype)
{
case Device_Type_Air_Condition:
{
modeid = MODEID_AIR_MEIDI;
if(device_subtype == 0)
modeid = MODEID_AIR_MEIDI;
else if(device_subtype == 1)
modeid = MODEID_FAN_CONTROL_PANNEL;
}
break;
case Device_Type_Floor_Heating:
......
......@@ -165,7 +165,7 @@ beginAttrList:REPORTABLE
cl:0xFCC0, at:0x100C, di:server, mf:0x0000
endAttrList:REPORTABLE
beginAttributeDefaults
cl:0x0000, at:0x0001, di:server, mf:0x0000 => 0x11
cl:0x0000, at:0x0001, di:server, mf:0x0000 => 0x14
cl:0x0000, at:0x0003, di:server, mf:0x0000 => 0x10
cl:0x0000, at:0x0004, di:server, mf:0x0000 => Konke
cl:0x0000, at:0x0005, di:server, mf:0x0000 => 3AFE101003008611
......@@ -794,11 +794,8 @@ AppPluginOption(efr32~family[M]~series[2]~device_configuration[1]~performance[A]
AppPluginOption(efr32~family[M]~series[2]~device_configuration[1]~performance[A]~radio[020]~flash[768K]~temp[I]~package[M]~pins[32]~!module+iar):EMBER_AF_PLUGIN_OTA_STORAGE_SIMPLE_EEPROM_STORAGE_START,425984
AppPluginOption(efr32~family[M]~series[2]~device_configuration[1]~performance[A]~radio[020]~flash[768K]~temp[I]~package[M]~pins[32]~!module+iar):EMBER_AF_PLUGIN_OTA_STORAGE_SIMPLE_EEPROM_STORAGE_END,778240
AppPluginOption(efr32~family[M]~series[2]~device_configuration[1]~performance[A]~radio[020]~flash[768K]~temp[I]~package[M]~pins[32]~!module+iar):EMBER_AF_PLUGIN_NETWORK_STEERING_SCAN_DURATION,3
AppPluginOption(efr32~family[M]~series[2]~device_configuration[1]~performance[A]~radio[020]~flash[768K]~temp[I]~package[M]~pins[32]~!module+iar):EMBER_APS_UNICAST_MESSAGE_COUNT,64
AppPluginOption(efr32~family[M]~series[2]~device_configuration[1]~performance[A]~radio[020]~flash[768K]~temp[I]~package[M]~pins[32]~!module+iar):EMBER_BROADCAST_TABLE_SIZE,64
AppPluginOption(efr32~family[M]~series[2]~device_configuration[1]~performance[A]~radio[020]~flash[768K]~temp[I]~package[M]~pins[32]~!module+iar):EMBER_END_DEVICE_POLL_TIMEOUT,Minutes-64
AppPluginOption(efr32~family[M]~series[2]~device_configuration[1]~performance[A]~radio[020]~flash[768K]~temp[I]~package[M]~pins[32]~!module+iar):EMBER_MAX_END_DEVICE_CHILDREN,32
AppPluginOption(efr32~family[M]~series[2]~device_configuration[1]~performance[A]~radio[020]~flash[768K]~temp[I]~package[M]~pins[32]~!module+iar):EMBER_PACKET_BUFFER_COUNT,200
AppPluginOption(efr32~family[M]~series[2]~device_configuration[1]~performance[A]~radio[020]~flash[768K]~temp[I]~package[M]~pins[32]~!module+iar):EMBER_NEIGHBOR_TABLE_SIZE,26
AppPluginOption(efr32~family[M]~series[2]~device_configuration[1]~performance[A]~radio[020]~flash[768K]~temp[I]~package[M]~pins[32]~!module+iar):EMBER_AF_PLUGIN_NETWORK_STEERING_CHANNEL_MASK,0x02108000
AppPluginOption(efr32~family[M]~series[2]~device_configuration[1]~performance[A]~radio[020]~flash[768K]~temp[I]~package[M]~pins[32]~!module+iar):EMBER_AF_PLUGIN_NVM3_FLASH_PAGES,8
......@@ -808,4 +805,7 @@ AppPluginOption(efr32~family[M]~series[2]~device_configuration[1]~performance[A]
AppPluginOption(efr32~family[M]~series[2]~device_configuration[1]~performance[A]~radio[020]~flash[768K]~temp[I]~package[M]~pins[32]~!module+iar):EMBER_AF_PLUGIN_NVM3_MAX_OBJECT_SIZE,254
AppPluginOption(efr32~family[M]~series[2]~device_configuration[1]~performance[A]~radio[020]~flash[768K]~temp[I]~package[M]~pins[32]~!module+iar):EMBER_AF_PLUGIN_REPORTING_TABLE_SIZE,62
AppPluginOption(efr32~family[M]~series[2]~device_configuration[1]~performance[A]~radio[020]~flash[768K]~temp[I]~package[M]~pins[32]~!module+iar):EMBER_AF_PLUGIN_NVM3_CACHE_SIZE,335
AppPluginOption(efr32~family[M]~series[2]~device_configuration[1]~performance[A]~radio[020]~flash[768K]~temp[I]~package[M]~pins[32]~!module+iar):EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_FIRMWARE_VERSION,0x12
AppPluginOption(efr32~family[M]~series[2]~device_configuration[1]~performance[A]~radio[020]~flash[768K]~temp[I]~package[M]~pins[32]~!module+iar):EMBER_PACKET_BUFFER_COUNT,200
AppPluginOption(efr32~family[M]~series[2]~device_configuration[1]~performance[A]~radio[020]~flash[768K]~temp[I]~package[M]~pins[32]~!module+iar):EMBER_APS_UNICAST_MESSAGE_COUNT,64
AppPluginOption(efr32~family[M]~series[2]~device_configuration[1]~performance[A]~radio[020]~flash[768K]~temp[I]~package[M]~pins[32]~!module+iar):EMBER_BROADCAST_TABLE_SIZE,64
AppPluginOption(efr32~family[M]~series[2]~device_configuration[1]~performance[A]~radio[020]~flash[768K]~temp[I]~package[M]~pins[32]~!module+iar):EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_FIRMWARE_VERSION,0x14
......@@ -90,14 +90,14 @@ def GBL():
def OTA():
if not '"%PROJECT_DIR%\..\\..\\..\\..\\..\\..\\SiliconLabs\\SimplicityStudio\\v4\\developer\\sdks\\gecko_sdk_suite\\v2.6\\protocol\\zigbee\\tool\\image-builder\\image-builder-windows.exe" --create "%TARGET_BPATH%.ota" --version 0x12 --manuf-id 0x1268 --image-type 17061 --tag-id 0x0000 --tag-file "%TARGET_BPATH%.gbl" --string "EBL kkAllInOneFloorHeatingMG21SDK665V1"':
if not '"%PROJECT_DIR%\..\\..\\..\\..\\..\\..\\SiliconLabs\\SimplicityStudio\\v4\\developer\\sdks\\gecko_sdk_suite\\v2.6\\protocol\\zigbee\\tool\\image-builder\\image-builder-windows.exe" --create "%TARGET_BPATH%.ota" --version 0x14 --manuf-id 0x1268 --image-type 17061 --tag-id 0x0000 --tag-file "%TARGET_BPATH%.gbl" --string "EBL kkAllInOneFloorHeatingMG21SDK665V1"':
sys.exit(0)
print (" ")
print ("This creates a ZigBee OTA file if the OTA Client Policy Plugin has been enabled.")
print ("It uses the parameters defined there. ")
print (" ")
# wine needed by postbuild script under studio for mac/linux
IMAGE_BUILDER = '"%PROJECT_DIR%\..\\..\\..\\..\\..\\..\\SiliconLabs\\SimplicityStudio\\v4\\developer\\sdks\\gecko_sdk_suite\\v2.6\\protocol\\zigbee\\tool\\image-builder\\image-builder-windows.exe" --create "%TARGET_BPATH%.ota" --version 0x12 --manuf-id 0x1268 --image-type 17061 --tag-id 0x0000 --tag-file "%TARGET_BPATH%.gbl" --string "EBL kkAllInOneFloorHeatingMG21SDK665V1"'.replace("\t", "\\t")
IMAGE_BUILDER = '"%PROJECT_DIR%\..\\..\\..\\..\\..\\..\\SiliconLabs\\SimplicityStudio\\v4\\developer\\sdks\\gecko_sdk_suite\\v2.6\\protocol\\zigbee\\tool\\image-builder\\image-builder-windows.exe" --create "%TARGET_BPATH%.ota" --version 0x14 --manuf-id 0x1268 --image-type 17061 --tag-id 0x0000 --tag-file "%TARGET_BPATH%.gbl" --string "EBL kkAllInOneFloorHeatingMG21SDK665V1"'.replace("\t", "\\t")
WINE_CMD = WINE.replace("cmd /C ","") if not "echo" in IMAGE_BUILDER else WINE
OTA_COMMAND = WINE_CMD + IMAGE_BUILDER
OTA_COMMAND = OTA_COMMAND.replace("%PROJECT_DIR%", PROJECT_DIR)
......
......@@ -369,7 +369,7 @@
#define CUSTOMER_APPLICATION_VERSION EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_FIRMWARE_VERSION
// User options for plugin OTA Bootload Cluster Client Policy
#define EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_IMAGE_TYPE_ID 17061
#define EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_FIRMWARE_VERSION 18
#define EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_FIRMWARE_VERSION 20
#define EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_HARDWARE_VERSION 16
#define EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_EBL_VERIFICATION
#define EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_DELETE_FAILED_DOWNLOADS
......
......@@ -42,7 +42,7 @@
// Generated attributes
#define GENERATED_ATTRIBUTES { \
{ 0x0000, ZCL_INT8U_ATTRIBUTE_TYPE, 1, (ATTRIBUTE_MASK_SINGLETON), { (uint8_t*)0x01 } }, /* 0 / Basic / ZCL version*/\
{ 0x0001, ZCL_INT8U_ATTRIBUTE_TYPE, 1, (ATTRIBUTE_MASK_SINGLETON), { (uint8_t*)0x11 } }, /* 1 / Basic / application version*/\
{ 0x0001, ZCL_INT8U_ATTRIBUTE_TYPE, 1, (ATTRIBUTE_MASK_SINGLETON), { (uint8_t*)0x14 } }, /* 1 / Basic / application version*/\
{ 0x0002, ZCL_INT8U_ATTRIBUTE_TYPE, 1, (ATTRIBUTE_MASK_SINGLETON), { (uint8_t*)0x01 } }, /* 2 / Basic / stack version*/\
{ 0x0003, ZCL_INT8U_ATTRIBUTE_TYPE, 1, (ATTRIBUTE_MASK_SINGLETON), { (uint8_t*)0x10 } }, /* 3 / Basic / hardware version*/\
{ 0x0004, ZCL_CHAR_STRING_ATTRIBUTE_TYPE, 33, (ATTRIBUTE_MASK_SINGLETON), { (uint8_t*)&(generatedDefaults[0]) } }, /* 4 / Basic / manufacturer name*/\
......
......@@ -42,7 +42,7 @@
// Generated attributes
#define GENERATED_ATTRIBUTES { \
{ 0x0000, ZCL_INT8U_ATTRIBUTE_TYPE, 1, (ATTRIBUTE_MASK_SINGLETON), { (uint8_t*)0x01 } }, /* 0 / Basic / ZCL version*/\
{ 0x0001, ZCL_INT8U_ATTRIBUTE_TYPE, 1, (ATTRIBUTE_MASK_SINGLETON), { (uint8_t*)0x11 } }, /* 1 / Basic / application version*/\
{ 0x0001, ZCL_INT8U_ATTRIBUTE_TYPE, 1, (ATTRIBUTE_MASK_SINGLETON), { (uint8_t*)0x13 } }, /* 1 / Basic / application version*/\
{ 0x0002, ZCL_INT8U_ATTRIBUTE_TYPE, 1, (ATTRIBUTE_MASK_SINGLETON), { (uint8_t*)0x01 } }, /* 2 / Basic / stack version*/\
{ 0x0003, ZCL_INT8U_ATTRIBUTE_TYPE, 1, (ATTRIBUTE_MASK_SINGLETON), { (uint8_t*)0x10 } }, /* 3 / Basic / hardware version*/\
{ 0x0004, ZCL_CHAR_STRING_ATTRIBUTE_TYPE, 33, (ATTRIBUTE_MASK_SINGLETON), { (uint8_t*)&(generatedDefaults[0]) } }, /* 4 / Basic / manufacturer name*/\
......@@ -206,12 +206,14 @@ const EmberAfGenericClusterFunction emberAfFuncArrayFanControlClusterServer[] =
#define EMBER_AF_GENERATED_PLUGIN_INIT_FUNCTION_DECLARATIONS \
void emberAfPluginEepromInitCallback(void); \
void emberAfPluginGreenPowerClientInitCallback(void); \
void emberAfPluginReportingInitCallback(void); \
void emberAfPluginCountersInitCallback(void); \
#define EMBER_AF_GENERATED_PLUGIN_INIT_FUNCTION_CALLS \
emberAfPluginEepromInitCallback(); \
emberAfPluginGreenPowerClientInitCallback(); \
emberAfPluginReportingInitCallback(); \
emberAfPluginCountersInitCallback(); \
......@@ -225,12 +227,14 @@ const EmberAfGenericClusterFunction emberAfFuncArrayFanControlClusterServer[] =
#define EMBER_AF_GENERATED_PLUGIN_STACK_STATUS_FUNCTION_DECLARATIONS \
void emberAfPluginGreenPowerClientStackStatusCallback(EmberStatus status); \
void emberAfPluginReportingStackStatusCallback(EmberStatus status); \
void emberAfPluginOtaClientStackStatusCallback(EmberStatus status); \
void emberAfPluginNetworkSteeringStackStatusCallback(EmberStatus status); \
#define EMBER_AF_GENERATED_PLUGIN_STACK_STATUS_FUNCTION_CALLS \
emberAfPluginGreenPowerClientStackStatusCallback(status); \
emberAfPluginReportingStackStatusCallback(status); \
emberAfPluginOtaClientStackStatusCallback(status); \
emberAfPluginNetworkSteeringStackStatusCallback(status); \
......@@ -271,11 +275,17 @@ const EmberAfGenericClusterFunction emberAfFuncArrayFanControlClusterServer[] =
{ 0x0019, 0x01, COMMAND_MASK_OUTGOING_CLIENT }, /* Over the Air Bootloading / QueryNextImageRequest */ \
{ 0x0019, 0x03, COMMAND_MASK_OUTGOING_CLIENT }, /* Over the Air Bootloading / ImageBlockRequest */ \
{ 0x0019, 0x06, COMMAND_MASK_OUTGOING_CLIENT }, /* Over the Air Bootloading / UpgradeEndRequest */ \
{ 0x0021, 0x00, COMMAND_MASK_INCOMING_CLIENT }, /* Green Power / GpNotificationResponse */ \
{ 0x0021, 0x01, COMMAND_MASK_INCOMING_CLIENT }, /* Green Power / GpPairing */ \
{ 0x0021, 0x02, COMMAND_MASK_INCOMING_CLIENT }, /* Green Power / GpProxyCommissioningMode */ \
{ 0x0021, 0x06, COMMAND_MASK_INCOMING_CLIENT }, /* Green Power / GpResponse */ \
{ 0x0021, 0x0A, COMMAND_MASK_INCOMING_CLIENT }, /* Green Power / GpSinkTableResponse */ \
{ 0x0021, 0x0B, COMMAND_MASK_INCOMING_CLIENT }, /* Green Power / GpProxyTableRequest */ \
{ 0x0201, 0x00, COMMAND_MASK_OUTGOING_SERVER }, /* Thermostat / CurrentWeeklySchedule */ \
{ 0x0201, 0x00, COMMAND_MASK_INCOMING_SERVER }, /* Thermostat / SetpointRaiseLower */ \
{ 0x0201, 0x01, COMMAND_MASK_OUTGOING_SERVER }, /* Thermostat / RelayStatusLog */ \
}
#define EMBER_AF_GENERATED_COMMAND_COUNT (36)
#define EMBER_AF_GENERATED_COMMAND_COUNT (42)
// Command manufacturer codes
#define GENERATED_COMMAND_MANUFACTURER_CODES { \
......
......@@ -91,6 +91,7 @@ typedef enum{
#define DisplayCharr 0x30 // r
#define DisplayCharL 0x51
#define DisplayCharo 0x33
#define DisplayCharBelowZero 0x20
......@@ -109,7 +110,7 @@ typedef enum{
typedef struct Lcd_Display_Status
{
u8 LCD_place; // 需要点亮部分位置,LCDDisplayInvalidParameter/0XFF为无效值
u16 LCD_code_data; // 参数--当前只有温度部分需要使用此参数 范围( NULL - ShowCharNumLitd ),超出此 范围无效,LCDDisplayInvalidParameter/0XFFFF为无效值
s16 LCD_code_data; // 参数--当前只有温度部分需要使用此参数 范围( NULL - ShowCharNumLitd ),超出此 范围无效,LCDDisplayInvalidParameter/0XFFFF为无效值
u8 LCD_state; // 亮、灭、闪,双闪LCDDisplayInvalidParameter/0XFF为无效值,不包括数码管1、2、3、4、5、6
u16 LCD_display_timer; // 闪烁间隔时间,单位10ms,LCDDisplayInvalidParameter/0XFFFF/NULL为无效值
u16 LCD_display_count; // 部分液晶只需要闪烁几次,一个跳变为一次,LCDDisplayInvalidParameter /0xFFFF为无效值,不使用填充无效值
......
......@@ -45,7 +45,7 @@ typedef struct
u16 set_temperature; //设置温度
s8 correct_temperature; //温度校准值
u8 system_type; //系统类型
u8 operation_mode; //运行模式
u8 operation_mode; //风机盘管模式,默认0,冷热单管
u8 wind_speed; //风速 0 关 1 低 2 中 3 高,4 开,5,自动 ,6 智能 7,中低,8 中高 ,9 超高 默认自动
u8 lock_flage; //儿童锁显示图标
u8 air_cond_type; //空调类型 1.风机盘管 2,线控器
......@@ -162,7 +162,7 @@ u8 kNetIndicatorIsBlinking(void);
void kNetIndicatorOptTrigger(uint8_t id, uint32_t duration_on_ms, uint32_t duration_off_ms, uint32_t times, u8 start, u8 end );
void kLedModuleActionDetectCallback(void );
void display_set_temp(u8 display_mode,int temp_value,u8 ararm_f);
void display_set_temp(u8 display_mode,s16 temp_value,u8 ararm_f);
void display_system_mode(u8 heat,u8 dry,u8 cold ,u8 air,u8 sleep,u8 manufture,u8 Auto,u8 Roll);
void display_wind_speed(u8 wind_speed,u8 support_type);
void display_wind_direct(u8 low,u8 mediu,u8 high);
......@@ -180,6 +180,9 @@ u8 IsLocalConfigMode(void);
u8 kAllLedIsBlinking(void);
void Display_Up_Contend(u8 device_type);
void Setup_Mode_Handle (void);
void Display_Current_Temper(s16 temper);
void Reset_Flash_Time_10s(void);
#define Operation_LED(X) Operate_Led_Button(Oled_Display_Info.screen_page,X)
#define Reload_Save_Time() do{ sBacklight.blacklight_flag = 1;\
......
......@@ -8,7 +8,7 @@ u8 g_u8slaver_addr ;
u8 Display_Num[] = {DisplayChar0,DisplayChar1,DisplayChar2,DisplayChar3,DisplayChar4,DisplayChar5,\
DisplayChar6,DisplayChar7,DisplayChar8,DisplayChar9,DisplayCharA,DisplayCharB,\
0XFF,0XFF,DisplayCharE,DisplayCharF,DisplayChar4,DisplayCharr,DisplayCharL,DisplayCharo};
0XFF,0XFF,DisplayCharE,DisplayCharF,DisplayCharBelowZero,DisplayCharr,DisplayCharL,DisplayCharo};
......@@ -669,6 +669,7 @@ void LcdControlSetting(u8 uADD, u8 uNumber )
void DelayPowerOffControlSetting(s16 time)
{
u8 temp = 0 ;
u16 data = 0;
if(time == 0x7fff) //show null
{
BL55072A_DisplayGeneral( BL55072A_SEG1, 0x07, 0 );
......@@ -682,7 +683,7 @@ void DelayPowerOffControlSetting(s16 time)
BL55072A_DisplayGeneral( BL55072A_SEG5, 0x07, 0 );
BL55072A_DisplayGeneral( BL55072A_SEG6, 0x0F, 0 );
}
else{
else if(time >=0){
temp = time/100;
LcdControlSetting(BL55072A_SEG1,temp);
......@@ -694,6 +695,20 @@ void DelayPowerOffControlSetting(s16 time)
temp = time %10;
LcdControlSetting(BL55072A_SEG5,temp);
}
else{
//显示‘-’号
BL55072A_DisplayGeneral( BL55072A_SEG1, 0x07, 0x02 );
BL55072A_DisplayGeneral( BL55072A_SEG2, 0x0F, 0x00 );
data = 65536-time;
temp = ( (data/10) %10);
LcdControlSetting(BL55072A_SEG3,temp);
LcdControlP1(1);
temp = (data %10);
LcdControlSetting(BL55072A_SEG5,temp);
}
}
u8 DelayPowerOffGetStat(void)
{
......
......@@ -386,12 +386,10 @@ static void LED_BEEP_Feedback(u8 key_id)
||((Oled_Display_Info.screen_page == 3)&&(Oled_Display_Info.FAN_Device.no_disturb_mode == 0) ) )
Spake_Start();
if(Oled_Display_Info.net_work_flage == IN_LINE)
{
kNetIndicatorOptTrigger(key_id, 200, 200, 1, 0, 1 );
}else{
if(Oled_Display_Info.net_work_flage == OUT_LINE){
kNetIndicatorOptTrigger(key_id, 200, 200, 3, 0, 1 );
}else{
kNetIndicatorOptTrigger(key_id, 200, 200, 1, 0, 1 );
}
}
void KeyProcess_Handler_Callbacks(u8 key_id,u8 KeyPressEvent)
......@@ -571,17 +569,7 @@ void Delay_OFF_Rel_Display(u8 stop_flash,u8 delay_timer,u8 dispaly_data,u8 H_cha
}
if(H_char)
{
//显示H图标
LCDShowTemp_state_t.LCD_place = H_CHAR_DISPLAY;
LCDShowTemp_state_t.LCD_state = ON;
}
else{
LCDShowTemp_state_t.LCD_place = H_CHAR_DISPLAY;
LCDShowTemp_state_t.LCD_state = OFF;
}
LcdShowCTR(LCDShowTemp_state_t);
if(bell_char){
//显示闹钟
LCDShowTemp_state_t.LCD_place = SETTING_TIMER_DISPLAY;
......@@ -731,7 +719,7 @@ static void KEY1_Botton_Process_Handler(u8 KeyPressEvent)
{
Oled_Display_Info.Air_Device.power_off_flage = 1;
Reset_DelayOFF_timer(AIR_CONDITION);
Delay_OFF_Rel_Display(1,1,Oled_Display_Info.Air_Device.power_off_time,1,1,1);
Delay_OFF_Rel_Display(1,1,Oled_Display_Info.Air_Device.power_off_time,1,1,0);
}
else
{
......@@ -793,7 +781,7 @@ static void KEY1_Botton_Process_Handler(u8 KeyPressEvent)
{
Oled_Display_Info.FLOOR_Device.power_off_flage = 1;
Reset_DelayOFF_timer(FLOOR_HEATING);
Delay_OFF_Rel_Display(1,1,Oled_Display_Info.FLOOR_Device.power_off_time,1,1,1);
Delay_OFF_Rel_Display(1,1,Oled_Display_Info.FLOOR_Device.power_off_time,1,1,0);
}
else
{
......@@ -846,7 +834,7 @@ static void KEY1_Botton_Process_Handler(u8 KeyPressEvent)
{
Oled_Display_Info.FAN_Device.power_off_flage = 1;
Reset_DelayOFF_timer(FAN);
Delay_OFF_Rel_Display(1,1,Oled_Display_Info.FAN_Device.power_off_time,1,1,1);
Delay_OFF_Rel_Display(1,1,Oled_Display_Info.FAN_Device.power_off_time,1,1,0);
}
else
{
......@@ -1217,7 +1205,8 @@ static void KEY5_Botton_Process_Handler(u8 KeyPressEvent)
{
next_speed = Get_NextOne_By_Current_Speed_Level(1,Oled_Display_Info.Air_Device.wind_speed,0);
display_wind_speed(next_speed,0);
Reset_Flash_Time_10s();
delay_confirm_fan_speed_control(1);
Oled_Display_Info.Air_Device.wind_speed = next_speed;
#if (DEV_TYPE == 0) &&(DEVICE_TYPE_AIR_CONDITION ==1)
delay_control_fan_speed_start();
......@@ -1441,6 +1430,8 @@ static void KEY6_Botton_Process_Handler(u8 KeyPressEvent)
{
next_speed = Get_NextOne_By_Current_Speed_Level(0,Oled_Display_Info.Air_Device.wind_speed,0);
display_wind_speed(next_speed,0);
Reset_Flash_Time_10s();
delay_confirm_fan_speed_control(1);
Oled_Display_Info.Air_Device.wind_speed = next_speed;
#if (DEV_TYPE == 0) &&(DEVICE_TYPE_AIR_CONDITION ==1)
delay_control_fan_speed_start();
......@@ -1893,25 +1884,29 @@ void Tap_Init(void)
Relay_Action(0x01,0x00); //继电器断开
}
}
}
Tap_Status_Scan_Task_Start();
}
#elif DEVICE_TYPE_FAN
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老化期间
{
Fan_PassbyONOFF_By_Mode_Trans(Oled_Display_Info.FAN_Device.system_type,1);
Fan_Speed_Control(Oled_Display_Info.FAN_Device.wind_speed);
if(Oled_Display_Info.FAN_Device.on_off == 1)
{
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老化期间
{
Fan_PassbyONOFF_By_Mode_Trans(Oled_Display_Info.FAN_Device.system_type,1);
Fan_Speed_Control(Oled_Display_Info.FAN_Device.wind_speed);
}
}
#endif
}
/******************************************
//新风模式切换,打开关闭旁通模式
*******************************************/
void Fan_PassbyONOFF_By_Mode_Trans(u8 system_mdoe,u8 reset_count_time)
{
#if DEVICE_TYPE_FAN
if(system_mdoe == SYSTEM_MODE_MANUAL)
{
Relay_Action(0x08,0x00);
......@@ -1928,6 +1923,7 @@ void Fan_PassbyONOFF_By_Mode_Trans(u8 system_mdoe,u8 reset_count_time)
auto_time = 0;
auto_type = 0;
}
#endif
}
/******************************************
//新风风速切换
......
......@@ -16,7 +16,7 @@ u16 wind_open_time = 330 ; //3ms
u16 temp_open_time = 200 ; //4ms
u8 wind_close_time = 250 ; //4ms
u16 wind_close_time = 250 ; //4ms
u16 temp_close_time = 250 ; //5ms
......@@ -300,6 +300,7 @@ void shtc3_sensor_measure_loop(void)
}
state_change_report(OPCODE_GENERAL_REPORT_STATUS,1);
}
abnormal_times = 0;
temp_new_data = tmep_data;
......@@ -758,42 +759,42 @@ static void record_dev_used_time(void)
***********************************************************************/
#define Spake_Continue_Time_ms 100
#define Spake_Interval_Time_ms 300
static u8 Spake_Flag = 0;
static u8 Spake_Flag = 0;
static u16 Spake_Count = 0;
static u8 LED_FLASH_Flag = 0;
static void spake_control_loop(void)
{
}
static void Spake_Control(void)
{
static u16 i = 0;
if(Spake_Flag)
{
i++;
if(Oled_Display_Info.net_work_flage == IN_LINE)
Spake_Count++;
if(Oled_Display_Info.net_work_flage != OUT_LINE)
{
if(i == 1)
if(Spake_Count == 1)
{
PWM_ConfigOutputChannel(PWM, 0, 1000, 70);
//printf("##111spake_control_loop i = %d,ON\n",i);
}
if(i == Spake_Continue_Time_ms)
if(Spake_Count == Spake_Continue_Time_ms)
{
PWM_ConfigOutputChannel(PWM, 0, 1000, 0);
i = 0;
Spake_Count = 0;
Spake_Flag = 0;
}
}
else{
if((i == 1)||(i == (Spake_Continue_Time_ms+Spake_Interval_Time_ms) ))
if((Spake_Count == 1)||(Spake_Count == (Spake_Continue_Time_ms+Spake_Interval_Time_ms) ))
{
PWM_ConfigOutputChannel(PWM, 0, 1000, 70);
}
if((i == (2*Spake_Continue_Time_ms+Spake_Interval_Time_ms) ) ||( i == Spake_Continue_Time_ms) )
if((Spake_Count == (2*Spake_Continue_Time_ms+Spake_Interval_Time_ms) ) ||( Spake_Count == Spake_Continue_Time_ms) )
{
PWM_ConfigOutputChannel(PWM, 0, 1000, 0);
if(i == 2*Spake_Continue_Time_ms+Spake_Interval_Time_ms)
if(Spake_Count == 2*Spake_Continue_Time_ms+Spake_Interval_Time_ms)
{
i = 0;
Spake_Count = 0;
Spake_Flag = 0;
}
......@@ -801,22 +802,22 @@ static void Spake_Control(void)
}
}
}
static u16 led_count = 0;
static void LED_Flash_Control(void)
{
static u16 i = 0;
if(LED_FLASH_Flag)
{
i++;
if((i == 1)||(i == 400)||(i == 800))
led_count++;
if((led_count == 1)||(led_count == 400)||(led_count == 800))
{
LED3 = 0;
}
if((i == 200)||(i == 600)||(i == 1000))
if((led_count == 200)||(led_count == 600)||(led_count == 1000))
{
LED3 = 1;
if(i == 1000)
if(led_count == 1000)
{
i = 0;
led_count = 0;
LED_FLASH_Flag = 0;
}
}
......@@ -825,6 +826,7 @@ static void LED_Flash_Control(void)
void ChildLockLedFlash(void)
{
LED_FLASH_Flag = 1;
led_count = 0;
}
extern void delay_confirm_system_mode(void);
void delay_confirm_system_control(u8 start)
......@@ -878,9 +880,7 @@ void setup_handler(void)
//未老化完成,则进入老化阶段
if(Oled_Display_Info.aging_test_flag == 0)
aging_test_start();
temp_init();
//上电显示
Detect_Human_Dispaly();
}
......@@ -1118,7 +1118,7 @@ static void delay_300ms_report_task(void)
{
delay_300ms_report_stop();
proximity_triagger_report(); //单板产测上报
if(Oled_Display_Info.net_work_flage == IN_LINE)
if(Oled_Display_Info.net_work_flage != OUT_LINE)
proximity_triagger_report_zigbee(); //整机产测上报
//printf("start report proximity_triagger event\r\n");
......@@ -1144,8 +1144,8 @@ static void task_exit_aging_test(void)
void Spake_Start(void)
{
//task_comps[3].task_switch = SWITCH_ON;
Spake_Flag = 1;
Spake_Count = 0;
}
void Ararm_Init(void)
......@@ -1603,7 +1603,7 @@ void zero_check_init(void)
#if DEVICE_TYPE_FLOOR_HEATING
wind_open_time = 330;
wind_close_time = 250;
wind_close_time = 500;
#elif DEVICE_TYPE_FAN
......@@ -1891,8 +1891,8 @@ void transparent_data_analyze(PROTOCOL_DEAL recv_data)
case _OPCODE_QUERY_NET_STATE: //网络状态查询
{
if( (kNetIndicatorIsBlinking() ) &&(((recv_data.ARG[1] == IN_LINE)&&(Oled_Display_Info.net_work_flage ==OUT_LINE ) )||
((recv_data.ARG[1] == OUT_LINE)&&(Oled_Display_Info.net_work_flage ==IN_LINE ) ))) //是否在闪烁
if( (kNetIndicatorIsBlinking() ) &&(((recv_data.ARG[1] != OUT_LINE)&&(Oled_Display_Info.net_work_flage ==OUT_LINE ) )||
((recv_data.ARG[1] == OUT_LINE)&&(Oled_Display_Info.net_work_flage != OUT_LINE ) ))) //是否在闪烁
{
memset(arg_data,0,sizeof(arg_data));
network_state_machine(recv_data.ARG[1]);
......
......@@ -308,6 +308,7 @@ void hardware_init(void)
Setup_Task_Start();
//fmc test
recover_current_state();
#if DEVICE_TYPE_FAN
if(Oled_Display_Info.aging_test_flag == 2)
{
......@@ -321,6 +322,7 @@ void hardware_init(void)
#endif
GPIO_init();
temp_init();
#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