|
|
@ -2,15 +2,14 @@ |
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "sdk/components/step_motor_ctrl_module/step_motor_ctrl_module.hpp"
|
|
|
|
#include "sdk/components/zcancmder_module/zcan_step_motor_ctrl_module.hpp"
|
|
|
|
#include "sdk/os/zos.hpp"
|
|
|
|
#include "sdk\components\flash\zsimple_flash.hpp"
|
|
|
|
#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\zcancmder_module\zcan_xy_robot_module.hpp"
|
|
|
|
//
|
|
|
|
#include "sdk\components\flash\znvs.hpp"
|
|
|
|
//
|
|
|
@ -30,9 +29,7 @@ static TMC4361A motorb; |
|
|
|
static ZCanCmder zcanCmder; |
|
|
|
static ZCanBasicOrderModule zcanBasicOrderModule; |
|
|
|
|
|
|
|
static StepMotorCtrlModule stepMotorCtrlModule; |
|
|
|
static ZCanStepMotorCtrlModule zcanStepMotorCtrlModule; |
|
|
|
|
|
|
|
static StepMotorCtrlModule stepMotorCtrlModule; |
|
|
|
static XYRobotCtrlModule xyRobotCtrlModule; |
|
|
|
static ZCANXYRobotCtrlModule zcanXYRobotCtrlModule; |
|
|
|
|
|
|
@ -50,6 +47,8 @@ void umain() { |
|
|
|
zos_cfg_t zoscfg; |
|
|
|
zos_init(&zoscfg); |
|
|
|
|
|
|
|
ZLOGI(TAG, "boardid:%d moduleid:%d", BOARD_ID, MODULE_ID); |
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
* NVSINIT * |
|
|
|
*******************************************************************************/ |
|
|
@ -92,17 +91,17 @@ void umain() { |
|
|
|
ZLOGI(TAG, "motorb initialize TMC4361A:%x DriverIC:%x", motorb.readICVersion(), motorb.readSubICVersion()); |
|
|
|
} |
|
|
|
|
|
|
|
motora.setAcceleration(300000); |
|
|
|
motora.setDeceleration(300000); |
|
|
|
motora.setAcceleration(300); |
|
|
|
motora.setDeceleration(300); |
|
|
|
motora.setIHOLD_IRUN(0, 2, 10); |
|
|
|
|
|
|
|
motorb.setAcceleration(300000); |
|
|
|
motorb.setDeceleration(300000); |
|
|
|
motorb.setAcceleration(300); |
|
|
|
motorb.setDeceleration(300); |
|
|
|
motorb.setIHOLD_IRUN(0, 2, 10); |
|
|
|
|
|
|
|
motora.rotate(0); |
|
|
|
motorb.rotate(0); |
|
|
|
auto zcanCmder_cfg = zcanCmder.createCFG(DEVICE_ID); |
|
|
|
auto zcanCmder_cfg = zcanCmder.createCFG(BOARD_ID); |
|
|
|
zcanCmder.init(zcanCmder_cfg); |
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
@ -136,7 +135,7 @@ void umain() { |
|
|
|
|
|
|
|
xyRobotCtrlModule.initialize(&motora, &motorb, &input[6], &input[7], XYRobotCtrlModule_1_FLASH_MARK); |
|
|
|
xyRobotCtrlModule.dumpcfg(); |
|
|
|
zcanXYRobotCtrlModule.initialize(&zcanCmder, 1, &xyRobotCtrlModule); |
|
|
|
zcanXYRobotCtrlModule.initialize(&zcanCmder, MODULE_ID, &xyRobotCtrlModule); |
|
|
|
|
|
|
|
while (true) { |
|
|
|
OSDefaultSchduler::getInstance()->loop(); |
|
|
|