Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Crocker <dcrocker@eschertech.com>2022-04-19 15:23:42 +0300
committerDavid Crocker <dcrocker@eschertech.com>2022-04-19 15:23:42 +0300
commit6c87d3beb80a6d9a25047ba6732d1c5a8e5feed8 (patch)
tree989046c5e7f27ea2eced929901b4b08ceeb4fb40 /src
parent84fa543a3d4b32494420653964b555f1d882ade6 (diff)
Fix to TMC51xx accumulated drive status (thanks Andy)
Diffstat (limited to 'src')
-rw-r--r--src/Movement/StepperDrivers/TMC51xx.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Movement/StepperDrivers/TMC51xx.cpp b/src/Movement/StepperDrivers/TMC51xx.cpp
index ae673995..7e69a491 100644
--- a/src/Movement/StepperDrivers/TMC51xx.cpp
+++ b/src/Movement/StepperDrivers/TMC51xx.cpp
@@ -765,7 +765,9 @@ StandardDriverStatus TmcDriverState::GetStatus(bool accumulated, bool clearAccum
status = accumulatedDriveStatus;
if (clearAccumulated)
{
- accumulatedDriveStatus = readRegisters[ReadDrvStat];
+ // In the following we can't just copy readRegisters[ReadDrvStat] into accumulatedDriveStatus, because we only want to set bits in accumulatedDriveStatus
+ // when they occur in 2 successive samples. So clear it instead.
+ accumulatedDriveStatus = 0;
}
}
else