From 5831580e552504d038aef59ebac8ef15af13983f Mon Sep 17 00:00:00 2001 From: bmy <2583236812@qq.com> Date: Sun, 12 May 2024 09:26:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E4=B8=8A=E7=94=B5?= =?UTF-8?q?=E5=9B=9E=E9=9B=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/by_motion.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/by_motion.c b/app/by_motion.c index 7e945e0..45e5826 100644 --- a/app/by_motion.c +++ b/app/by_motion.c @@ -154,6 +154,14 @@ void by_motion_init(void) motion_enable_flag = 1; DRV_ENABLE(); + + // 上电回零 + DWT_Delay(3000000); + by_motion_set_speed_m1(-4); + while (SET == gpio_input_data_bit_read(GPIOB, GPIO_PINS_3)) { + // 等待复位 + } + by_motion_set_speed_m1(0); } void by_motion_run(void)