diff --git a/.cproject b/.cproject
index 6058b70..c08840d 100644
--- a/.cproject
+++ b/.cproject
@@ -90,6 +90,7 @@
+
diff --git a/sdk b/sdk
index 76ef997..0f5a291 160000
--- a/sdk
+++ b/sdk
@@ -1 +1 @@
-Subproject commit 76ef997ee4eea38d58ce29a67581e4318ca6f798
+Subproject commit 0f5a291b031589e0f435b7f9faafd514ee032940
diff --git a/usrc/main.cpp b/usrc/main.cpp
index 7a0bce9..4b4996d 100644
--- a/usrc/main.cpp
+++ b/usrc/main.cpp
@@ -7,9 +7,9 @@
#include "sdk\components\mini_servo_motor\feite_servo_motor.hpp"
#include "sdk\components\tmc\ic\ztmc4361A.hpp"
#include "sdk\components\xy_robot_ctrl_module\xy_robot_ctrl_module.hpp"
-#include "sdk\components\xy_robot_ctrl_module\zcan_xy_robot_module.hpp"
#include "sdk\components\zcancmder\zcanreceiver.hpp"
#include "sdk\components\zcancmder_module\zcan_basic_order_module.hpp"
+#include "sdk\components\zprotocols\zcancmder_v2\protocol_parser.hpp"
//
#include "sdk\components\flash\znvs.hpp"
//
@@ -24,14 +24,13 @@ void StartDefaultTask(void const* argument) { umain(); }
}
#define TMC_MOTOR_SPI hspi1
-static TMC4361A motora;
-static TMC4361A motorb;
-static ZCanCmder zcanCmder;
-static ZCanBasicOrderModule zcanBasicOrderModule;
+static TMC4361A motora;
+static TMC4361A motorb;
+static ZCanCmder zcanCmder;
-static StepMotorCtrlModule stepMotorCtrlModule;
-static XYRobotCtrlModule xyRobotCtrlModule;
-static ZCANXYRobotCtrlModule zcanXYRobotCtrlModule;
+static StepMotorCtrlModule stepMotorCtrlModule;
+static XYRobotCtrlModule xyRobotCtrlModule;
+static ZIProtocolParser g_ziProtocolParser;
#define XYRobotCtrlModule_1_FLASH_MARK "XYRobotCtrlModule_1"
@@ -107,7 +106,6 @@ void umain() {
/*******************************************************************************
* zcanBasicOrderModule *
*******************************************************************************/
- zcanBasicOrderModule.initialize(&zcanCmder);
#if 0
zcanBasicOrderModule.reg_set_io(1, [](bool val) { ZLOGI(TAG, "write io 1:%d", val); });
zcanBasicOrderModule.reg_read_io(1, []() {
@@ -133,9 +131,12 @@ void umain() {
input[6].initAsInput(ARM_SENSOR7_GPIO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
input[7].initAsInput(ARM_SENSOR8_GPIO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
- xyRobotCtrlModule.initialize(&motora, &motorb, &input[0], 8, XYRobotCtrlModule_1_FLASH_MARK);
+ xyRobotCtrlModule.initialize(BOARD_ID, &motora, &motorb, &input[0], 8, XYRobotCtrlModule_1_FLASH_MARK);
xyRobotCtrlModule.dumpcfg();
- zcanXYRobotCtrlModule.initialize(&zcanCmder, MODULE_ID, &xyRobotCtrlModule);
+ // zcanXYRobotCtrlModule.initialize(&zcanCmder, MODULE_ID, &xyRobotCtrlModule);
+
+ g_ziProtocolParser.initialize(&zcanCmder);
+ g_ziProtocolParser.registerModule(&xyRobotCtrlModule);
while (true) {
OSDefaultSchduler::getInstance()->loop();
diff --git a/usrc/project_configs.h b/usrc/project_configs.h
index 9d57dd5..7f0e9af 100644
--- a/usrc/project_configs.h
+++ b/usrc/project_configs.h
@@ -14,7 +14,7 @@
#define IFLYTOP_PREEMPTPRIORITY_DEFAULT 5
#define MODULE_ID (1)
-#define BOARD_ID (1 + ZCAN_CMD_PUBLIC_DEVICE_ID_XY_ROBOT_BOARD_OFFEST)
+#define BOARD_ID (1 + XY_MOTOR_ID_OFF)
/****************************************FLASH***************************************/
#define IFLYTOP_NVS_CONFIG_FLASH_SECTOR 8