Browse Source

fix date update

yf_zjb 5 years ago
parent
commit
d5646fb5e4

+ 1 - 1
Application_BZY/.settings/language.settings.xml

@@ -5,7 +5,7 @@
 			<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
 			<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
 			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
 			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
 			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
 			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
-			<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1851277576767914990" id="ilg.gnuarmeclipse.managedbuild.cross.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT ARM Cross GCC Built-in Compiler Settings " parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
+			<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-127453641507294465" id="ilg.gnuarmeclipse.managedbuild.cross.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT ARM Cross GCC Built-in Compiler Settings " parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
 				<language-scope id="org.eclipse.cdt.core.gcc"/>
 				<language-scope id="org.eclipse.cdt.core.gcc"/>
 				<language-scope id="org.eclipse.cdt.core.g++"/>
 				<language-scope id="org.eclipse.cdt.core.g++"/>
 			</provider>
 			</provider>

File diff suppressed because it is too large
+ 237 - 237
Application_CBD/.cproject


+ 1 - 1
Application_CBD/.settings/language.settings.xml

@@ -5,7 +5,7 @@
 			<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
 			<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
 			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
 			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
 			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
 			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
-			<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1817733636792884352" id="ilg.gnuarmeclipse.managedbuild.cross.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT ARM Cross GCC Built-in Compiler Settings " parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
+			<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-160997581482325103" id="ilg.gnuarmeclipse.managedbuild.cross.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT ARM Cross GCC Built-in Compiler Settings " parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
 				<language-scope id="org.eclipse.cdt.core.gcc"/>
 				<language-scope id="org.eclipse.cdt.core.gcc"/>
 				<language-scope id="org.eclipse.cdt.core.g++"/>
 				<language-scope id="org.eclipse.cdt.core.g++"/>
 			</provider>
 			</provider>

+ 0 - 415
Application_CBD/applications/control.c

@@ -553,420 +553,7 @@ void SunTest(void)
     }
     }
     HMI_WRITE("sysTest.switchSun.val=%d",0);
     HMI_WRITE("sysTest.switchSun.val=%d",0);
 }
 }
