zhunk 3 месяцев назад
Родитель
Сommit
7e1d311a9e

+ 29 - 10
Application_cbd_apm32f1/applications/control.c

@@ -51,6 +51,17 @@ rt_event_t event_485_play;
 
 
 extern eMBMasterReqErrCode _485_play(USHORT *Buffer,USHORT NREGS);
 extern eMBMasterReqErrCode _485_play(USHORT *Buffer,USHORT NREGS);
 
 
+
+const uint8_t open_Led[] = {0x02,0x06,0x00,0x32,0x00,0x01,0xE9,0xF6};   //02 06 00 32 00 01 E9 F6
+const uint8_t close_Led[] = {0x02,0x06,0x00,0x32,0x00,0x00,0x28,0x36};   //02 06 00 32 00 01 E9 F6
+const uint8_t motor1_Forword[] = {0x02,0x06,0x00,0x00,0x00,0x01,0x48,0x39};   //02 06 00 00 00 01 48 39
+const uint8_t motor1_Backward[] = {0x02,0x06,0x00,0x00,0x00,0x02,0x08,0x38};   //02 06 00 00 00 01 48 39
+const uint8_t motor1_Stop[] = {0x02,0x06,0x00,0x00,0x00,0x00,0x89,0xF9};   //02 06 00 00 00 01 48 39
+const uint8_t motor2_Forword[] = {0x02,0x06,0x00,0x00,0x00,0x10,0x88,0x35};   //02 06 00 00 00 01 48 39
+const uint8_t motor2_Backward[] = {0x02,0x06,0x00,0x00,0x00,0x20,0x88,0x31};   //02 06 00 00 00 01 48 39
+const uint8_t motor2_Stop[] = {0x02,0x06,0x00,0x00,0x00,0x00,0x89,0xF9};   //02 06 00 00 00 01 48 39
+const uint8_t get_status[] = {0x02,0x03,0x00,0x00,0x00,0x01,0x84,0x39};     //02 03 02 00 00 FC 44
+
 /***************************************************************************/
 /***************************************************************************/
 int thread_delete_workloop(void)
 int thread_delete_workloop(void)
 {
 {
@@ -342,6 +353,9 @@ uint8_t ctr_cangmen_up(uint8_t status_up)
    rt_pin_mode(Collect_fan_L, PIN_MODE_OUTPUT);
    rt_pin_mode(Collect_fan_L, PIN_MODE_OUTPUT);
    if(status_up==OFF)
    if(status_up==OFF)
    {
    {
+#if JINGJIKUAN == 1
+       Uart5_Write_Bin(motor1_Stop, sizeof(motor1_Stop));   //推杆停止
+#endif
        rt_pin_write(Collect_fan_R,ON);
        rt_pin_write(Collect_fan_R,ON);
        rt_pin_write(Collect_fan_L,ON);
        rt_pin_write(Collect_fan_L,ON);
        device_status.ctr_up_motor = 0;
        device_status.ctr_up_motor = 0;
@@ -360,6 +374,9 @@ uint8_t ctr_cangmen_up(uint8_t status_up)
        rt_pin_write(Collect_fan_R,OFF);
        rt_pin_write(Collect_fan_R,OFF);
        rt_pin_write(Collect_fan_L,ON);
        rt_pin_write(Collect_fan_L,ON);
 #endif
 #endif
+#if JINGJIKUAN == 1
+       Uart5_Write_Bin(motor1_Forword, sizeof(motor1_Forword));   //推杆打开
+#endif
    }
    }
 
 
    if(status_up==CLOSE)
    if(status_up==CLOSE)
@@ -374,7 +391,9 @@ uint8_t ctr_cangmen_up(uint8_t status_up)
        rt_pin_write(Collect_fan_R,ON);
        rt_pin_write(Collect_fan_R,ON);
        rt_pin_write(Collect_fan_L,OFF);
        rt_pin_write(Collect_fan_L,OFF);
 #endif
 #endif
-
+#if JINGJIKUAN == 1
+       Uart5_Write_Bin(motor1_Backward, sizeof(motor1_Backward));   //推杆关闭
+#endif
    }
    }
    return device_status.up_status;
    return device_status.up_status;
 }
 }
