|
|
@ -36,6 +36,8 @@ static ZCanStepMotorCtrlModule zcanStepMotorCtrlModule; |
|
|
|
static XYRobotCtrlModule xyRobotCtrlModule; |
|
|
|
static ZCANXYRobotCtrlModule zcanXYRobotCtrlModule; |
|
|
|
|
|
|
|
#define XYRobotCtrlModule_1_FLASH_MARK "XYRobotCtrlModule_1"
|
|
|
|
|
|
|
|
void umain() { |
|
|
|
chip_cfg_t chipcfg; |
|
|
|
chipcfg.us_dleay_tim = &DELAY_US_TIMER; |
|
|
@ -48,12 +50,18 @@ void umain() { |
|
|
|
zos_cfg_t zoscfg; |
|
|
|
zos_init(&zoscfg); |
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
* NVSINIT * |
|
|
|
*******************************************************************************/ |
|
|
|
ZNVS::ins().initialize(); |
|
|
|
// ZNVS::ins().set_config_int32("test", 1234);
|
|
|
|
ZNVS::ins().dumpcfg(); |
|
|
|
{ |
|
|
|
static I_XYRobotCtrlModule::flash_config_t cfg; |
|
|
|
XYRobotCtrlModule::create_default_cfg(cfg); |
|
|
|
ZNVS::ins().alloc_config(XYRobotCtrlModule_1_FLASH_MARK, (uint8_t*)&cfg, sizeof(cfg)); |
|
|
|
} |
|
|
|
ZNVS::ins().init_config(); |
|
|
|
|
|
|
|
osDelay(1000); |
|
|
|
|
|
|
|
{ |
|
|
|
TMC4361A::cfg_t cfg = { |
|
|
|
.spi = &TMC_MOTOR_SPI, //
|
|
|
@ -126,11 +134,8 @@ void umain() { |
|
|
|
input[6].initAsInput(ARM_SENSOR7_GPIO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, false); |
|
|
|
input[7].initAsInput(ARM_SENSOR8_GPIO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, false); |
|
|
|
|
|
|
|
xyRobotCtrlModule.initialize(&motora, &motorb, &input[6], &input[7]); |
|
|
|
I_XYRobotCtrlModule::base_param_t base_param; |
|
|
|
xyRobotCtrlModule.create_default_cfg(base_param); |
|
|
|
xyRobotCtrlModule.set_base_param(base_param); |
|
|
|
|
|
|
|
xyRobotCtrlModule.initialize(&motora, &motorb, &input[6], &input[7], XYRobotCtrlModule_1_FLASH_MARK); |
|
|
|
xyRobotCtrlModule.dumpcfg(); |
|
|
|
zcanXYRobotCtrlModule.initialize(&zcanCmder, 1, &xyRobotCtrlModule); |
|
|
|
|
|
|
|
while (true) { |
|
|
|