瀏覽代碼

优化数据上传

yf_zjb 5 年之前
父節點
當前提交
a3072b7179

二進制
Application_CBD/Debug/packages/freemodbus-latest/samples/sample_mb_master.o


+ 9 - 8
Application_CBD/applications/control.c

@@ -544,27 +544,28 @@ void HK_TakePhoto(void)
 //光控测试任务
 //光控测试任务
 void SunTest(void)
 void SunTest(void)
 {
 {
-    ctr_lamp(ON);
-    while(Read_Light_Voltage()<300)
+
+    while(Read_Light_Voltage()<500)
     {
     {
         rt_thread_delay(1000);
         rt_thread_delay(1000);
     }
     }
     rt_thread_delay(3000);
     rt_thread_delay(3000);
-    while(Read_Light_Voltage()<300)
+    if(Read_Light_Voltage()<500)
     {
     {
-        device_status.sun_status = 0;   //光控状态
+        device_status.sun_status = 0;//光控状态
     }
     }
-    ctr_lamp(OFF);
-    while(Read_Light_Voltage()<300)
+    if(Read_Light_Voltage()>500)
     {
     {
         rt_thread_delay(1000);
         rt_thread_delay(1000);
     }
     }
     rt_thread_delay(3000);
     rt_thread_delay(3000);
-    while(Read_Light_Voltage()<300)
+    if(Read_Light_Voltage()>500)
     {
     {
         device_status.sun_status = 1;
         device_status.sun_status = 1;
+        ctr_lamp(OFF);
     }
     }
     HMI_WRITE("sysTest.switchSun.val=%d",0);
     HMI_WRITE("sysTest.switchSun.val=%d",0);
+    device_status.sun_test = 0;
 }
 }
 
 
 /*上电初始化*/
 /*上电初始化*/
