zhunk 2 лет назад
Родитель
Сommit
b30c1e6a1d

Разница между файлами не показана из-за своего большого размера
+ 6 - 1
Application_CBD/.cproject


+ 42 - 6
Application_CBD/applications/control.c

@@ -8,7 +8,6 @@
  * Date           Author       Notes
  * 2020-05-30     Administrator       the first version
  */
-
 #include "beep.h"
 #include "hmi.h"
 #include "easyflash.h"
@@ -38,6 +37,27 @@ rt_thread_t tid_workloop = RT_NULL;
 rt_thread_t tid_wkstc = RT_NULL;
 rt_thread_t tid_ctr = RT_NULL;
 rt_thread_t tid_heat = RT_NULL;
+
+/***************************************************************************/
+
+
+
+int thread_delete_workloop(void)
+{
+    rt_err_t result;
+    if(tid_workloop!=RT_NULL)
+    {
+        result = rt_thread_delete(tid_workloop);
+    }
+    return result;
+}
+
+int thread_restart_workloop(void)
+{
+    rt_err_t result;
+    result = Work_Loop_Task();
+    return result;
+}
 /**************************1.0定制2000W*************************************/
 uint8_t ctr_Fan_PUT(uint8_t status_ws)
 {
@@ -2599,7 +2619,8 @@ static void Control_Clear_thread_entry(void *parameter)
             }
 
         }
