Fix reset of endstops and move state
This commit is contained in:
		@@ -263,15 +263,6 @@ void Endstops::not_homing() {
 | 
				
			|||||||
  #endif
 | 
					  #endif
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Clear endstops (i.e., they were hit intentionally) to suppress the report
 | 
					 | 
				
			||||||
void Endstops::hit_on_purpose() {
 | 
					 | 
				
			||||||
  hit_state = 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE)
 | 
					 | 
				
			||||||
    if (enabled) update(); // If enabling, update state now
 | 
					 | 
				
			||||||
  #endif
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Enable / disable endstop z-probe checking
 | 
					// Enable / disable endstop z-probe checking
 | 
				
			||||||
#if HAS_BED_PROBE
 | 
					#if HAS_BED_PROBE
 | 
				
			||||||
  void Endstops::enable_z_probe(bool onoff) {
 | 
					  void Endstops::enable_z_probe(bool onoff) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -111,9 +111,9 @@ class Endstops {
 | 
				
			|||||||
    FORCE_INLINE static esbits_t state() { return live_state; }
 | 
					    FORCE_INLINE static esbits_t state() { return live_state; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Print an error message reporting the position when the endstops were last hit.
 | 
					     * Report endstop hits to serial. Called from loop().
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    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
 | 
					    static void report_state();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Report endstop positions in response to M119
 | 
					     * Report endstop positions in response to M119
 | 
				
			||||||
@@ -130,7 +130,7 @@ class Endstops {
 | 
				
			|||||||
    static void not_homing();
 | 
					    static void not_homing();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Clear endstops (i.e., they were hit intentionally) to suppress the report
 | 
					    // Clear endstops (i.e., they were hit intentionally) to suppress the report
 | 
				
			||||||
    static void hit_on_purpose();
 | 
					    FORCE_INLINE static void hit_on_purpose() { hit_state = 0; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Enable / disable endstop z-probe checking
 | 
					    // Enable / disable endstop z-probe checking
 | 
				
			||||||
    #if HAS_BED_PROBE
 | 
					    #if HAS_BED_PROBE
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1232,6 +1232,7 @@ void Stepper::stepper_pulse_phase_isr() {
 | 
				
			|||||||
  if (abort_current_block) {
 | 
					  if (abort_current_block) {
 | 
				
			||||||
    abort_current_block = false;
 | 
					    abort_current_block = false;
 | 
				
			||||||
    if (current_block) {
 | 
					    if (current_block) {
 | 
				
			||||||
 | 
					      axis_did_move = 0;
 | 
				
			||||||
      current_block = NULL;
 | 
					      current_block = NULL;
 | 
				
			||||||
      planner.discard_current_block();
 | 
					      planner.discard_current_block();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -1541,6 +1542,7 @@ uint32_t Stepper::stepper_block_phase_isr() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    // If current block is finished, reset pointer
 | 
					    // If current block is finished, reset pointer
 | 
				
			||||||
    if (all_steps_done) {
 | 
					    if (all_steps_done) {
 | 
				
			||||||
 | 
					      axis_did_move = 0;
 | 
				
			||||||
      current_block = NULL;
 | 
					      current_block = NULL;
 | 
				
			||||||
      planner.discard_current_block();
 | 
					      planner.discard_current_block();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user