@ -27,6 +27,7 @@
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					# include  "temperature.h" 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					# include  "ultralcd.h" 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					# include  "language.h" 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					# include  "cardreader.h" 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					# include  "speed_lookuptable.h" 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					# if DIGIPOTSS_PIN > -1 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					# include  <SPI.h> 
 
				
			 
			
		
	
	
		
			
				
					
						
							
								 
							 
						
						
							
								 
							 
						
						
					 
				
				 
				 
				
					@ -67,6 +68,9 @@ volatile long endstops_stepsTotal,endstops_stepsDone;
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					static  volatile  bool  endstop_x_hit = false ; 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					static  volatile  bool  endstop_y_hit = false ; 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					static  volatile  bool  endstop_z_hit = false ; 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					# ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					bool  abort_on_endstop_hit  =  false ; 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					# endif 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					static  bool  old_x_min_endstop = false ; 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					static  bool  old_x_max_endstop = false ; 
 
				
			 
			
		
	
	
		
			
				
					
						
							
								 
							 
						
						
							
								 
							 
						
						
					 
				
				 
				 
				
					@ -169,17 +173,31 @@ void checkHitEndstops()
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					   SERIAL_ECHOPGM ( MSG_ENDSTOPS_HIT ) ; 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					   if ( endstop_x_hit )  { 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					     SERIAL_ECHOPAIR ( "  X: " , ( float ) endstops_trigsteps [ X_AXIS ] / axis_steps_per_unit [ X_AXIS ] ) ; 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					     LCD_MESSAGEPGM ( MSG_ENDSTOPS_HIT  " X " ) ; 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					   } 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					   if ( endstop_y_hit )  { 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					     SERIAL_ECHOPAIR ( "  Y: " , ( float ) endstops_trigsteps [ Y_AXIS ] / axis_steps_per_unit [ Y_AXIS ] ) ; 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					     LCD_MESSAGEPGM ( MSG_ENDSTOPS_HIT  " Y " ) ; 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					   } 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					   if ( endstop_z_hit )  { 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					     SERIAL_ECHOPAIR ( "  Z: " , ( float ) endstops_trigsteps [ Z_AXIS ] / axis_steps_per_unit [ Z_AXIS ] ) ; 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					     LCD_MESSAGEPGM ( MSG_ENDSTOPS_HIT  " Z " ) ; 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					   } 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					   SERIAL_ECHOLN ( " " ) ; 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					   endstop_x_hit = false ; 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					   endstop_y_hit = false ; 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					   endstop_z_hit = false ; 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					# ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					   if  ( abort_on_endstop_hit ) 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					   { 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					     card . sdprinting  =  false ; 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					     card . closefile ( ) ; 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					     quickStop ( ) ; 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					     setTargetHotend0 ( 0 ) ; 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					     setTargetHotend1 ( 0 ) ; 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					     setTargetHotend2 ( 0 ) ; 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					   } 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					# endif 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					 } 
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					}