-        if(device_status.selfcheck_ws==0){
+        if(device_status.selfcheck_ws==0)
+        {
             selfcheck_cnt = 0;
         }
         if(device_status.clear_status==1)
@@ -2615,7 +2636,6 @@ static void Control_Clear_thread_entry(void *parameter)
 /*入口函数加热*/
 static void Control_Heat_thread_entry(void *parameter)
 {
-
     uint16_t var_clear = 0;
     #if ROBOT_EN == 1
     static uint8_t key_on = 0;
@@ -2631,7 +2651,7 @@ static void Control_Heat_thread_entry(void *parameter)
     {
         #if ROBOT_EN == 1
         //磁悬浮供电
-        //监测磁悬浮限位位置`
+        //监测磁悬浮限位位置
         LOG_D("Read 磁悬浮:%d",device_status.heattem);
         //等待10S
         if(device_status.heattem<30&&Read_Real_Voltage()/100>12)   //磁悬浮处于关闭状态
@@ -2699,6 +2719,20 @@ static void Control_Heat_thread_entry(void *parameter)
                 ctr_cangmen_down(OFF);
             }
         }
+        if(device_status.selfcheck_ws==2)
+        {
+            static int total_seconds = 200;
+            static int current_second = 0;
+            while(current_second <= total_seconds)
+            {
+                int process = (current_second * 100) / total_seconds;
+                device_status.process = process / 100.0;
+                LOG_I("process:%d",process);
+                HMI_WRITE("selfcheck.s106.val=%d",process);
+                rt_thread_delay(1000);
+                current_second++;
+            }
+        }
         rt_thread_delay(1000);
         #endif
         #endif
@@ -2753,6 +2787,7 @@ int Workstatus_check(void)
 /*工作流程线程*/
 int Work_Loop_Task(void)
 {
+    rt_err_t result_loop;
     /* 创建线程*/
     tid_workloop = rt_thread_create("work_loop_thread",
                                 Work_Loop_thread_entry, RT_NULL,
@@ -2762,12 +2797,13 @@ int Work_Loop_Task(void)
     #if Color_EN == 0
     if(tid_workloop!=RT_NULL)
     {
-        rt_thread_startup(tid_workloop);
+        result_loop = rt_thread_startup(tid_workloop);
     }
     #endif
-    return 0;
+    return result_loop;
 }
 MSH_CMD_EXPORT(HardWare_Check,HardWare_Check<ON|OFF>);
 MSH_CMD_EXPORT(ctr_lamp,ctr_lamp<ON|OFF>);
 MSH_CMD_EXPORT(ctr_clear,ctr_clear<ON|OFF>);
 MSH_CMD_EXPORT(ctr_led,sample:ctr_led <ON|OFF>);
+INIT_APP_EXPORT(Control_heat);

+ 8 - 1
Application_CBD/applications/control.h

@@ -118,7 +118,7 @@ typedef struct  _packed
     uint8_t camsta;          //拍照报警,0正常,1异常
     uint8_t heat_sta;        //加热报警0-正常,1-异常
     uint8_t led_sta;         //补光灯报警0-正常,1-异常
-    uint8_t selfcheck_ws;    //自检开关
+    uint8_t selfcheck_ws;    //自检开关1-北大荒,2-标配
     #if BOOT_ERR == 1
     uint8_t gps_inuse;
     uint8_t gps_view;
@@ -126,12 +126,14 @@ typedef struct  _packed
     uint16_t dattim;         //数据上传间隔
     uint16_t shake_sec;      //震动时间
     uint16_t thsp;           //息屏时间
+    uint16_t C01;            //故障码
     rt_uint32_t num_updata;         //
     rt_uint32_t rebootcnt;          //启动次数
     rt_uint32_t light_over_tim;     //光控定时差秒数,镇流器的结束时间
     rt_uint32_t data_plan;          //流量套餐
     rt_uint32_t expiry_date;        //到期时间
     int passWord;              //初始密码
+    double process;
     long photo_stamp;           //采集时间戳
     const char *coll_time[10];
     char mqttcfg1[64];         //
@@ -326,4 +328,9 @@ int Control_clear(void);
 int Workstatus_check(void);
 int Work_Loop_Task(void);
 int Control_heat(void);
+
+
+int thread_delete_workloop(void);
+int thread_restart_workloop(void);
+
 #endif /* APPLICATIONS_INC_CONTROL_H_ */

+ 61 - 3
Application_CBD/applications/dtu_uart2.c

@@ -22,6 +22,7 @@
 #include "sound.h"
 #include <ymodem.h>
 #include "beep.h"
+#include <selfcheck.h>
 #define DBG_ENABLE
 #define DBG_COLOR
 #define DBG_TAG "dtu"
@@ -625,6 +626,37 @@ char *makeJson_Cam(char * s,char *t)
     cJSON_Delete(wJsonRoot);
     return w;
 }
+
+char *makeJson_C01_Warn(uint16_t code,double process)
+{
+    cJSON * pJsonRoot = NULL;
+    pJsonRoot = cJSON_CreateObject();
+    if(NULL==pJsonRoot)
+    {
+        LOG_E("cJSON pJsonRoot NULL!!!");
+        return NULL;
+    }
+    cJSON_AddStringToObject(pJsonRoot, "cmd", "warn");
+    cJSON * pubstring = NULL;
+    pubstring = cJSON_CreateObject();
+    if(NULL==pubstring)
+    {
+        rt_kprintf("cJSON pubstring NULL!!!\n");
+        return NULL;
+    }
+    cJSON_AddItemToObject(pJsonRoot, "ext", pubstring);
+    cJSON_AddNumberToObject(pubstring, "C01", code);//
+    cJSON_AddNumberToObject(pubstring, "process", process);//
+    char * w = cJSON_PrintUnformatted(pJsonRoot);
+    if(NULL == w)
+    {
+        cJSON_Delete(pJsonRoot);
+        LOG_E("wJsonRoot cJSON_Delete NULL!!!\n");
+        return NULL;
+    }
+    cJSON_Delete(pJsonRoot);
+    return w;
+}
 /*生成JSON数据*/
 char * makeJson()
 {
@@ -1019,7 +1051,6 @@ int parseDtu(char *json_string)
           if(cam_cmd!=NULL){
               //先检查定时器状态,否则会崩溃
               rt_timer_stop(timer_uart2);
-
               LOG_I("cam_code");
               if(cam_cmd->valueint==0){
                   ctr_led(ON);
@@ -1033,6 +1064,20 @@ int parseDtu(char *json_string)
 
           if(ledsta!=NULL)
           {
+              rt_timer_stop(timer_takephoto);
+              HMI_WRITE("selfcheck.t3.bco=2024");
+              device_status.C01 &= ~(1<<2);
+              if(ledsta->valueint==0)
+              {
+                  HMI_WRITE("selfcheck.t4.bco=2024");
+                  device_status.C01 &= ~(1<<3);
+              }
+              else
+              {
+                  HMI_WRITE("selfcheck.t4.bco=63488");
+                  device_status.C01 |= (1<<3);
+              }
+
               device_status.led_sta = ledsta->valueint;
               LOG_I("补光灯报警状态:%d",device_status.led_sta);
           }
@@ -1128,7 +1173,8 @@ int parseDtu(char *json_string)
                   }
                   else if(strstr(type->valuestring,"takephoto")!=RT_NULL)
                   {
-                      HK_TakePhoto();
+                      //HK_TakePhoto();
+                      device_status.photo_ws = 1;
                       char *photo = makeJson_Warn("takephoto","control");
                       DTU_Write("%s",photo);
                       rt_free(photo);
@@ -1162,6 +1208,19 @@ int parseDtu(char *json_string)
                   {
                       ctr_led(OFF);
                   }
+                  else if(strstr(type->valuestring,"selfcheck")!=RT_NULL)
+                  {
+                      if(device_status.selfcheck_ws == 2)
+                      {
+                          char *js = makeJson_C01_Warn(device_status.C01,device_status.process);
+                          DTU_Write("%s",js);
+                          free(js);
+                      }
+                      else
+                      {
+                          device_status.selfcheck_ws = 2;
+                      }
+                  }
               }
               //切换平台
               else if (strstr(item_cmd->valuestring,"platform")!=RT_NULL)
@@ -1240,7 +1299,6 @@ int parseDtu(char *json_string)
               }
               else if (strstr(item_cmd->valuestring,"read")!=RT_NULL)
               {
-
                   char * readinfo = makeJson_ReadInfo();
                   DTU_Write("%s",readinfo);
                   rt_kprintf("%s\n",readinfo);

+ 1 - 0
Application_CBD/applications/dtu_uart2.h

@@ -38,4 +38,5 @@ char *makeJson_Config_Reset(void);
 char *makeJson_Config_BDH(char * deviceId);
 char *makeJson_selfCheck_(uint8_t sta);
 char *makeJson_Cam(char * s,char *t);
+char *makeJson_C01_Warn(uint16_t code,double process);
 #endif /* APPLICATIONS_INC_DTU_UART2_H_ */

+ 28 - 7
Application_CBD/applications/hmi.c

@@ -25,7 +25,7 @@
 #include <shell.h>
 #include "dtu_uart2.h"
 #include <fal.h>
-
+#include "selfcheck.h"
 #define DBG_ENABLE
 #define DBG_COLOR
 #define DBG_TAG "hmi"
@@ -160,22 +160,24 @@ static void Hmi_thread_entry(void *parameter)
 static void t_uart2_callback(void *parameter)
 {
     HMI_WRITE("sysSet.va0.txt=\"指令超时,请重试...\"");
-    LOG_I("t_uart2_callback");
+    LOG_E("t_uart2_callback");
 }
 
+
 void Start_timer_Uart2(void)
 {
-
-    if(timer_uart2!=RT_NULL){
+    if(timer_uart2!=RT_NULL)
+    {
         rt_timer_start(timer_uart2);
     }
     else
     {
         LOG_E("timer_uart2 start Failed!");
     }
-
 }
 
+
+
 /***************************** 解析从屏幕收到的数据 begin **********************************/
 static void HMI_Decode(void)
 {
@@ -1392,7 +1394,18 @@ static void HMI_Decode(void)
         //开启超时定时器
         Start_timer_Uart2();
     }
-
+    else if(strstr(rx_buffer,"SelfCheck")!=NULL)
+    {
+        //校准屏幕的RTC
+        HMI_WRITE("rtc0=%d",tm.tm_year+1900);
+        HMI_WRITE("rtc1=%d",tm.tm_mon+1);
+        HMI_WRITE("rtc2=%d",tm.tm_mday);
+        HMI_WRITE("rtc3=%d",tm.tm_hour);
+        HMI_WRITE("rtc4=%d",tm.tm_min);
+        HMI_WRITE("rtc5=%d",tm.tm_sec);
+        device_status.selfcheck_ws = 2;
+        LOG_W("开始自检:%d",device_status.selfcheck_ws);
+    }
 }
 
 
@@ -1818,6 +1831,11 @@ static void Ctr_Mortor_entry(void* parameter)
             device_status.auto_test_sw=0;
             HMI_WRITE("sysTest.auto_flag.txt=\"\"");
         }
+        if(device_status.selfcheck_ws==2)
+        {
+            selfcheck(1);
+            device_status.selfcheck_ws = 0;
+        }
         rt_thread_delay(100);
     }
 }
