spindle could not be stopped. Thanks again to Etienne for reporting
This commit is contained in:
parent
cd074bc590
commit
d914089e91
@ -36,12 +36,16 @@ void spindle_run(int direction, uint32_t rpm)
|
|||||||
{
|
{
|
||||||
if (direction != current_direction) {
|
if (direction != current_direction) {
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
if(direction >= 0) {
|
if(direction) {
|
||||||
SPINDLE_DIRECTION_PORT &= ~(1<<SPINDLE_DIRECTION_BIT);
|
if(direction > 0) {
|
||||||
|
SPINDLE_DIRECTION_PORT &= ~(1<<SPINDLE_DIRECTION_BIT);
|
||||||
|
} else {
|
||||||
|
SPINDLE_DIRECTION_PORT |= 1<<SPINDLE_DIRECTION_BIT;
|
||||||
|
}
|
||||||
|
SPINDLE_ENABLE_PORT |= 1<<SPINDLE_ENABLE_BIT;
|
||||||
} else {
|
} else {
|
||||||
SPINDLE_DIRECTION_PORT |= 1<<SPINDLE_DIRECTION_BIT;
|
SPINDLE_ENABLE_PORT &= ~(1<<SPINDLE_ENABLE_BIT);
|
||||||
}
|
}
|
||||||
SPINDLE_ENABLE_PORT |= 1<<SPINDLE_ENABLE_BIT;
|
|
||||||
current_direction = direction;
|
current_direction = direction;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user