@@ -797,7 +798,7 @@ void WorkTast(void)
     while(device_status.work_status==1&&device_status.temp_status==0&&device_status.bat_status==0&&device_status.rain_status==0&&device_status.ds==1)
     while(device_status.work_status==1&&device_status.temp_status==0&&device_status.bat_status==0&&device_status.rain_status==0&&device_status.ds==1)
     {
     {
         device_status.work_done = 0;
         device_status.work_done = 0;
-        if(clt_time==0)    DTU_Write("workstart");
+        if(clt_time==0)    DTU_Write("workstart.mp3");
         //1.打开灯管
         //1.打开灯管
         ctr_lamp(ON);
         ctr_lamp(ON);
         rt_kprintf("打开灯管!!!\n");
         rt_kprintf("打开灯管!!!\n");

+ 8 - 8
Application_CBD/applications/control.h

@@ -13,10 +13,10 @@
 #include <board.h>
 #include <board.h>
 
 
 #include <rtdevice.h>
 #include <rtdevice.h>
-#define VERSION_HK "1.11.41(HK)"         //版本
-#define VERSION_ZP "1.11.1(ZP)"         //版本
+#define VERSION_HK "1.12.41(HK)"         //版本
+#define VERSION_ZP "1.12.1(ZP)"         //版本
 
 
-#define CompileTime "20210426"
+#define CompileTime "2021514"
 
 
 /*******************************测试任务****************************************/
 /*******************************测试任务****************************************/
 /*********************************************************************/
 /*********************************************************************/
@@ -24,15 +24,13 @@
 typedef struct{
 typedef struct{
     uint8_t iSave;          //存储标志位
     uint8_t iSave;          //存储标志位
     uint8_t dtype;          //设备类型
     uint8_t dtype;          //设备类型
-
+    uint8_t photo_ws;
+    uint8_t power_status;
+    uint8_t sun_test;
     uint8_t heat_status;    //加热状态   0-关   1-开
     uint8_t heat_status;    //加热状态   0-关   1-开
-
     uint8_t lamp_status;    //灯管状态   0-关   1-开
     uint8_t lamp_status;    //灯管状态   0-关   1-开
-
     uint8_t up_status;      //上仓门状态 0-停止 1-打开 2-关闭
     uint8_t up_status;      //上仓门状态 0-停止 1-打开 2-关闭
-
     uint8_t down_status;    //下仓门状态 0-停止 1-打开 2-关闭
     uint8_t down_status;    //下仓门状态 0-停止 1-打开 2-关闭
-
     uint8_t clear_status;   //清扫状态   0-停止 1-开始
     uint8_t clear_status;   //清扫状态   0-停止 1-开始
     uint8_t shake_ws;       //震动       0-关   1-开
     uint8_t shake_ws;       //震动       0-关   1-开
     uint8_t heatvalue;
     uint8_t heatvalue;
@@ -66,6 +64,7 @@ typedef struct{
     uint8_t version_type;   //版本类型,1-转盘,4-海康
     uint8_t version_type;   //版本类型,1-转盘,4-海康
     uint8_t stop_in_bootloader;     //进入bootloader模式 1
     uint8_t stop_in_bootloader;     //进入bootloader模式 1
     uint8_t account_status;         //卡状态
     uint8_t account_status;         //卡状态
+    rt_uint32_t num_updata;            //
     rt_uint32_t rebootcnt;          //启动次数
     rt_uint32_t rebootcnt;          //启动次数
     rt_uint32_t light_over_tim;     //光控定时差秒数
     rt_uint32_t light_over_tim;     //光控定时差秒数
     rt_uint32_t data_plan;          //流量套餐
     rt_uint32_t data_plan;          //流量套餐
@@ -148,6 +147,7 @@ uint8_t ctr_led(uint8_t status_led);            //补光灯
 void calorstat(uint16_t heat_time);             //恒温
 void calorstat(uint16_t heat_time);             //恒温
 void ctr_router(uint8_t status_router);         //路由器
 void ctr_router(uint8_t status_router);         //路由器
 void turnzp(void);                              //转仓
 void turnzp(void);                              //转仓
+void Hk_Take_io(void);
 void HK_TakePhoto(void);                        //拍照
 void HK_TakePhoto(void);                        //拍照
 void ctr_photo(uint8_t status_photo);
 void ctr_photo(uint8_t status_photo);
 void ctr_RTU_DTU(uint8_t status_rtu);
 void ctr_RTU_DTU(uint8_t status_rtu);

+ 37 - 31
Application_CBD/applications/dtu_uart2.c

@@ -49,7 +49,7 @@ rt_thread_t dtu_send_data = RT_NULL;
 
 
 rt_device_t dtuserial;   /*串口设备句柄*/
 rt_device_t dtuserial;   /*串口设备句柄*/
 struct  serial_configure dtuconfig = RT_SERIAL_CONFIG_DEFAULT;  /*初始化配置参数*/
 struct  serial_configure dtuconfig = RT_SERIAL_CONFIG_DEFAULT;  /*初始化配置参数*/
-static int num_updata = 60;
+
 static uint8_t makejson_sta = 0;
 static uint8_t makejson_sta = 0;
 
 
 static int DTU_uart2_init(void)
 static int DTU_uart2_init(void)
@@ -71,6 +71,7 @@ static int DTU_uart2_init(void)
 /*数据发送*/
 /*数据发送*/
 void DTU_Write(char *fmt, ...)
 void DTU_Write(char *fmt, ...)
 {
 {
+    const char dtu_conf[4] = {device_status.vol,0x00,0x00,0x00};
     va_list arg;
     va_list arg;
     static char dtu_str[800];
     static char dtu_str[800];
     rt_size_t str_length;
     rt_size_t str_length;
@@ -80,6 +81,14 @@ void DTU_Write(char *fmt, ...)
         str_length = 800 - 1;
         str_length = 800 - 1;
 
 
     rt_device_write(dtuserial, 0, dtu_str, str_length);
     rt_device_write(dtuserial, 0, dtu_str, str_length);
+    if(strstr(dtu_str,"volume")!=RT_NULL)
+    {
+        rt_device_write(dtuserial,0,dtu_conf,4);
+    }
+    else if (strstr(dtu_str,"reset")!=RT_NULL) {
+        const char dtu_conf[4] = {7,0x00,0x00,0x00};
+        rt_device_write(dtuserial,0,dtu_conf,4);
+    }
     va_end(arg);
     va_end(arg);
     memset(dtu_str,'\0',sizeof(dtu_str));
     memset(dtu_str,'\0',sizeof(dtu_str));
 }
 }
@@ -160,44 +169,29 @@ static void dtu_thread_entry_recv(void *parameter)
 static void dtu_thread_entry_send(void *parameter)
 static void dtu_thread_entry_send(void *parameter)
 {
 {
 
 
-    static uint8_t power_sta = 1;//开机置1
-    static uint8_t dev_sta = 1;//开机置1
-    rt_thread_delay(10000);  //20S等待联网
-    if(atoi(device_status.net)==1) num_updata = 0;
-    while(1)
+    device_status.power_status = 1;
+    device_status.num_updata = 0;
+    rt_thread_delay(10000);
+    while(atoi(device_status.net)==0)
     {
     {
-                if(num_updata!=0)
+                if(device_status.num_updata!=0)
                 {
                 {
-                    num_updata --;
-//                  //屏幕休眠
-                    if(num_updata==(device_status.dattim * 60-10))
+                    device_status.num_updata--;
+                    //屏幕休眠
+                    if(device_status.num_updata==(device_status.dattim * 60-10))
                     {
                     {
                         HMI_WRITE("sleep=%d",1);
                         HMI_WRITE("sleep=%d",1);
                     }
                     }
-                    if(Read_Real_Voltage()/100<12&&power_sta==1)
+                    if(Read_Real_Voltage()/100<12&&device_status.power_status==1)
                     {
                     {
-                        rt_thread_delay(500);
-                        static char warn_power[20];
-                        sprintf(warn_power,"Power down");
-                        char * res_power_warn = makeJson_Warn(warn_power,"power");
-                        DTU_Write("%s",res_power_warn);
-                        rt_free(res_power_warn);
-                        power_sta = 0;
-                        num_updata=0;
-                        rt_thread_delay(2000);
+                        DTU_Write("%s",makeJson_Warn("power down","power"));
+                        device_status.power_status = 0;
+                        rt_thread_delay(1500);
                     }
                     }
                 }
                 }
                 else {
                 else {
                     char *readinfo =  makeJson_ReadInfo();
                     char *readinfo =  makeJson_ReadInfo();
                     LOG_I("upload data:%s\n",readinfo);
                     LOG_I("upload data:%s\n",readinfo);
-                    if(dev_sta==1)
-                    {
-                        DTU_Write("%s",makeJson_Warn("turnon", "device_stm32"));
-                        dev_sta = 0;
-                        rt_thread_delay(500);
-                    }
-                    DTU_Write("%s",readinfo);
-                    rt_thread_delay(2000);
                     UpLoad_Data();
                     UpLoad_Data();
                     rt_free(readinfo);
                     rt_free(readinfo);
                     if(atoi(device_status.fuse_voltage)<1)
                     if(atoi(device_status.fuse_voltage)<1)
@@ -209,8 +203,9 @@ static void dtu_thread_entry_send(void *parameter)
                         DTU_Write("%s",res_fuse_warn);
                         DTU_Write("%s",res_fuse_warn);
                         rt_free(res_fuse_warn);
                         rt_free(res_fuse_warn);
                     }
                     }
-                    num_updata = device_status.dattim * 60;
+                    device_status.num_updata = device_status.dattim * 60;
                     if(device_status.dattim==0) device_status.dattim=20;   //数据上传时间间隔设置为0?
                     if(device_status.dattim==0) device_status.dattim=20;   //数据上传时间间隔设置为0?
+                    if(device_status.bat_status==0) device_status.power_status = 1;     //解除欠压,清除标志位
                 }
                 }
                 rt_thread_mdelay(1000);
                 rt_thread_mdelay(1000);
     }
     }
@@ -534,6 +529,7 @@ void parseDtu(char *json_string)
     cJSON* iccid = NULL;
     cJSON* iccid = NULL;
     cJSON* imei = NULL;
     cJSON* imei = NULL;
     cJSON* sim = NULL;
     cJSON* sim = NULL;
+    cJSON* volume = NULL;
     cJSON* driver_4g = NULL;   //版本号
     cJSON* driver_4g = NULL;   //版本号
     cJSON* project = NULL;  //Project
     cJSON* project = NULL;  //Project
     cJSON* ds = NULL;   //设备状态
     cJSON* ds = NULL;   //设备状态
@@ -638,6 +634,7 @@ void parseDtu(char *json_string)
                   iccid = cJSON_GetObjectItem(item_ext,"iccid");
                   iccid = cJSON_GetObjectItem(item_ext,"iccid");
                   imei = cJSON_GetObjectItem(item_ext,"imei");
                   imei = cJSON_GetObjectItem(item_ext,"imei");
                   gps = cJSON_GetObjectItem(item_ext,"gps");
                   gps = cJSON_GetObjectItem(item_ext,"gps");
+                  volume = cJSON_GetObjectItem(item_ext,"volume");
                   mqttcfg1 = cJSON_GetObjectItem(item_ext,"mqttcfg1");
                   mqttcfg1 = cJSON_GetObjectItem(item_ext,"mqttcfg1");
                   mqttcfg2 = cJSON_GetObjectItem(item_ext,"mqttcfg2");
                   mqttcfg2 = cJSON_GetObjectItem(item_ext,"mqttcfg2");
                   //如果DTU的IMEI和FLash中的不一样,保存到FLASH
                   //如果DTU的IMEI和FLash中的不一样,保存到FLASH
@@ -703,6 +700,15 @@ void parseDtu(char *json_string)
                   else {
                   else {
                       rt_sprintf(device_status.csq,"0");
                       rt_sprintf(device_status.csq,"0");
                   }
                   }
+                  //Volume
+                  if(volume!=NULL&&atoi(volume->valuestring)>=0&&atoi(volume->valuestring)<=31)
+                  {
+                      device_status.vol = atoi(volume->valuestring);
+                      rt_kprintf("设置音量:%d\n",device_status.vol);
+                  }
+                  else {
+                      device_status.vol = 7;
+                  }
                   //NET
                   //NET
                   if (net!=NULL&&atoi(net->valuestring)>=0&&atoi(net->valuestring)<=1)
                   if (net!=NULL&&atoi(net->valuestring)>=0&&atoi(net->valuestring)<=1)
                   {
                   {
@@ -743,11 +749,11 @@ void parseDtu(char *json_string)
                   sprintf(device_status.project,"%s",project->valuestring);
                   sprintf(device_status.project,"%s",project->valuestring);
                   sprintf(device_status.mqttcfg1,"%s",mqttcfg1->valuestring);
                   sprintf(device_status.mqttcfg1,"%s",mqttcfg1->valuestring);
                   sprintf(device_status.mqttcfg2,"%s",mqttcfg2->valuestring);
                   sprintf(device_status.mqttcfg2,"%s",mqttcfg2->valuestring);
-                  if(num_updata==0)
+                  if( device_status.num_updata==0)
                   {
                   {
                       Beep_Tip(100);
                       Beep_Tip(100);
                   }
                   }
-                  else if(num_updata!=0&&device_status.hmi_fresh==2)
+                  else if(device_status.num_updata!=0&&device_status.hmi_fresh==2)
                   {
                   {
                       if(strstr(device_status.project,"A7_DTU_V3")!=RT_NULL)
                       if(strstr(device_status.project,"A7_DTU_V3")!=RT_NULL)
                       {
                       {

+ 37 - 4
Application_CBD/applications/hmi.c

@@ -218,6 +218,8 @@ static void HMI_Decode(char *cmd,uint8_t cmd_len)
         //更新加热时间
         //更新加热时间
         HMI_WRITE("workSta.heatTime.val=%d",device_status.heattime);
         HMI_WRITE("workSta.heatTime.val=%d",device_status.heattime);
         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("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);
@@ -280,7 +282,7 @@ static void HMI_Decode(char *cmd,uint8_t cmd_len)
     }
     }
     //拍照
     //拍照
     else if(strstr(rx_buffer,"putTest.switchPhoto=1")!=NULL) {
     else if(strstr(rx_buffer,"putTest.switchPhoto=1")!=NULL) {
-        HK_TakePhoto();
+        device_status.photo_ws = 1;
     }
     }
     //清扫
     //清扫
     else if (strstr(rx_buffer,"clear")!=NULL) {
     else if (strstr(rx_buffer,"clear")!=NULL) {
@@ -436,6 +438,7 @@ static void HMI_Decode(char *cmd,uint8_t cmd_len)
         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=");
         }
         }
         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)
@@ -445,7 +448,7 @@ static void HMI_Decode(char *cmd,uint8_t cmd_len)
         else {
         else {
             rt_kprintf("参数设置失败!!!\n");
             rt_kprintf("参数设置失败!!!\n");
         }
         }
-        MA_save();
+        //MA_save();
         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,"saveUploadSet=")!=NULL)
     else if(strstr(rx_buffer,"saveUploadSet=")!=NULL)
@@ -469,7 +472,8 @@ static void HMI_Decode(char *cmd,uint8_t cmd_len)
     else if(strstr(rx_buffer,"putTest.switchSun=1")!=NULL)
     else if(strstr(rx_buffer,"putTest.switchSun=1")!=NULL)
     {
     {
         rt_kprintf("光控测试!!!");
         rt_kprintf("光控测试!!!");
-        SunTest();
+        ctr_lamp(ON);
+        device_status.sun_test = 1;
     }
     }
     //恢复出厂设置电池
     //恢复出厂设置电池
     else if (strstr(rx_buffer,"resetdcDefault")!=NULL)
     else if (strstr(rx_buffer,"resetdcDefault")!=NULL)
@@ -537,6 +541,7 @@ static void Ctr_Mortor_entry(void* parameter)
    static rt_uint16_t num_up_close = 200;   //
    static rt_uint16_t num_up_close = 200;   //
    static rt_uint16_t num_down_open = 200;  //
    static rt_uint16_t num_down_open = 200;  //
    static rt_uint16_t num_down_close = 200;  //
    static rt_uint16_t num_down_close = 200;  //
+   static rt_uint16_t photo_led_sec = 450;  //45S
     while(1)
     while(1)
     {
     {
         if(device_status.ctr_up_motor==1)
         if(device_status.ctr_up_motor==1)
@@ -612,6 +617,32 @@ static void Ctr_Mortor_entry(void* parameter)
             if(ctr_clear(650)==0)
             if(ctr_clear(650)==0)
             ctr_TG_Clear(250);
             ctr_TG_Clear(250);
         }
         }
+        if(device_status.sun_test==1)
+        {
+            SunTest();
+        }
+        if(device_status.photo_ws==1)
+        {
+            //打开补光灯
+            if(photo_led_sec==100)
+            {
+                ctr_led(ON);
+                DTU_Write("takephoto.mp3");
+                //延时
+                rt_thread_delay(1000);
+                rt_kprintf("\n测试拍照!\n");
+                Hk_Take_io();
+            }
+            photo_led_sec--;
+            if(photo_led_sec==0)
+            {
+                ctr_led(OFF);
+                photo_led_sec = 100;
+                device_status.photo_ws = 0;
+                HMI_WRITE("sysTest.switchPhoto.val=0");
+                HMI_WRITE("sysTest.switchFill.val=0");
+            }
+        }
         rt_thread_delay(100);
         rt_thread_delay(100);
         //rt_kprintf("action num is:%d%d%d",num_up_open,num_up_close,num_down_open,num_down_close,num_clear);
         //rt_kprintf("action num is:%d%d%d",num_up_open,num_up_close,num_down_open,num_down_close,num_clear);
     }
     }
@@ -841,7 +872,7 @@ void Check_ParamConfig(void)
             if(tm.tm_year>=2021)
             if(tm.tm_year>=2021)
             break;
             break;
         }
         }
-
+        DTU_Write("%s",makeJson_Warn("turnon", "device_stm32"));
     }
     }
 }
 }
 void ResetParamDefault(void)
 void ResetParamDefault(void)