@@ -1863,6 +1881,10 @@ int Hmi_Fresh(void)
     }
     //定时器,串口通信超时监测20S
     timer_uart2 = rt_timer_create("t_uart2",t_uart2_callback,RT_NULL, 20000, RT_TIMER_FLAG_ONE_SHOT);
+    if(timer_uart2==RT_NULL)
+    {
+        LOG_E("rt_timer_create timer_uart2 failed!");
+    }
     return ret;
 }
 void Check_ParamConfig(void)
@@ -2125,7 +2147,6 @@ void Check_ParamConfig(void)
         if(device_status.dtype!=7)
         {
             Control_clear();
-            Control_heat();
         }
         dtu_data_play();
         sht30_collect();

+ 0 - 1
Application_CBD/applications/hmi.h

@@ -22,7 +22,6 @@ extern uint8_t dbg_flag;
 extern uint8_t DBG_EN;  //是否使能调试打印
 
 extern rt_timer_t timer_uart2;
-
 void Check_ParamConfig(void);
 void HMI_WRITE(char *fmt,...);
 void Fresh_Hmi(void);

+ 27 - 13
Application_CBD/applications/sht30_collect.c

@@ -122,6 +122,7 @@ static void sht30_collect_thread_entry(void *parameter)
             if(checklightnum==20)
             {
                 device_status.sun_status = 1;
+                device_status.C01 |= (1<<6);
                 checklightnum =0;
             }
 
