1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-08-16 03:24:15 +02:00

Update TrinamicDriver.cpp

This commit is contained in:
bdring
2022-01-02 13:44:19 -06:00
parent 7d649cb0c9
commit 4d6bd3492d

View File

@@ -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.