diff --git a/README.md b/README.md index 574fe99..9aea5c1 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,9 @@ 1.修复电机错误的停止方式 2.将所有依赖更新到最新版本 3.支持外置过氧化氢传感器 + V110: + 1. 修改电机旋转使用接口 + 2. 增加电机refreshcfg接口 ``` diff --git a/stm32components b/stm32components index c329787..09a2e4d 160000 --- a/stm32components +++ b/stm32components @@ -1 +1 @@ -Subproject commit c3297878099d6ab606c91c0cd29c37ebadcd035a +Subproject commit 09a2e4d56041cc988ddb766185f323ede4d713b4 diff --git a/usrc/module/tmc_motor_group.cpp b/usrc/module/tmc_motor_group.cpp index 2dc26c3..d7d76eb 100644 --- a/usrc/module/tmc_motor_group.cpp +++ b/usrc/module/tmc_motor_group.cpp @@ -180,8 +180,9 @@ void TmcMotorGroup::fn_pump_rotate(ProcessContext* cxt) { ZLOGI(TAG, "pump_rotate: %d %d", GET_PARAM(0), velocity); motor(GET_PARAM(0))->enable(false); + motor(GET_PARAM(0))->refreshcfg(); motor(GET_PARAM(0))->enable(true); - motor(GET_PARAM(0))->moveToEnd(velocity > 0 ? 1 : -1, abs(velocity)); + motor(GET_PARAM(0))->rotate(velocity); zcanbus_send_ack(cxt->packet, NULL, 0); motorErrorFlag_set(GET_PARAM(0), false); diff --git a/usrc/module/tmc_motor_group.hpp b/usrc/module/tmc_motor_group.hpp index 2669525..105bd1d 100644 --- a/usrc/module/tmc_motor_group.hpp +++ b/usrc/module/tmc_motor_group.hpp @@ -30,7 +30,7 @@ class TmcMotorGroup { void fn_pump_set_acc(ProcessContext* cxt); void fn_pump_set_ramp(ProcessContext* cxt); void fn_pump_set_tzw(ProcessContext* cxt); - + void fn_pump_set_subic_reg(ProcessContext* cxt); void fn_pump_get_subic_reg(ProcessContext* cxt); void fn_pump_ping(ProcessContext* cxt); diff --git a/usrc/project_configs.h b/usrc/project_configs.h index 03b92b9..bf3b188 100644 --- a/usrc/project_configs.h +++ b/usrc/project_configs.h @@ -15,7 +15,7 @@ * @brief 基础配置 * */ -#define SOFTWARE_VERSION 106 // 软件版本 +#define SOFTWARE_VERSION 110 // 软件版本 #define HARDWARE_VERSION 1 // 硬件版本 #define PROJECT "transmit_disinfection_micro_re" // 工程名称 #define SN_HEADER "SN" // SN号前缀