From 614d8b811b4737c5b2e08e9abc3e10a5fd6cb11c Mon Sep 17 00:00:00 2001 From: zhaohe Date: Fri, 29 Sep 2023 16:35:35 +0800 Subject: [PATCH] update --- api/i_step_motor_ctrl_module.hpp | 2 ++ api/i_xyrobot_ctrl_module.hpp | 2 ++ zcancmder_protocol.hpp | 6 +++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/api/i_step_motor_ctrl_module.hpp b/api/i_step_motor_ctrl_module.hpp index 98d2d4e..abf26b6 100644 --- a/api/i_step_motor_ctrl_module.hpp +++ b/api/i_step_motor_ctrl_module.hpp @@ -50,11 +50,13 @@ class I_StepMotorCtrlModule { typedef struct { uint8_t status; + uint8_t io_state; // x_zero_io x_end_io int32_t x; } status_t; typedef struct { uint8_t status; + uint8_t io_state; // x_zero_io x_end_io int32_t x; } debug_info_t; diff --git a/api/i_xyrobot_ctrl_module.hpp b/api/i_xyrobot_ctrl_module.hpp index 0adca80..c114301 100644 --- a/api/i_xyrobot_ctrl_module.hpp +++ b/api/i_xyrobot_ctrl_module.hpp @@ -50,12 +50,14 @@ class I_XYRobotCtrlModule { uint8_t status; int32_t x; int32_t y; + u8 iostate; // x_zero_io y_zero_io } status_t; typedef struct { uint8_t status; int32_t x; int32_t y; + u8 iostate; // x_zero_io y_zero_io } debug_info_t; /******************************************************************************* diff --git a/zcancmder_protocol.hpp b/zcancmder_protocol.hpp index ceed921..63a1374 100644 --- a/zcancmder_protocol.hpp +++ b/zcancmder_protocol.hpp @@ -233,9 +233,9 @@ ZPACKET_CMD_ACK(kcmd_step_motor_ctrl_enable, CMD(u8 id; u8 enable;), ACK(u8 id;) ZPACKET_CMD_ACK(kcmd_step_motor_ctrl_stop, CMD(u8 id; u8 stop_type;), ACK(u8 id;)); ZPACKET_CMD_ACK_AND_REPORT(kcmd_step_motor_ctrl_move_to_zero, CMD(u8 id;), ACK(u8 id;), REPORT(u8 id; I_StepMotorCtrlModule::move_to_zero_cb_status_t status;)); ZPACKET_CMD_ACK_AND_REPORT(kcmd_step_motor_ctrl_move_to_zero_with_calibrate, CMD(u8 id; s32 nowx; s32 nowy;), ACK(u8 id;), REPORT(u8 id; I_StepMotorCtrlModule::move_to_zero_with_calibrate_cb_status_t status;)); -ZPACKET_CMD_ACK_AND_REPORT(kcmd_step_motor_ctrl_move_to, CMD(u8 id; s32 x; s32 y; s32 speed;), ACK(u8 id;), REPORT(u8 id; I_StepMotorCtrlModule::move_to_cb_status_t status;)); -ZPACKET_CMD_ACK_AND_REPORT(kcmd_step_motor_ctrl_move_by, CMD(u8 id; s32 dx; s32 dy; s32 speed;), ACK(u8 id;), REPORT(u8 id; I_StepMotorCtrlModule::move_by_cb_status_t status;)); -ZPACKET_CMD_ACK(kcmd_step_motor_ctrl_force_change_current_pos, CMD(u8 id; s32 x; s32 y;), ACK(u8 id;)); +ZPACKET_CMD_ACK_AND_REPORT(kcmd_step_motor_ctrl_move_to, CMD(u8 id; s32 x; s32 speed;), ACK(u8 id;), REPORT(u8 id; I_StepMotorCtrlModule::move_to_cb_status_t status;)); +ZPACKET_CMD_ACK_AND_REPORT(kcmd_step_motor_ctrl_move_by, CMD(u8 id; s32 dx; s32 speed;), ACK(u8 id;), REPORT(u8 id; I_StepMotorCtrlModule::move_by_cb_status_t status;)); +ZPACKET_CMD_ACK(kcmd_step_motor_ctrl_force_change_current_pos, CMD(u8 id; s32 x;), ACK(u8 id;)); ZPACKET_CMD_ACK_AND_REPORT(kcmd_step_motor_ctrl_rotate, CMD(u8 id; s32 speed; s32 run_time;), ACK(u8 id;), REPORT(u8 id; I_StepMotorCtrlModule::rotate_cb_status_t status;)); // READ ZPACKET_CMD_ACK(kcmd_step_motor_ctrl_read_version, CMD(u8 id;), ACK(u8 id; I_StepMotorCtrlModule::version_t ack;));