Browse Source

Fix reset of endstops and move state

Scott Lahteine 7 years ago
parent
commit
7261f48872
3 changed files with 5 additions and 12 deletions
  1. 0
    9
      Marlin/src/module/endstops.cpp
  2. 3
    3
      Marlin/src/module/endstops.h
  3. 2
    0
      Marlin/src/module/stepper.cpp

+ 0
- 9
Marlin/src/module/endstops.cpp View File

263
   #endif
263
   #endif
264
 }
264
 }
265
 
265
 
266
-// Clear endstops (i.e., they were hit intentionally) to suppress the report
267
-void Endstops::hit_on_purpose() {
268
-  hit_state = 0;
269
-
270
-  #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE)
271
-    if (enabled) update(); // If enabling, update state now
272
-  #endif
273
-}
274
-
275
 // Enable / disable endstop z-probe checking
266
 // Enable / disable endstop z-probe checking
276
 #if HAS_BED_PROBE
267
 #if HAS_BED_PROBE
277
   void Endstops::enable_z_probe(bool onoff) {
268
   void Endstops::enable_z_probe(bool onoff) {

+ 3
- 3
Marlin/src/module/endstops.h View File

111
     FORCE_INLINE static esbits_t state() { return live_state; }
111
     FORCE_INLINE static esbits_t state() { return live_state; }
112
 
112
 
113
     /**
113
     /**
114
-     * Print an error message reporting the position when the endstops were last hit.
114
+     * Report endstop hits to serial. Called from loop().
115
      */
115
      */
116
-    static void report_state(); //call from somewhere to create an serial error message with the locations the endstops where hit, in case they were triggered
116
+    static void report_state();
117
 
117
 
118
     /**
118
     /**
119
      * Report endstop positions in response to M119
119
      * Report endstop positions in response to M119
130
     static void not_homing();
130
     static void not_homing();
131
 
131
 
132
     // Clear endstops (i.e., they were hit intentionally) to suppress the report
132
     // Clear endstops (i.e., they were hit intentionally) to suppress the report
133
-    static void hit_on_purpose();
133
+    FORCE_INLINE static void hit_on_purpose() { hit_state = 0; }
134
 
134
 
135
     // Enable / disable endstop z-probe checking
135
     // Enable / disable endstop z-probe checking
136
     #if HAS_BED_PROBE
136
     #if HAS_BED_PROBE

+ 2
- 0
Marlin/src/module/stepper.cpp View File

1232
   if (abort_current_block) {
1232
   if (abort_current_block) {
1233
     abort_current_block = false;
1233
     abort_current_block = false;
1234
     if (current_block) {
1234
     if (current_block) {
1235
+      axis_did_move = 0;
1235
       current_block = NULL;
1236
       current_block = NULL;
1236
       planner.discard_current_block();
1237
       planner.discard_current_block();
1237
     }
1238
     }
1541
 
1542
 
1542
     // If current block is finished, reset pointer
1543
     // If current block is finished, reset pointer
1543
     if (all_steps_done) {
1544
     if (all_steps_done) {
1545
+      axis_did_move = 0;
1544
       current_block = NULL;
1546
       current_block = NULL;
1545
       planner.discard_current_block();
1547
       planner.discard_current_block();
1546
     }
1548
     }

Loading…
Cancel
Save