Browse Source

Prevent watchdog timeout in bezier moves

Scott Lahteine 9 years ago
parent
commit
a058226799
1 changed files with 12 additions and 0 deletions
  1. 12
    0
      Marlin/planner_bezier.cpp

+ 12
- 0
Marlin/planner_bezier.cpp View File

33
 
33
 
34
 #include "planner.h"
34
 #include "planner.h"
35
 #include "language.h"
35
 #include "language.h"
36
+#include "temperature.h"
36
 
37
 
37
 // See the meaning in the documentation of cubic_b_spline().
38
 // See the meaning in the documentation of cubic_b_spline().
38
 #define MIN_STEP 0.002
39
 #define MIN_STEP 0.002
116
   tmp[X_AXIS] = position[X_AXIS];
117
   tmp[X_AXIS] = position[X_AXIS];
117
   tmp[Y_AXIS] = position[Y_AXIS];
118
   tmp[Y_AXIS] = position[Y_AXIS];
118
   float step = MAX_STEP;
119
   float step = MAX_STEP;
120
+
121
+  uint8_t idle_counter = 0;
122
+  millis_t next_ping_ms = millis() + 200UL;
123
+
119
   while (t < 1.0) {
124
   while (t < 1.0) {
125
+
126
+    millis_t now = millis();
127
+    if (ELAPSED(now, next_ping_ms)) {
128
+      next_ping_ms = now + 200UL;
129
+      (idle_counter++ & 0x03) ? thermalManager.manage_heater() : idle();
130
+    }
131
+
120
     // First try to reduce the step in order to make it sufficiently
132
     // First try to reduce the step in order to make it sufficiently
121
     // close to a linear interpolation.
133
     // close to a linear interpolation.
122
     bool did_reduce = false;
134
     bool did_reduce = false;

Loading…
Cancel
Save