From 6ed00e1c1de500bdc1e796723ccd1dda8e784f85 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Sat, 14 Oct 2023 22:27:55 +0800 Subject: [PATCH] update --- sdk | 2 +- usrc/main.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/sdk b/sdk index 18d70a8..541da22 160000 --- a/sdk +++ b/sdk @@ -1 +1 @@ -Subproject commit 18d70a8b2ed213738162a5631519ca1e3b8e94e8 +Subproject commit 541da22a0f3afd3b6f8b55646d6cca7958512dc0 diff --git a/usrc/main.cpp b/usrc/main.cpp index b362e08..e26774c 100644 --- a/usrc/main.cpp +++ b/usrc/main.cpp @@ -19,6 +19,7 @@ #include "sdk\components/step_motor_ctrl_module/zcan_master_step_motor_ctrl_module.hpp" #include "sdk\components/xy_robot_ctrl_module/xy_robot_script_cmder_module.hpp" #include "sdk\components/xy_robot_ctrl_module/zcan_xy_robot_master_module.hpp" +#include "sdk\components\eq_20_asb_motor\script_cmder_eq20_servomotor.hpp" #include "sdk\components\mini_servo_motor\mini_servo_motor_ctrl_module.hpp" // #include "sdk\components\scriptcmder_module\xy_robot_script_cmder_module.hpp" // #include "sdk\components\zcancmder_master_module/zcan_master_step_motor_ctrl_module.hpp" @@ -153,6 +154,7 @@ I_StepMotorCtrlModule* g_z_step_motor = nullptr; *******************************************************************************/ StepMotorCtrlScriptCmderModule g_script_zmotor; XYRobotScriptCmderModule g_script_xyrobot; +ScriptCmderEq20Servomotor g_script_eq20servomotor; } // namespace iflytop #if 0 @@ -223,6 +225,9 @@ extern DMA_HandleTypeDef hdma_usart3_tx; } extern "C" {} +extern DMA_HandleTypeDef hdma_usart2_rx; +extern DMA_HandleTypeDef hdma_usart2_tx; + extern void step_motor_cmd_reg(); void Main::run() { /******************************************************************************* @@ -238,7 +243,15 @@ void Main::run() { m_zcanCommnaderMaster.init(cfg); g_cmdScheduler.initialize(&DEBUG_UART, 1000); g_feiteservomotor_bus.initialize(&huart3, &hdma_usart3_rx, &hdma_usart3_tx); + g_modbusblockhost.initialize(&huart2, &hdma_usart2_tx, &hdma_usart2_rx); + + g_main_servo_motor.init(&g_modbusblockhost, 1); + /******************************************************************************* + * CMD * + *******************************************************************************/ + g_script_eq20servomotor.initialize(&g_cmdScheduler); + g_script_eq20servomotor.regmodule(1, &g_main_servo_motor); #if 0 g_xyrobotctrlmodule = zcancmder_master::create_xyrobot_ctrl_module(&m_zcanCommnaderMaster, 1);