@@ -875,6 +906,7 @@ void ResetParamDefault(void)
     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));
+    DTU_Write("reset.mp3");
 }
 }
 void ResetParamDefault_DC(void)
 void ResetParamDefault_DC(void)
 {
 {
@@ -908,6 +940,7 @@ void ResetParamDefault_DC(void)
     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));
+    DTU_Write("reset.mp3");
 }
 }
 //固件备份
 //固件备份
 void app_partion_backup(void)
 void app_partion_backup(void)

+ 1 - 0
Application_CBD/applications/main.c

@@ -49,6 +49,7 @@ int main(void)
     LOG_I("HCLK_Frequency   = %d\n", HAL_RCC_GetHCLKFreq());
     LOG_I("HCLK_Frequency   = %d\n", HAL_RCC_GetHCLKFreq());
     LOG_I("PCLK1_Frequency  = %d\n", HAL_RCC_GetPCLK1Freq());
     LOG_I("PCLK1_Frequency  = %d\n", HAL_RCC_GetPCLK1Freq());
     LOG_I("PCLK2_Frequency  = %d\n", HAL_RCC_GetPCLK2Freq());
     LOG_I("PCLK2_Frequency  = %d\n", HAL_RCC_GetPCLK2Freq());
+    Beep_Tip(100);
     //ulog初始化
     //ulog初始化
     ulog_ef_log_lvl_set(LOG_LVL_ERROR); //设定日志保存级别,错误
     ulog_ef_log_lvl_set(LOG_LVL_ERROR); //设定日志保存级别,错误
     //读FLASH配置文件,未配置则设置默认配置                                - 完成
     //读FLASH配置文件,未配置则设置默认配置                                - 完成

