mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-08-16 11:35:44 +02:00
Update TrinamicDriver.cpp
This commit is contained in:
@@ -376,16 +376,25 @@ namespace Motors {
|
|||||||
|
|
||||||
digitalWrite(_disable_pin, _disabled);
|
digitalWrite(_disable_pin, _disabled);
|
||||||
|
|
||||||
|
uint8_t _toff_value = 0;
|
||||||
|
|
||||||
#ifdef USE_TRINAMIC_ENABLE
|
#ifdef USE_TRINAMIC_ENABLE
|
||||||
if (_disabled) {
|
if (_disabled) {
|
||||||
tmcstepper->toff(TRINAMIC_TOFF_DISABLE);
|
_toff_value = TRINAMIC_TOFF_DISABLE;
|
||||||
} else {
|
} else {
|
||||||
if (_mode == TrinamicMode::StealthChop) {
|
if (_mode == TrinamicMode::StealthChop) {
|
||||||
tmcstepper->toff(TRINAMIC_TOFF_STEALTHCHOP);
|
_toff_value = TRINAMIC_TOFF_STEALTHCHOP;
|
||||||
} else {
|
} else {
|
||||||
tmcstepper->toff(TRINAMIC_TOFF_COOLSTEP);
|
_toff_value = TRINAMIC_TOFF_COOLSTEP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tmc2130) {
|
||||||
|
tmc2130->toff(_toff_value);
|
||||||
|
} else {
|
||||||
|
tmc5160->toff(_toff_value);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// the pin based enable could be added here.
|
// the pin based enable could be added here.
|
||||||
// This would be for individual motors, not the single pin for all motors.
|
// This would be for individual motors, not the single pin for all motors.
|
||||||
|
Reference in New Issue
Block a user