-//读取上仓门电机功耗
-void ReadUpMotorPower(uint16_t timeout)
-{
-    if(timeout>100||timeout < 0)
-    {
-        return;
-    }
-    HardWare_Init(0);
-    //读取上仓门功耗***************************************************************
-      if(device_status.up_status==1)
-      {
-          device_status.ctr_up_motor = 2;    //关闭上仓门
-      }
-      else {
-          device_status.ctr_up_motor = 1;    //打开
-    }
-      //等待5s
-      rt_kprintf("开始读取上仓门电流......\n");
-      HMI_WRITE("hardcheck.checktip.txt=\"开始读取上仓门电流...\"");
-      //当前功耗小于待机功耗+100,大于待机功耗-100,说明镇流器还未工作,阻塞至此,10s超时
-      while((atoi(device_status.power)<device_status.sleep_p+100)&&(atoi(device_status.power)>device_status.sleep_p-100))
-      {
-          timeout++;
-          rt_thread_delay(500);
-          rt_kprintf("正在读取上仓门电机电流...");
-          HMI_WRITE("hardcheck.checktip.txt=\"正在读取上仓门电机电流...\"");
-          if(timeout==20)
-          {
-              break;
-          }
-      }
-      timeout = 0;
-
-        device_status.up_motor_p = atoi(device_status.power);
-        rt_kprintf("上仓门电流:%d\n",device_status.up_motor_p);
-        ef_set_env_blob("up_motor_power", &device_status.up_motor_p, sizeof(device_status.up_motor_p));
-        HMI_WRITE("hardcheck.up_motor_p.val=%d",device_status.up_motor_p);  //减去屏幕的功耗才是待机功耗
-      //当前电流大于待机电流+100,上仓门电机还未停止
-      while(atoi(device_status.power)>device_status.sleep_p+100)
-      {
-          timeout++;
-          rt_thread_delay(500);
-          rt_kprintf("正在等待上仓门电机停止...");
-          HMI_WRITE("hardcheck.checktip.txt=\"正在等待上仓门电机停止...\"");
-          if(timeout==20)
-          {
-              break;
-          }
-      }
-      HMI_WRITE("hardcheck.checktip.txt=\"上仓门电机停止!!!\"");
-}
-//读取下仓门电机功耗
-void ReadDownMotorPower(uint16_t timeout)
-{
-    if(timeout>100||timeout < 0)
-    {
-        return;
-    }
-    HardWare_Init(0);
-    //读取下仓门功耗***************************************************************
-       if(device_status.down_status == 1)
-       {
-           device_status.ctr_down_motor = 2;
-       }
-       else {
-           device_status.ctr_down_motor = 1;
-    }
-       //等待5s
-       rt_kprintf("开始读取下仓门电流......\n");
-       HMI_WRITE("hardcheck.checktip.txt=\"开始读取下仓门电流...\"");
-       //当前功耗小于待机功耗+100,大于待机功耗-100,说明镇流器还未工作,阻塞至此,10s超时
-       while((atoi(device_status.power)<device_status.sleep_p+100)&&(atoi(device_status.power)>device_status.sleep_p-100))
-       {
-           timeout ++;
-           rt_thread_delay(500);
-           rt_kprintf("正在读取下仓门电流...");
-           HMI_WRITE("hardcheck.checktip.txt=\"正在读取下仓门电流...\"");
-           if(timeout==20)
-           {
-               break;
-           }
-       }
-       device_status.down_motor_p = atoi(device_status.power);
-       rt_kprintf("下仓门电流:%d\n",device_status.down_motor_p);
-       HMI_WRITE("hardcheck.down_motor_p.val=%d",device_status.down_motor_p);  //减去屏幕的功耗才是待机功耗
-       ef_set_env_blob("down_motor_power", &device_status.down_motor_p, sizeof(device_status.down_motor_p));
-       timeout = 0;
-       //当前电流大于待机电流+100,上仓门电机还未停止
-       while(atoi(device_status.power)>device_status.sleep_p+100)
-       {
-           timeout++;
-           rt_thread_delay(500);
-           rt_kprintf("正在等待下仓门电机停止...");
-           HMI_WRITE("hardcheck.checktip.txt=\"正在等待下仓门电机停止...\"");
-           if(timeout==20)
-           {
-               break;
-           }
-       }
-       timeout = 0;
-       HMI_WRITE("hardcheck.checktip.txt=\"下仓门电机已停止!!!\"");
-}
-//读取清扫电机功耗
-void ReadClearMortorPower(uint16_t timeout)
-{
-    if(timeout>100||timeout < 0)
-    {
-        return;
-    }
-    HardWare_Init(0);
-    //读取清扫电机功耗***************************************************************
-        device_status.clear_status = 1;
-        //等待5s
-        rt_kprintf("开始读取清扫电机电流......\n");
-        HMI_WRITE("hardcheck.checktip.txt=\"开始读取清扫电机电流...\"");
-        while((atoi(device_status.power)<device_status.sleep_p+100)&&(atoi(device_status.power)>device_status.sleep_p-100))
-        {
-            rt_kprintf("正在读取清扫电机电流......\n");
-            HMI_WRITE("hardcheck.checktip.txt=\"正在读取清扫电机电流...\"");
-            timeout ++;
-            rt_thread_delay(500);
-            if(timeout==20)
-            {
-                break;
-            }
-        }
-
-            device_status.clear_motor_p = atoi(device_status.power);
-            rt_kprintf("清扫电机电流:%d\n",device_status.clear_motor_p);
-            HMI_WRITE("hardcheck.clear_motor_p.val=%d",device_status.clear_motor_p);
-            ef_set_env_blob("clear_motor_power", &device_status.clear_motor_p, sizeof(device_status.clear_motor_p));
-        while(device_status.clear_status!=0)
-        {
-            rt_thread_delay(200);
-            rt_kprintf("等待清扫电机停止...");
-            HMI_WRITE("hardcheck.checktip.txt=\"等待清扫电机停止...\"");
-        }
-        HMI_WRITE("hardcheck.checktip.txt=\"清扫电机已停止!!!\"");
-}
-//读取镇流器功耗
-void ReadLampPower(uint16_t timeout)
-{
-    if(timeout>100||timeout < 0)
-    {
-        return;
-    }
-    HardWare_Init(0);
-    ctr_lamp(ON);
-       //
-       rt_kprintf("开始读取镇流器电流......\n");
-       while((atoi(device_status.power)<device_status.sleep_p+100)&&(atoi(device_status.power)>device_status.sleep_p-100))
-       {
-           rt_kprintf("正在读取镇流器电流......\n");
-           HMI_WRITE("hardcheck.checktip.txt=\"正在读取镇流器电流...\"");
-           timeout ++;
-           rt_thread_delay(500);
-           if(timeout==20)
-           {
-               break;
-           }
-       }
-       timeout = 0;
-       if(device_status.lamp_status==1)
-       {
-           device_status.lamp_p = atoi(device_status.power);
-           rt_kprintf("镇流器电流:%d\n",device_status.lamp_p);
-           HMI_WRITE("hardcheck.lamp_p.val=%d",device_status.lamp_p);
-           ef_set_env_blob("lamp_power", &device_status.lamp_p, sizeof(device_status.lamp_p));
-       }
-       ctr_lamp(OFF);
-       HMI_WRITE("hardcheck.checktip.txt=\"镇流器已关闭!!!\"");
-}
-//读取补光灯功耗
-void ReadLedPower(uint16_t timeout)
-{
-    if(timeout>100||timeout < 0)
-    {
-        return;
-    }
-    HardWare_Init(0);
-    ctr_led(ON);
-    rt_kprintf("开始读取补光灯电流......\n");
-    while((atoi(device_status.power)<device_status.sleep_p+100)&&(atoi(device_status.power)>device_status.sleep_p-100))
-          {
-              rt_kprintf("正在补光灯电流......\n");
-              HMI_WRITE("hardcheck.checktip.txt=\"正在读取补光灯电流...\"");
-              timeout ++;
-              rt_thread_delay(500);
-              if(timeout==20)
-              {
-                  break;
-              }
-          }
-    device_status.led_p = atoi(device_status.power);
-    rt_kprintf("补光灯电流:%d\n",device_status.led_p);
-    HMI_WRITE("hardcheck.led_p.val=%d",device_status.led_p);
-    ef_set_env_blob("led_power", &device_status.led_p, sizeof(device_status.led_p));
-    ctr_led(OFF);
-    rt_kprintf("关闭补光灯!!!");
-    HMI_WRITE("hardcheck.checktip.txt=\"补光灯已关闭!!!\"");
-}
-//读取震动电机
-void ReadShakePower(uint16_t timeout)
-{
-    if(timeout>100||timeout < 0)
-    {
-        return;
-    }
-    HardWare_Init(0);
-    ctr_shake(ON,device_status.shake_sec);
-    rt_kprintf("开始读取震动电机电流......\n");
-    while((atoi(device_status.power)<device_status.sleep_p+100)&&(atoi(device_status.power)>device_status.sleep_p-100))
-   {
-         rt_kprintf("正在读取震动电机电流......\n");
-         HMI_WRITE("hardcheck.checktip.txt=\"正在读取震动电机电流...\"");
-         timeout ++;
-         rt_thread_delay(500);
-         if(timeout==20)
-         {
-             break;
-         }
-    }
-    device_status.shake_p = atoi(device_status.power);
-    rt_kprintf("震动电机电流:%d\n",device_status.shake_p);
-    HMI_WRITE("hardcheck.shake_p.val=%d",device_status.shake_p);
-    ef_set_env_blob("shake_power", &device_status.shake_p, sizeof(device_status.shake_p));
-    ctr_shake(OFF,0);
-    rt_kprintf("关闭震动!!!");
-    HMI_WRITE("hardcheck.checktip.txt=\"震动已关闭!!!\"");
-}
-//读取加热
-void ReadHeatPower(uint16_t timeout)
-{
-    if(timeout>100||timeout < 0)
-    {
-        return;
-    }
-    HardWare_Init(0);
-    ctr_Heat(ON);
-    rt_kprintf("开始读取加热带电流......\n");
-    while((atoi(device_status.power)<device_status.sleep_p+100)&&(atoi(device_status.power)>device_status.sleep_p-100))
-          {
-              rt_kprintf("正在读取加热带电流......\n");
-              HMI_WRITE("hardcheck.checktip.txt=\"正在读取加热带电流...\"");
-              timeout ++;
-              rt_thread_delay(500);
-              if(timeout==20)
-              {
-                  break;
-              }
-          }
-    device_status.heat_p = atoi(device_status.power);
-    rt_kprintf("加热带电流:%d\n",device_status.heat_p);
-    HMI_WRITE("hardcheck.heat_p.val=%d",device_status.heat_p);
-    ef_set_env_blob("led_power", &device_status.heat_p, sizeof(device_status.heat_p));
-    ctr_Heat(OFF);
-    rt_kprintf("关闭加热带!!!\n");
-    HMI_WRITE("hardcheck.checktip.txt=\"加热带已关闭!!!\"");
-}
-//读取路由器
-void ReadRouterPower(uint16_t timeout)
-{
-    if(timeout>100||timeout < 0)
-    {
-        return;
-    }
-    HardWare_Init(0);
-    ctr_router(ON);
-    rt_kprintf("开始读取路由器电流......\n");
-    while((atoi(device_status.power)<device_status.sleep_p+100)&&(atoi(device_status.power)>device_status.sleep_p-100))
-    {
-        rt_kprintf("正在读取路由器电流......\n");
-        HMI_WRITE("hardcheck.checktip.txt=\"正在读取路由器电流...\"");
-        timeout ++;
-        rt_thread_delay(500);
-        if(timeout==20)
-        {
-           break;
-        }
-    }
-    timeout = 0;
-    device_status.router_p =  atoi(device_status.power);
-    rt_kprintf("路由器电流:%d\n",device_status.router_p);
-    HMI_WRITE("hardcheck.router_p.val=%d",device_status.router_p);
-    ef_set_env_blob("router_power", &device_status.router_p, sizeof(device_status.router_p));
-    ctr_Heat(OFF);
-    rt_kprintf("关闭路由器!!!\n");
-    HMI_WRITE("hardcheck.checktip.txt=\"路由器已关闭!!!\"");
-}
-//读取相机
-void ReadHkPower(uint16_t timeout)
-{
-    if(timeout>100||timeout < 0)
-    {
-        return;
-    }
-    HardWare_Init(0);
-    ctr_photo(ON);
-    rt_kprintf("开始读取相机电流......\n");
-    while((atoi(device_status.power)<device_status.sleep_p+100)&&(atoi(device_status.power)>device_status.sleep_p-100))
-    {
-        rt_kprintf("正在读取相机电流......\n");
-        HMI_WRITE("hardcheck.checktip.txt=\"正在读取相机电流...\"");
-        timeout ++;
-        rt_thread_delay(500);
-        if(timeout==20)
-        {
-           break;
-        }
-    }
-    timeout = 0;
-    device_status.hk_power =  atoi(device_status.power);
-    rt_kprintf("相机电流:%d\n",device_status.hk_power);
-    HMI_WRITE("hardcheck.photo_p.val=%d",device_status.hk_power);
-    ef_set_env_blob("hk_power", &device_status.hk_power, sizeof(device_status.hk_power));
-    ctr_photo(OFF);
-    rt_kprintf("关闭相机!!!\n");
-    HMI_WRITE("hardcheck.checktip.txt=\"相机已关闭!!!\"");
-}
-//读取RTU/DTU
-void ReadRtuDtuPower(uint16_t timeout)
-{
-    if(timeout>100||timeout < 0)
-    {
-        return;
-    }
-    HardWare_Init(0);
-    ctr_RTU_DTU(ON);
-    rt_kprintf("开始读RTU电流......\n");
-    while((atoi(device_status.power)<device_status.sleep_p+100)&&(atoi(device_status.power)>device_status.sleep_p-100))
-    {
-        rt_kprintf("正在读取RTU电流......\n");
-        HMI_WRITE("hardcheck.checktip.txt=\"正在读取RTU电流...\"");
-        timeout ++;
-        rt_thread_delay(500);
-        if(timeout==20)
-        {
-           break;
-        }
-    }
-    timeout = 0;
-    device_status.rtu_dtu_p =  atoi(device_status.power);
-    rt_kprintf("RTU12V电流:%d\n",device_status.rtu_dtu_p);
-    HMI_WRITE("hardcheck.rtu_p.val=%d",device_status.rtu_dtu_p);
-    ef_set_env_blob("rtu_power", &device_status.rtu_dtu_p, sizeof(device_status.rtu_dtu_p));
-    ctr_photo(OFF);
-    rt_kprintf("关闭RTU12V!!!\n");
-    HMI_WRITE("hardcheck.checktip.txt=\"RTU12V已关闭!!!\"");
-}
-//读待机功耗
-void ReadSleepPower(uint8_t boot)
-{
-    HardWare_Init(boot);
-    device_status.sleep_p = atoi(device_status.power);
-    if(device_status.sleep_p>100)
-    {
-        device_status.sleep_p = device_status.sleep_p - 60; //减去屏幕的功耗才是待机功耗
-    }
-    rt_kprintf("待机电流:%d\n",device_status.sleep_p);
-    //保存待机功耗到Flash
-    ef_set_env_blob("sleep_power", &device_status.sleep_p, sizeof(device_status.sleep_p));
-    HMI_WRITE("hardcheck.sleep_p.val=%d",device_status.sleep_p);
-}
-//
-void CheckRead_Power(void)
-{
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    ReadSleepPower(1);          //1.待机
-    HMI_WRITE("hardcheck.tip_num.val=%d",5);
-    rt_thread_delay(1000);
-//////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    ReadRouterPower(0);           //2.路由器
-    rt_thread_delay(1000);
-    HMI_WRITE("hardcheck.tip_num.val=%d",10);
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    ReadHkPower(0);               //3.相机
-    rt_thread_delay(1000);
-    HMI_WRITE("hardcheck.tip_num.val=%d",20);
-////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    ReadLampPower(0);           //4.打开镇流器
-    rt_thread_delay(1000);
-    HMI_WRITE("hardcheck.tip_num.val=%d",30);
-//////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    ReadUpMotorPower(0);        //5.打开上仓门
-    rt_thread_delay(1000);
-    HMI_WRITE("hardcheck.tip_num.val=%d",40);
-//////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    ReadDownMotorPower(0);        //6.关闭下仓门
-    rt_thread_delay(1000);
-    HMI_WRITE("hardcheck.tip_num.val=%d",50);
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    ReadHeatPower(0);             //7.加热带
-    rt_thread_delay(1000);
-    HMI_WRITE("hardcheck.tip_num.val=%d",60);
-////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    ReadClearMortorPower(0);       //8.清扫
-    rt_thread_delay(1000);
-    HMI_WRITE("hardcheck.tip_num.val=%d",70);
-////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    ReadShakePower(0);           //9.震动
-    rt_thread_delay(1000);
-    HMI_WRITE("hardcheck.tip_num.val=%d",80);
-//////////////////////////////////////////////////////////////////////////////////////////////////////////
-    ReadLedPower(0);             //10.补光灯
-    rt_thread_delay(1000);
-    HMI_WRITE("hardcheck.tip_num.val=%d",90);
-/////////////////////////////////////////////////////////////////////////////////////////////////////////
-    ReadRtuDtuPower(0);           //11.外接12V供电,(路由器/海康相机/RTU/DTU)
-    rt_thread_delay(1000);
-    HMI_WRITE("hardcheck.tip_num.val=%d",100);
 
 
-////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-}
 /*上电初始化*/
 /*上电初始化*/
 void ResetInit(void)
 void ResetInit(void)
 {
 {
@@ -1039,8 +626,6 @@ void HardWare_Check(uint8_t boot)
         //打开补光灯,读取功率值保存
         //打开补光灯,读取功率值保存
         //打开路由器/RTU供电,读取功率值保存
         //打开路由器/RTU供电,读取功率值保存
         //打开加热,读取功率值保存
         //打开加热,读取功率值保存
-        CheckRead_Power();
-
     }
     }
 
 
 }
 }

