From 5abc24f215d0d5d05827561cdb71d4bad3bc7323 Mon Sep 17 00:00:00 2001 From: "DESKTOP-KQHDCM4\\97555" <975559679@qq.com> Date: Sat, 25 Oct 2025 19:21:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A7=E5=88=B6=E6=96=B9=E5=BC=8F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Project/HC32F460/MDK/HC32F460.uvoptx | 7 +------ Project/HC32F460/source/Module/dc_motor/dc_motor.c | 2 +- Project/HC32F460/source/User/Inc/main.h | 12 ++++++++---- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Project/HC32F460/MDK/HC32F460.uvoptx b/Project/HC32F460/MDK/HC32F460.uvoptx index fc47953..44340c8 100644 --- a/Project/HC32F460/MDK/HC32F460.uvoptx +++ b/Project/HC32F460/MDK/HC32F460.uvoptx @@ -208,12 +208,7 @@ 11 1 - LeftLowDiff,0x0A - - - 12 - 1 - RightLowDiff,0x0A + DcMotorDispEn diff --git a/Project/HC32F460/source/Module/dc_motor/dc_motor.c b/Project/HC32F460/source/Module/dc_motor/dc_motor.c index f2e52ca..bb60a0c 100644 --- a/Project/HC32F460/source/Module/dc_motor/dc_motor.c +++ b/Project/HC32F460/source/Module/dc_motor/dc_motor.c @@ -15,7 +15,7 @@ volatile uint16_t g_accelTimer = 0; static uint16_t accelCounter = 0; -static uint8_t DcMotorDispEn = false; +static uint8_t DcMotorDispEn = true; #define DCMOTOR_DBG_LOG(...) { if(DcMotorDispEn) DBG_LOG(__VA_ARGS__);} #define DCMOTOR_DBG_ARRAY(ARRAY, SIZE) { if(DcMotorDispEn) {DBG_ARRAY(ARRAY,SIZE)}} diff --git a/Project/HC32F460/source/User/Inc/main.h b/Project/HC32F460/source/User/Inc/main.h index 2782bae..d66b8f7 100644 --- a/Project/HC32F460/source/User/Inc/main.h +++ b/Project/HC32F460/source/User/Inc/main.h @@ -15,7 +15,7 @@ #define SHIELD_VPT 2500 #define EME_STOP_VPT 10000 -#define STOP_TIME_MS 500 +#define STOP_TIME_MS 0 #define RUN_TIME_MS 0 #define EME_START_MS 3000 #define EME_STOP_MS 3000 @@ -23,10 +23,14 @@ #define TRAVEL_TIME_MS 30000 -#define BDC_STOP() (SET_TWIN_BIT0(),SET_TWIN_BIT1()) -#define BDC_UP() (SET_TWIN_BIT0(),CLR_TWIN_BIT1()) -#define BDC_DOWN() (SET_TWIN_BIT1(),CLR_TWIN_BIT0()) +//#define BDC_STOP() (SET_TWIN_BIT0(),SET_TWIN_BIT1()) +//#define BDC_UP() (SET_TWIN_BIT0(),CLR_TWIN_BIT1()) +//#define BDC_DOWN() (SET_TWIN_BIT1(),CLR_TWIN_BIT0()) +#define BDC_STOP() Motor_Control(MOTOR_CMD_STOP) +#define BDC_UP() Motor_Control(MOTOR_CMD_FORWARD) +#define BDC_DOWN() Motor_Control(MOTOR_CMD_REVERSE) + /*控制等级*/ typedef enum { LEVEL_1 = 1, // 一级