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
#if HOTENDS > 1
tool_change(old_tool_index, 0,
tool_change(old_tool_index, 0, (
#if ENABLED(PARKING_EXTRUDER)
false // Fetch the previous toolhead
#else
true
#endif
);
));
#endif
#if HAS_LEVELING

View File

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

View File

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

View File

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

View File

@ -431,7 +431,7 @@
/**
* Default hotend offsets, if not defined
*/
#if HOTENDS > 1
#if HAS_HOTEND_OFFSET
#ifndef HOTEND_OFFSET_X
#define HOTEND_OFFSET_X { 0 } // X offsets for each extruder
#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
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);
draw_temps(1
#if HOTENDS > 1
+ 1
#endif
, temp, target, show_target, display_state.bed_show_target != show_target || forceUpdate
);
draw_temps(HOTENDS > 1 ? 2 : 1, temp, target, show_target, display_state.bed_show_target != show_target || forceUpdate);
display_state.bed_show_target = show_target;
}
#endif

View File

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

View File

@ -300,24 +300,26 @@ void menu_tmc();
#define DEFINE_PIDTEMP_FUNCS(N) _DEFINE_PIDTEMP_BASE_FUNCS(N); //
#endif
DEFINE_PIDTEMP_FUNCS(0);
#if ENABLED(PID_PARAMS_PER_HOTEND)
#if HOTENDS > 1
DEFINE_PIDTEMP_FUNCS(1);
#if HOTENDS > 2
DEFINE_PIDTEMP_FUNCS(2);
#if HOTENDS > 3
DEFINE_PIDTEMP_FUNCS(3);
#if HOTENDS > 4
DEFINE_PIDTEMP_FUNCS(4);
#if HOTENDS > 5
DEFINE_PIDTEMP_FUNCS(5);
#endif // HOTENDS > 5
#endif // HOTENDS > 4
#endif // HOTENDS > 3
#endif // HOTENDS > 2
#endif // HOTENDS > 1
#endif // PID_PARAMS_PER_HOTEND
#if HOTENDS
DEFINE_PIDTEMP_FUNCS(0);
#if ENABLED(PID_PARAMS_PER_HOTEND)
#if HOTENDS > 1
DEFINE_PIDTEMP_FUNCS(1);
#if HOTENDS > 2
DEFINE_PIDTEMP_FUNCS(2);
#if HOTENDS > 3
DEFINE_PIDTEMP_FUNCS(3);
#if HOTENDS > 4
DEFINE_PIDTEMP_FUNCS(4);
#if HOTENDS > 5
DEFINE_PIDTEMP_FUNCS(5);
#endif // HOTENDS > 5
#endif // HOTENDS > 4
#endif // HOTENDS > 3
#endif // HOTENDS > 2
#endif // HOTENDS > 1
#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))