|
@@ -222,7 +222,7 @@ static void HMI_Decode(char *cmd,uint8_t cmd_len)
|
|
|
HMI_WRITE("sysSet.jtime.val=%d",device_status.heattime);
|
|
HMI_WRITE("sysSet.jtime.val=%d",device_status.heattime);
|
|
|
//
|
|
//
|
|
|
HMI_WRITE("sysSet.vol.val=%d",device_status.vol);
|
|
HMI_WRITE("sysSet.vol.val=%d",device_status.vol);
|
|
|
- //更新加热温度
|
|
|
|
|
|
|
+ //更新加热时间和温度
|
|
|
HMI_WRITE("workSta.heatTem.val=%d",device_status.heattem);
|
|
HMI_WRITE("workSta.heatTem.val=%d",device_status.heattem);
|
|
|
HMI_WRITE("sysSet.jheat.val=%d",device_status.heatvalue);
|
|
HMI_WRITE("sysSet.jheat.val=%d",device_status.heatvalue);
|
|
|
//更新加热状态
|
|
//更新加热状态
|
|
@@ -267,6 +267,21 @@ static void HMI_Decode(char *cmd,uint8_t cmd_len)
|
|
|
HMI_WRITE("menu.net.val=1");
|
|
HMI_WRITE("menu.net.val=1");
|
|
|
HMI_WRITE("workSta.net.val=2");
|
|
HMI_WRITE("workSta.net.val=2");
|
|
|
}
|
|
}
|
|
|
|
|
+ /**********************************吸虫塔*********************************/
|
|
|
|
|
+ //更新电压
|
|
|
|
|
+ HMI_WRITE("menu.vbat.txt=\"%sV\"",device_status.voltage);
|
|
|
|
|
+ //更新震动时间
|
|
|
|
|
+ HMI_WRITE("menu.shake_sec.txt=\"%s\"",device_status.shake_sec);
|
|
|
|
|
+ //更新电流
|
|
|
|
|
+ HMI_WRITE("menu.power.txt=\"%smA\"",device_status.power);
|
|
|
|
|
+ //更新温湿度数据
|
|
|
|
|
+ HMI_WRITE("menu.envHum.val=%d",atoi(device_status.humidity));
|
|
|
|
|
+ HMI_WRITE("menu.envTem.val=%d",atoi(device_status.tempture));
|
|
|
|
|
+ //SIM卡状态
|
|
|
|
|
+ HMI_WRITE("menu.bt0.val=%d",atoi(device_status.sim));
|
|
|
|
|
+ //数据上传间隔
|
|
|
|
|
+ HMI_WRITE("menu.datt.val=%d",device_status.dattim);
|
|
|
|
|
+ /**********************************************************************/
|
|
|
}
|
|
}
|
|
|
else if (strstr(rx_buffer,"getClockData")!=NULL) {
|
|
else if (strstr(rx_buffer,"getClockData")!=NULL) {
|
|
|
//更新定时模式
|
|
//更新定时模式
|
|
@@ -289,7 +304,7 @@ static void HMI_Decode(char *cmd,uint8_t cmd_len)
|
|
|
//清扫
|
|
//清扫
|
|
|
else if (strstr(rx_buffer,"clear")!=NULL) {
|
|
else if (strstr(rx_buffer,"clear")!=NULL) {
|
|
|
rt_kprintf("\n清扫!\n");
|
|
rt_kprintf("\n清扫!\n");
|
|
|
- if(device_status.version_type==4)
|
|
|
|
|
|
|
+ if(device_status.version_type==4||device_status.version_type==41)
|
|
|
{
|
|
{
|
|
|
device_status.clear_status=1;
|
|
device_status.clear_status=1;
|
|
|
}
|
|
}
|
|
@@ -497,6 +512,7 @@ static void HMI_Decode(char *cmd,uint8_t cmd_len)
|
|
|
if(atoi(dattim_str)>=1&&atoi(dattim_str)<=120)
|
|
if(atoi(dattim_str)>=1&&atoi(dattim_str)<=120)
|
|
|
{
|
|
{
|
|
|
device_status.dattim =atoi(dattim_str); //数据上传间隔
|
|
device_status.dattim =atoi(dattim_str); //数据上传间隔
|
|
|
|
|
+ ef_set_env_blob("dattim", &device_status.dattim, sizeof(device_status.dattim));
|
|
|
MA_save();
|
|
MA_save();
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
@@ -511,6 +527,24 @@ static void HMI_Decode(char *cmd,uint8_t cmd_len)
|
|
|
ctr_lamp(ON);
|
|
ctr_lamp(ON);
|
|
|
device_status.sun_test = 1;
|
|
device_status.sun_test = 1;
|
|
|
}
|
|
}
|
|
|
|
|
+ else if (strstr(rx_buffer,"shakesec=")!=NULL)
|
|
|
|
|
+ {
|
|
|
|
|
+ static char shakesec_str[3];
|
|
|
|
|
+ rt_kprintf("震动时间设置!\n");
|
|
|
|
|
+ var = strstr(rx_buffer,"=");
|
|
|
|
|
+ var ++;
|
|
|
|
|
+ strncpy(shakesec_str,var,2);
|
|
|
|
|
+ if(atoi(shakesec_str)>=1&&atoi(shakesec_str)<=1000)
|
|
|
|
|
+ {
|
|
|
|
|
+ device_status.shake_sec =atoi(shakesec_str); //
|
|
|
|
|
+ ef_set_env_blob("shake_sec", &device_status.shake_sec, sizeof(device_status.shake_sec));
|
|
|
|
|
+ MA_save();
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ rt_kprintf("设置失败!!!\n");
|
|
|
|
|
+ }
|
|
|
|
|
+ rt_kprintf("震动时间设置:%d\n",device_status.shake_sec);
|
|
|
|
|
+ }
|
|
|
//恢复出厂设置电池
|
|
//恢复出厂设置电池
|
|
|
else if (strstr(rx_buffer,"resetdcDefault")!=NULL)
|
|
else if (strstr(rx_buffer,"resetdcDefault")!=NULL)
|
|
|
{
|
|
{
|
|
@@ -535,23 +569,82 @@ static void HMI_Decode(char *cmd,uint8_t cmd_len)
|
|
|
else if (strstr(rx_buffer,"DebugDisable")!=NULL) {
|
|
else if (strstr(rx_buffer,"DebugDisable")!=NULL) {
|
|
|
Debug_log_OFF();
|
|
Debug_log_OFF();
|
|
|
}
|
|
}
|
|
|
|
|
+ //1.0
|
|
|
else if (strstr(rx_buffer,"SwversionV1")!=NULL)
|
|
else if (strstr(rx_buffer,"SwversionV1")!=NULL)
|
|
|
{
|
|
{
|
|
|
- device_status.version_type = 1;
|
|
|
|
|
- sprintf(device_status.driver, "%s",VERSION_ZP);
|
|
|
|
|
- ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type)); //版本类型
|
|
|
|
|
- MA_save();
|
|
|
|
|
|
|
+ if(device_status.version_type != 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ device_status.version_type = 1;
|
|
|
|
|
+ sprintf(device_status.driver, "%s",VERSION_ZP);
|
|
|
|
|
+ ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type)); //版本类型
|
|
|
|
|
+ MA_save();
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- else if (strstr(rx_buffer,"SwversionV1")!=NULL) {
|
|
|
|
|
- device_status.version_type = 4;
|
|
|
|
|
- sprintf(device_status.driver, "%s",VERSION_HK);
|
|
|
|
|
- ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type)); //版本类型
|
|
|
|
|
- MA_save();
|
|
|
|
|
|
|
+ //高空
|
|
|
|
|
+ else if (strstr(rx_buffer,"SwversionV11")!=NULL)
|
|
|
|
|
+ {
|
|
|
|
|
+ if(device_status.version_type != 11)
|
|
|
|
|
+ {
|
|
|
|
|
+ device_status.version_type = 11;
|
|
|
|
|
+ sprintf(device_status.driver, "%s",VERSION_ZP);
|
|
|
|
|
+ ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type)); //版本类型
|
|
|
|
|
+ MA_save();
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ //4.0
|
|
|
|
|
+ else if (strstr(rx_buffer,"SwversionV41")!=NULL) {
|
|
|
|
|
+ if(device_status.version_type != 41)
|
|
|
|
|
+ {
|
|
|
|
|
+ device_status.version_type = 41;
|
|
|
|
|
+ sprintf(device_status.driver, "%s",VERSION_HK);
|
|
|
|
|
+ ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type)); //版本类型
|
|
|
|
|
+ MA_save();
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ //水稻
|
|
|
|
|
+ else if (strstr(rx_buffer,"SwversionV4")!=NULL) {
|
|
|
|
|
+ if(device_status.version_type != 4)
|
|
|
|
|
+ {
|
|
|
|
|
+ device_status.version_type = 4;
|
|
|
|
|
+ sprintf(device_status.driver, "%s",VERSION_HK_2000W);
|
|
|
|
|
+ ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type)); //版本类型
|
|
|
|
|
+ MA_save();
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ //吸虫塔
|
|
|
|
|
+ else if (strstr(rx_buffer,"SwversionV6")!=NULL) {
|
|
|
|
|
+ if(device_status.version_type != 6)
|
|
|
|
|
+ {
|
|
|
|
|
+ device_status.version_type = 6;
|
|
|
|
|
+ sprintf(device_status.driver, "%s",VERSION_XCT);
|
|
|
|
|
+ ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type)); //版本类型
|
|
|
|
|
+ MA_save();
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
else if(strstr(rx_buffer,"DisplayPower")!=RT_NULL)
|
|
else if(strstr(rx_buffer,"DisplayPower")!=RT_NULL)
|
|
|
{
|
|
{
|
|
|
HMI_WRITE("sysTest.sysTest_power.txt=\"%s\"",device_status.power);
|
|
HMI_WRITE("sysTest.sysTest_power.txt=\"%s\"",device_status.power);
|
|
|
}
|
|
}
|
|
|
|
|
+ //立即上传
|
|
|
|
|
+ else if(strstr(rx_buffer,"uploaddata")!=RT_NULL)
|
|
|
|
|
+ {
|
|
|
|
|
+ UpLoad_Data();
|
|
|
|
|
+ }
|
|
|
else if (strstr(rx_buffer,"checkupdate")!=NULL)
|
|
else if (strstr(rx_buffer,"checkupdate")!=NULL)
|
|
|
{
|
|
{
|
|
|
time_t now = time(RT_NULL);
|
|
time_t now = time(RT_NULL);
|
|
@@ -576,7 +669,16 @@ static void HMI_Decode(char *cmd,uint8_t cmd_len)
|
|
|
else if (strstr(rx_buffer,"reboot")!=NULL) {
|
|
else if (strstr(rx_buffer,"reboot")!=NULL) {
|
|
|
rt_hw_cpu_reset();
|
|
rt_hw_cpu_reset();
|
|
|
}
|
|
}
|
|
|
|
|
+ //屏幕上触发远程升级
|
|
|
|
|
+ else if (strstr(rx_buffer,"hmi_update")!=NULL) {
|
|
|
|
|
+ DTU_Write("hmi_update");
|
|
|
|
|
+ device_status.update_flag = 1;
|
|
|
|
|
+ ef_set_env_blob("update_flag", &device_status.update_flag, sizeof(device_status.update_flag));
|
|
|
|
|
+ rt_thread_delay(2000);
|
|
|
|
|
+ rt_hw_cpu_reset();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
//入口函数-电机控制及
|
|
//入口函数-电机控制及
|
|
|
static void Ctr_Mortor_entry(void* parameter)
|
|
static void Ctr_Mortor_entry(void* parameter)
|
|
|
{
|
|
{
|
|
@@ -610,6 +712,11 @@ static void Ctr_Mortor_entry(void* parameter)
|
|
|
num_up_open = 200;
|
|
num_up_open = 200;
|
|
|
rt_kprintf("*************************上仓门电机打开堵转!!!**********************%d\n",atoi(device_status.power));
|
|
rt_kprintf("*************************上仓门电机打开堵转!!!**********************%d\n",atoi(device_status.power));
|
|
|
}
|
|
}
|
|
|
|
|
+ //如果打开仓门1S后检测不到电流增大,则判定为异常
|
|
|
|
|
+ else if (atoi(device_status.power)<500&&num_up_open==190&&device_status.work_status==1) {
|
|
|
|
|
+ DTU_Write("%s",makeJson_Warn("UP Motor OPEN ERR","device_Up_TG"));
|
|
|
|
|
+ rt_free(makeJson_Warn("UP Motor OPEN ERR","device_Up_TG"));
|
|
|
|
|
+ }
|
|
|
if (num_up_open == 0)
|
|
if (num_up_open == 0)
|
|
|
{
|
|
{
|
|
|
ctr_cangmen_up(OFF);
|
|
ctr_cangmen_up(OFF);
|
|
@@ -626,7 +733,11 @@ static void Ctr_Mortor_entry(void* parameter)
|
|
|
num_up_close = 200;
|
|
num_up_close = 200;
|
|
|
rt_kprintf("************************上仓门电机关闭堵转!!!**********************%d\n",atoi(device_status.power));
|
|
rt_kprintf("************************上仓门电机关闭堵转!!!**********************%d\n",atoi(device_status.power));
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ //如果关闭仓门1S后检测不到电流增大,则判定为异常
|
|
|
|
|
+ else if (atoi(device_status.power)<500&&num_up_close==190&&device_status.work_status==1) {
|
|
|
|
|
+ DTU_Write("%s",makeJson_Warn("UP Motor CLOSE ERR","device_Up_TG"));
|
|
|
|
|
+ rt_free(makeJson_Warn("UP Motor CLOSE ERR","device_Up_TG"));
|
|
|
|
|
+ }
|
|
|
if (num_up_close == 0)
|
|
if (num_up_close == 0)
|
|
|
{
|
|
{
|
|
|
ctr_cangmen_up(OFF);
|
|
ctr_cangmen_up(OFF);
|
|
@@ -643,6 +754,11 @@ static void Ctr_Mortor_entry(void* parameter)
|
|
|
num_down_open = 200;
|
|
num_down_open = 200;
|
|
|
rt_kprintf("*************************下仓门电机打开堵转!!!**********************%d\n",atoi(device_status.power));
|
|
rt_kprintf("*************************下仓门电机打开堵转!!!**********************%d\n",atoi(device_status.power));
|
|
|
}
|
|
}
|
|
|
|
|
+ //如果关闭仓门1S后检测不到电流增大,则判定为异常
|
|
|
|
|
+ else if (atoi(device_status.power)<500&&num_down_open==190&&device_status.work_status==1) {
|
|
|
|
|
+ DTU_Write("%s",makeJson_Warn("Down Motor OPEN ERR","device_Down_TG"));
|
|
|
|
|
+ rt_free(makeJson_Warn("Down Motor OPEN ERR","device_Down_TG"));
|
|
|
|
|
+ }
|
|
|
if (num_down_open == 0)
|
|
if (num_down_open == 0)
|
|
|
{
|
|
{
|
|
|
ctr_cangmen_down(OFF);
|
|
ctr_cangmen_down(OFF);
|
|
@@ -659,6 +775,11 @@ static void Ctr_Mortor_entry(void* parameter)
|
|
|
num_down_close = 200;
|
|
num_down_close = 200;
|
|
|
rt_kprintf("*************************下仓门电机关闭堵转!!!**********************%d\n",atoi(device_status.power));
|
|
rt_kprintf("*************************下仓门电机关闭堵转!!!**********************%d\n",atoi(device_status.power));
|
|
|
}
|
|
}
|
|
|
|
|
+ //如果关闭仓门1S后检测不到电流增大,则判定为异常
|
|
|
|
|
+ else if (atoi(device_status.power)<500&&num_down_close==190&&device_status.work_status==1) {
|
|
|
|
|
+ DTU_Write("%s",makeJson_Warn("Down Motor CLOSE ERR","device_Down_TG"));
|
|
|
|
|
+ rt_free(makeJson_Warn("Down Motor CLOSE ERR","device_Down_TG"));
|
|
|
|
|
+ }
|
|
|
if (num_down_close == 0)
|
|
if (num_down_close == 0)
|
|
|
{
|
|
{
|
|
|
ctr_cangmen_down(OFF);
|
|
ctr_cangmen_down(OFF);
|
|
@@ -721,7 +842,7 @@ int Hmi_Fresh(void)
|
|
|
HMI_THREAD_STACK_SIZE,
|
|
HMI_THREAD_STACK_SIZE,
|
|
|
HMI_THREAD_PRIORITY,
|
|
HMI_THREAD_PRIORITY,
|
|
|
HMI_THREAD_TIMESLICE);
|
|
HMI_THREAD_TIMESLICE);
|
|
|
- /*打开上仓门的线程*/
|
|
|
|
|
|
|
+ /*部分控制的线程*/
|
|
|
ctr_motor = rt_thread_create("Ctr motor",
|
|
ctr_motor = rt_thread_create("Ctr motor",
|
|
|
Ctr_Mortor_entry,
|
|
Ctr_Mortor_entry,
|
|
|
RT_NULL,
|
|
RT_NULL,
|
|
@@ -838,8 +959,7 @@ void Check_ParamConfig(void)
|
|
|
ef_get_env_blob("passWord",&device_status.passWord,sizeof(device_status.passWord),NULL); //密码
|
|
ef_get_env_blob("passWord",&device_status.passWord,sizeof(device_status.passWord),NULL); //密码
|
|
|
ef_get_env_blob("imei",&device_status.imei,sizeof(device_status.imei),NULL); //IMEI
|
|
ef_get_env_blob("imei",&device_status.imei,sizeof(device_status.imei),NULL); //IMEI
|
|
|
ef_get_env_blob("iccid",&device_status.iccid,sizeof(device_status.iccid),NULL); //ICCID
|
|
ef_get_env_blob("iccid",&device_status.iccid,sizeof(device_status.iccid),NULL); //ICCID
|
|
|
- ef_get_env_blob("ds",&device_status.ds,
|
|
|
|
|
- sizeof(device_status.ds),NULL); //开关机状态
|
|
|
|
|
|
|
+ ef_get_env_blob("ds",&device_status.ds,sizeof(device_status.ds),NULL); //开关机状态
|
|
|
ef_get_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type),NULL); //版本类型
|
|
ef_get_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type),NULL); //版本类型
|
|
|
ef_get_env_blob("driver_bl",&device_status.driver_bl,sizeof(device_status.driver_bl),NULL); //BL版本号 进BL的时候存储到FLASH
|
|
ef_get_env_blob("driver_bl",&device_status.driver_bl,sizeof(device_status.driver_bl),NULL); //BL版本号 进BL的时候存储到FLASH
|
|
|
ef_get_env_blob("driver_compile",&device_status.driver_compile,sizeof(device_status.driver_compile),NULL); //BL版本号 进BL的时候存储到FLASH
|
|
ef_get_env_blob("driver_compile",&device_status.driver_compile,sizeof(device_status.driver_compile),NULL); //BL版本号 进BL的时候存储到FLASH
|
|
@@ -853,17 +973,29 @@ void Check_ParamConfig(void)
|
|
|
if(device_status.version_type==0)
|
|
if(device_status.version_type==0)
|
|
|
{
|
|
{
|
|
|
app_partion_backup(); //固件备份至df_area
|
|
app_partion_backup(); //固件备份至df_area
|
|
|
- device_status.version_type = 4;
|
|
|
|
|
|
|
+ device_status.version_type = 41;
|
|
|
|
|
+ rt_sprintf(device_status.driver, "%s",VERSION_HK);
|
|
|
ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type));
|
|
ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type));
|
|
|
}
|
|
}
|
|
|
- if(device_status.version_type==1)
|
|
|
|
|
|
|
+ else if(device_status.version_type==1)
|
|
|
{
|
|
{
|
|
|
rt_sprintf(device_status.driver, "%s",VERSION_ZP);
|
|
rt_sprintf(device_status.driver, "%s",VERSION_ZP);
|
|
|
}
|
|
}
|
|
|
- else if (device_status.version_type==4) {
|
|
|
|
|
|
|
+ else if (device_status.version_type==11)
|
|
|
|
|
+ {
|
|
|
|
|
+ rt_sprintf(device_status.driver, "%s",VERSION_GK);
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (device_status.version_type==4)
|
|
|
|
|
+ {
|
|
|
|
|
+ rt_sprintf(device_status.driver, "%s",VERSION_HK_2000W);
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (device_status.version_type==41) {
|
|
|
rt_sprintf(device_status.driver, "%s",VERSION_HK);
|
|
rt_sprintf(device_status.driver, "%s",VERSION_HK);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ else if (device_status.version_type==6)
|
|
|
|
|
+ {
|
|
|
|
|
+ rt_sprintf(device_status.driver, "%s",VERSION_XCT);
|
|
|
|
|
+ }
|
|
|
rt_kprintf("SOFTWARE VERSION:%s-imei:%s--iccid:%s\n",device_status.driver,device_status.imei,device_status.iccid);
|
|
rt_kprintf("SOFTWARE VERSION:%s-imei:%s--iccid:%s\n",device_status.driver,device_status.imei,device_status.iccid);
|
|
|
rt_kprintf("read flash paramconfis:%d-%s-%s\r\n",device_status.version_type,device_status.driver_bl,device_status.driver_compile);
|
|
rt_kprintf("read flash paramconfis:%d-%s-%s\r\n",device_status.version_type,device_status.driver_bl,device_status.driver_compile);
|
|
|
rt_kprintf("开机次数:%d\n",device_status.rebootcnt);
|
|
rt_kprintf("开机次数:%d\n",device_status.rebootcnt);
|
|
@@ -901,7 +1033,7 @@ void Check_ParamConfig(void)
|
|
|
Hmi_Fresh();
|
|
Hmi_Fresh();
|
|
|
dtu_data_play();
|
|
dtu_data_play();
|
|
|
sht30_collect();
|
|
sht30_collect();
|
|
|
- mb_master_samlpe();
|
|
|
|
|
|
|
+ //mb_master_samlpe();
|
|
|
uint16_t connect_num=0;
|
|
uint16_t connect_num=0;
|
|
|
//等待联网,
|
|
//等待联网,
|
|
|
while(atoi(device_status.net)==1)
|
|
while(atoi(device_status.net)==1)
|
|
@@ -916,8 +1048,6 @@ void Check_ParamConfig(void)
|
|
|
if(connect_num==180)
|
|
if(connect_num==180)
|
|
|
{
|
|
{
|
|
|
device_status.timeSwitch = 0;
|
|
device_status.timeSwitch = 0;
|
|
|
- //保存光控变量
|
|
|
|
|
- ef_set_env_blob("timeSwitch", &device_status.timeSwitch, sizeof(device_status.timeSwitch));
|
|
|
|
|
rt_kprintf("Time not set:%04d-%02d-%02d %02d:%02d:%02d\n",tm.tm_year+1900,tm.tm_mon+1,tm.tm_mday,tm.tm_hour,tm.tm_min,tm.tm_sec);
|
|
rt_kprintf("Time not set:%04d-%02d-%02d %02d:%02d:%02d\n",tm.tm_year+1900,tm.tm_mon+1,tm.tm_mday,tm.tm_hour,tm.tm_min,tm.tm_sec);
|
|
|
set_date(2020, 1, 1);
|
|
set_date(2020, 1, 1);
|
|
|
set_time(0, 0, 0);
|
|
set_time(0, 0, 0);
|
|
@@ -942,7 +1072,7 @@ void ResetParamDefault(void)
|
|
|
device_status.tph = 70; //高温保护阈值
|
|
device_status.tph = 70; //高温保护阈值
|
|
|
device_status.tpl = 5; //低温保护阈值
|
|
device_status.tpl = 5; //低温保护阈值
|
|
|
device_status.timeSwitch = 0; //定时模式
|
|
device_status.timeSwitch = 0; //定时模式
|
|
|
- device_status.heatvalue=110;//加热温度
|
|
|
|
|
|
|
+ device_status.heatvalue=110; //加热温度
|
|
|
device_status.ds = 1; //设备状态开机
|
|
device_status.ds = 1; //设备状态开机
|
|
|
device_status.thsp = 300;
|
|
device_status.thsp = 300;
|
|
|
device_status.passWord = 8888;
|
|
device_status.passWord = 8888;
|
|
@@ -956,8 +1086,8 @@ void ResetParamDefault(void)
|
|
|
ef_set_env_blob("jheat", &device_status.heatvalue, sizeof(device_status.heatvalue));
|
|
ef_set_env_blob("jheat", &device_status.heatvalue, sizeof(device_status.heatvalue));
|
|
|
ef_set_env_blob("tph", &device_status.tph, sizeof(device_status.tph));
|
|
ef_set_env_blob("tph", &device_status.tph, sizeof(device_status.tph));
|
|
|
ef_set_env_blob("tpl", &device_status.tpl, sizeof(device_status.tpl));
|
|
ef_set_env_blob("tpl", &device_status.tpl, sizeof(device_status.tpl));
|
|
|
- ef_set_env_blob("shake_ws", &device_status.shake_ws, sizeof(device_status.shake_ws)); //震动开关
|
|
|
|
|
- ef_set_env_blob("shake_sec", &device_status.shake_sec, sizeof(device_status.shake_sec)); //震动时间
|
|
|
|
|
|
|
+ ef_set_env_blob("shake_ws", &device_status.shake_ws, sizeof(device_status.shake_ws)); //震动开关
|
|
|
|
|
+ ef_set_env_blob("shake_sec", &device_status.shake_sec, sizeof(device_status.shake_sec)); //震动时间
|
|
|
ef_set_env_blob("thsp", &device_status.thsp, sizeof(device_status.thsp));
|
|
ef_set_env_blob("thsp", &device_status.thsp, sizeof(device_status.thsp));
|
|
|
ef_set_env_blob("passWord", &device_status.passWord,sizeof(device_status.passWord));
|
|
ef_set_env_blob("passWord", &device_status.passWord,sizeof(device_status.passWord));
|
|
|
DTU_Write("reset.mp3");
|
|
DTU_Write("reset.mp3");
|
|
@@ -990,7 +1120,7 @@ void ResetParamDefault_DC(void)
|
|
|
ef_set_env_blob("jheat", &device_status.heatvalue, sizeof(device_status.heatvalue));
|
|
ef_set_env_blob("jheat", &device_status.heatvalue, sizeof(device_status.heatvalue));
|
|
|
ef_set_env_blob("tph", &device_status.tph, sizeof(device_status.tph));
|
|
ef_set_env_blob("tph", &device_status.tph, sizeof(device_status.tph));
|
|
|
ef_set_env_blob("tpl", &device_status.tpl, sizeof(device_status.tpl));
|
|
ef_set_env_blob("tpl", &device_status.tpl, sizeof(device_status.tpl));
|
|
|
- ef_set_env_blob("shake_ws", &device_status.shake_ws, sizeof(device_status.shake_ws)); //震动开关
|
|
|
|
|
|
|
+ ef_set_env_blob("shake_ws", &device_status.shake_ws, sizeof(device_status.shake_ws)); //震动开关
|
|
|
ef_set_env_blob("shake_sec", &device_status.shake_sec, sizeof(device_status.shake_sec)); //震动时间
|
|
ef_set_env_blob("shake_sec", &device_status.shake_sec, sizeof(device_status.shake_sec)); //震动时间
|
|
|
ef_set_env_blob("thsp", &device_status.thsp, sizeof(device_status.thsp));
|
|
ef_set_env_blob("thsp", &device_status.thsp, sizeof(device_status.thsp));
|
|
|
ef_set_env_blob("passWord", &device_status.passWord,sizeof(device_status.passWord));
|
|
ef_set_env_blob("passWord", &device_status.passWord,sizeof(device_status.passWord));
|