@@ -385,6 +404,9 @@ uint8_t ctr_cangmen_down(uint8_t status_down)
     rt_pin_mode(C_DOWN_L, PIN_MODE_OUTPUT);
     rt_pin_mode(C_DOWN_L, PIN_MODE_OUTPUT);
     if(status_down==OFF)
     if(status_down==OFF)
        {
        {
+#if JINGJIKUAN == 1
+           Uart5_Write_Bin(motor2_Stop, sizeof(motor2_Stop));   //推杆关闭
+#endif
            rt_pin_write(C_DOWN_R,ON);
            rt_pin_write(C_DOWN_R,ON);
            rt_pin_write(C_DOWN_L,ON);
            rt_pin_write(C_DOWN_L,ON);
            device_status.ctr_down_motor = 0;
            device_status.ctr_down_motor = 0;
@@ -397,6 +419,9 @@ uint8_t ctr_cangmen_down(uint8_t status_down)
            rt_pin_write(C_DOWN_L,OFF);
            rt_pin_write(C_DOWN_L,OFF);
            rt_pin_write(C_DOWN_R,ON);
            rt_pin_write(C_DOWN_R,ON);
            rt_pin_write(C_DOWN_L,OFF);
            rt_pin_write(C_DOWN_L,OFF);
+#if JINGJIKUAN == 1
+           Uart5_Write_Bin(motor2_Forword, sizeof(motor2_Forword));   //推杆关闭
+#endif
 
 
        }
        }
        if(status_down==CLOSE)
        if(status_down==CLOSE)
@@ -406,6 +431,9 @@ uint8_t ctr_cangmen_down(uint8_t status_down)
            rt_pin_write(C_DOWN_L,OFF);
            rt_pin_write(C_DOWN_L,OFF);
            rt_pin_write(C_DOWN_R,OFF);
            rt_pin_write(C_DOWN_R,OFF);
            rt_pin_write(C_DOWN_L,ON);
            rt_pin_write(C_DOWN_L,ON);
+#if JINGJIKUAN == 1
+           Uart5_Write_Bin(motor2_Backward, sizeof(motor2_Backward));   //推杆关闭
+#endif
 
 
        }
        }
        return device_status.down_status;
        return device_status.down_status;
