|
|
@ -223,13 +223,13 @@ static void zcanbus_on_connected(bool connected) { |
|
|
|
void hardware_init() { |
|
|
|
m_motor_spi.init(&MOTOR_SPI); |
|
|
|
m_motor[0].initialize(&m_motor_spi, MOTOR1_ENN, MOTOR1_CSN); |
|
|
|
m_motor[0].setIHOLD_IRUN(1, 20, 0); |
|
|
|
m_motor[0].setIHOLD_IRUN(1, 15, 0); |
|
|
|
m_motor[0].setMotorShaft(true); |
|
|
|
m_motor[0].setAcceleration(300000); |
|
|
|
m_motor[0].setDeceleration(300000); |
|
|
|
|
|
|
|
m_motor[1].initialize(&m_motor_spi, MOTOR2_ENN, MOTOR2_CSN); |
|
|
|
m_motor[1].setIHOLD_IRUN(1, 20, 0); |
|
|
|
m_motor[1].setIHOLD_IRUN(1, 15, 0); |
|
|
|
m_motor[1].setMotorShaft(true); |
|
|
|
m_motor[1].setAcceleration(300000); |
|
|
|
m_motor[1].setDeceleration(300000); |
|
|
@ -237,8 +237,8 @@ void hardware_init() { |
|
|
|
int32_t chipv0 = m_motor[0].readChipVERSION(); // 5130:0x11
|
|
|
|
int32_t chipv1 = m_motor[1].readChipVERSION(); // 5130:0x11
|
|
|
|
|
|
|
|
m_motor[0].rotate(1000000); |
|
|
|
m_motor[1].rotate(1000000); |
|
|
|
// m_motor[0].rotate(500000);
|
|
|
|
// m_motor[1].rotate(500000);
|
|
|
|
|
|
|
|
ZLOGI(TAG, "chipv0: %x, chipv1: %x", chipv0, chipv1); |
|
|
|
} |
|
|
|