+ 17 - 3
Application_CBD/applications/dtu_uart2.c

@@ -597,15 +597,29 @@ void parseDtu(char *json_string)
                       strncpy(hour_s,datetime->valuestring+8,2);
                       strncpy(hour_s,datetime->valuestring+8,2);
                       strncpy(min_s,datetime->valuestring+10,2);
                       strncpy(min_s,datetime->valuestring+10,2);
                       strncpy(sec_s,datetime->valuestring+12,2);
                       strncpy(sec_s,datetime->valuestring+12,2);
-                      if(atoi(year_s)>2000&&atoi(year_s)<3000&&atoi(month_s)>0&&atoi(month_s)<13&&atoi(day_s)>0&&atoi(day_s)<32)
+                      if(atoi(year_s)>2020&&atoi(year_s)<3000&&atoi(month_s)>0&&atoi(month_s)<13&&atoi(day_s)>0&&atoi(day_s)<32)
                       {
                       {
                           rt_kprintf("设置时间:%d年%d月%d日\n",atoi(year_s),atoi(month_s),atoi(day_s));
                           rt_kprintf("设置时间:%d年%d月%d日\n",atoi(year_s),atoi(month_s),atoi(day_s));
-                          set_date(atoi(year_s),atoi(month_s),atoi(day_s));
+                          if(net->valueint==0)
+                          {
+                              set_date(atoi(year_s),atoi(month_s),atoi(day_s));
+                          }
+                          else {
+
+                              rt_kprintf("网络连接失败,同步时间失败!!!\n");
+                        }
                       }
                       }
                       if(atoi(hour_s)>0&&atoi(hour_s)<=24&&atoi(min_s)>=0&&atoi(min_s)<=60&&atoi(sec_s)>=0&&atoi(sec_s)<=60)
                       if(atoi(hour_s)>0&&atoi(hour_s)<=24&&atoi(min_s)>=0&&atoi(min_s)<=60&&atoi(sec_s)>=0&&atoi(sec_s)<=60)
                       {
                       {
                           rt_kprintf("设置时间:%d时%d分%d秒\n",atoi(hour_s),atoi(min_s),atoi(sec_s));
                           rt_kprintf("设置时间:%d时%d分%d秒\n",atoi(hour_s),atoi(min_s),atoi(sec_s));
-                          set_time(atoi(hour_s),atoi(min_s),atoi(sec_s));
+                          if(net->valueint==0)
+                          {
+                              set_time(atoi(hour_s),atoi(min_s),atoi(sec_s));
+                          }
+                          else {
+
+                              rt_kprintf("网络连接失败,同步时间失败!!!\n");
+                        }
                       }
                       }
                       rt_kprintf("参数同步:\nlat:%s\nlng:%s\n",lat->valuestring,lng->valuestring);
                       rt_kprintf("参数同步:\nlat:%s\nlng:%s\n",lat->valuestring,lng->valuestring);
                   if(sim->valueint==0)
                   if(sim->valueint==0)

