|
|
@@ -51,6 +51,17 @@ rt_event_t event_485_play;
|
|
|
|
|
|
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)
|
|
|
{
|
|
|
@@ -342,6 +353,9 @@ uint8_t ctr_cangmen_up(uint8_t status_up)
|
|
|
rt_pin_mode(Collect_fan_L, PIN_MODE_OUTPUT);
|
|
|
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_L,ON);
|
|
|
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_L,ON);
|
|
|
#endif
|
|
|
+#if JINGJIKUAN == 1
|
|
|
+ Uart5_Write_Bin(motor1_Forword, sizeof(motor1_Forword)); //推杆打开
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
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_L,OFF);
|
|
|
#endif
|
|
|
-
|
|
|
+#if JINGJIKUAN == 1
|
|
|
+ Uart5_Write_Bin(motor1_Backward, sizeof(motor1_Backward)); //推杆关闭
|
|
|
+#endif
|
|
|
}
|
|
|
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);
|
|
|
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_L,ON);
|
|
|
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_R,ON);
|
|
|
rt_pin_write(C_DOWN_L,OFF);
|
|
|
+#if JINGJIKUAN == 1
|
|
|
+ Uart5_Write_Bin(motor2_Forword, sizeof(motor2_Forword)); //推杆关闭
|
|
|
+#endif
|
|
|
|
|
|
}
|
|
|
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_R,OFF);
|
|
|
rt_pin_write(C_DOWN_L,ON);
|
|
|
+#if JINGJIKUAN == 1
|
|
|
+ Uart5_Write_Bin(motor2_Backward, sizeof(motor2_Backward)); //推杆关闭
|
|
|
+#endif
|
|
|
|
|
|
}
|
|
|
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)
|
|
|
{
|
|
|
- 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);
|
|
|
ResetInit();
|
|
|
rt_pin_mode(CTR_UPC_LIMIT, PIN_MODE_INPUT);
|