@ -1460,7 +1460,7 @@ static void homeaxis(int axis) {
sync_plan_position ( ) ;
sync_plan_position ( ) ;
// Engage Servo endstop if enabled
// Engage Servo endstop if enabled
# ifdef SERVO_ENDSTOPS && !defined(Z_PROBE_SLED)
# if defined(SERVO_ENDSTOPS) && !defined(Z_PROBE_SLED)
# if SERVO_LEVELING
# if SERVO_LEVELING
if ( axis = = Z_AXIS ) engage_z_probe ( ) ; else
if ( axis = = Z_AXIS ) engage_z_probe ( ) ; else
@ -2781,7 +2781,7 @@ inline void gcode_M42() {
}
}
}
}
# if defined(FAN_PIN) && FAN_PIN > -1
# if HAS_FAN
if ( pin_number = = FAN_PIN ) fanSpeed = pin_status ;
if ( pin_number = = FAN_PIN ) fanSpeed = pin_status ;
# endif
# endif
@ -3067,17 +3067,17 @@ inline void gcode_M104() {
inline void gcode_M105 ( ) {
inline void gcode_M105 ( ) {
if ( setTargetedHotend ( 105 ) ) return ;
if ( setTargetedHotend ( 105 ) ) return ;
# if defined(TEMP_0_PIN) && TEMP_0_PIN > -1
# if HAS_TEMP_0
SERIAL_PROTOCOLPGM ( " ok T: " ) ;
SERIAL_PROTOCOLPGM ( " ok T: " ) ;
SERIAL_PROTOCOL_F ( degHotend ( tmp_extruder ) , 1 ) ;
SERIAL_PROTOCOL_F ( degHotend ( tmp_extruder ) , 1 ) ;
SERIAL_PROTOCOLPGM ( " / " ) ;
SERIAL_PROTOCOLPGM ( " / " ) ;
SERIAL_PROTOCOL_F ( degTargetHotend ( tmp_extruder ) , 1 ) ;
SERIAL_PROTOCOL_F ( degTargetHotend ( tmp_extruder ) , 1 ) ;
# if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1
# if HAS_TEMP_BED
SERIAL_PROTOCOLPGM ( " B: " ) ;
SERIAL_PROTOCOLPGM ( " B: " ) ;
SERIAL_PROTOCOL_F ( degBed ( ) , 1 ) ;
SERIAL_PROTOCOL_F ( degBed ( ) , 1 ) ;
SERIAL_PROTOCOLPGM ( " / " ) ;
SERIAL_PROTOCOLPGM ( " / " ) ;
SERIAL_PROTOCOL_F ( degTargetBed ( ) , 1 ) ;
SERIAL_PROTOCOL_F ( degTargetBed ( ) , 1 ) ;
# endif //TEMP_BED_PIN
# endif
for ( int8_t cur_extruder = 0 ; cur_extruder < EXTRUDERS ; + + cur_extruder ) {
for ( int8_t cur_extruder = 0 ; cur_extruder < EXTRUDERS ; + + cur_extruder ) {
SERIAL_PROTOCOLPGM ( " T " ) ;
SERIAL_PROTOCOLPGM ( " T " ) ;
SERIAL_PROTOCOL ( cur_extruder ) ;
SERIAL_PROTOCOL ( cur_extruder ) ;
@ -3108,7 +3108,7 @@ inline void gcode_M105() {
# endif
# endif
# ifdef SHOW_TEMP_ADC_VALUES
# ifdef SHOW_TEMP_ADC_VALUES
# if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1
# if HAS_TEMP_BED
SERIAL_PROTOCOLPGM ( " ADC B: " ) ;
SERIAL_PROTOCOLPGM ( " ADC B: " ) ;
SERIAL_PROTOCOL_F ( degBed ( ) , 1 ) ;
SERIAL_PROTOCOL_F ( degBed ( ) , 1 ) ;
SERIAL_PROTOCOLPGM ( " C-> " ) ;
SERIAL_PROTOCOLPGM ( " C-> " ) ;
@ -3124,10 +3124,10 @@ inline void gcode_M105() {
}
}
# endif
# endif
SERIAL_PROTOCOLLN ( " " ) ;
SERIAL_EOL ;
}
}
# if defined(FAN_PIN) && FAN_PIN > -1
# if HAS_FAN
/**
/**
* M106 : Set Fan Speed
* M106 : Set Fan Speed
@ -3139,7 +3139,7 @@ inline void gcode_M105() {
*/
*/
inline void gcode_M107 ( ) { fanSpeed = 0 ; }
inline void gcode_M107 ( ) { fanSpeed = 0 ; }
# endif //FAN_PI N
# endif // HAS_ FAN
/**
/**
* M109 : Wait for extruder ( s ) to reach temperature
* M109 : Wait for extruder ( s ) to reach temperature
@ -3197,10 +3197,10 @@ inline void gcode_M109() {
SERIAL_PROTOCOLLN ( timetemp ) ;
SERIAL_PROTOCOLLN ( timetemp ) ;
}
}
else {
else {
SERIAL_PROTOCOLLN ( " ? " ) ;
SERIAL_PROTOCOLLNPGM ( " ? " ) ;
}
}
# else
# else
SERIAL_PROTOCOLLN ( " " ) ;
SERIAL_EOL ;
# endif
# endif
timetemp = millis ( ) ;
timetemp = millis ( ) ;
}
}
@ -3223,7 +3223,7 @@ inline void gcode_M109() {
starttime = previous_millis_cmd = millis ( ) ;
starttime = previous_millis_cmd = millis ( ) ;
}
}
# if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1
# if HAS_TEMP_BED
/**
/**
* M190 : Sxxx Wait for bed current temp to reach target temp . Waits only when heating
* M190 : Sxxx Wait for bed current temp to reach target temp . Waits only when heating
@ -3251,7 +3251,7 @@ inline void gcode_M109() {
SERIAL_PROTOCOL ( ( int ) active_extruder ) ;
SERIAL_PROTOCOL ( ( int ) active_extruder ) ;
SERIAL_PROTOCOLPGM ( " B: " ) ;
SERIAL_PROTOCOLPGM ( " B: " ) ;
SERIAL_PROTOCOL_F ( degBed ( ) , 1 ) ;
SERIAL_PROTOCOL_F ( degBed ( ) , 1 ) ;
SERIAL_PROTOCOLLN ( " " ) ;
SERIAL_EOL ;
}
}
manage_heater ( ) ;
manage_heater ( ) ;
manage_inactivity ( ) ;
manage_inactivity ( ) ;
@ -3452,27 +3452,26 @@ inline void gcode_M114() {
SERIAL_PROTOCOLPGM ( " Z: " ) ;
SERIAL_PROTOCOLPGM ( " Z: " ) ;
SERIAL_PROTOCOL ( float ( st_get_position ( Z_AXIS ) ) / axis_steps_per_unit [ Z_AXIS ] ) ;
SERIAL_PROTOCOL ( float ( st_get_position ( Z_AXIS ) ) / axis_steps_per_unit [ Z_AXIS ] ) ;
SERIAL_PROTOCOLLN ( " " ) ;
SERIAL_EOL ;
# ifdef SCARA
# ifdef SCARA
SERIAL_PROTOCOLPGM ( " SCARA Theta: " ) ;
SERIAL_PROTOCOLPGM ( " SCARA Theta: " ) ;
SERIAL_PROTOCOL ( delta [ X_AXIS ] ) ;
SERIAL_PROTOCOL ( delta [ X_AXIS ] ) ;
SERIAL_PROTOCOLPGM ( " Psi+Theta: " ) ;
SERIAL_PROTOCOLPGM ( " Psi+Theta: " ) ;
SERIAL_PROTOCOL ( delta [ Y_AXIS ] ) ;
SERIAL_PROTOCOL ( delta [ Y_AXIS ] ) ;
SERIAL_PROTOCOLLN ( " " ) ;
SERIAL_EOL ;
SERIAL_PROTOCOLPGM ( " SCARA Cal - Theta: " ) ;
SERIAL_PROTOCOLPGM ( " SCARA Cal - Theta: " ) ;
SERIAL_PROTOCOL ( delta [ X_AXIS ] + home_offset [ X_AXIS ] ) ;
SERIAL_PROTOCOL ( delta [ X_AXIS ] + home_offset [ X_AXIS ] ) ;
SERIAL_PROTOCOLPGM ( " Psi+Theta (90): " ) ;
SERIAL_PROTOCOLPGM ( " Psi+Theta (90): " ) ;
SERIAL_PROTOCOL ( delta [ Y_AXIS ] - delta [ X_AXIS ] - 90 + home_offset [ Y_AXIS ] ) ;
SERIAL_PROTOCOL ( delta [ Y_AXIS ] - delta [ X_AXIS ] - 90 + home_offset [ Y_AXIS ] ) ;
SERIAL_PROTOCOLLN ( " " ) ;
SERIAL_EOL ;
SERIAL_PROTOCOLPGM ( " SCARA step Cal - Theta: " ) ;
SERIAL_PROTOCOLPGM ( " SCARA step Cal - Theta: " ) ;
SERIAL_PROTOCOL ( delta [ X_AXIS ] / 90 * axis_steps_per_unit [ X_AXIS ] ) ;
SERIAL_PROTOCOL ( delta [ X_AXIS ] / 90 * axis_steps_per_unit [ X_AXIS ] ) ;
SERIAL_PROTOCOLPGM ( " Psi+Theta: " ) ;
SERIAL_PROTOCOLPGM ( " Psi+Theta: " ) ;
SERIAL_PROTOCOL ( ( delta [ Y_AXIS ] - delta [ X_AXIS ] ) / 90 * axis_steps_per_unit [ Y_AXIS ] ) ;
SERIAL_PROTOCOL ( ( delta [ Y_AXIS ] - delta [ X_AXIS ] ) / 90 * axis_steps_per_unit [ Y_AXIS ] ) ;
SERIAL_PROTOCOLLN ( " " ) ;
SERIAL_EOL ; SERIAL_EOL ;
SERIAL_PROTOCOLLN ( " " ) ;
# endif
# endif
}
}
@ -3915,7 +3914,7 @@ inline void gcode_M226() {
SERIAL_PROTOCOL ( servo_index ) ;
SERIAL_PROTOCOL ( servo_index ) ;
SERIAL_PROTOCOL ( " : " ) ;
SERIAL_PROTOCOL ( " : " ) ;
SERIAL_PROTOCOL ( servos [ servo_index ] . read ( ) ) ;
SERIAL_PROTOCOL ( servos [ servo_index ] . read ( ) ) ;
SERIAL_PROTOCOLLN ( " " ) ;
SERIAL_EOL ;
}
}
}
}
@ -3983,7 +3982,7 @@ inline void gcode_M226() {
//Kc does not have scaling applied above, or in resetting defaults
//Kc does not have scaling applied above, or in resetting defaults
SERIAL_PROTOCOL ( PID_PARAM ( Kc , e ) ) ;
SERIAL_PROTOCOL ( PID_PARAM ( Kc , e ) ) ;
# endif
# endif
SERIAL_PROTOCOLLN ( " " ) ;
SERIAL_EOL ;
}
}
else {
else {
SERIAL_ECHO_START ;
SERIAL_ECHO_START ;
@ -4008,7 +4007,7 @@ inline void gcode_M226() {
SERIAL_PROTOCOL ( unscalePID_i ( bedKi ) ) ;
SERIAL_PROTOCOL ( unscalePID_i ( bedKi ) ) ;
SERIAL_PROTOCOL ( " d: " ) ;
SERIAL_PROTOCOL ( " d: " ) ;
SERIAL_PROTOCOL ( unscalePID_d ( bedKd ) ) ;
SERIAL_PROTOCOL ( unscalePID_d ( bedKd ) ) ;
SERIAL_PROTOCOLLN ( " " ) ;
SERIAL_EOL ;
}
}
# endif // PIDTEMPBED
# endif // PIDTEMPBED
@ -4058,7 +4057,7 @@ inline void gcode_M226() {
if ( code_seen ( ' C ' ) ) lcd_setcontrast ( code_value_long ( ) & 0x3F ) ;
if ( code_seen ( ' C ' ) ) lcd_setcontrast ( code_value_long ( ) & 0x3F ) ;
SERIAL_PROTOCOLPGM ( " lcd contrast value: " ) ;
SERIAL_PROTOCOLPGM ( " lcd contrast value: " ) ;
SERIAL_PROTOCOL ( lcd_contrast ) ;
SERIAL_PROTOCOL ( lcd_contrast ) ;
SERIAL_PROTOCOLLN ( " " ) ;
SERIAL_EOL ;
}
}
# endif // DOGLCD
# endif // DOGLCD
@ -4331,7 +4330,7 @@ inline void gcode_M503() {
zprobe_zoffset = - value ; // compare w/ line 278 of ConfigurationStore.cpp
zprobe_zoffset = - value ; // compare w/ line 278 of ConfigurationStore.cpp
SERIAL_ECHO_START ;
SERIAL_ECHO_START ;
SERIAL_ECHOLNPGM ( MSG_ZPROBE_ZOFFSET " " MSG_OK ) ;
SERIAL_ECHOLNPGM ( MSG_ZPROBE_ZOFFSET " " MSG_OK ) ;
SERIAL_PROTOCOLLN ( " " ) ;
SERIAL_EOL ;
}
}
else {
else {
SERIAL_ECHO_START ;
SERIAL_ECHO_START ;
@ -4340,14 +4339,14 @@ inline void gcode_M503() {
SERIAL_ECHO ( Z_PROBE_OFFSET_RANGE_MIN ) ;
SERIAL_ECHO ( Z_PROBE_OFFSET_RANGE_MIN ) ;
SERIAL_ECHOPGM ( MSG_Z_MAX ) ;
SERIAL_ECHOPGM ( MSG_Z_MAX ) ;
SERIAL_ECHO ( Z_PROBE_OFFSET_RANGE_MAX ) ;
SERIAL_ECHO ( Z_PROBE_OFFSET_RANGE_MAX ) ;
SERIAL_PROTOCOLLN ( " " ) ;
SERIAL_EOL ;
}
}
}
}
else {
else {
SERIAL_ECHO_START ;
SERIAL_ECHO_START ;
SERIAL_ECHOLNPGM ( MSG_ZPROBE_ZOFFSET " : " ) ;
SERIAL_ECHOLNPGM ( MSG_ZPROBE_ZOFFSET " : " ) ;
SERIAL_ECHO ( - zprobe_zoffset ) ;
SERIAL_ECHO ( - zprobe_zoffset ) ;
SERIAL_PROTOCOLLN ( " " ) ;
SERIAL_EOL ;
}
}
}
}
@ -4852,20 +4851,20 @@ void process_commands() {
gcode_M109 ( ) ;
gcode_M109 ( ) ;
break ;
break ;
# if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1
# if HAS_TEMP_BED
case 190 : // M190 - Wait for bed heater to reach target.
case 190 : // M190 - Wait for bed heater to reach target.
gcode_M190 ( ) ;
gcode_M190 ( ) ;
break ;
break ;
# endif //TEMP_BED_PIN
# endif // HAS_ TEMP_BED
# if defined(FAN_PIN) && FAN_PIN > -1
# if HAS_FAN
case 106 : //M106 Fan On
case 106 : //M106 Fan On
gcode_M106 ( ) ;
gcode_M106 ( ) ;
break ;
break ;
case 107 : //M107 Fan Off
case 107 : //M107 Fan Off
gcode_M107 ( ) ;
gcode_M107 ( ) ;
break ;
break ;
# endif //FAN_PI N
# endif // HAS_ FAN
# ifdef BARICUDA
# ifdef BARICUDA
// PWM for HEATER_1_PIN
// PWM for HEATER_1_PIN
@ -5704,7 +5703,7 @@ void handle_status_leds(void) {
max_temp = max ( max_temp , degHotend ( cur_extruder ) ) ;
max_temp = max ( max_temp , degHotend ( cur_extruder ) ) ;
max_temp = max ( max_temp , degTargetHotend ( cur_extruder ) ) ;
max_temp = max ( max_temp , degTargetHotend ( cur_extruder ) ) ;
}
}
# if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1
# if HAS_TEMP_BED
max_temp = max ( max_temp , degTargetBed ( ) ) ;
max_temp = max ( max_temp , degTargetBed ( ) ) ;
max_temp = max ( max_temp , degBed ( ) ) ;
max_temp = max ( max_temp , degBed ( ) ) ;
# endif
# endif