+ 18 - 16
Application_CBD/applications/hmi.c

@@ -28,7 +28,7 @@
 #include <shell.h>
 #include <shell.h>
 #include "dtu_uart2.h"
 #include "dtu_uart2.h"
 #include <fal.h>
 #include <fal.h>
-#define HMI_THREAD_PRIORITY         26          //线程优先级
+#define HMI_THREAD_PRIORITY         24          //线程优先级
 #define HMI_THREAD_STACK_SIZE       2048        //线程栈空间大小
 #define HMI_THREAD_STACK_SIZE       2048        //线程栈空间大小
 #define HMI_THREAD_TIMESLICE        10           //时间片
 #define HMI_THREAD_TIMESLICE        10           //时间片
 
 
@@ -67,7 +67,7 @@ static int HMI_uart4_init(void)
 {
 {
     serial  = rt_device_find(UART_NAME);
     serial  = rt_device_find(UART_NAME);
     /*修改串口配置参数*/
     /*修改串口配置参数*/
-    config.baud_rate = BAUD_RATE_9600;  //修改波特率9600
+    config.baud_rate = BAUD_RATE_115200;  //修改波特率9600
     config.data_bits = DATA_BITS_8;     //数据位8
     config.data_bits = DATA_BITS_8;     //数据位8
     config.stop_bits = STOP_BITS_1;     //停止位1
     config.stop_bits = STOP_BITS_1;     //停止位1
     config.bufsz = 512;                 //缓冲区128字节
     config.bufsz = 512;                 //缓冲区128字节
@@ -160,8 +160,7 @@ static void HMI_Decode(char *cmd,uint8_t cmd_len)
             DTU_Write("%s",readinfo);
             DTU_Write("%s",readinfo);
             list_mem();
             list_mem();
             device_status.hmi_fresh = 1;
             device_status.hmi_fresh = 1;
-
-
+            rt_thread_delay(100);
         }
         }
         rt_free(readinfo);
         rt_free(readinfo);
         device_status.refresh_num--;
         device_status.refresh_num--;