@@ -130,6 +131,7 @@ static void sht30_collect_thread_entry(void *parameter)
             checknightnum ++;
             if(checknightnum==20)
             {
+                device_status.C01 &= ~(1<<6);
                 device_status.sun_status = 0;
                 checknightnum = 0;
             }
@@ -137,9 +139,12 @@ static void sht30_collect_thread_entry(void *parameter)
         //温控
         if(atoi(device_status.tempture)>=device_status.tph||atoi(device_status.tempture)<=device_status.tpl)
         {
+            device_status.C01 |= (1<<7);
             device_status.temp_status = 1;
         }
-        else if(atoi(device_status.tempture)>=(device_status.tpl+5)&&atoi(device_status.tempture)<=(device_status.tph-10)) {
+        else if(atoi(device_status.tempture)>=(device_status.tpl+5)&&atoi(device_status.tempture)<=(device_status.tph-10))
+        {
+            device_status.C01 &= ~(1<<7);
             device_status.temp_status = 0;
         }
         LOG_I("光控计数:%d-%d",checklightnum,checknightnum);
@@ -154,17 +159,22 @@ static void Power_ReadCheck(void *parameter)
     while(1)
     {
         sprintf(device_status.power,"%.2f",(float)Read_Real_Current()/100*2.5);
-        if (Read_Real_Voltage()/100<12) {
-                    //关闭外设
-                    ctr_photo(OFF); //关闭相机供电
-                    ctr_led(OFF);   //关闭补光灯
-                    ctr_Heat(OFF);  //关闭加热
-                    ctr_Cold(OFF);  //关闭制冷
-                    #if Color_EN == 0
-                    ctr_cangmen_down(OFF);  //关闭下仓门输出(转盘)
-                    ctr_cangmen_up(OFF);    //关闭上仓门输出(散热)
-                    #endif
-                }
+        if(device_status.selfcheck_ws==2)
+        {
+            //HMI_WRITE("sysSet.va0.txt=\"%s\"",device_status.power);
+        }
+        if (Read_Real_Voltage()/100<12)
+        {
+            //关闭外设
+            ctr_photo(OFF); //关闭相机供电
+            ctr_led(OFF);   //关闭补光灯
+            ctr_Heat(OFF);  //关闭加热
+            ctr_Cold(OFF);  //关闭制冷
+            #if Color_EN == 0
+            ctr_cangmen_down(OFF);  //关闭下仓门输出(转盘)
+            ctr_cangmen_up(OFF);    //关闭上仓门输出(散热)
+            #endif
+        }
         if(atof(device_status.voltage)<22.0)    //小于22.0V,并且持续10S,欠压
         {
             #if ROBOT_EN == 1
@@ -175,6 +185,7 @@ static void Power_ReadCheck(void *parameter)
         }else if(atof(device_status.voltage)>24.0)    //大于24.0V,解除欠压
         {
             bat_cnt = 0;
+            device_status.C01 &= ~(1<<4);
             device_status.bat_status = 0; //解除欠压
             ctr_router(ON);               //打开路由器供电
             ctr_photo(ON);                //打开相机供电
@@ -233,6 +244,7 @@ static void Power_ReadCheck(void *parameter)
             //雨控
             if(Read_Rain_Voltage()>1500&&device_status.selfcheck_ws==0)
             {
+                device_status.C01 |= (1<<5);
                 device_status.rain_status = 1;
                 ctr_lamp(OFF,1);
                 ctr_lamp(OFF,2);
@@ -247,11 +259,13 @@ static void Power_ReadCheck(void *parameter)
                 {
                     rain_cnt = 0;
                     device_status.rain_status = 0;
+                    device_status.C01 &= ~(1<<5);
                 }
             }
         }
-        if(bat_cnt>=5){  //持续10s
+        if(bat_cnt>=8){  //持续10s
             bat_cnt = 0;
+            device_status.C01 |= (1<<4);
             device_status.bat_status = 1; //欠压
         }
         #if ROBOT_EN == 0

+ 1 - 1
Application_CBD/applications/sht30_collect.h

@@ -10,7 +10,7 @@
 #ifndef APPLICATIONS_INC_SHT30_COLLECT_H_
 #define APPLICATIONS_INC_SHT30_COLLECT_H_
 #define ADC_VOL_BASE                            1.20 //ADC内部电压基准,后续版本可改为针对每一块板子实际测量后写入 flash
-#define N 11        //adc采样计算次数
+#define N 6        //adc采样计算次数
 #define UART_485 "uart5"  /*串口设备名称*/
 
 

+ 1 - 1
Application_CBD/drivers/drv_rtc.c

@@ -253,6 +253,6 @@ int rt_hw_rtc_init(void)
     LOG_D("rtc init success");
     return RT_EOK;
 }
-INIT_DEVICE_EXPORT(rt_hw_rtc_init);
+INIT_APP_EXPORT(rt_hw_rtc_init);
 
 #endif /* BSP_USING_ONCHIP_RTC */

+ 8 - 0
Application_CBD/readme.md

@@ -1,3 +1,11 @@
+# 2024-09-29 更新说明
+#define VERSION_HK          "1.54.41(HK)"       //4.0海康-1200W
+#define VERSION_HK_2000W    "1.53.40(2000W)"         //4.0水稻
+#define VERSION_ZP          "1.46.1(ZP)"            //1.0转盘
+#define VERSION_GK          "1.42.1(GK)"            //1.0高空
+1. 增加一键自检功能及故障上报功能
+
+-------------------------------------
 # 2024-09-07 更新说明
 #define VERSION_HK          "1.53.41(HK)"       //4.0海康-1200W
 #define VERSION_HK_2000W    "1.52.40(2000W)"         //4.0水稻

+ 8 - 8
Application_CBD/rt-thread/components/finsh/cmd.c

@@ -898,7 +898,7 @@ long list(void)
 #ifndef FINSH_USING_MSH_ONLY
     /* list syscall list */
     syscall_item = global_syscall_list;
-    while (syscall_item != NULL)
+    while (syscall_item != RT_NULL)
     {
         rt_kprintf("[l] %s\n", syscall_item->syscall.name);
         syscall_item = syscall_item->next;
@@ -920,7 +920,7 @@ long list(void)
     }
 
     sysvar_item = global_sysvar_list;
-    while (sysvar_item != NULL)
+    while (sysvar_item != RT_NULL)
     {
         rt_kprintf("[l] %s\n", sysvar_item->sysvar.name);
         sysvar_item = sysvar_item->next;
@@ -1018,14 +1018,14 @@ void list_prefix(char *prefix)
 
     /* checks in dynamic system function call */
     syscall_item = global_syscall_list;
-    while (syscall_item != NULL)
+    while (syscall_item != RT_NULL)
     {
         if (str_is_prefix(prefix, syscall_item->syscall.name) == 0)
         {
             if (func_cnt == 0)
             {
                 rt_kprintf("--function:\n");
-                if (*prefix != 0 && name_ptr == NULL)
+                if (*prefix != 0 && name_ptr == RT_NULL)
                 {
                     /* set name_ptr */
                     name_ptr = syscall_item->syscall.name;
@@ -1062,7 +1062,7 @@ void list_prefix(char *prefix)
                 {
                     rt_kprintf("--variable:\n");
 
-                    if (*prefix != 0 && name_ptr == NULL)
+                    if (*prefix != 0 && name_ptr == RT_NULL)
                     {
                         /* set name_ptr */
                         name_ptr = index->name;
@@ -1093,14 +1093,14 @@ void list_prefix(char *prefix)
 
     /* checks in dynamic system variable */
     sysvar_item = global_sysvar_list;
-    while (sysvar_item != NULL)
+    while (sysvar_item != RT_NULL)
     {
         if (str_is_prefix(prefix, sysvar_item->sysvar.name) == 0)
         {
             if (var_cnt == 0)
             {
                 rt_kprintf("--variable:\n");
-                if (*prefix != 0 && name_ptr == NULL)
+                if (*prefix != 0 && name_ptr == RT_NULL)
                 {
                     /* set name_ptr */
                     name_ptr = sysvar_item->sysvar.name;
@@ -1125,7 +1125,7 @@ void list_prefix(char *prefix)
     }
 
     /* only one matched */
-    if (name_ptr != NULL)
+    if (name_ptr != RT_NULL)
     {
         rt_strncpy(prefix, name_ptr, min_length);
     }

+ 14 - 14
Application_CBD/rt-thread/components/finsh/finsh_compiler.c

@@ -23,10 +23,10 @@ uint8_t*            finsh_compile_pc;       /* PC */
 
 static int finsh_compile(struct finsh_node* node)
 {
-    if (node != NULL)
+    if (node != RT_NULL)
     {
         /* compile child node */
-        if (finsh_node_child(node) != NULL)
+        if (finsh_node_child(node) != RT_NULL)
             finsh_compile(finsh_node_child(node));
 
         /* compile current node */
@@ -47,7 +47,7 @@ static int finsh_compile(struct finsh_node* node)
                     struct finsh_sysvar* sysvar;
 
                     sysvar = node->id.sysvar;
-                    if (sysvar != NULL)
+                    if (sysvar != RT_NULL)
                     {
                         switch (sysvar->type)
                         {
@@ -113,7 +113,7 @@ static int finsh_compile(struct finsh_node* node)
                     struct finsh_var* var;
 
                     var = node->id.var;
-                    if (var != NULL)
+                    if (var != RT_NULL)
                     {
                         switch (var->type)
                         {
@@ -269,10 +269,10 @@ static int finsh_compile(struct finsh_node* node)
                 struct finsh_node* sibling;
 
                 parameters = 0;
-                if (finsh_node_child(node) != NULL)
+                if (finsh_node_child(node) != RT_NULL)
                 {
                     sibling = finsh_node_sibling(finsh_node_child(node));
-                    while (sibling != NULL)
+                    while (sibling != RT_NULL)
                     {
                         parameters ++;
                         sibling = finsh_node_sibling(sibling);
@@ -730,7 +730,7 @@ static int finsh_compile(struct finsh_node* node)
         }
 
         /* compile sibling node */
-        if (finsh_node_sibling(node) != NULL)
+        if (finsh_node_sibling(node) != RT_NULL)
             finsh_compile(finsh_node_sibling(node));
     }
 
@@ -739,7 +739,7 @@ static int finsh_compile(struct finsh_node* node)
 
 static int finsh_type_check(struct finsh_node* node, uint8_t is_addr)
 {
-    if (node != NULL)
+    if (node != RT_NULL)
     {
         /* address & value */
         if (node->node_type == FINSH_NODE_SYS_ASSIGN ||
@@ -769,7 +769,7 @@ static int finsh_type_check(struct finsh_node* node, uint8_t is_addr)
         /* make sure the current node is address or value */
         if (node->idtype != FINSH_IDTYPE_SYSCALL) node->idtype |= is_addr;
 
-        if (finsh_node_child(node) != NULL)
+        if (finsh_node_child(node) != RT_NULL)
         {
             node->data_type = finsh_node_child(node)->data_type;
             return 0;
@@ -782,7 +782,7 @@ static int finsh_type_check(struct finsh_node* node, uint8_t is_addr)
                 struct finsh_var* var;
 
                 var = node->id.var;
-                if (var != NULL)
+                if (var != RT_NULL)
                 {
                     switch (var->type)
                     {
@@ -826,7 +826,7 @@ static int finsh_type_check(struct finsh_node* node, uint8_t is_addr)
                 struct finsh_sysvar *sysvar;
 
                 sysvar = node->id.sysvar;
-                if (sysvar != NULL)
+                if (sysvar != RT_NULL)
                 {
                     switch (sysvar->type)
                     {
@@ -898,7 +898,7 @@ int finsh_compiler_run(struct finsh_node* node)
 
     /* compile node */
     sibling = node;
-    while (sibling != NULL)
+    while (sibling != RT_NULL)
     {
         struct finsh_node* current_node;
         current_node = sibling;
@@ -907,11 +907,11 @@ int finsh_compiler_run(struct finsh_node* node)
         sibling = current_node->sibling;
 
         /* clean sibling node */
-        current_node->sibling = NULL;
+        current_node->sibling = RT_NULL;
         finsh_compile(current_node);
 
         /* pop current value */
-        if (sibling != NULL) finsh_code_byte(FINSH_OP_POP);
+        if (sibling != RT_NULL) finsh_code_byte(FINSH_OP_POP);
     }
 
     return 0;

+ 6 - 6
Application_CBD/rt-thread/components/libc/compilers/newlib/stdio.c

@@ -17,7 +17,7 @@
 
 int	_EXFUN(fileno, (FILE *));
 
-static FILE* std_console = NULL;
+static FILE* std_console = RT_NULL;
 
 int libc_stdio_set_console(const char* device_name, int mode)
 {
@@ -35,12 +35,12 @@ int libc_stdio_set_console(const char* device_name, int mode)
     fp = fopen(name, file_mode);
     if (fp)
     {
-        setvbuf(fp, NULL, _IONBF, 0);
+        setvbuf(fp, RT_NULL, _IONBF, 0);
 
         if (std_console)
         {
             fclose(std_console);
-            std_console = NULL;
+            std_console = RT_NULL;
         }
         std_console = fp;
 
@@ -50,13 +50,13 @@ int libc_stdio_set_console(const char* device_name, int mode)
         }
         else 
         {
-            _GLOBAL_REENT->_stdin  = NULL;
+            _GLOBAL_REENT->_stdin  = RT_NULL;
         }
 
         if (mode == O_RDONLY)
         {
-            _GLOBAL_REENT->_stdout = NULL;
-            _GLOBAL_REENT->_stderr = NULL;
+            _GLOBAL_REENT->_stdout = RT_NULL;
+            _GLOBAL_REENT->_stderr = RT_NULL;
         }
         else
         {

+ 0 - 1
Application_CBD/rt-thread/include/rtdef.h

@@ -305,7 +305,6 @@ typedef int (*init_fn_t)(void);
  * Similar as the \c NULL in C library.
  */
 #define RT_NULL                         (0)
-
 /**
  * Double List structure
  */

+ 1 - 1
Application_CBD/rt-thread/src/signal.c

@@ -277,7 +277,7 @@ int rt_signal_wait(const rt_sigset_t *set, rt_siginfo_t *si, rt_int32_t timeout)
     RT_DEBUG_IN_THREAD_CONTEXT;
 
     /* parameters check */
-    if (set == NULL || *set == 0 || si == NULL )
+    if (set == RT_NULL || *set == 0 || si == RT_NULL )
     {
         ret = -RT_EINVAL;
         goto __done_return;

BIN
Application_CBD/rt-thread/tools/building.pyc


BIN
Application_CBD/rt-thread/tools/eclipse.pyc


BIN
Application_CBD/rt-thread/tools/gcc.pyc


BIN
Application_CBD/rt-thread/tools/mkdist.pyc


BIN
Application_CBD/rt-thread/tools/utils.pyc


BIN
Application_CBD/rtconfig.pyc