feat: 增加上电回零

This commit is contained in:
bmy
2024-05-12 09:26:34 +08:00
parent 82e5f25e3a
commit 5831580e55

View File

@@ -154,6 +154,14 @@ void by_motion_init(void)
motion_enable_flag = 1; motion_enable_flag = 1;
DRV_ENABLE(); 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) void by_motion_run(void)