@@ -200,18 +199,6 @@ static void HMI_Decode(char *cmd,uint8_t cmd_len)
         HMI_WRITE("workSta.rainStatus.val=%d",device_status.rain_status);
         HMI_WRITE("workSta.rainStatus.val=%d",device_status.rain_status);
         //更新光控状态
         //更新光控状态
         HMI_WRITE("workSta.sunStatus.val=%d",device_status.sun_status);
         HMI_WRITE("workSta.sunStatus.val=%d",device_status.sun_status);
-        //更新联网状态
-        if(device_status.net==1)
-        {
-            HMI_WRITE("workSta.net.val=1");
-        }
-        else {
-            HMI_WRITE("workSta.net.val=0");
-        }
-        if(device_status.csq==1)
-        {
-            HMI_WRITE("workSta.net.val=2");
-        }
         //更新CSQ
         //更新CSQ
         static char csq_str[10];
         static char csq_str[10];
         itoa(device_status.csq,csq_str,10);
         itoa(device_status.csq,csq_str,10);
@@ -252,6 +239,21 @@ static void HMI_Decode(char *cmd,uint8_t cmd_len)
         HMI_WRITE("uploadSet.datt.val=%d",device_status.dattim);
         HMI_WRITE("uploadSet.datt.val=%d",device_status.dattim);
         //语音音量
         //语音音量
         HMI_WRITE("sysSet.vol.val=%d",device_status.vol);
         HMI_WRITE("sysSet.vol.val=%d",device_status.vol);
