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
diff options
context:
space:
mode:
Diffstat (limited to 'src/Reprap.cpp')
-rw-r--r--src/Reprap.cpp32
1 files changed, 14 insertions, 18 deletions
diff --git a/src/Reprap.cpp b/src/Reprap.cpp
index 76cb970d..d2ac20ca 100644
--- a/src/Reprap.cpp
+++ b/src/Reprap.cpp
@@ -490,28 +490,24 @@ unsigned int RepRap::GetNumberOfContiguousTools() const
void RepRap::Tick()
{
- if (active)
+ if (active && !resetting)
{
- Platform::KickWatchdog();
- if (!resetting)
+ platform->Tick();
+ ++ticksInSpinState;
+ if (ticksInSpinState >= 20000) // if we stall for 20 seconds, save diagnostic data and reset
{
- platform->Tick();
- ++ticksInSpinState;
- if (ticksInSpinState >= 20000) // if we stall for 20 seconds, save diagnostic data and reset
+ resetting = true;
+ for(size_t i = 0; i < HEATERS; i++)
{
- resetting = true;
- for(size_t i = 0; i < HEATERS; i++)
- {
- platform->SetHeater(i, 0.0);
- }
- for(size_t i = 0; i < DRIVES; i++)
- {
- platform->DisableDrive(i);
- // We can't set motor currents to 0 here because that requires interrupts to be working, and we are in an ISR
- }
-
- platform->SoftwareReset((uint16_t)SoftwareResetReason::stuckInSpin);
+ platform->SetHeater(i, 0.0);
+ }
+ for(size_t i = 0; i < DRIVES; i++)
+ {
+ platform->DisableDrive(i);
+ // We can't set motor currents to 0 here because that requires interrupts to be working, and we are in an ISR
}
+
+ platform->SoftwareReset((uint16_t)SoftwareResetReason::stuckInSpin);
}
}
}