@@ -1968,15 +1996,6 @@ static void Work_status_thread_entry(void *parameter)
 /*入口函数-工作流程*/
 /*入口函数-工作流程*/
 static void Work_Loop_thread_entry(void *parameter)
 static void Work_Loop_thread_entry(void *parameter)
 {
 {
-    const uint8_t open_Led[] = {0x02,0x06,0x00,0x32,0x00,0x01,0xE9,0xF6};   //02 06 00 32 00 01 E9 F6
-    const uint8_t close_Led[] = {0x02,0x06,0x00,0x32,0x00,0x00,0x28,0x36};   //02 06 00 32 00 01 E9 F6
-    const uint8_t motor1_Forword[] = {0x02,0x06,0x00,0x00,0x00,0x01,0x48,0x39};   //02 06 00 00 00 01 48 39
-    const uint8_t motor1_Backward[] = {0x02,0x06,0x00,0x00,0x00,0x02,0x08,0x38};   //02 06 00 00 00 01 48 39
-    const uint8_t motor1_Stop[] = {0x02,0x06,0x00,0x00,0x00,0x00,0x89,0xF9};   //02 06 00 00 00 01 48 39
-    const uint8_t motor2_Forword[] = {0x02,0x06,0x00,0x00,0x00,0x10,0x88,0x35};   //02 06 00 00 00 01 48 39
-    const uint8_t motor2_Backward[] = {0x02,0x06,0x00,0x00,0x00,0x20,0x88,0x31};   //02 06 00 00 00 01 48 39
-    const uint8_t motor2_Stop[] = {0x02,0x06,0x00,0x00,0x00,0x00,0x89,0xF9};   //02 06 00 00 00 01 48 39
-    const uint8_t get_status[] = {0x02,0x03,0x00,0x00,0x00,0x01,0x84,0x39};     //02 03 02 00 00 FC 44
     rt_thread_delay(1000);
     rt_thread_delay(1000);
     ResetInit();
     ResetInit();
     rt_pin_mode(CTR_UPC_LIMIT, PIN_MODE_INPUT);
     rt_pin_mode(CTR_UPC_LIMIT, PIN_MODE_INPUT);

+ 7 - 3
Application_cbd_apm32f1/applications/control.h

@@ -17,17 +17,17 @@
 
 
 
 
 #define LAMP_EN          0             //李新3灯管:0关闭,1打开
 #define LAMP_EN          0             //李新3灯管:0关闭,1打开
-#define PCB_V1           0             //1-旧PCB,0-新PCB(模块化)
+#define PCB_V1           1             //1-旧PCB,0-新PCB(模块化)
 #define MATCH_DEVICE     0             //比赛设备1-开启 0-关闭
 #define MATCH_DEVICE     0             //比赛设备1-开启 0-关闭
 #define SENSOR_EN        0             //温湿度:0关闭,1打开
 #define SENSOR_EN        0             //温湿度:0关闭,1打开
 #define UART_TEST_EN     0             ///串口测试0-关闭,1-启用
 #define UART_TEST_EN     0             ///串口测试0-关闭,1-启用
-#define TG_MODULE        1             //推杆电机结构模块化控制
+#define TG_MODULE        0             //推杆电机结构模块化控制
 #define DINGZHI_0722     0             //控制一个电机每天12点20工作12秒
 #define DINGZHI_0722     0             //控制一个电机每天12点20工作12秒
 #define QINGSAO_IO       1             //调整清扫顺序20250801
 #define QINGSAO_IO       1             //调整清扫顺序20250801
 #define WENKONG          1             //温控功能1-开启 0-关闭
 #define WENKONG          1             //温控功能1-开启 0-关闭
 #define YUKONG           1             //雨控功能1-开启 0-关闭
 #define YUKONG           1             //雨控功能1-开启 0-关闭
 #define QIANYA           1             //欠压功能1-开启 0-关闭
 #define QIANYA           1             //欠压功能1-开启 0-关闭
-
+#define JINGJIKUAN       0             //经济款1-开启 0-关闭
 
 
 #if MATCH_DEVICE == 1
 #if MATCH_DEVICE == 1
 #define LAMP_CURRENT    600
 #define LAMP_CURRENT    600
@@ -41,7 +41,11 @@
 #else
 #else
     #define VERSION_HK          "2.41.41(HK)"            //4.0海康-1200W
     #define VERSION_HK          "2.41.41(HK)"            //4.0海康-1200W
     #if TG_MODULE == 0
     #if TG_MODULE == 0
+#if JINGJIKUAN == 0
     #define VERSION_HK_2000W    "2.41.4(2000W)"         //4.0水稻
     #define VERSION_HK_2000W    "2.41.4(2000W)"         //4.0水稻
+#else
+    #define VERSION_HK_2000W    "2.41.4(jjk)"           //经济款
+#endif
     #else
     #else
     #if MATCH_DEVICE == 1
     #if MATCH_DEVICE == 1
     #define VERSION_HK_2000W    "3.3.4(TG)"             //推杆结构比赛设备
     #define VERSION_HK_2000W    "3.3.4(TG)"             //推杆结构比赛设备

+ 1 - 1
Application_cbd_apm32f1/applications/dtu_uart2.c

@@ -593,7 +593,7 @@ int dtu_data_play(void)
 {
 {
     lwjson_stream_init(&lwparser, NULL);
     lwjson_stream_init(&lwparser, NULL);
     DTU_uart2_init();
     DTU_uart2_init();
-#if MATCH_DEVICE == 1
+#if 1
     DTU_uart5_init();
     DTU_uart5_init();
     rt_sem_init(&rx5_sem, "rx5_sem", 0, RT_IPC_FLAG_FIFO);
     rt_sem_init(&rx5_sem, "rx5_sem", 0, RT_IPC_FLAG_FIFO);
     rt_device_set_rx_indicate(serial_485, uart5_input);
     rt_device_set_rx_indicate(serial_485, uart5_input);