+        //更新联网状态
+        if(device_status.net==1)
+        {
+            HMI_WRITE("menu.net.val=1");
+            HMI_WRITE("workSta.net.val=1");
+        }
+        else {
+            HMI_WRITE("workSta.net.val=0");
+            HMI_WRITE("menu.net.val=0");
+        }
+        if(device_status.csq==1)
+        {
+            HMI_WRITE("menu.net.val=1");
+            HMI_WRITE("workSta.net.val=2");
+        }
     }
     }
     else if (strstr(rx_buffer,"getClockData")!=NULL) {
     else if (strstr(rx_buffer,"getClockData")!=NULL) {
         //更新定时模式
         //更新定时模式

+ 9 - 6
Application_CBD/applications/main.c

@@ -24,17 +24,20 @@
 #include <ledblink.h>
 #include <ledblink.h>
 #include <beep.h>
 #include <beep.h>
 #define WDT_DEVICE_NAME    "wdt"    /* 看门狗设备名称 */
 #define WDT_DEVICE_NAME    "wdt"    /* 看门狗设备名称 */
-/*********************************************************************/
+/********************************************************************/
 static rt_device_t wdg_dev;    /* 看门狗设备句柄 */
 static rt_device_t wdg_dev;    /* 看门狗设备句柄 */
 Device_Status_typedef device_status;
 Device_Status_typedef device_status;
-/*****************LED thread************************************/
+/*****************LED thread*****************************************/
 /*栈空间地址对齐*/
 /*栈空间地址对齐*/
 ALIGN(RT_ALIGN_SIZE)
 ALIGN(RT_ALIGN_SIZE)
-/******************************************************/
+/********************************************************************/
+//外部函数声明,消除警告信息
+int mb_master_samlpe(void);
+int memtrace();
 /********************************************************************/
 /********************************************************************/
 static int wdt_init(void);
 static int wdt_init(void);
 static void idle_hook(void);
 static void idle_hook(void);
-/******************************************************************/
+/********************************************************************/
 int main(void)
 int main(void)
 {
 {
     /* 初始化设备 */
     /* 初始化设备 */
@@ -51,7 +54,7 @@ int main(void)
     //读FLASH配置文件,未配置则设置默认配置                                - 完成
     //读FLASH配置文件,未配置则设置默认配置                                - 完成
     //判断RTC时间是否设置
     //判断RTC时间是否设置
     Check_ParamConfig();
     Check_ParamConfig();
-    //远程更新判断
+    //是否触发固件更新
     if(device_status.update_flag==0)
     if(device_status.update_flag==0)
     {
     {
         //屏幕初始化
         //屏幕初始化
@@ -64,11 +67,11 @@ int main(void)
         //工作状态置位线程
         //工作状态置位线程
         Workstatus_check();
         Workstatus_check();
         /***************/
         /***************/
+        //工作流程
         Work_Loop_Task();
         Work_Loop_Task();
         /*******************/
         /*******************/
         //数据透传
         //数据透传
         dtu_data_play();
         dtu_data_play();
-
     }
     }
     //看门狗初始化
     //看门狗初始化
      wdt_init();
      wdt_init();

+ 5 - 1
Application_CBD/readme.md

@@ -43,4 +43,8 @@ void ymodem_ota(uint8_t argc, char **argv)
 - 修复开机操作屏幕启动异常,解决办法:
 - 修复开机操作屏幕启动异常,解决办法:
 使用INIT_BOARD_EXPORT(fn)初始化屏幕串口,非常早期的初始化,此时调度器还未启动
 使用INIT_BOARD_EXPORT(fn)初始化屏幕串口,非常早期的初始化,此时调度器还未启动
 ## 2021-03-24-版本:1.5.41(HK)
 ## 2021-03-24-版本:1.5.41(HK)
-- 工作过程中触发欠压,温控,雨控.关闭灯管.
+- 工作过程触发雨控流程优化,触发雨控关闭上下仓门,灯管,加热带,响应时间1s.
+## 2021-03-25-版本:1.5.41(HK)
+- HMI_THREAD_PRIORITY         26>24          //线程优先级
+## 2021-03-26-版本:1.5.41(HK)
+- 屏幕串口4波特率修改,9600>115200

+ 1 - 1
CBD_FOTA_BootLoader/.settings/language.settings.xml

@@ -5,7 +5,7 @@
 			<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
 			<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
 			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
 			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
 			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
 			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
-			<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1810423657937294051" id="ilg.gnuarmeclipse.managedbuild.cross.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT ARM Cross GCC Built-in Compiler Settings " parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
+			<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-168307560337915404" id="ilg.gnuarmeclipse.managedbuild.cross.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT ARM Cross GCC Built-in Compiler Settings " parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
 				<language-scope id="org.eclipse.cdt.core.gcc"/>
 				<language-scope id="org.eclipse.cdt.core.gcc"/>
 				<language-scope id="org.eclipse.cdt.core.g++"/>
 				<language-scope id="org.eclipse.cdt.core.g++"/>
 			</provider>
 			</provider>