From 584762968681c003e098cc9b0afd454bc4aeb9ca Mon Sep 17 00:00:00 2001 From: zhaohe Date: Fri, 29 Sep 2023 10:46:08 +0800 Subject: [PATCH] update --- .clang-format | 2 +- sdk | 2 +- usrc/main.cpp | 13 +++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.clang-format b/.clang-format index 1c995cf..4c41736 100644 --- a/.clang-format +++ b/.clang-format @@ -2,7 +2,7 @@ # http://clang.llvm.org/docs/ClangFormatStyleOptions.html Language: Cpp BasedOnStyle: Google -ColumnLimit: 250 +ColumnLimit: 300 AlignConsecutiveMacros: true AlignConsecutiveDeclarations: true AlignConsecutiveAssignments: true diff --git a/sdk b/sdk index e82611f..0ac64e0 160000 --- a/sdk +++ b/sdk @@ -1 +1 @@ -Subproject commit e82611f05a5999c543c80b7384cd2b4dd8c3a0e2 +Subproject commit 0ac64e0639074c634238995530a40c96c89a7988 diff --git a/usrc/main.cpp b/usrc/main.cpp index 36c1e1b..0fd6983 100644 --- a/usrc/main.cpp +++ b/usrc/main.cpp @@ -22,7 +22,7 @@ static TMC4361A motora; static TMC4361A motorb; static ZCanCmder zcanCmder; static ZCanBasicOrderModule zcanBasicOrderModule; -static ZCANXYRobotCtrlModule zcanXYRobotCtrlModule; +// static ZCANXYRobotCtrlModule zcanXYRobotCtrlModule; static XYRobotCtrlModule xyRobotCtrlModule; void umain() { @@ -96,10 +96,6 @@ void umain() { return 123; }); - uint16_t maincmdid = (((uint32_t)kcmd_xy_robot_ctrl_enable) >> 8) & 0xFFFF; - uint8_t subcmdId = (((uint32_t)kcmd_xy_robot_ctrl_enable)) & 0xFF; - - printf("maincmdid:%d subcmdId:%d\n", maincmdid, subcmdId); /******************************************************************************* * zcanXYRobotCtrlModule * @@ -115,7 +111,12 @@ void umain() { input[7].initAsInput(ARM_SENSOR8_GPIO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, false); xyRobotCtrlModule.initialize(&motora, &motorb, &input[6], &input[7], 1.0f); - zcanXYRobotCtrlModule.initialize(&zcanCmder, 1, &xyRobotCtrlModule); + xyRobotCtrlModule.set_speed(1000000); + xyRobotCtrlModule.set_acc(3000000); + xyRobotCtrlModule.set_dec(3000000); + xyRobotCtrlModule.set_zero_robottype(xyRobotCtrlModule.corexy); + xyRobotCtrlModule.set_shaft(false, false); + // zcanXYRobotCtrlModule.initialize(&zcanCmder, 1, &xyRobotCtrlModule); // ARM_SENSOR1_GPIO.initAsInput(STM32_GPIO::kInput_risingAndFallingIrq, true); // ARM_SENSOR2_GPIO.initAsInput(STM32_GPIO::kInput_risingAndFallingIrq, true);