+ 0 - 1
Application_CBD/applications/sht30_collect.c

@@ -168,7 +168,6 @@ static void Power_ReadCheck(void *parameter)
             device_status.bat_status = 1; //欠压
             device_status.bat_status = 1; //欠压
         }
         }
         else {
         else {
-            //power_sta = 1;
             device_status.bat_status = 0; //解除欠压
             device_status.bat_status = 0; //解除欠压
             ctr_router(ON);               //打开路由器供电
             ctr_router(ON);               //打开路由器供电
             ctr_photo(ON);                //打开相机供电
             ctr_photo(ON);                //打开相机供电

+ 6 - 5
Application_CBD/readme.md

@@ -79,8 +79,8 @@ void ymodem_ota(uint8_t argc, char **argv)
 {"cmd": "GetInfo"}>>>>={"uart": "getinfo"}
 {"cmd": "GetInfo"}>>>>={"uart": "getinfo"}
 同步消息:
 同步消息:
 	csq->valueint-----csq->valuestring
 	csq->valueint-----csq->valuestring
-	net
-	sim
+	net->valueint-----net->valuestring
+	sim->valueint-----sim->valuestring
 ## 2021-04-09-版本:1.9.41(HK)
 ## 2021-04-09-版本:1.9.41(HK)
 - 数据上传下发字段改为字符串
 - 数据上传下发字段改为字符串
 ## 2021-04-12-版本:1.9.41(HK)
 ## 2021-04-12-版本:1.9.41(HK)
@@ -94,7 +94,8 @@ static int num_updata = 60;
 - 修复开机上电的第一条数据灯管状态为异常;
 - 修复开机上电的第一条数据灯管状态为异常;
 	原因:已经进入工作状态但是灯管还未启动.
 	原因:已经进入工作状态但是灯管还未启动.
 - 修复485温湿度
 - 修复485温湿度
-
-
-
+## 2021-05-13-版本:1.11.41(HK)
+- 光控测试优化
+## 2021-05-14-版本:1.12.41(HK)
+- 数据上传优化
 
 

+ 9 - 1
CBD_FOTA_BootLoader/applications/main.c

@@ -37,7 +37,7 @@
 #define COMPILE "20210408"
 #define COMPILE "20210408"
 
 
 #define RTU_DTU GET_PIN(B,13)
 #define RTU_DTU GET_PIN(B,13)
-
+#define Beep    GET_PIN(B, 4)
 #define HMI_THREAD_PRIORITY         5          //线程优先级
 #define HMI_THREAD_PRIORITY         5          //线程优先级
 #define HMI_THREAD_STACK_SIZE       2048        //线程栈空间大小
 #define HMI_THREAD_STACK_SIZE       2048        //线程栈空间大小
 #define HMI_THREAD_TIMESLICE        5           //时间片
 #define HMI_THREAD_TIMESLICE        5           //时间片
@@ -73,6 +73,13 @@ void rt_fota_print_log(void)
     LOG_RAW("2016 - 2019 Copyright by Radiation @ warfalcon \r\n");
     LOG_RAW("2016 - 2019 Copyright by Radiation @ warfalcon \r\n");
     LOG_RAW("Version: %s build %s\r\n\r\n", RT_FOTA_SW_VERSION, __DATE__);
     LOG_RAW("Version: %s build %s\r\n\r\n", RT_FOTA_SW_VERSION, __DATE__);
 }
 }
+void Beep_Tip(uint16_t volnum)
+{
+    rt_pin_mode(Beep, PIN_MODE_OUTPUT);
+    rt_pin_write(Beep, 1);
+    rt_thread_mdelay(volnum);
+    rt_pin_write(Beep, 0);
+}
 int Ota_uart2_init(void)
 int Ota_uart2_init(void)
 {
 {
      otaserial  = rt_device_find("uart4");
      otaserial  = rt_device_find("uart4");
@@ -349,6 +356,7 @@ int main(void)
     easyflash_init();
     easyflash_init();
     rt_fota_init();
     rt_fota_init();
     HMI_Thread();
     HMI_Thread();
+    Beep_Tip(100);
     return RT_EOK;
     return RT_EOK;
 }
 }