Merge branch 'master' of http://git.brisky.space/btl143/BC3D-firmware
This commit is contained in:
@@ -116,7 +116,7 @@ void by_stepper_init(void)
|
||||
// DWT_Delay(40U * (uint16_t)by_stepper.speed);
|
||||
// }
|
||||
|
||||
by_stepper_set_speed(STEPPER_SPEED_DIV1);
|
||||
by_stepper_set_speed(STEPPER_SPEED_DIV4);
|
||||
|
||||
while (gpio_input_data_bit_read(GPIOB, GPIO_PINS_10) == SET) {
|
||||
gpio_bits_write(GPIOA, GPIO_PINS_8, by_stepper.dir ? TRUE : FALSE); // DIR
|
||||
@@ -138,7 +138,7 @@ void by_stepper_init(void)
|
||||
void by_stepper_loop(void)
|
||||
{
|
||||
int16_t temp = (int16_t)tmr_counter_value_get(TMR3);
|
||||
position += (int64_t)temp;
|
||||
position -= (int64_t)temp;
|
||||
tmr_counter_value_set(TMR3, 0);
|
||||
|
||||
if (running_flag) {
|
||||
@@ -151,10 +151,10 @@ void by_stepper_loop(void)
|
||||
} else // 正常模式
|
||||
{
|
||||
if (position_offset > 0) {
|
||||
by_stepper_set_dir(0);
|
||||
by_stepper_set_dir(1);
|
||||
by_stepper_run();
|
||||
} else if (position_offset < 0) {
|
||||
by_stepper_set_dir(1);
|
||||
by_stepper_set_dir(0);
|
||||
by_stepper_run();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user