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)