stepper enable pin now toggles to reflect the active/passive state of the stepper subsystem
This commit is contained in:
parent
2c913a00bd
commit
68ff56a8b1
@ -82,6 +82,7 @@ static uint32_t trapezoid_adjusted_rate; // The current rate of step_events
|
|||||||
static void set_step_events_per_minute(uint32_t steps_per_minute);
|
static void set_step_events_per_minute(uint32_t steps_per_minute);
|
||||||
|
|
||||||
void st_wake_up() {
|
void st_wake_up() {
|
||||||
|
STEPPERS_ENABLE_PORT |= (1<<STEPPERS_ENABLE_BIT);
|
||||||
ENABLE_STEPPER_DRIVER_INTERRUPT();
|
ENABLE_STEPPER_DRIVER_INTERRUPT();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,6 +154,8 @@ SIGNAL(TIMER1_COMPA_vect)
|
|||||||
counter_z = counter_x;
|
counter_z = counter_x;
|
||||||
step_events_completed = 0;
|
step_events_completed = 0;
|
||||||
} else {
|
} else {
|
||||||
|
// set enable pin
|
||||||
|
STEPPERS_ENABLE_PORT &= ~(1<<STEPPERS_ENABLE_BIT);
|
||||||
DISABLE_STEPPER_DRIVER_INTERRUPT();
|
DISABLE_STEPPER_DRIVER_INTERRUPT();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -229,11 +232,10 @@ void st_init()
|
|||||||
TIMSK2 |= (1<<TOIE2);
|
TIMSK2 |= (1<<TOIE2);
|
||||||
|
|
||||||
set_step_events_per_minute(6000);
|
set_step_events_per_minute(6000);
|
||||||
DISABLE_STEPPER_DRIVER_INTERRUPT();
|
|
||||||
trapezoid_tick_cycle_counter = 0;
|
trapezoid_tick_cycle_counter = 0;
|
||||||
|
|
||||||
// set enable pin
|
STEPPERS_ENABLE_PORT &= ~(1<<STEPPERS_ENABLE_BIT);
|
||||||
STEPPERS_ENABLE_PORT |= 1<<STEPPERS_ENABLE_BIT;
|
DISABLE_STEPPER_DRIVER_INTERRUPT();
|
||||||
|
|
||||||
sei();
|
sei();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user