|
@ -50,6 +50,7 @@ void umain() { |
|
|
.driverIC_resetPin = PinNull, //
|
|
|
.driverIC_resetPin = PinNull, //
|
|
|
}; |
|
|
}; |
|
|
motora.initialize(&cfg); |
|
|
motora.initialize(&cfg); |
|
|
|
|
|
motora.setMotorShaft(false); |
|
|
ZLOGI(TAG, "motora initialize TMC4361A:%x DriverIC:%x", motora.readICVersion(), motora.readSubICVersion()); |
|
|
ZLOGI(TAG, "motora initialize TMC4361A:%x DriverIC:%x", motora.readICVersion(), motora.readSubICVersion()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -64,6 +65,7 @@ void umain() { |
|
|
.driverIC_resetPin = PinNull, //
|
|
|
.driverIC_resetPin = PinNull, //
|
|
|
}; |
|
|
}; |
|
|
motorb.initialize(&cfg); |
|
|
motorb.initialize(&cfg); |
|
|
|
|
|
motorb.setMotorShaft(false); |
|
|
ZLOGI(TAG, "motorb initialize TMC4361A:%x DriverIC:%x", motorb.readICVersion(), motorb.readSubICVersion()); |
|
|
ZLOGI(TAG, "motorb initialize TMC4361A:%x DriverIC:%x", motorb.readICVersion(), motorb.readSubICVersion()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -102,13 +104,36 @@ void umain() { |
|
|
/*******************************************************************************
|
|
|
/*******************************************************************************
|
|
|
* zcanXYRobotCtrlModule * |
|
|
* zcanXYRobotCtrlModule * |
|
|
*******************************************************************************/ |
|
|
*******************************************************************************/ |
|
|
xyRobotCtrlModule.initialize(&motora, &motorb, NULL, NULL, 1.0f); |
|
|
|
|
|
|
|
|
ZGPIO input[8]; |
|
|
|
|
|
input[0].initAsInput(ARM_SENSOR1_GPIO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, false); |
|
|
|
|
|
input[1].initAsInput(ARM_SENSOR2_GPIO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, false); |
|
|
|
|
|
input[2].initAsInput(ARM_SENSOR3_GPIO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, false); |
|
|
|
|
|
input[3].initAsInput(ARM_SENSOR4_GPIO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, false); |
|
|
|
|
|
input[4].initAsInput(ARM_SENSOR5_GPIO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, false); |
|
|
|
|
|
input[5].initAsInput(ARM_SENSOR6_GPIO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, false); |
|
|
|
|
|
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], 1.0f); |
|
|
zcanXYRobotCtrlModule.initialize(&zcanCmder, 1, &xyRobotCtrlModule); |
|
|
zcanXYRobotCtrlModule.initialize(&zcanCmder, 1, &xyRobotCtrlModule); |
|
|
|
|
|
|
|
|
|
|
|
// ARM_SENSOR1_GPIO.initAsInput(STM32_GPIO::kInput_risingAndFallingIrq, true);
|
|
|
|
|
|
// ARM_SENSOR2_GPIO.initAsInput(STM32_GPIO::kInput_risingAndFallingIrq, true);
|
|
|
|
|
|
// ARM_SENSOR3_GPIO.initAsInput();
|
|
|
|
|
|
// ARM_SENSOR4_GPIO.initAsInput();
|
|
|
|
|
|
// ARM_SENSOR5_GPIO.initAsInput();
|
|
|
|
|
|
// ARM_SENSOR6_GPIO.initAsInput();
|
|
|
|
|
|
// ARM_SENSOR7_GPIO.initAsInput(STM32_GPIO::kInput_risingAndFallingIrq, true);
|
|
|
|
|
|
// ARM_SENSOR8_GPIO.initAsInput(STM32_GPIO::kInput_risingAndFallingIrq, true);
|
|
|
|
|
|
|
|
|
while (true) { |
|
|
while (true) { |
|
|
OSDefaultSchduler::getInstance()->loop(); |
|
|
OSDefaultSchduler::getInstance()->loop(); |
|
|
zcanCmder.loop(); |
|
|
zcanCmder.loop(); |
|
|
// zcanCmder.sendPacket(data, 4);
|
|
|
// zcanCmder.sendPacket(data, 4);
|
|
|
// osDelay(100);
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
|
osDelay(100); |
|
|
|
|
|
ZLOGI(TAG, "input:%d %d %d %d %d %d %d %d", //
|
|
|
|
|
|
input[0].getState(), input[1].getState(), input[2].getState(), input[3].getState(), input[4].getState(), input[5].getState(), input[6].getState(), input[7].getState()); |
|
|
|
|
|
#endif
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |