From 4e850ef79f310f0dcc6e381b9f88e469bf13cb45 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Tue, 4 Jun 2024 17:57:42 +0800 Subject: [PATCH] update --- sdk | 2 +- usrc/subboards/subboard30_shake_module/pri_board.h | 8 +++++--- .../subboards/subboard30_shake_module/subboard30_shake_module.cpp | 8 ++++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/sdk b/sdk index 42fbbd4..c698f7e 160000 --- a/sdk +++ b/sdk @@ -1 +1 @@ -Subproject commit 42fbbd4c7b2d17d07d3bc5cb3f603d1466318293 +Subproject commit c698f7e05b12ee3e6af4fa3dcca78c73f902a2f5 diff --git a/usrc/subboards/subboard30_shake_module/pri_board.h b/usrc/subboards/subboard30_shake_module/pri_board.h index 72c52d9..61fe15b 100644 --- a/usrc/subboards/subboard30_shake_module/pri_board.h +++ b/usrc/subboards/subboard30_shake_module/pri_board.h @@ -8,10 +8,12 @@ #define MOTOR1_ENN PE3 #define MOTOR1_SPI_MODE_SELECT PinNull #define MOTOR1_REFL PD13 +#define MOTOR1_REFL_MIRROR false #define MOTOR1_REFR PinNull +#define MOTOR1_REFR_MIRROR false -#define MOTOR1_MOTOR_SHAFT true -#define MOTOR1_MOTOR_ONE_CIRCLE_PULSE 15 +#define MOTOR1_MOTOR_SHAFT false // 向外打开为正方向 +#define MOTOR1_MOTOR_ONE_CIRCLE_PULSE 15 // 0.1mm #define MOTOR1_MOTOR_ONE_CIRCLE_PULSE_DENOMINATOR 1 #define MOTOR1_STEPMOTOR_IHOLD 2 #define MOTOR1_STEPMOTOR_IRUN 8 @@ -63,7 +65,7 @@ #define MOTOR3_REFR PinNull #define MOTOR3_MOTOR_SHAFT true -#define MOTOR3_MOTOR_ONE_CIRCLE_PULSE 120 // 360转一圈 +#define MOTOR3_MOTOR_ONE_CIRCLE_PULSE 120 // 360转一圈 #define MOTOR3_MOTOR_ONE_CIRCLE_PULSE_DENOMINATOR 1 #define MOTOR3_STEPMOTOR_IHOLD 2 #define MOTOR3_STEPMOTOR_IRUN 18 diff --git a/usrc/subboards/subboard30_shake_module/subboard30_shake_module.cpp b/usrc/subboards/subboard30_shake_module/subboard30_shake_module.cpp index 51d6140..79f3a69 100644 --- a/usrc/subboards/subboard30_shake_module/subboard30_shake_module.cpp +++ b/usrc/subboards/subboard30_shake_module/subboard30_shake_module.cpp @@ -67,8 +67,8 @@ void Subboard30ShakeModule::initialize() { motor.setMotorShaft(false); static ZGPIO input[2]; - input[0].initAsInput(MOTOR1_REFL /*REFL*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true); - input[1].initAsInput(MOTOR1_REFR /*REFR*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true); + input[0].initAsInput(MOTOR1_REFL /*REFL*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, MOTOR1_REFL_MIRROR); + input[1].initAsInput(MOTOR1_REFR /*REFR*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, MOTOR1_REFR_MIRROR); StepMotorCtrlModule::config_t stepcfg = {0}; StepMotorCtrlModule::create_default_cfg(stepcfg); @@ -158,8 +158,8 @@ void Subboard30ShakeModule::initialize() { motor.setMotorShaft(false); static ZGPIO input[2]; - input[0].initAsInput(MOTOR3_REFL /*REFL*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true); - input[1].initAsInput(MOTOR3_REFR /*REFR*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true); + input[0].initAsInput(MOTOR3_REFL /*REFL*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, false); + input[1].initAsInput(MOTOR3_REFR /*REFR*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, false); StepMotorCtrlModule::config_t stepcfg = {0}; StepMotorCtrlModule::create_default_cfg(stepcfg);