|
@@ -134,7 +134,7 @@ static rt_err_t uart_input(rt_device_t dev, rt_size_t size)
|
|
|
if ( result == -RT_EFULL)
|
|
if ( result == -RT_EFULL)
|
|
|
{
|
|
{
|
|
|
/* 消息队列满 */
|
|
/* 消息队列满 */
|
|
|
- LOG_I("hmi message queue full!\n");
|
|
|
|
|
|
|
+ LOG_E("hmi message queue full!\n");
|
|
|
}
|
|
}
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
@@ -947,7 +947,6 @@ static void HMI_Decode(void)
|
|
|
rt_free(json_temp);
|
|
rt_free(json_temp);
|
|
|
rt_thread_delay(2000);
|
|
rt_thread_delay(2000);
|
|
|
MA_save();
|
|
MA_save();
|
|
|
- rt_free(var);
|
|
|
|
|
rt_kprintf("工作时间参数已保存:模式-%d,光控时间-%d,时控开始时间-%d,时控结束时间-%d\n",device_status.timeSwitch,device_status.sunBar,device_status.startBar,device_status.stopBar);
|
|
rt_kprintf("工作时间参数已保存:模式-%d,光控时间-%d,时控开始时间-%d,时控结束时间-%d\n",device_status.timeSwitch,device_status.sunBar,device_status.startBar,device_status.stopBar);
|
|
|
}
|
|
}
|
|
|
else if (strstr(rx_buffer,"saveSystemSet")!=NULL) {
|
|
else if (strstr(rx_buffer,"saveSystemSet")!=NULL) {
|
|
@@ -1024,34 +1023,36 @@ static void HMI_Decode(void)
|
|
|
strncpy(heattime_str,var+2,2);
|
|
strncpy(heattime_str,var+2,2);
|
|
|
if(atoi(heattime_str)>0 && atoi(heattime_str) <= 30)
|
|
if(atoi(heattime_str)>0 && atoi(heattime_str) <= 30)
|
|
|
{
|
|
{
|
|
|
- rt_kprintf("加热时间:%d\n",atoi(heattime_str));
|
|
|
|
|
device_status.heattime = atoi(heattime_str); //加热时间
|
|
device_status.heattime = atoi(heattime_str); //加热时间
|
|
|
|
|
+ LOG_I("设置加热时间:%d",atoi(heattime_str));
|
|
|
ef_set_env_blob("jtime", &device_status.heattime, sizeof(device_status.heattime));
|
|
ef_set_env_blob("jtime", &device_status.heattime, sizeof(device_status.heattime));
|
|
|
}
|
|
}
|
|
|
strncpy(heatvale_str,var+4,3);
|
|
strncpy(heatvale_str,var+4,3);
|
|
|
if(atoi(heatvale_str) > 0 && atoi(heatvale_str) <= 130)
|
|
if(atoi(heatvale_str) > 0 && atoi(heatvale_str) <= 130)
|
|
|
{
|
|
{
|
|
|
device_status.heatvalue=atoi(heatvale_str);
|
|
device_status.heatvalue=atoi(heatvale_str);
|
|
|
|
|
+ LOG_I("设置加热温度:%d",device_status.heatvalue);
|
|
|
ef_set_env_blob("jheat", &device_status.heatvalue, sizeof(device_status.heatvalue));
|
|
ef_set_env_blob("jheat", &device_status.heatvalue, sizeof(device_status.heatvalue));
|
|
|
}
|
|
}
|
|
|
strncpy(vol_str,var+7,3);
|
|
strncpy(vol_str,var+7,3);
|
|
|
if(atoi(vol_str)>0&&atoi(vol_str)<8)
|
|
if(atoi(vol_str)>0&&atoi(vol_str)<8)
|
|
|
{
|
|
{
|
|
|
device_status.vol = atoi(vol_str); //音量
|
|
device_status.vol = atoi(vol_str); //音量
|
|
|
- DTU_Write("volume=");
|
|
|
|
|
|
|
+ LOG_I("设置音量:%d",device_status.vol);
|
|
|
|
|
+ //DTU_Write("volume=");
|
|
|
}
|
|
}
|
|
|
strncpy(thsp_str,var+10,4);
|
|
strncpy(thsp_str,var+10,4);
|
|
|
if(atoi(thsp_str)>0&&atoi(thsp_str)<3600)
|
|
if(atoi(thsp_str)>0&&atoi(thsp_str)<3600)
|
|
|
{
|
|
{
|
|
|
device_status.thsp = atoi(thsp_str); //熄屏时间
|
|
device_status.thsp = atoi(thsp_str); //熄屏时间
|
|
|
|
|
+ LOG_I("设置熄屏时间:%d",device_status.thsp);
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
- rt_kprintf("参数设置失败!!!\n");
|
|
|
|
|
|
|
+ LOG_E("参数设置失败!!!");
|
|
|
}
|
|
}
|
|
|
rt_thread_delay(1000);
|
|
rt_thread_delay(1000);
|
|
|
MA_save();
|
|
MA_save();
|
|
|
- rt_free(var);
|
|
|
|
|
- rt_kprintf("系统设置已保存:收集时间-%d,加热时间-%d,加热温度-%d,音量-%d,自动关屏-%d\n",device_status.clt_time,device_status.heattime,device_status.heatvalue,device_status.vol,device_status.thsp);
|
|
|
|
|
|
|
+ //rt_kprintf("系统设置已保存:收集时间-%d,加热时间-%d,加热温度-%d,音量-%d,自动关屏-%d\n",device_status.clt_time,device_status.heattime,device_status.heatvalue,device_status.vol,device_status.thsp);
|
|
|
}
|
|
}
|
|
|
else if (strstr(rx_buffer,"rtc_h=")!=NULL) {
|
|
else if (strstr(rx_buffer,"rtc_h=")!=NULL) {
|
|
|
char rtc_h[2];
|
|
char rtc_h[2];
|
|
@@ -1099,7 +1100,6 @@ static void HMI_Decode(void)
|
|
|
else {
|
|
else {
|
|
|
rt_kprintf("设置失败!!!\n");
|
|
rt_kprintf("设置失败!!!\n");
|
|
|
}
|
|
}
|
|
|
- rt_free(var);
|
|
|
|
|
rt_kprintf("数据上传设置:%d\n",device_status.dattim);
|
|
rt_kprintf("数据上传设置:%d\n",device_status.dattim);
|
|
|
}
|
|
}
|
|
|
//光控测试
|
|
//光控测试
|
|
@@ -1123,7 +1123,7 @@ static void HMI_Decode(void)
|
|
|
else {
|
|
else {
|
|
|
LOG_E("设置失败!!!");
|
|
LOG_E("设置失败!!!");
|
|
|
}
|
|
}
|
|
|
- rt_free(var);
|
|
|
|
|
|
|
+
|
|
|
LOG_D("震动时间设置:%d",device_status.shake_sec);
|
|
LOG_D("震动时间设置:%d",device_status.shake_sec);
|
|
|
}
|
|
}
|
|
|
//切换大数据平台
|
|
//切换大数据平台
|
|
@@ -1852,7 +1852,7 @@ static void Ctr_Mortor_entry(void* parameter)
|
|
|
int Hmi_Fresh(void)
|
|
int Hmi_Fresh(void)
|
|
|
{
|
|
{
|
|
|
//初始化串口4
|
|
//初始化串口4
|
|
|
- HMI_uart4_init();
|
|
|
|
|
|
|
+ //HMI_uart4_init();
|
|
|
rt_err_t ret = RT_EOK;
|
|
rt_err_t ret = RT_EOK;
|
|
|
/* 初始化消息队列 */
|
|
/* 初始化消息队列 */
|
|
|
rt_mq_init(&rx_mq, "rx_mq",
|
|
rt_mq_init(&rx_mq, "rx_mq",
|
|
@@ -2203,6 +2203,18 @@ void Check_ParamConfig(void)
|
|
|
if(device_status.version_type==6) device_status.timeSwitch = 1;
|
|
if(device_status.version_type==6) device_status.timeSwitch = 1;
|
|
|
DTU_Write("%s",makeJson_Warn("turnon", "device_stm32"));
|
|
DTU_Write("%s",makeJson_Warn("turnon", "device_stm32"));
|
|
|
rt_thread_delay(1000);
|
|
rt_thread_delay(1000);
|
|
|
|
|
+ if(device_status.dtype!=7&&device_status.version_type!=30)
|
|
|
|
|
+ {
|
|
|
|
|
+ Workstatus_check();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /********************/
|
|
|
|
|
+ //工作流程
|
|
|
|
|
+ if(device_status.version_type!=30)
|
|
|
|
|
+ {
|
|
|
|
|
+ Work_Loop_Task();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
#endif
|
|
#endif
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -2417,4 +2429,4 @@ void Debug_log_OFF(void)
|
|
|
MSH_CMD_EXPORT(Debug_log_ON,Debug_log_ON);
|
|
MSH_CMD_EXPORT(Debug_log_ON,Debug_log_ON);
|
|
|
MSH_CMD_EXPORT(Debug_log_OFF,Debug_log_OFF);
|
|
MSH_CMD_EXPORT(Debug_log_OFF,Debug_log_OFF);
|
|
|
//
|
|
//
|
|
|
-//INIT_BOARD_EXPORT(HMI_uart4_init);
|
|
|
|
|
|
|
+INIT_BOARD_EXPORT(HMI_uart4_init);
|