Apply HAS_HOTEND_OFFSET where needed

This commit is contained in:
Scott Lahteine 2019-03-11 20:48:49 -05:00
parent 11d6a939df
commit d94e077901
9 changed files with 31 additions and 34 deletions

View File

@ -230,13 +230,13 @@ void GcodeSuite::G34() {
// Restore the active tool after homing // Restore the active tool after homing
#if HOTENDS > 1 #if HOTENDS > 1
tool_change(old_tool_index, 0, tool_change(old_tool_index, 0, (
#if ENABLED(PARKING_EXTRUDER) #if ENABLED(PARKING_EXTRUDER)
false // Fetch the previous toolhead false // Fetch the previous toolhead
#else #else
true true
#endif #endif
); ));
#endif #endif
#if HAS_LEVELING #if HAS_LEVELING

View File

@ -418,7 +418,7 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {
SERIAL_EOL(); SERIAL_EOL();
} }
#if HOTENDS > 1 #if HAS_HOTEND_OFFSET
// //
// This function requires normalize_hotend_offsets() to be called // This function requires normalize_hotend_offsets() to be called
// //
@ -642,7 +642,7 @@ void GcodeSuite::G425() {
report_measured_backlash(m); report_measured_backlash(m);
report_measured_nozzle_dimensions(m); report_measured_nozzle_dimensions(m);
report_measured_positional_error(m); report_measured_positional_error(m);
#if HOTENDS > 1 #if HAS_HOTEND_OFFSET
normalize_hotend_offsets(); normalize_hotend_offsets();
report_hotend_offsets(); report_hotend_offsets();
#endif #endif

View File

@ -516,7 +516,7 @@ void GcodeSuite::process_parsed_command(
case 217: M217(); break; // M217: Set filament swap parameters case 217: M217(); break; // M217: Set filament swap parameters
#endif #endif
#if HOTENDS > 1 #if HAS_HOTEND_OFFSET
case 218: M218(); break; // M218: Set a tool offset case 218: M218(); break; // M218: Set a tool offset
#endif #endif

View File

@ -637,7 +637,7 @@ private:
static void M217(); static void M217();
#endif #endif
#if HOTENDS > 1 #if HAS_HOTEND_OFFSET
static void M218(); static void M218();
#endif #endif

View File

@ -431,7 +431,7 @@
/** /**
* Default hotend offsets, if not defined * Default hotend offsets, if not defined
*/ */
#if HOTENDS > 1 #if HAS_HOTEND_OFFSET
#ifndef HOTEND_OFFSET_X #ifndef HOTEND_OFFSET_X
#define HOTEND_OFFSET_X { 0 } // X offsets for each extruder #define HOTEND_OFFSET_X { 0 } // X offsets for each extruder
#endif #endif

View File

@ -580,12 +580,7 @@ void ST7920_Lite_Status_Screen::draw_extruder_2_temp(const int16_t temp, const i
#if HAS_HEATED_BED #if HAS_HEATED_BED
void ST7920_Lite_Status_Screen::draw_bed_temp(const int16_t temp, const int16_t target, bool forceUpdate) { void ST7920_Lite_Status_Screen::draw_bed_temp(const int16_t temp, const int16_t target, bool forceUpdate) {
const bool show_target = target && FAR(temp, target); const bool show_target = target && FAR(temp, target);
draw_temps(1 draw_temps(HOTENDS > 1 ? 2 : 1, temp, target, show_target, display_state.bed_show_target != show_target || forceUpdate);
#if HOTENDS > 1
+ 1
#endif
, temp, target, show_target, display_state.bed_show_target != show_target || forceUpdate
);
display_state.bed_show_target = show_target; display_state.bed_show_target = show_target;
} }
#endif #endif

View File

@ -530,7 +530,7 @@ namespace ExtUI {
} }
#endif // HAS_BED_PROBE #endif // HAS_BED_PROBE
#if HOTENDS > 1 #if HAS_HOTEND_OFFSET
float getNozzleOffset_mm(const axis_t axis, const extruder_t extruder) { float getNozzleOffset_mm(const axis_t axis, const extruder_t extruder) {
if (extruder - E0 >= HOTENDS) return 0; if (extruder - E0 >= HOTENDS) return 0;
@ -552,7 +552,7 @@ namespace ExtUI {
HOTEND_LOOP() hotend_offset[axis][e] -= offs; HOTEND_LOOP() hotend_offset[axis][e] -= offs;
} }
#endif // HOTENDS > 1 #endif // HAS_HOTEND_OFFSET
#if ENABLED(BACKLASH_GCODE) #if ENABLED(BACKLASH_GCODE)
float getAxisBacklash_mm(const axis_t axis) { return backlash_distance_mm[axis]; } float getAxisBacklash_mm(const axis_t axis) { return backlash_distance_mm[axis]; }

View File

@ -144,7 +144,7 @@ namespace ExtUI {
void smartAdjustAxis_steps(const int16_t steps, const axis_t axis, bool linked_nozzles); void smartAdjustAxis_steps(const int16_t steps, const axis_t axis, bool linked_nozzles);
#endif #endif
#if HOTENDS > 1 #if HAS_HOTEND_OFFSET
float getNozzleOffset_mm(const axis_t, const extruder_t); float getNozzleOffset_mm(const axis_t, const extruder_t);
void setNozzleOffset_mm(const float, const axis_t, const extruder_t); void setNozzleOffset_mm(const float, const axis_t, const extruder_t);
void normalizeNozzleOffset(const axis_t axis); void normalizeNozzleOffset(const axis_t axis);

View File

@ -300,8 +300,9 @@ void menu_tmc();
#define DEFINE_PIDTEMP_FUNCS(N) _DEFINE_PIDTEMP_BASE_FUNCS(N); // #define DEFINE_PIDTEMP_FUNCS(N) _DEFINE_PIDTEMP_BASE_FUNCS(N); //
#endif #endif
DEFINE_PIDTEMP_FUNCS(0); #if HOTENDS
#if ENABLED(PID_PARAMS_PER_HOTEND) DEFINE_PIDTEMP_FUNCS(0);
#if ENABLED(PID_PARAMS_PER_HOTEND)
#if HOTENDS > 1 #if HOTENDS > 1
DEFINE_PIDTEMP_FUNCS(1); DEFINE_PIDTEMP_FUNCS(1);
#if HOTENDS > 2 #if HOTENDS > 2
@ -317,7 +318,8 @@ DEFINE_PIDTEMP_FUNCS(0);
#endif // HOTENDS > 3 #endif // HOTENDS > 3
#endif // HOTENDS > 2 #endif // HOTENDS > 2
#endif // HOTENDS > 1 #endif // HOTENDS > 1
#endif // PID_PARAMS_PER_HOTEND #endif // PID_PARAMS_PER_HOTEND
#endif // HOTENDS
#define SHOW_MENU_ADVANCED_TEMPERATURE ((ENABLED(AUTOTEMP) && HAS_TEMP_HOTEND) || ENABLED(PID_AUTOTUNE_MENU) || ENABLED(PID_EDIT_MENU)) #define SHOW_MENU_ADVANCED_TEMPERATURE ((ENABLED(AUTOTEMP) && HAS_TEMP_HOTEND) || ENABLED(PID_AUTOTUNE_MENU) || ENABLED(PID_EDIT_MENU))