pref: 上电复位到指定位置

This commit is contained in:
bmy
2024-06-10 17:47:09 +08:00
parent 7523e7096e
commit c286c90928

View File

@@ -116,7 +116,7 @@ void by_stepper_init(void)
// DWT_Delay(40U * (uint16_t)by_stepper.speed); // DWT_Delay(40U * (uint16_t)by_stepper.speed);
// } // }
by_stepper_set_speed(STEPPER_SPEED_DIV4); by_stepper_set_speed(STEPPER_SPEED_DIV1);
while (gpio_input_data_bit_read(GPIOB, GPIO_PINS_10) == SET) { while (gpio_input_data_bit_read(GPIOB, GPIO_PINS_10) == SET) {
gpio_bits_write(GPIOA, GPIO_PINS_8, by_stepper.dir ? TRUE : FALSE); // DIR gpio_bits_write(GPIOA, GPIO_PINS_8, by_stepper.dir ? TRUE : FALSE); // DIR
@@ -131,8 +131,7 @@ void by_stepper_init(void)
LOGD("by_stepper init ok"); LOGD("by_stepper init ok");
by_stepper_set_dir(1); by_stepper_set_position_millimeter(160.0f);
by_stepper_set_position_millimeter(-160.0f);
} }
void by_stepper_loop(void) void by_stepper_loop(void)