From e5d6d72d23c3e9e9e53c6e4e54f38576e2a4864d Mon Sep 17 00:00:00 2001 From: sarusani <62053849+sarusani@users.noreply.github.com> Date: Fri, 15 Dec 2023 14:09:46 +0100 Subject: [PATCH] Add #ifdef --- Firmware/Marlin_main.cpp | 5 ++++- Firmware/ultralcd.cpp | 21 ++++++++++++------- Firmware/ultralcd.h | 3 +++ Firmware/variants/MK25-RAMBo10a.h | 11 ++++++++-- Firmware/variants/MK25-RAMBo13a.h | 11 ++++++++-- Firmware/variants/MK25S-RAMBo10a.h | 11 ++++++++-- Firmware/variants/MK25S-RAMBo13a.h | 11 ++++++++-- Firmware/variants/MK3-E3DREVO.h | 11 ++++++++-- Firmware/variants/MK3-E3DREVO_HF_60W.h | 11 ++++++++-- Firmware/variants/MK3.h | 11 ++++++++-- Firmware/variants/MK3S-E3DREVO.h | 11 ++++++++-- Firmware/variants/MK3S-E3DREVO_HF_60W.h | 11 ++++++++-- Firmware/variants/MK3S.h | 11 ++++++++-- .../obsolete/1_75mm_MK2-RAMBo10a-E3Dv6full.h | 11 ++++++++-- .../obsolete/1_75mm_MK2-RAMBo13a-E3Dv6full.h | 11 ++++++++-- 15 files changed, 128 insertions(+), 33 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 892f337d7..342ee9756 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3545,7 +3545,10 @@ void gcode_M701(float fastLoadLength, uint8_t mmuSlotIndex){ lcd_load_filament_color_check(); } - retract_for_ooze_prevention(); // Retract a little of filament to prevent oozing + #ifdef COMMUNITY_PREVENT_OOZE + // Retract filament to prevent oozing + retract_for_ooze_prevention(); + #endif //COMMUNITY_PREVENT_OOZE lcd_update_enable(true); lcd_update(2); diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 61b691ec2..781fa1db9 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -5603,14 +5603,16 @@ static void lcd_sd_updir() menu_data_reset(); //Forces reloading of cached variables. } -/// @brief retract a little of filament to prevent oozing +#ifdef COMMUNITY_PREVENT_OOZE +/// @brief Retract filament to prevent oozing void retract_for_ooze_prevention() { - current_position[E_AXIS] += FILAMENTCHANGE_ROOZEFEED; - plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); - current_position[E_AXIS] += FILAMENTCHANGE_EOOZEFEED; - plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); - st_synchronize(); + current_position[E_AXIS] += FILAMENTCHANGE_COMMUNITY_ROOZEFEED; + plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); + current_position[E_AXIS] += FILAMENTCHANGE_COMMUNITY_EOOZEFEED; + plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); + st_synchronize(); } +#endif //COMMUNITY_PREVENT_OOZE // continue stopping the print from the main loop after lcd_print_stop() is called void lcd_print_stop_finish() @@ -5626,10 +5628,13 @@ void lcd_print_stop_finish() current_position[Y_AXIS] = Y_CANCEL_POS; plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); } + st_synchronize(); - // Retract a little of filament to prevent oozing + #ifdef COMMUNITY_PREVENT_OOZE + // Retract filament to prevent oozing retract_for_ooze_prevention(); - + #endif //COMMUNITY_PREVENT_OOZE + // did we come here from a thermal error? if(get_temp_error()) { // time to stop the error beep diff --git a/Firmware/ultralcd.h b/Firmware/ultralcd.h index dcae0a2c5..afb4ace77 100755 --- a/Firmware/ultralcd.h +++ b/Firmware/ultralcd.h @@ -253,6 +253,9 @@ extern void lcd_pinda_temp_compensation_toggle(); #endif //PINDA_TEMP_COMP extern void lcd_heat_bed_on_load_toggle(); + +#ifdef COMMUNITY_PREVENT_OOZE extern void retract_for_ooze_prevention(); +#endif //COMMUNITY_PREVENT_OOZE #endif //ULTRALCD_H diff --git a/Firmware/variants/MK25-RAMBo10a.h b/Firmware/variants/MK25-RAMBo10a.h index bc2c6d719..943b965c3 100644 --- a/Firmware/variants/MK25-RAMBo10a.h +++ b/Firmware/variants/MK25-RAMBo10a.h @@ -232,8 +232,15 @@ #define FILAMENTCHANGE_RFEED 7000 / 60 #define FILAMENTCHANGE_EXFEED 2 #define FILAMENTCHANGE_ZFEED 15 -#define FILAMENTCHANGE_ROOZEFEED -10 //E retract distance in mm for ooze prevention -#define FILAMENTCHANGE_EOOZEFEED 4 //E extrude distance in mm for ooze prevention + +//Retract and then extrude some filament to prevent oozing. +//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle. +//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing. +//#define COMMUNITY_PREVENT_OOZE +#ifdef COMMUNITY_PREVENT_OOZE +#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention +#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention +#endif //End COMMUNITY_PREVENT_OOZE #endif diff --git a/Firmware/variants/MK25-RAMBo13a.h b/Firmware/variants/MK25-RAMBo13a.h index 313619ff5..35bfe89a0 100644 --- a/Firmware/variants/MK25-RAMBo13a.h +++ b/Firmware/variants/MK25-RAMBo13a.h @@ -233,8 +233,15 @@ #define FILAMENTCHANGE_RFEED 7000 / 60 #define FILAMENTCHANGE_EXFEED 2 #define FILAMENTCHANGE_ZFEED 15 -#define FILAMENTCHANGE_ROOZEFEED -10 //E retract distance in mm for ooze prevention -#define FILAMENTCHANGE_EOOZEFEED 4 //E extrude distance in mm for ooze prevention + +//Retract and then extrude some filament to prevent oozing. +//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle. +//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing. +//#define COMMUNITY_PREVENT_OOZE +#ifdef COMMUNITY_PREVENT_OOZE +#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention +#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention +#endif //End COMMUNITY_PREVENT_OOZE #endif diff --git a/Firmware/variants/MK25S-RAMBo10a.h b/Firmware/variants/MK25S-RAMBo10a.h index 1b1ed7311..94946ca45 100644 --- a/Firmware/variants/MK25S-RAMBo10a.h +++ b/Firmware/variants/MK25S-RAMBo10a.h @@ -232,8 +232,15 @@ #define FILAMENTCHANGE_RFEED 7000 / 60 #define FILAMENTCHANGE_EXFEED 2 #define FILAMENTCHANGE_ZFEED 15 -#define FILAMENTCHANGE_ROOZEFEED -10 //E retract distance in mm for ooze prevention -#define FILAMENTCHANGE_EOOZEFEED 4 //E extrude distance in mm for ooze prevention + +//Retract and then extrude some filament to prevent oozing. +//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle. +//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing. +//#define COMMUNITY_PREVENT_OOZE +#ifdef COMMUNITY_PREVENT_OOZE +#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention +#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention +#endif //End COMMUNITY_PREVENT_OOZE #endif diff --git a/Firmware/variants/MK25S-RAMBo13a.h b/Firmware/variants/MK25S-RAMBo13a.h index 202910828..b09588508 100644 --- a/Firmware/variants/MK25S-RAMBo13a.h +++ b/Firmware/variants/MK25S-RAMBo13a.h @@ -233,8 +233,15 @@ #define FILAMENTCHANGE_RFEED 7000 / 60 #define FILAMENTCHANGE_EXFEED 2 #define FILAMENTCHANGE_ZFEED 15 -#define FILAMENTCHANGE_ROOZEFEED -10 //E retract distance in mm for ooze prevention -#define FILAMENTCHANGE_EOOZEFEED 4 //E extrude distance in mm for ooze prevention + +//Retract and then extrude some filament to prevent oozing. +//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle. +//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing. +//#define COMMUNITY_PREVENT_OOZE +#ifdef COMMUNITY_PREVENT_OOZE +#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention +#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention +#endif //End COMMUNITY_PREVENT_OOZE #endif diff --git a/Firmware/variants/MK3-E3DREVO.h b/Firmware/variants/MK3-E3DREVO.h index 4f6686fe5..46237f1b8 100644 --- a/Firmware/variants/MK3-E3DREVO.h +++ b/Firmware/variants/MK3-E3DREVO.h @@ -366,8 +366,15 @@ #define FILAMENTCHANGE_RFEED 7000 / 60 #define FILAMENTCHANGE_EXFEED 2 #define FILAMENTCHANGE_ZFEED 15 -#define FILAMENTCHANGE_ROOZEFEED -10 //E retract distance in mm for ooze prevention -#define FILAMENTCHANGE_EOOZEFEED 4 //E extrude distance in mm for ooze prevention + +//Retract and then extrude some filament to prevent oozing. +//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle. +//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing. +//#define COMMUNITY_PREVENT_OOZE +#ifdef COMMUNITY_PREVENT_OOZE +#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention +#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention +#endif //End COMMUNITY_PREVENT_OOZE #endif diff --git a/Firmware/variants/MK3-E3DREVO_HF_60W.h b/Firmware/variants/MK3-E3DREVO_HF_60W.h index 1150728be..81cca3934 100644 --- a/Firmware/variants/MK3-E3DREVO_HF_60W.h +++ b/Firmware/variants/MK3-E3DREVO_HF_60W.h @@ -367,8 +367,15 @@ #define FILAMENTCHANGE_RFEED 7000 / 60 #define FILAMENTCHANGE_EXFEED 2 #define FILAMENTCHANGE_ZFEED 15 -#define FILAMENTCHANGE_ROOZEFEED -10 //E retract distance in mm for ooze prevention -#define FILAMENTCHANGE_EOOZEFEED 4 //E extrude distance in mm for ooze prevention + +//Retract and then extrude some filament to prevent oozing. +//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle. +//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing. +//#define COMMUNITY_PREVENT_OOZE +#ifdef COMMUNITY_PREVENT_OOZE +#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention +#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention +#endif //End COMMUNITY_PREVENT_OOZE #endif diff --git a/Firmware/variants/MK3.h b/Firmware/variants/MK3.h index 2ad822208..393bff59f 100644 --- a/Firmware/variants/MK3.h +++ b/Firmware/variants/MK3.h @@ -369,8 +369,15 @@ #define FILAMENTCHANGE_RFEED 7000 / 60 #define FILAMENTCHANGE_EXFEED 2 #define FILAMENTCHANGE_ZFEED 15 -#define FILAMENTCHANGE_ROOZEFEED -10 //E retract distance in mm for ooze prevention -#define FILAMENTCHANGE_EOOZEFEED 4 //E extrude distance in mm for ooze prevention + +//Retract and then extrude some filament to prevent oozing. +//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle. +//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing. +//#define COMMUNITY_PREVENT_OOZE +#ifdef COMMUNITY_PREVENT_OOZE +#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention +#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention +#endif //End COMMUNITY_PREVENT_OOZE #endif diff --git a/Firmware/variants/MK3S-E3DREVO.h b/Firmware/variants/MK3S-E3DREVO.h index 633f4a2b1..91f79408c 100644 --- a/Firmware/variants/MK3S-E3DREVO.h +++ b/Firmware/variants/MK3S-E3DREVO.h @@ -370,8 +370,15 @@ #define FILAMENTCHANGE_RFEED 7000 / 60 #define FILAMENTCHANGE_EXFEED 2 #define FILAMENTCHANGE_ZFEED 15 -#define FILAMENTCHANGE_ROOZEFEED -10 //E retract distance in mm for ooze prevention -#define FILAMENTCHANGE_EOOZEFEED 4 //E extrude distance in mm for ooze prevention + +//Retract and then extrude some filament to prevent oozing. +//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle. +//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing. +//#define COMMUNITY_PREVENT_OOZE +#ifdef COMMUNITY_PREVENT_OOZE +#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention +#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention +#endif //End COMMUNITY_PREVENT_OOZE #endif diff --git a/Firmware/variants/MK3S-E3DREVO_HF_60W.h b/Firmware/variants/MK3S-E3DREVO_HF_60W.h index de14e2815..7437c281d 100644 --- a/Firmware/variants/MK3S-E3DREVO_HF_60W.h +++ b/Firmware/variants/MK3S-E3DREVO_HF_60W.h @@ -371,8 +371,15 @@ #define FILAMENTCHANGE_RFEED 7000 / 60 #define FILAMENTCHANGE_EXFEED 2 #define FILAMENTCHANGE_ZFEED 15 -#define FILAMENTCHANGE_ROOZEFEED -10 //E retract distance in mm for ooze prevention -#define FILAMENTCHANGE_EOOZEFEED 4 //E extrude distance in mm for ooze prevention + +//Retract and then extrude some filament to prevent oozing. +//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle. +//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing. +//#define COMMUNITY_PREVENT_OOZE +#ifdef COMMUNITY_PREVENT_OOZE +#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention +#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention +#endif //End COMMUNITY_PREVENT_OOZE #endif diff --git a/Firmware/variants/MK3S.h b/Firmware/variants/MK3S.h index a0dc63366..4ebf2ea2e 100644 --- a/Firmware/variants/MK3S.h +++ b/Firmware/variants/MK3S.h @@ -373,8 +373,15 @@ #define FILAMENTCHANGE_RFEED 7000 / 60 #define FILAMENTCHANGE_EXFEED 2 #define FILAMENTCHANGE_ZFEED 15 -#define FILAMENTCHANGE_ROOZEFEED -10 //E retract distance in mm for ooze prevention -#define FILAMENTCHANGE_EOOZEFEED 4 //E extrude distance in mm for ooze prevention + +//Retract and then extrude some filament to prevent oozing. +//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle. +//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing. +//#define COMMUNITY_PREVENT_OOZE +#ifdef COMMUNITY_PREVENT_OOZE +#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention +#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention +#endif //End COMMUNITY_PREVENT_OOZE #endif diff --git a/Firmware/variants/obsolete/1_75mm_MK2-RAMBo10a-E3Dv6full.h b/Firmware/variants/obsolete/1_75mm_MK2-RAMBo10a-E3Dv6full.h index 78a558a89..928021809 100644 --- a/Firmware/variants/obsolete/1_75mm_MK2-RAMBo10a-E3Dv6full.h +++ b/Firmware/variants/obsolete/1_75mm_MK2-RAMBo10a-E3Dv6full.h @@ -161,8 +161,15 @@ CHANGE FILAMENT SETTINGS #define FILAMENTCHANGE_RFEED 400 #define FILAMENTCHANGE_EXFEED 2 #define FILAMENTCHANGE_ZFEED 15 -#define FILAMENTCHANGE_ROOZEFEED -10 //E retract distance in mm for ooze prevention -#define FILAMENTCHANGE_EOOZEFEED 4 //E extrude distance in mm for ooze prevention + +//Retract and then extrude some filament to prevent oozing. +//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle. +//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing. +//#define COMMUNITY_PREVENT_OOZE +#ifdef COMMUNITY_PREVENT_OOZE +#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention +#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention +#endif //End COMMUNITY_PREVENT_OOZE #endif diff --git a/Firmware/variants/obsolete/1_75mm_MK2-RAMBo13a-E3Dv6full.h b/Firmware/variants/obsolete/1_75mm_MK2-RAMBo13a-E3Dv6full.h index 212d01f73..94ca7304a 100644 --- a/Firmware/variants/obsolete/1_75mm_MK2-RAMBo13a-E3Dv6full.h +++ b/Firmware/variants/obsolete/1_75mm_MK2-RAMBo13a-E3Dv6full.h @@ -160,8 +160,15 @@ CHANGE FILAMENT SETTINGS #define FILAMENTCHANGE_RFEED 400 #define FILAMENTCHANGE_EXFEED 2 #define FILAMENTCHANGE_ZFEED 15 -#define FILAMENTCHANGE_ROOZEFEED -10 //E retract distance in mm for ooze prevention -#define FILAMENTCHANGE_EOOZEFEED 4 //E extrude distance in mm for ooze prevention + +//Retract and then extrude some filament to prevent oozing. +//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle. +//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing. +//#define COMMUNITY_PREVENT_OOZE +#ifdef COMMUNITY_PREVENT_OOZE +#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention +#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention +#endif //End COMMUNITY_PREVENT_OOZE #endif