From 3b3614bd313f202c5e64844180559440d5738348 Mon Sep 17 00:00:00 2001 From: cgy Date: Wed, 11 Feb 2026 15:21:22 +0800 Subject: [PATCH] =?UTF-8?q?1.=E8=B0=83=E6=95=B4=E4=BA=86spi=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96=E5=92=8Ctimer1=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E7=9A=84=E5=85=88=E5=90=8E=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- USER/main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/USER/main.c b/USER/main.c index 577c564..ba7471f 100644 --- a/USER/main.c +++ b/USER/main.c @@ -217,8 +217,6 @@ int main(void) uart5_init(115200); uart6_init(115200); //串口6初始化波特率为115200 上传到slide gpio_Init(); //初始化gpio - motor_spi1_init(); - motor_spi2_init(); TIM1_PWM_Init(16, 32); //TIM2_PWM_Init(16, 32); TIM4_PWM_Init(16, 32); @@ -231,7 +229,11 @@ int main(void) // 初始化PWM定时器(如果需要调速) PWM_Timer_Init(); - + + motor_spi1_init(); + motor_spi2_init(); + + // 使能全局中断 __enable_irq(); //=======================================================================