diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 50ea9ecf07..4846d12b7c 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -206,18 +206,6 @@ void disable_all_steppers(); void FlushSerialRequestResend(); void ok_to_send(); -#ifdef DELTA - void calculate_delta(float cartesian[3]); - #ifdef ENABLE_AUTO_BED_LEVELING - extern int delta_grid_spacing[2]; - void adjust_delta(float cartesian[3]); - #endif - extern float delta[3]; -#endif -#ifdef SCARA - void calculate_delta(float cartesian[3]); - void calculate_SCARA_forward_Transform(float f_scara[3]); -#endif void reset_bed_level(); void prepare_move(); void kill(const char *); @@ -269,26 +257,34 @@ extern int extruder_multiplier[EXTRUDERS]; // sets extrude multiply factor (in p 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 current_position[NUM_AXIS]; -extern float home_offset[3]; +extern float home_offset[3]; // axis[n].home_offset +extern float min_pos[3]; // axis[n].min_pos +extern float max_pos[3]; // axis[n].max_pos +extern bool axis_known_position[3]; // axis[n].is_known -#ifdef DELTA - extern float endstop_adj[3]; - extern float delta_radius; - extern float delta_diagonal_rod; - extern float delta_segments_per_second; - void recalc_delta_settings(float radius, float diagonal_rod); -#elif defined(Z_DUAL_ENDSTOPS) +#if defined(DELTA) || defined(SCARA) + void calculate_delta(float cartesian[3]); + #ifdef DELTA + extern float delta[3]; + extern float endstop_adj[3]; // axis[n].endstop_adj + extern float delta_radius; + extern float delta_diagonal_rod; + extern float delta_segments_per_second; + void recalc_delta_settings(float radius, float diagonal_rod); + #ifdef ENABLE_AUTO_BED_LEVELING + extern int delta_grid_spacing[2]; + void adjust_delta(float cartesian[3]); + #endif + #elif defined(SCARA) + extern float axis_scaling[3]; // Build size scaling + void calculate_SCARA_forward_Transform(float f_scara[3]); + #endif +#endif + +#ifdef Z_DUAL_ENDSTOPS extern float z_endstop_adj; #endif -#ifdef SCARA - extern float axis_scaling[3]; // Build size scaling -#endif - -extern float min_pos[3]; -extern float max_pos[3]; -extern bool axis_known_position[3]; - #ifdef ENABLE_AUTO_BED_LEVELING extern float zprobe_zoffset; #endif @@ -320,7 +316,7 @@ extern int fanSpeed; #ifdef FWRETRACT extern bool autoretract_enabled; - extern bool retracted[EXTRUDERS]; + extern bool retracted[EXTRUDERS]; // extruder[n].retracted extern float retract_length, retract_length_swap, retract_feedrate, retract_zlift; extern float retract_recover_length, retract_recover_length_swap, retract_recover_feedrate; #endif diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index a662e99af8..25d891d23f 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -80,7 +80,7 @@ unsigned char soft_pwm_bed; static TRState thermal_runaway_state_machine[4] = { TRReset, TRReset, TRReset, TRReset }; static millis_t thermal_runaway_timer[4]; // = {0,0,0,0}; #endif - #ifdef THERMAL_PROTECTION_BED + #if defined(THERMAL_PROTECTION_BED) && TEMP_SENSOR_BED != 0 static TRState thermal_runaway_bed_state_machine = TRReset; static millis_t thermal_runaway_bed_timer; #endif @@ -1550,7 +1550,7 @@ ISR(TIMER0_COMPB_vect) { if (minttemp_raw[0] GE0 current_temperature_raw[0]) min_temp_error(0); #endif - #if HAS_TEMP_1 + #if HAS_TEMP_1 && EXTRUDERS > 1 #if HEATER_1_RAW_LO_TEMP > HEATER_1_RAW_HI_TEMP #define GE1 <= #else @@ -1560,7 +1560,7 @@ ISR(TIMER0_COMPB_vect) { if (minttemp_raw[1] GE1 current_temperature_raw[1]) min_temp_error(1); #endif // TEMP_SENSOR_1 - #if HAS_TEMP_2 + #if HAS_TEMP_2 && EXTRUDERS > 2 #if HEATER_2_RAW_LO_TEMP > HEATER_2_RAW_HI_TEMP #define GE2 <= #else @@ -1570,7 +1570,7 @@ ISR(TIMER0_COMPB_vect) { if (minttemp_raw[2] GE2 current_temperature_raw[2]) min_temp_error(2); #endif // TEMP_SENSOR_2 - #if HAS_TEMP_3 + #if HAS_TEMP_3 && EXTRUDERS > 3 #if HEATER_3_RAW_LO_TEMP > HEATER_3_RAW_HI_TEMP #define GE3 <= #else