@ -93,18 +93,15 @@ void serial_echopair_P(const char *s_P, double v);
void serial_echopair_P ( const char * s_P , unsigned long v ) ;
void serial_echopair_P ( const char * s_P , unsigned long v ) ;
//Things to write to serial from Program memory. Saves 400 to 2k of RAM.
// Things to write to serial from Program memory. Saves 400 to 2k of RAM.
FORCE_INLINE void serialprintPGM ( const char * str )
FORCE_INLINE void serialprintPGM ( const char * str ) {
{
char ch = pgm_read_byte ( str ) ;
char ch = pgm_read_byte ( str ) ;
while ( ch ) {
while ( ch )
{
MYSERIAL . write ( ch ) ;
MYSERIAL . write ( ch ) ;
ch = pgm_read_byte ( + + str ) ;
ch = pgm_read_byte ( + + str ) ;
}
}
}
}
void get_command ( ) ;
void get_command ( ) ;
void process_commands ( ) ;
void process_commands ( ) ;
@ -148,7 +145,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
# endif
# endif
# if HAS_E0_ENABLE
# if HAS_E0_ENABLE
# define enable_e0() E0_ENABLE_WRITE(E_ENABLE_ON)
# define enable_e0() E0_ENABLE_WRITE( E_ENABLE_ON)
# define disable_e0() E0_ENABLE_WRITE(!E_ENABLE_ON)
# define disable_e0() E0_ENABLE_WRITE(!E_ENABLE_ON)
# else
# else
# define enable_e0() /* nothing */
# define enable_e0() /* nothing */
@ -156,7 +153,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
# endif
# endif
# if (EXTRUDERS > 1) && HAS_E1_ENABLE
# if (EXTRUDERS > 1) && HAS_E1_ENABLE
# define enable_e1() E1_ENABLE_WRITE(E_ENABLE_ON)
# define enable_e1() E1_ENABLE_WRITE( E_ENABLE_ON)
# define disable_e1() E1_ENABLE_WRITE(!E_ENABLE_ON)
# define disable_e1() E1_ENABLE_WRITE(!E_ENABLE_ON)
# else
# else
# define enable_e1() /* nothing */
# define enable_e1() /* nothing */
@ -164,7 +161,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
# endif
# endif
# if (EXTRUDERS > 2) && HAS_E2_ENABLE
# if (EXTRUDERS > 2) && HAS_E2_ENABLE
# define enable_e2() E2_ENABLE_WRITE(E_ENABLE_ON)
# define enable_e2() E2_ENABLE_WRITE( E_ENABLE_ON)
# define disable_e2() E2_ENABLE_WRITE(!E_ENABLE_ON)
# define disable_e2() E2_ENABLE_WRITE(!E_ENABLE_ON)
# else
# else
# define enable_e2() /* nothing */
# define enable_e2() /* nothing */
@ -172,15 +169,25 @@ void manage_inactivity(bool ignore_stepper_queue=false);
# endif
# endif
# if (EXTRUDERS > 3) && HAS_E3_ENABLE
# if (EXTRUDERS > 3) && HAS_E3_ENABLE
# define enable_e3() E3_ENABLE_WRITE(E_ENABLE_ON)
# define enable_e3() E3_ENABLE_WRITE( E_ENABLE_ON)
# define disable_e3() E3_ENABLE_WRITE(!E_ENABLE_ON)
# define disable_e3() E3_ENABLE_WRITE(!E_ENABLE_ON)
# else
# else
# define enable_e3() /* nothing */
# define enable_e3() /* nothing */
# define disable_e3() /* nothing */
# define disable_e3() /* nothing */
# endif
# endif
/**
* The axis order in all axis related arrays is X , Y , Z , E
*/
# define NUM_AXIS 4
/**
* Axis indices as enumerated constants
*
* A_AXIS and B_AXIS are used by COREXY printers
* X_HEAD and Y_HEAD is used for systems that don ' t have a 1 : 1 relationship between X_AXIS and X Head movement , like CoreXY bots .
*/
enum AxisEnum { X_AXIS = 0 , Y_AXIS = 1 , A_AXIS = 0 , B_AXIS = 1 , Z_AXIS = 2 , E_AXIS = 3 , X_HEAD = 4 , Y_HEAD = 5 } ;
enum AxisEnum { X_AXIS = 0 , Y_AXIS = 1 , A_AXIS = 0 , B_AXIS = 1 , Z_AXIS = 2 , E_AXIS = 3 , X_HEAD = 4 , Y_HEAD = 5 } ;
//X_HEAD and Y_HEAD is used for systems that don't have a 1:1 relationship between X_AXIS and X Head movement, like CoreXY bots.
void FlushSerialRequestResend ( ) ;
void FlushSerialRequestResend ( ) ;
void ClearToSend ( ) ;
void ClearToSend ( ) ;
@ -224,7 +231,7 @@ void refresh_cmd_timeout(void);
# ifndef CRITICAL_SECTION_START
# ifndef CRITICAL_SECTION_START
# define CRITICAL_SECTION_START unsigned char _sreg = SREG; cli();
# define CRITICAL_SECTION_START unsigned char _sreg = SREG; cli();
# define CRITICAL_SECTION_END SREG = _sreg;
# define CRITICAL_SECTION_END SREG = _sreg;
# endif //CRITICAL_SECTION_START
# endif
extern float homing_feedrate [ ] ;
extern float homing_feedrate [ ] ;
extern bool axis_relative_modes [ ] ;
extern bool axis_relative_modes [ ] ;
@ -233,8 +240,9 @@ extern bool volumetric_enabled;
extern int extruder_multiply [ EXTRUDERS ] ; // sets extrude multiply factor (in percent) for each extruder individually
extern int extruder_multiply [ EXTRUDERS ] ; // sets extrude multiply factor (in percent) for each extruder individually
extern float filament_size [ EXTRUDERS ] ; // cross-sectional area of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder.
extern float filament_size [ EXTRUDERS ] ; // cross-sectional area of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder.
extern float volumetric_multiplier [ EXTRUDERS ] ; // reciprocal of cross-sectional area of filament (in square millimeters), stored this way to reduce computational burden in planner
extern float volumetric_multiplier [ EXTRUDERS ] ; // reciprocal of cross-sectional area of filament (in square millimeters), stored this way to reduce computational burden in planner
extern float current_position [ NUM_AXIS ] ;
extern float current_position [ NUM_AXIS ] ;
extern float home_offset [ 3 ] ;
extern float home_offset [ 3 ] ;
# ifdef DELTA
# ifdef DELTA
extern float endstop_adj [ 3 ] ;
extern float endstop_adj [ 3 ] ;
extern float delta_radius ;
extern float delta_radius ;
@ -242,18 +250,23 @@ extern float home_offset[3];
extern float delta_segments_per_second ;
extern float delta_segments_per_second ;
void recalc_delta_settings ( float radius , float diagonal_rod ) ;
void recalc_delta_settings ( float radius , float diagonal_rod ) ;
# elif defined(Z_DUAL_ENDSTOPS)
# elif defined(Z_DUAL_ENDSTOPS)
extern float z_endstop_adj ;
extern float z_endstop_adj ;
# endif
# endif
# ifdef SCARA
# ifdef SCARA
extern float axis_scaling [ 3 ] ; // Build size scaling
extern float axis_scaling [ 3 ] ; // Build size scaling
# endif
# endif
extern float min_pos [ 3 ] ;
extern float min_pos [ 3 ] ;
extern float max_pos [ 3 ] ;
extern float max_pos [ 3 ] ;
extern bool axis_known_position [ 3 ] ;
extern bool axis_known_position [ 3 ] ;
# ifdef ENABLE_AUTO_BED_LEVELING
# ifdef ENABLE_AUTO_BED_LEVELING
extern float zprobe_zoffset ;
extern float zprobe_zoffset ;
# endif
# endif
extern int fanSpeed ;
extern int fanSpeed ;
# ifdef BARICUDA
# ifdef BARICUDA
extern int ValvePressure ;
extern int ValvePressure ;
extern int EtoPPressure ;
extern int EtoPPressure ;